Hello,
LAMMPS newcomer here.
Following the instructions in /lib/poems/README I think I managed to produce the required file (libpoems.a, Makefile.lammps)
I have installed gcc-5 as it supports c++11 (I've read it was essential for some modules to compile properly) and used the CMAKE_CXX_FLAGS=-std=c++11
Once it is done, I use the following :
cmake -D PKG_OPT=yes -D PKG_POEMS=yes -D PKG_MSCG=yes -D BUILD_LIB=yes -D BUILD_SHARED_LIBS=yes ../cmake
make returns the following error :
[ 11%] Building CXX object CMakeFiles/lammps.dir/mnt/d/lammps_build/source/src/MSCG/fix_mscg.cpp.o
In file included from /usr/include/c++/5/cstdint:35:0,
from /mnt/d/lammps_build/source/build/mscg_build-prefix/src/mscg_build/src/control_input.h:9,
from /mnt/d/lammps_build/source/build/mscg_build-prefix/src/mscg_build/src/mscg.h:37,
from /mnt/d/lammps_build/source/src/MSCG/fix_mscg.cpp:22:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
This is followed by plenty of other errors that might be related to the aforementioned c++11 problem...
Is there anything else I should add in cmake to get rid of this error? I tried adding CMAKE_CXX_FLAGS=-std=c++11 to the cmake flags to no avail...
Thanks.
This error has nothing to do with POEMS, but stems from the MSCG package.
When you are using cmake, you don’t need to compile libpoems separately. It will be built automatically as part of the build procedure.
gcc-5 is quite old, too. gcc-9 is the current version and that one does not need any specific flag to enable c++11 compatibility.
axel.
Thank you for the answer Axel.
So I compiled gcc-9 and g+±9 (took me some times) and this solved the problem with the c++11 compatibility. POEMS is installed, so that’s a good news.
But when trying : lmp -in in.rigid.poems
I get the following :
“lmp: error while loading shared libraries: liblammps.so.0: cannot open shared object file: No such file or directory”
liblammps.so.0 is present in ~/lammps-master/build/
I tried appending this directory to LD_LIBRARY_PATH in the .bashrc file but lmp still can’t find liblammps.so.0
Any suggestions?
Thanks,
Hua
editing $HOME/.bashrc is not sufficient, you also have to source it.
axel.
Dear Axel,
I sourced it of course.
~ source \~/\.bashrc
\~ echo $LD_LIBRARY_PATH
~/lammps-master/build:/usr/local/cuda-9.0/lib64:/home/hua/anaconda3/lib:~/lammps-master/build:/usr/local/cuda-9.0/lib64:/home/hua/anaconda3/lib:
Just to be on the safe side, I rm'ed the previous binary and did a 'make install' again from the build directory.
Here is the relevant line in the .bashrc file (in case I missed something embarrassingly obvious):
export LD_LIBRARY_PATH="~/lammps-master/build:$LD_LIBRARY_PATH"
Thanks,
Hua
using “~/some/path” cannot work. ‘~’ is a shell expansion, but the quotes mask it. try “$HOME/some/path” instead
please note, that “make install” will install the executable and the library to $HOME/.local/bin and $HOME/.local/lib64, respectively.
i just ran on my Fedora 31 machine:
cmake -D PKG_OPT=yes -D PKG_POEMS=yes -D PKG_MSCG=yes -D BUILD_LIB=yes -D BUILD_SHARED_LIBS=yes …/cmake
make -j2
make install
and now get with:
D_LIBRARY_PATH="~/.local/lib64/:$LD_LIBRARY_PATH" ldd which lmp
linux-vdso.so.1 (0x00007ffec29ab000)
liblammps.so.0 => /home/akohlmey/.local/lib64/liblammps.so.0 (0x00007f48d666c000)
libmpicxx.so.12 => /usr/lib64/mpich/lib/libmpicxx.so.12 (0x00007f48d6647000)
libmpi.so.12 => /usr/lib64/mpich/lib/libmpi.so.12 (0x00007f48d633e000)
libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00007f48d6285000)
libpng16.so.16 => /lib64/libpng16.so.16 (0x00007f48d624f000)
libz.so.1 => /lib64/libz.so.1 (0x00007f48d6235000)
libgsl.so.23 => /lib64/libgsl.so.23 (0x00007f48d5fa2000)
libgslcblas.so.0 => /lib64/libgslcblas.so.0 (0x00007f48d5f60000)
libopenblas.so.0 => /lib64/libopenblas.so.0 (0x00007f48d3c4d000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f48d3a53000)
libm.so.6 => /lib64/libm.so.6 (0x00007f48d390d000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f48d38f3000)
libc.so.6 => /lib64/libc.so.6 (0x00007f48d3728000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f48d3706000)
librt.so.1 => /lib64/librt.so.1 (0x00007f48d36fb000)
libhwloc.so.15 => /lib64/libhwloc.so.15 (0x00007f48d36ae000)
/lib64/ld-linux-x86-64.so.2 (0x00007f48d6b9e000)
libgfortran.so.5 => /lib64/libgfortran.so.5 (0x00007f48d340c000)
libltdl.so.7 => /lib64/libltdl.so.7 (0x00007f48d33fe000)
libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f48d33b4000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f48d33ad000)
but with using ~ i get:
linux-vdso.so.1 (0x00007ffc0bde6000)
liblammps.so.0 => not found
libmpicxx.so.12 => /usr/lib64/mpich/lib/libmpicxx.so.12 (0x00007f14f6f8b000)
libmpi.so.12 => /usr/lib64/mpich/lib/libmpi.so.12 (0x00007f14f6c82000)
libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00007f14f6bfd000)
libpng16.so.16 => /lib64/libpng16.so.16 (0x00007f14f6bc7000)
libz.so.1 => /lib64/libz.so.1 (0x00007f14f6bad000)
libgsl.so.23 => /lib64/libgsl.so.23 (0x00007f14f691a000)
libgslcblas.so.0 => /lib64/libgslcblas.so.0 (0x00007f14f68d8000)
libopenblas.so.0 => /lib64/libopenblas.so.0 (0x00007f14f45c5000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f14f43cb000)
libm.so.6 => /lib64/libm.so.6 (0x00007f14f4285000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f14f426b000)
libc.so.6 => /lib64/libc.so.6 (0x00007f14f40a0000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f14f407e000)
librt.so.1 => /lib64/librt.so.1 (0x00007f14f4073000)
libhwloc.so.15 => /lib64/libhwloc.so.15 (0x00007f14f4026000)
/lib64/ld-linux-x86-64.so.2 (0x00007f14f6fe6000)
libgfortran.so.5 => /lib64/libgfortran.so.5 (0x00007f14f3d84000)
libltdl.so.7 => /lib64/libltdl.so.7 (0x00007f14f3d76000)
libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f14f3d2c000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f14f3d25000)
not a LAMMPS problem, but PEBCAC,
axel.
Damn, I just realized the ~ problem.
The problem with liblammps.so.0 has been solved, but now I get the following error when running lmp -in in.rigid.poems:
ERROR: Unrecognized fix style 'poems' is part of the POEMS package which is not enabled in this LAMMPS binary. (src/modify.cpp:901)
Querying make package-status in /src returns the following, which should means POEMS is installed :
Installed YES: package POEMS
Any idea?
You seem to be confusing the conventional build with the cmake based build procedure. Please re-read the documentation on building and pick one method.
Axel
After reading your mail, I decided to make a clean build (erasing bins, libs, previous directories).
I read the manual (the github one, I was on the sandia website previously) and now it seems to work (well lmp doesn't show any blatant error for the examples I'm interested at the very least).
Thank you very much for your time Axel.
Hua