Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

❓ [QUESTION] installation with lammps #8

Closed
deleep225 opened this issue Mar 15, 2022 · 10 comments
Closed

❓ [QUESTION] installation with lammps #8

deleep225 opened this issue Mar 15, 2022 · 10 comments
Labels
question Further information is requested

Comments

@deleep225
Copy link

deleep225 commented Mar 15, 2022

I have done the cmake part successfully in our cluster.
while doing make -j 32 i got the following error.

/data/home/reddy/softwares/lammps-29Sep2021/src/pair_nequip.cpp: In member function ‘virtual void LAMMPS_NS::PairNEQUIP::coeff(int, char**)’:
/data/home/reddy/softwares/lammps-29Sep2021/src/pair_nequip.cpp:209:30: error: lvalue required as left operand of assignment
209 | torch::jit::getBailoutDepth() = jit_bailout_depth;

I was able to install in my own laptop but got the above error in all of our clusters.

please help me to resolve this issue.
thank you.

@deleep225 deleep225 added the question Further information is requested label Mar 15, 2022
@simonbatzner
Copy link

Hi @deleep225, please provide a full set of information what platform you are on and what you ran for the install.

@deleep225
Copy link
Author

Hi Simon,
please check the information below.

uname -a
Linux nanochem3 3.10.0-1160.42.2.el7.x86_64 mir-group/nequip#1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

my cmake command includes the following

cmake ../cmake -DCMAKE_PREFIX_PATH=python -c 'import torch;print(torch.utils.cmake_prefix_path)' -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -DCUDNN_LIBRARY_PATH=/data/home/reddy/anacoda3/lib -DCUDNN_INCLUDE_PATH=/data/home/reddy/anaconda3/include -DMKL_INCLUDE_DIR=/usr/include/

OUTPUT for the above command.

-- Running check for auto-generated files from make-based build system
-- Found OpenMP_CXX: -fopenmp
-- Found OpenMP: TRUE
-- Could NOT find FFMPEG (missing: FFMPEG_EXECUTABLE)
-- Generating style headers...
-- Generating package headers...
-- Generating lmpinstalledpkgs.h...
-- Could NOT find ClangFormat (missing: ClangFormat_EXECUTABLE) (Required is at least version "8.0")
-- The following tools and libraries have been found and configured:

  • Git
  • MPI
  • OpenMP

-- <<< Build configuration >>>
Operating System: Linux CentOS Linux 7
Build type: RelWithDebInfo
Install path: /data/home/reddy/.local
Generator: Unix Makefiles using /usr/bin/gmake
-- Enabled packages:
-- <<< Compilers and Flags: >>>
-- C++ Compiler: /data/home/reddy/softwares/gcc-10.3.0/bin/c++
Type: GNU
Version: 10.3.0
C++ Flags: -O2 -g -DNDEBUG
Defines: LAMMPS_SMALLBIG;LAMMPS_MEMALIGN=64;LAMMPS_OMP_COMPAT=4;LAMMPS_GZIP
-- <<< Linker flags: >>>
-- Executable name: lmp
-- Static library flags:
-- <<< MPI flags >>>
-- MPI_defines: MPICH_SKIP_MPICXX;OMPI_SKIP_MPICXX;_MPICC_H
-- MPI includes: /usr/local/mpich-3.1.4/include
-- MPI libraries: /usr/local/mpich-3.1.4/lib/libmpicxx.so;/usr/local/mpich-3.1.4/lib/libmpi.so;
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda (found version "11.4")
-- The CUDA compiler identification is NVIDIA 11.4.120
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc -- works
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Caffe2: CUDA detected: 11.4
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 11.4
-- Found CUDNN: /data/home/reddy/anacoda3/lib
-- Found cuDNN: v7.6.5 (include: /data/home/reddy/anaconda3/include, library: /data/home/reddy/anacoda3/lib)
-- /usr/local/cuda/lib64/libnvrtc.so shorthash is edac1e2e
-- Autodetected CUDA architecture(s): 6.1 6.1 6.1 6.1 6.1 6.1 6.1 6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
-- Found Torch: /data/home/reddy/softwares/libtorch/lib/libtorch.so
-- Configuring done
-- Generating done
-- Build files have been written to: /data/home/reddy/softwares/lammps/lammps-29Sep2021/build

Afeter his I have used make -j 32 command, which was 100 percent build but at the last step the installation gave the error.
[100%] Building CXX object CMakeFiles/lammps.dir/data/home/reddy/softwares/lammps/lammps-29Sep2021/src/write_restart.cpp.o
/data/home/reddy/softwares/lammps/lammps-29Sep2021/src/pair_nequip.cpp: In member function ‘virtual void LAMMPS_NS::PairNEQUIP::coeff(int, char**)’:
/data/home/reddy/softwares/lammps/lammps-29Sep2021/src/pair_nequip.cpp:209:30: error: lvalue required as left operand of assignment
209 | torch::jit::getBailoutDepth() = jit_bailout_depth;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
make[2]: *** [CMakeFiles/lammps.dir/data/home/reddy/softwares/lammps/lammps-29Sep2021/src/pair_nequip.cpp.o] Error 1
make[1]: *** [CMakeFiles/lammps.dir/all] Error 2
make: *** [all] Error 2

