Closed jcklasseter closed 5 years ago
Thanks. I don't have a Ubuntu 18.04.3 LTS machine handy to test on but I made a few changes that will hopefully address it. Specifically the call to shm_unlink was part of a deprecated code path and is now gone so that should not be a problem anymore. The other libs should have been linked if cmake thought it was a linux system but they should also be linked if gcc is the compiler so I made sure they are in both cases.
Maybe a little niche, but I compiled rmg-cpu v4.0.0-beta in Ubuntu 18.04.3 LTS in a VirtualBox VM for testing. Here is what worked for me:
I started with a fresh, minimal install.
sudo apt-get install cmake libblas-dev liblapack-dev gfortran libfftw3-dev libboost-all-dev
Then I followed the README.md:
Then the final step in
make -j 2 rmg-cpu
failed. The error was:So then I ran
VERBOSE=1 make -j 2 rmg-cpu
to see the actual cmake commands:To fix this I decided I would just fix the linking myself, I replaced '/usr/bin/c++' in the longer line with gcc and tried again, and got a different error:
/usr/bin/ld: RmgLib/libRmgLib.a(BaseThread.cpp.o): undefined reference to symbol '_ZNSt18condition_variable10notify_oneEv@@GLIBCXX_3.4.11'
I added
-lstdc++
and the error changed back to:/usr/bin/ld: Misc/libMisc.a(SharedMemory.cpp.o): undefined reference to symbol 'shm_unlink@@GLIBC_2.2.5'
Then, I added
-lrt
and the error changed to:/usr/bin/ld: spglib/libsymspg.a(symmetry.c.o): undefined reference to symbol 'acos@@GLIBC_2.2.5'
Which thankfully was the easiest fix of all:
-lm
. After that, things finally worked and the diamond8 example finished in ~30 seconds (which is an overestimate since I usedtime mpirun
) which is more than fine for some tests.So, long story short adding
-lstdc++ -lrt -lm
to the generated cmake link command resulted in successful compilation on Ubuntu 18.04.3 LTS.(I can't find the option to add the 'Build Instructions' flair, apologies)