Hi I have downloaded LAMMPS and the first couple of examples seem to work ok, but when I go to perform more specialized examples, specifically granular and meam there are compilation issues.
The errors seem to be related to the force
LAMMPS (2 Aug 2023 - Update 3)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
...
...
...
ERROR: Unrecognized pair style 'meam' is part of the MEAM package which is not enabled in this LAMMPS binary. (src/force.cpp:271)
Last command: pair_style meam
ERROR: Unrecognized pair style 'granular' is part of the GRANULAR package which is not enabled in this LAMMPS binary. (src/force.cpp:271)
Last command: pair_style granular
I went to the src directory and performed: make force
error message:
make force
g++ force.cpp -o force
In file included from force.h:17,
from force.cpp:14:
pointers.h:27:10: fatal error: mpi.h: No such file or directory
27 | #include <mpi.h> // IWYU pragma: export
| ^~~~~~~
compilation terminated.
make: *** [<builtin>: force] Error 1
I got an error with mpi
I verified that MPI was already installed on the system
I used the following environmental variables to ensure the correct MPI wrappers are used
export CC=mpicc
export CXX=mpicxx
export FC=mpif90
make clean-all
make mpi
issues persisted.
Other steps I took:
I copied the lammps executable from the downladed binaries and put it in the folder with the examples. I still encountered the same issues.
I did git clone
git clone -b release https://github.com/lammps/lammps.git mylammps
Cloning into 'mylammps'...
remote: Enumerating objects: 387222, done.
remote: Counting objects: 100% (2138/2138), done.
remote: Compressing objects: 100% (1065/1065), done.
remote: Total 387222 (delta 1250), reused 1873 (delta 1068), pack-reused 385084
Receiving objects: 100% (387222/387222), 708.80 MiB | 3.69 MiB/s, done.
Resolving deltas: 100% (324276/324276), done.
Updating files: 100% (13140/13140), done.
in this case I think the make force proceeded somewhat more, but it still got an error, and still had issues with unrecognized paeir style
make force
mpicxx force.cpp -o force
/usr/bin/ld: /tmp/ccPKQCd5.o: warning: relocation against `_ZTIN9LAMMPS_NS11AngleHybridE' in read-only section `.text'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
/usr/bin/ld: /tmp/ccPKQCd5.o: in function `LAMMPS_NS::Force::Force(LAMMPS_NS::LAMMPS*)':
force.cpp:(.text+0x229): undefined reference to `LAMMPS_NS::utils::strdup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
...
...
...
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [<builtin>: force] Error 1
Also meam and granular seem to be up to date:
make GRANULAR
make: 'GRANULAR' is up to date.
make MEAM
make: 'MEAM' is up to date.
Any help appreciated
Thanks