In file included from ../../../src/main/main.cpp:48:0:
../../../src/lib/box.h: In member function ‘void Box::add_ligand_box(OpenBabel::OBMol&)’:
../../../src/lib/box.h:23:20: error: ‘a’ was not declared in this scope
FOR_ATOMS_OF_MOL(a, mol)
^
../../../src/lib/box.h:23:3: error: ‘FOR_ATOMS_OF_MOL’ was not declared in this scope
FOR_ATOMS_OF_MOL(a, mol)
^~~~~~~~~~~~~~~~
Are you sure you have the latest version of the source code? These macros are defined in openbabel/obiter.h which is included in lib/common.h. This header didn't use to need to be explicitly included since other openbable headers included it, but this changed with openbabel 3.0. A commit in May (e6620331e3dadd3be20d70ac42c85c2a9ede0a8) fixed the problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For Smina, I used 'git clone' (https://github.com/mwojcikowski/smina) and then 'cd'ed to smina/build/linux/release (it shows 5 years old?). I guess I should have used the latest code from SourceForge (2020)? [git clone https://git.code.sf.net/p/smina/code smina-code]
For the OpenBabel, I used the tarball from their site (openbabel-3.0.0-source.tar.bz2). Boost is libboost 1.64 from Ubuntu repos.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you. I used the > git clone https://git.code.sf.net/p/smina/code and compiled after modifying make files. The compilation run much longer, but it failed with the output below? There is a lot of Eigen-related warnings but it seems that it failed at boost?
dpkg -s libboost-dev | grep Version
Version: 1.58.0.1ubuntu1
Created cmake-build as:
/smina/code/build/build-cmake
cd to it and then to point to CMakeLists.txt, run
cmake ../../
'CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.10 or higher is required. You are running version 3.5.1'
Changed the minimum version at line 1 to 3.5.1 and it started well. However, it failed again at 100% - at the very end after some checking. File liblibsmina.a was created. I attached CmakeError.log
"undefined reference to boost::re_detail::cpp_regex_traits_implementation<char>::transform_primaryabi:cxx11 const
main.cpp:(.text._ZN5boost9re_detail16re_is_set_memberIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_SH_SH_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb[_ZN5boost9re_detail16re_is_set_memberIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_SH_SH_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb]+0x41f): undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transformabi:cxx11 const'
collect2: error: ld returned 1 exit status
CMakeFiles/smina.dir/build.make:108: recipe for target 'smina' failed
make[2]: [smina] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/smina.dir/all' failed
make[1]: [CMakeFiles/smina.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2"</char></char>
The two most likely issues are that you have mulitple copies of boost installed and are linking to a library that is a different version than the headers you are building against (if this was they case I was hoping cmake would do a better job selecting library paths) or somehow your boost libraries are built with a different version of the compiler being used to build smina.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Mint 18.3 Cinnamon 64-bit. I'll try uninstall all boost versions and compile myself. Installed Boost libs are from unbuntu repo. Cmake though shows that it found Boost:
-- Found Boost include files at /usr/include
-- Found Boost libraries at /usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_timer.so;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_regex.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_serialization.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_program_options.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_chrono.so;/usr/lib/x86_64-linux-gnu/libboost_atomic.so;/usr/lib/x86_64-linux-gnu/libpthread.so
Cmake complains about not seing eigen3 (it is in /usr/include/eigen3). Where do I enter "eigen3_DIR"=/usr/include/eigen3?
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well. I removed libboost and installed version 1.68 (latest in package manager). Run the make from /code/linux/release, got close to 100% and got different error:
is that //lib/x86 a correct path?
/usr/bin/ld: parallel_mc.o: undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
../../makefile_common:34: recipe for target 'tosmina' failed
make: *** [tosmina] Error 1
I'll have to try diffrent machine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I pulled this docker image: https://hub.docker.com/r/linuxmintd/mint18-amd64
And had no trouble building smina either with the cmake build system or the classical build system.
Packages installed
libboost-all-dev
zlib1g-dev
ssh
cmake
vim
eigen3-dev
zlib-dev
OpenBabel 3 was built from source. I changed the cmake version requirement to get the cmake build to work.
I recommend trying to figure out what is different between your setup and a vanilla setup.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK. I was able to compile smina on Mint 19 virtual machine with Boost1.65 (default) and Openbabel3. It required reinstalling libeigen3 from the package manager.
As for the main system, I was not able to trace the cause of failure. Cmake was able to create Makefile without any warning while the final make failed at 100% compiled and linking.
It is clearly my machine that needs fixes. Thank you for the help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Finally, I was able to compile (and run) smina on my main machine. The problem was a conflict in multiple gcc versions. Dropping from 7.0 to the default 5.5 solved the issue. So it was compiler mixup.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It took some figuring out but in fact the problem comes from the fact that my boost is installed with boost-cmake (https://cmake.org/cmake/help/latest/module/FindBoost.html#boost-cmake).
It breaks smina CMake unless you add -DBoost_NO_BOOST_CMAKE=ON. It should probably be added to the CMakeList.txt.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I compiled OpenBabel 3.0.0 and Boost 1.54 on Ubuntu and edited makefile to set path to both. When running
and in the next line a warning:
../../../src/lib/Eigen/src/Core/arch/SSE/PacketMath.h:29:39: warning: ignoring attributes on template argument ‘__m128 {aka __vector(4) float}’ [-Wignored-attributes]
template<> struct is_arithmetic<__m128> { enum { value = true }; };
... later then ..
In file included from ../../../src/main/main.cpp:48:0:
../../../src/lib/box.h: In member function ‘void Box::add_ligand_box(OpenBabel::OBMol&)’:
../../../src/lib/box.h:23:20: error: ‘a’ was not declared in this scope
FOR_ATOMS_OF_MOL(a, mol)
^
../../../src/lib/box.h:23:3: error: ‘FOR_ATOMS_OF_MOL’ was not declared in this scope
FOR_ATOMS_OF_MOL(a, mol)
^~~~~~~~~~~~~~~~
and at the end,
../../makefile_common:19: recipe for target 'main.o' failed
make: *** [main.o] Error 1
I reinstalled Boost and OpenBabel (the latter works), but cannot finish installation of Smina. What I am missing?
Thank you.
Are you sure you have the latest version of the source code? These macros are defined in openbabel/obiter.h which is included in lib/common.h. This header didn't use to need to be explicitly included since other openbable headers included it, but this changed with openbabel 3.0. A commit in May (e6620331e3dadd3be20d70ac42c85c2a9ede0a8) fixed the problem.
For Smina, I used 'git clone' (https://github.com/mwojcikowski/smina) and then 'cd'ed to smina/build/linux/release (it shows 5 years old?). I guess I should have used the latest code from SourceForge (2020)? [git clone https://git.code.sf.net/p/smina/code smina-code]
For the OpenBabel, I used the tarball from their site (openbabel-3.0.0-source.tar.bz2). Boost is libboost 1.64 from Ubuntu repos.
Yes, the sourceforge git is the official respository, you need to use that.
Thank you. I used the > git clone https://git.code.sf.net/p/smina/code and compiled after modifying make files. The compilation run much longer, but it failed with the output below? There is a lot of Eigen-related warnings but it seems that it failed at boost?
make
g++ -ansi -O3 -DNDEBUG -g -I /usr/include/boost -I /usr/local/include/openbabel3 -o smina main.o builtinscoring.o cache.o coords.o custom_terms.o everything.o flexinfo.o grid.o szv_grid.o model.o monte_carlo.o mutate.o my_pid.o naive_non_cache.o non_cache.o obmolopener.o parallel_mc.o parse_pdbqt.o pdb.o quasi_newton.o quaternion.o random.o ssd.o terms.o weighted_terms.o molgetter.o result_info.o PDBQTUtilities.o SminaConverter.o -l openbabel -l boost_iostreams -l boost_timer -lz -l boost_system -l boost_regex -l boost_thread -l boost_serialization -l boost_filesystem -l boost_program_options -l boost_date_time
main.o: In function
boost::cpp_regex_traits<char>::transform_primary[abi:cxx11](char const*, char const*) const': /usr/include/boost/regex/v4/cpp_regex_traits.hpp:965: undefined reference to
boost::re_detail::cpp_regex_traits_implementation<char>::transform_primaryabi:cxx11 const'main.o: In function
boost::cpp_regex_traits<char>::transform[abi:cxx11](char const*, char const*) const': /usr/include/boost/regex/v4/cpp_regex_traits.hpp:961: undefined reference to
boost::re_detail::cpp_regex_traits_implementation<char>::transformabi:cxx11 const'collect2: error: ld returned 1 exit status
../../makefile_common:30: recipe for target 'smina' failed
make: *** [smina] Error 1</char></char>
I assume that the compiled binary will ultimately be in /usr/local/bin?
Thank you.
Have you tried using the cmake build system?
mkdir build-cmake
cd build-cmake
cmake ..
Created cmake-build as:
/smina/code/build/build-cmake
cd to it and then to point to CMakeLists.txt, run
'CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.10 or higher is required. You are running version 3.5.1'
Changed the minimum version at line 1 to 3.5.1 and it started well. However, it failed again at 100% - at the very end after some checking. File liblibsmina.a was created. I attached CmakeError.log
"undefined reference to boost::re_detail::cpp_regex_traits_implementation<char>::transform_primaryabi:cxx11 const
main.cpp:(.text._ZN5boost9re_detail16re_is_set_memberIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_SH_SH_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb[_ZN5boost9re_detail16re_is_set_memberIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_SH_SH_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb]+0x41f): undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transformabi:cxx11 const'
collect2: error: ld returned 1 exit status
CMakeFiles/smina.dir/build.make:108: recipe for target 'smina' failed
make[2]: [smina] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/smina.dir/all' failed
make[1]: [CMakeFiles/smina.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2"</char></char>
What operating system is this?
The two most likely issues are that you have mulitple copies of boost installed and are linking to a library that is a different version than the headers you are building against (if this was they case I was hoping cmake would do a better job selecting library paths) or somehow your boost libraries are built with a different version of the compiler being used to build smina.
Mint 18.3 Cinnamon 64-bit. I'll try uninstall all boost versions and compile myself. Installed Boost libs are from unbuntu repo. Cmake though shows that it found Boost:
-- Found Boost include files at /usr/include
-- Found Boost libraries at /usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_timer.so;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_regex.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_serialization.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_program_options.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_chrono.so;/usr/lib/x86_64-linux-gnu/libboost_atomic.so;/usr/lib/x86_64-linux-gnu/libpthread.so
Cmake complains about not seing eigen3 (it is in /usr/include/eigen3). Where do I enter "eigen3_DIR"=/usr/include/eigen3?
Thank you.
Well. I removed libboost and installed version 1.68 (latest in package manager). Run the
make
from /code/linux/release, got close to 100% and got different error:is that //lib/x86 a correct path?
/usr/bin/ld: parallel_mc.o: undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
../../makefile_common:34: recipe for target 'tosmina' failed
make: *** [tosmina] Error 1
I'll have to try diffrent machine.
I pulled this docker image:
https://hub.docker.com/r/linuxmintd/mint18-amd64
And had no trouble building smina either with the cmake build system or the classical build system.
Packages installed
libboost-all-dev
zlib1g-dev
ssh
cmake
vim
eigen3-dev
zlib-dev
OpenBabel 3 was built from source. I changed the cmake version requirement to get the cmake build to work.
I recommend trying to figure out what is different between your setup and a vanilla setup.
Good idea. I'll run the docker image and will compare both.
Thank you.
OK. I was able to compile smina on Mint 19 virtual machine with Boost1.65 (default) and Openbabel3. It required reinstalling libeigen3 from the package manager.
As for the main system, I was not able to trace the cause of failure. Cmake was able to create Makefile without any warning while the final
make
failed at 100% compiled and linking.It is clearly my machine that needs fixes. Thank you for the help.
Finally, I was able to compile (and run) smina on my main machine. The problem was a conflict in multiple gcc versions. Dropping from 7.0 to the default 5.5 solved the issue. So it was compiler mixup.
I was able to compile with gcc7 on linuxmint 19.3. I've had some problems compiling too but using cmake fixed it.
I had the same issue today using CMake.
It took some figuring out but in fact the problem comes from the fact that my boost is installed with boost-cmake (https://cmake.org/cmake/help/latest/module/FindBoost.html#boost-cmake).
It breaks smina CMake unless you add -DBoost_NO_BOOST_CMAKE=ON. It should probably be added to the CMakeList.txt.
I've pushed the Boost_NO_BOOST_CMAKE=ON configuration as well as removed the legacy build files.
Thanks, it does solve the issue for me.