Thank you.

@Linux-cpp-lisp
Copy link
Collaborator

Hi @deleep225 ,

What is your PyTorch version? If it is 1.11, I have a suspicion.

Thanks.

@deleep225
Copy link
Author

Hi,

print(torch.version)
1.11.0

should I use other version of pytorch?
Thank you.

@Linux-cpp-lisp
Copy link
Collaborator

Hi @deleep225 ,

1.11 is the newest version, just released, and it looks like there is some compatibility work to be done on the LAMMPS plugin. I would advise using 1.10 for now; at some point in the near future we will update the plugin to be compatible with 1.11.

@nisargjoshi10
Copy link

Hi everyone,

Sorry for adding my comment here and not creating a separate discussion, but I'm having the same issue as @deleep225, and as @Linux-cpp-lisp suggested, I tried changing the pytorch version from 1.11 to 1.10 but still getting the error.

My error is a little different where it fails at the cmake command, I'm attaching the details here

(nequip) nisarg@Nisargs-MacBook-Pro build % cmake ../cmake -DCMAKE_PREFIX_PATH=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'`
-- Running check for auto-generated files from make-based build system
-- Checking for module 'mpi-cxx'
--   No package 'mpi-cxx' found
-- Could NOT find FFMPEG (missing: FFMPEG_EXECUTABLE) 
-- Generating style headers...
-- Generating package headers...
-- Generating lmpinstalledpkgs.h...
-- Could NOT find ClangFormat (missing: ClangFormat_EXECUTABLE) (Required is at least version "8.0")
-- The following tools and libraries have been found and configured:
 * Git
 * PNG
 * ZLIB

-- <<< Build configuration >>>
   Operating System: Darwin  
   Build type:       RelWithDebInfo
   Install path:     /Users/nisarg/.local
   Generator:        Unix Makefiles using /usr/bin/make
-- Enabled packages: <None>
-- <<< Compilers and Flags: >>>
-- C++ Compiler:     /Library/Developer/CommandLineTools/usr/bin/c++
      Type:          AppleClang
      Version:       13.0.0.13000029
      C++ Flags:     -O2 -g -DNDEBUG
      Defines:       LAMMPS_SMALLBIG;LAMMPS_MEMALIGN=64;LAMMPS_PNG;LAMMPS_GZIP
-- <<< Linker flags: >>>
-- Executable name:  lmp
-- Static library flags:    
CMake Warning at /opt/anaconda3/envs/nequip/lib/python3.9/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:22 (message):
  static library kineto_LIBRARY-NOTFOUND not found.
Call Stack (most recent call first):
  /opt/anaconda3/envs/nequip/lib/python3.9/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:127 (append_torchlib_if_found)
  CMakeLists.txt:922 (find_package)


-- Configuring done
CMake Error in CMakeLists.txt:
  Imported target "torch" includes non-existent path

    "MKL_INCLUDE_DIR-NOTFOUND"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



CMake Error in CMakeLists.txt:
  Imported target "torch" includes non-existent path

    "MKL_INCLUDE_DIR-NOTFOUND"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



CMake Error in CMakeLists.txt:
  Imported target "torch" includes non-existent path

    "MKL_INCLUDE_DIR-NOTFOUND"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



CMake Error in CMakeLists.txt:
  Target "lammps" contains relative path in its
  INTERFACE_INCLUDE_DIRECTORIES:

    "MKL_INCLUDE_DIR-NOTFOUND"


CMake Error in CMakeLists.txt:
  Target "lammps" contains relative path in its
  INTERFACE_INCLUDE_DIRECTORIES:

    "MKL_INCLUDE_DIR-NOTFOUND"


CMake Error in CMakeLists.txt:
  Target "lammps" contains relative path in its
  INTERFACE_INCLUDE_DIRECTORIES:

    "MKL_INCLUDE_DIR-NOTFOUND"


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

I am working on macOS Monterey 12.1, and have also tried running the same on Linux but the same error. Not sure if there's any changes to be made in installing cmake as without it, it throws cmake not found error.

Thanks in advance for the help!

Nisarg

@Linux-cpp-lisp
Copy link
Collaborator

@nisargjoshi10 This is covered in the pair_nequip README, please follow the steps there for MKL.

@deleep225 I am migrating this issue to the pair_nequip repository, since it is more directly relevant to that code.

@Linux-cpp-lisp Linux-cpp-lisp transferred this issue from mir-group/nequip Mar 16, 2022
@deleep225
Copy link
Author

@nisargjoshi10 your installation need mkl-libraries or path of them if they are in your system.
please check the below issue

mir-group/nequip#151

@deleep225
Copy link
Author

@Linux-cpp-lisp I have just installed the nequip with lammps using libtorch1.10.2

Thank you.

However I could not find the conda command for installing the pytorch version 1.10.2 (there are only 1.9 and lower versions in conda website), so I have dowloaded the libtorch 1.10.2 version and given that path.

@Linux-cpp-lisp
Copy link
Collaborator

That works too. For 1.10, you just add something like conda install pytorch==1.10 ... with the added ==1.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants