dynamomd / DynamO

An event-driven particle simulator and visualisation code. Please see the website below for more information.
http://DynamOMD.com
GNU General Public License v3.0
56 stars 36 forks source link

Error when installing DynamO1.6 on workstation #44

Closed Bradleydi closed 9 years ago

Bradleydi commented 9 years ago

I tried to install new DynamO on the workstation but encountered a problem following instructions for CentOS. Maybe something is wrong with the boost? Taking "Alternative Step 2:Compiling using a local boost installation" still didn't fix it. If anyone has an idea, please give me some advice. Thank you!

Scanning dependencies of target dynahist_rw [ 81%] Building CXX object CMakeFiles/dynahist_rw.dir/src/dynamo/programs/dynahist_rw.cpp.o Linking CXX executable dynahist_rw CMakeFiles/dynahist_rw.dir/src/dynamo/programs/dynahist_rw.cpp.o: In function main': dynahist_rw.cpp:(.text+0x2068): undefined reference toboost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' CMakeFiles/dynahist_rw.dir/src/dynamo/programs/dynahist_rw.cpp.o: In function __static_initialization_and_destruction_0(int, int)': dynahist_rw.cpp:(.text+0x335d): undefined reference toboost::system::generic_category()' dynahist_rw.cpp:(.text+0x3369): undefined reference to boost::system::generic_category()' dynahist_rw.cpp:(.text+0x3375): undefined reference toboost::system::system_category()'

Thank you for your time!

toastedcrumpets commented 9 years ago

Hi, It looks like the linker is failing to correctly link against the boost program options library and the boost system library. It most likely caused by an incorrect configuration of where to find boost, as cmake would not let you compile without a working installation. I'll need a bit more information to figure out why its incorrect though.

Can you tell me which version of CentOS you have? Version 7 has up to date boost packages so this should just work, but version 6.5 and earlier has to use a local installation for compilation. I've only tested it on v6.5 and v7. If you have an earlier version I can try compiling it there too using a virtual machine.

Can you also post the output of trying to build using the verbose make command (see below)? make VERBOSE=1

Marcus

Bradleydi commented 9 years ago

Hi Marcus,

Thank you for your reply. The version of CentOS is 6.5. Gcc compiler is 4.4.7 but I use "scl enable devtoolset-1.1 bash" before installing.

Here is the error information:

SNIP Linking CXX executable dynahist_rw /usr/bin/cmake -E cmake_link_script CMakeFiles/dynahist_rw.dir/link.txt --verbose=1 /opt/centos/devtoolset-1.1/root/usr/bin/c++ -std=c++11 -fPIC CMakeFiles/dynahist_rw.dir/src/dynamo/programs/dynahist_rw.cpp.o -o dynahist_rw -rdynamic -lboost_filesystem-mt -lboost_program_options-mt -lboost_iostreams-mt -lboost_system-mt -lbz2 -lpthread libdynamo.a -lboost_filesystem-mt -lboost_program_options-mt -lboost_iostreams-mt -lboost_system-mt -lbz2 -lpthread CMakeFiles/dynahist_rw.dir/src/dynamo/programs/dynahist_rw.cpp.o: In function main': dynahist_rw.cpp:(.text+0x2068): undefined reference toboost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)' SNIP collect2: error: ld returned 1 exit status make[2]: * [dynahist_rw] Error 1 make[2]: Leaving directory `/home2/bliaf/zd/DynamO/build-dir' make[1]: * [CMakeFiles/dynahist_rw.dir/all] Error 2 make[1]: Leaving directory`/home2/bliaf/zd/DynamO/build-dir' make: *\ [all] Error 2

Thank you! Di

toastedcrumpets commented 9 years ago

Hi, So the problem here appears to be that you're still linking to the system boost libraries, which are too out of date for DynamO on CentOS 6.5. I can tell as there seems to be no altering of the library path to include a local boost install.

You have to make sure that cmake finds the local boost installation during its configuration, not the system one. To make absolutely sure, perform the following commands to remove your current build dir, force a reconfigure, and rebuild using a local boost install which has already been built.

cd DynamO rm -Rf build-dir scl enable devtoolset-1.1 bash mkdir build-dir cd build-dir export BOOST_ROOT=~/boost_1_56_0/ export BOOST_LIBRARYDIR=~/boost_1_56_0/stage/lib cmake ../

I will add an additional check to DynamO to make sure that configuration with an out-of-date boost fails. Marcus

toastedcrumpets commented 9 years ago

I've reviewed the build process on CentOS, and the configuration checks already fail when the current system version of boost is installed (so there is no need to add the check).

Can you still try a clean build, using the above commands, to see if it is an error brought about by an inconsistency in the build environment?

Bradleydi commented 9 years ago

The same error still exists. It seems that new boost_1_56_0 is not linked efficiently.

toastedcrumpets commented 9 years ago

On CentOS6.5 my link command is different:

Linking CXX executable dynahist_rw /usr/bin/cmake -E cmake_link_script CMakeFiles/dynahist_rw.dir/link.txt --verbose=1 /opt/centos/devtoolset-1.1/root/usr/bin/c++ -std=c++11 CMakeFiles/dynahist_rw.dir/src/dynamo/programs/dynahist_rw.cpp.o -o dynahist_rw -rdynamic /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_filesystem.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_program_options.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_iostreams.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_system.a -lbz2 -lpthread libdynamo.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_filesystem.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_program_options.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_iostreams.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_system.a -lbz2 -lpthread Linking CXX executable dynahist_rw /usr/bin/cmake -E cmake_link_script CMakeFiles/dynahist_rw.dir/link.txt --verbose=1 /opt/centos/devtoolset-1.1/root/usr/bin/c++ -std=c++11 CMakeFiles/dynahist_rw.dir/src/dynamo/programs/dynahist_rw.cpp.o -o dynahist_rw -rdynamic /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_filesystem.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_program_options.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_iostreams.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_system.a -lbz2 -lpthread libdynamo.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_filesystem.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_program_options.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_iostreams.a /home/mjki2mb2/boost_1_56_0/stage/lib/libboost_system.a -lbz2 -lpthread

This might be caused through me using an updated CMake as well from the stock version. I will try my fresh install image to see if this finds the error.

toastedcrumpets commented 9 years ago

I've tested compilation on a fresh install of CentOS, and it fails to compile as cmake 2.6 does not properly detect the setup of a local boost installation. I've backported the required FindBoost module from cmake 2.8 and stuck it in the source tree for DynamO. I'm currently performing a test compilation, if this succeeds, I'll upload a patch to fix your error later today.

toastedcrumpets commented 9 years ago

I've now uploaded the patch, this seems to fix the error on CentOS6.5 fcc0bd1439cf871ef5eab2f2b8afe46aefd87fc9

Please pull the patch using "git pull" and force a full rebuild by deleting your build-dir and restarting.

I'm currently performing a full rebuild on all test systems, which you can watch here (http://my.cdash.org/index.php?project=DynamOMD). Provided these all build I'll mark this as solved and close the bug later today.

If you're still having trouble, please just reopen it/comment again.

Bradleydi commented 9 years ago

Thank you for your help. I just installed DynamO successfully after updating the cmake to 2.8. Many thanks!

toastedcrumpets commented 9 years ago

Ah I'm glad, closing this issue as solved.

toastedcrumpets commented 9 years ago

Hi again, This is slightly embarrassing, but in the new build system I did not force "release mode", so all builds are getting built without compiler optimisations turned on. This slows DynamO by a factor of about 100 and effects all DynamO builds in the last two weeks, so you may want to update and rebuild DynamO again before evaluating it. I thought I'd tell you as I know you've (just) built the code, but most users are on Ubuntu and their builds are unaffected. Hopefully that's the last bug on the new build system! Marcus

Bradleydi commented 9 years ago

Thank you! I will rebuild DynamO asap.

Bradleydi commented 9 years ago

BTW Do you have the plan to add ellipsoid or superball to DynamO? I think it is very interesting to study and also meaningful.

toastedcrumpets commented 9 years ago

Ellipsoids (and probably superballs) will eventually be added to DynamO but it will take some work.

Donev and co-workers have already figured out how to implement them, but they're not straightforward as their overlap functions are not algebraic and need a minimisation step. The other obstacle is that the anisotropic parts of DynamO need cleaning up before I want to add more complexity to the code (see Issue #23). In short, it can be done but it may be a while before it is. I'd be happy to support someone else implementing it though.

Bradleydi commented 9 years ago

Donev only shared its hard-sphere codes, but not ellipsoid ones (precompiled executables). If you have related codes, I would like to be a helper to develop DynamO!

toastedcrumpets commented 9 years ago

Hi, can you start a new issue, and I'll tag it as a feature request to discuss how to implement this?