Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2016.09.2 rdkit build error on fedora 25 #37

Open
rvianello opened this issue Nov 29, 2016 · 21 comments
Open

2016.09.2 rdkit build error on fedora 25 #37

rvianello opened this issue Nov 29, 2016 · 21 comments

Comments

@rvianello
Copy link
Contributor

On fedora 25, with gcc 6.2.1, the rdkit conda recipe fails with the following error

In file included from /home/ric/miniconda3/conda-bld/rdkit_1480453840975/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include/boost/config.hpp:61:0, from /home/ric/miniconda3/conda-bld/rdkit_1480453840975/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include/boost/cstdint.hpp:36, from /home/ric/miniconda3/conda-bld/rdkit_1480453840975/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include/boost/multiprecision/cpp_int.hpp:11, from /home/ric/miniconda3/conda-bld/rdkit_1480453840975/work/Code/GraphMol/ChemReactions/Enumerate/Enumerate.cpp:36: /home/ric/miniconda3/conda-bld/rdkit_1480453840975/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include/boost/multiprecision/cpp_int.hpp:181:4: error: right operand of shift expression ‘(1u << 63u)’ is >= than the precision of the left operand [-fpermissive] BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1)); ^ /home/ric/miniconda3/conda-bld/rdkit_1480453840975/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include/boost/multiprecision/cpp_int.hpp:401:4: error: right operand of shift expression ‘(1u << 63u)’ is >= than the precision of the left operand [-fpermissive] BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1)); ^ /home/ric/miniconda3/conda-bld/rdkit_1480453840975/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include/boost/multiprecision/cpp_int.hpp:548:4: error: right operand of shift expression ‘(1u << 63u)’ is >= than the precision of the left operand [-fpermissive] BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1)); ^ Code/GraphMol/ChemReactions/CMakeFiles/ChemReactions.dir/build.make:350: recipe for target 'Code/GraphMol/ChemReactions/CMakeFiles/ChemReactions.dir/Enumerate/Enumerate.cpp.o' failed

the version of boost required by the rdkit recipe on unix is boost 1.56.0

@rvianello
Copy link
Contributor Author

rvianello commented Dec 9, 2016

I tested the build with every other boost release starting from boost 1.56.0 and it only succeeded with boost 1.62.

Similar errors have been reported to occur on Kubuntu 16.10 (#39) where building with boost 1.57 and 1.61 was also verified to fail.

@rvianello
Copy link
Contributor Author

@bp-kelley @greglandrum the current rdkit release appears to be problematic to build on some recent linux distributions. Do you have any idea if it may be possible to work around the above errors without upgrading to the latest boost?

@greglandrum
Copy link
Member

@rvianello Sorry, I missed this when it first came through.
Can you try adding -fpermissive to the CXXFLAGS and see if that helps?

@rvianello
Copy link
Contributor Author

@greglandrum yes, thanks for the suggestion, I will try that and then post an update.

@greglandrum
Copy link
Member

Another possibility may be to add USE_BOOST_MULTIPRECISION_DEFAULT=0 to the environment before building. (I'm just googling around; I can't actually test this at the moment)

@apahl
Copy link

apahl commented Dec 19, 2016

I can report that using USE_BOOST_MULTIPRECISION_DEFAULT=0does not lead to a successful build.

@apahl
Copy link

apahl commented Dec 19, 2016

Where would I add -fpermissive to the CXXFLAGS in the conda build workflow?

@greglandrum
Copy link
Member

greglandrum commented Dec 19, 2016

Maybe you may need to add the USE_BOOST_MULTIPRECISION_DEFAULT=0 argument as a flag when you invoke CMAKE?
The easiest way to quickly test adding -fpermissive is to edit the current build settings by running ccmake . in your build directory, hitting t to toggle into advance mode, adding -fpermissive to the end of CMAKE_CXX_FLAGS_RELEASE, and then typing c followed by g.

@apahl
Copy link

apahl commented Dec 19, 2016

I used USE_BOOST_MULTIPRECISION_DEFAULT=0 conda build rdkit.

@bp-kelley
Copy link

bp-kelley commented Dec 19, 2016 via email

@rvianello
Copy link
Contributor Author

-DCMAKE_CXX_FLAGS_RELEASE=-fpermissive does indeed seem to be sufficient to work around the problem, I'm checking if this is the proper way to pass an additional flag on the cmake command line, without overwriting the default ones.

@apahl
Copy link

apahl commented Dec 20, 2016

With -DCMAKE_CXX_FLAGS_RELEASE=-fpermissive put in the cmdline of cmake in build.sh, the build also runs successfully for me.
But, I get serious performance issues with the new version (and I don't know if this is related to the added parameter). When I perform a substructure search for the same structure in the same data set of ~190k compounds, the search takes 36 sec with RDKit 2016_03_2 and 130(!) sec with the current RDKit_2016_09_2.

@greglandrum
Copy link
Member

I believe that's because this formulation overwrites CXX_FLAGS_RELEASE instead of supplementing them, so you aren't compiling with full optimization.
Please try: -DCMAKE_CXX_FLAGS_RELEASE="-fpermissive -O3" (I think that syntax is right)

@apahl
Copy link

apahl commented Dec 20, 2016

Unfortunately, with that change (-DCMAKE_CXX_FLAGS_RELEASE="-fpermissive -O3"), the build fails again, but now at a later point and with a boost / regex related error:

[ 90%] Linking CXX executable testSLNParse
../../../lib/libSLNParse.so.1.2016.09.2: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
../../../lib/libSLNParse.so.1.2016.09.2: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
Code/GraphMol/SLNParse/CMakeFiles/testSLNParse.dir/build.make:104: recipe for target 'Code/GraphMol/SLNParse/testSLNParse' failed
make[2]: *** [Code/GraphMol/SLNParse/testSLNParse] Error 1
CMakeFiles/Makefile2:7758: recipe for target 'Code/GraphMol/SLNParse/CMakeFiles/testSLNParse.dir/all' failed
make[1]: *** [Code/GraphMol/SLNParse/CMakeFiles/testSLNParse.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

But, boost and boost regex are available and found:

-- Found Threads: TRUE  
-- Boost version: 1.56.0
-- Found the following Boost libraries:
--   thread
--   system
-- Boost version: 1.56.0
-- Found the following Boost libraries:
--   serialization
[...]
-- Boost version: 1.56.0
-- Found the following Boost libraries:
--   regex
-- Configuring done

and the error did not occur when I used just -fpermissive.
I have also edited build.sh to run make without the -joption.

@rvianello
Copy link
Contributor Author

with -D CMAKE_CXX_FLAGS="-fpermissive" a different layer of command line flags is set, that I think allows prepending this flag without altering the optimization flags (in my environment -O3 -DNDEBUG) that are appended when building in release mode (checked with make VERBOSE=1).

this was sufficient to me to complete the build and I didn't experience any issues related to the SLN parser. @apahl maybe you could try both passing -fpermissive and disabling the SLN support as discussed in #39 and see if the build at least proceeds to completion?

@greglandrum
Copy link
Member

As an FYI to be sure that something catastrophic hadn't happened with the release:
The 2016_09_2 version of the RDKit does seem to be a bit slower than the 2016_03_4 release (at least using the conda builds on my Mac), but it's not a dramatic difference. Still something for me to investigate.

@apahl
Copy link

apahl commented Dec 21, 2016

@rvianello: If I just pass -DCMAKE_CXX_FLAGS_RELEASE=-fpermissive. the build is successful without disabling SLN support, as mentioned above (#37 (comment)). The problem is, that I get really slow performance, apparently resulting from a build in debug mode.

@rvianello
Copy link
Contributor Author

@apahl yes, that's why I suggested using CMAKE_CXX_FLAGS instead of CMAKE_CXX_FLAGS_RELEASE. This way the optimization flags should be preserved. On the other hand, your problem with SLN looks likely to be related to the optimization level, so you will probably need to disable it.

@bp-kelley
Copy link

bp-kelley commented Dec 21, 2016 via email

@apahl
Copy link

apahl commented Dec 21, 2016

@rvianello: My apologies, I did not notice that you mentioned a different flag.
Yes, with -D CMAKE_CXX_FLAGS="-fpermissive" and disabling SLN support as you describe, the build runs through and all tests are passed. Benchmark will happen tomorrow.
@bp-kelley: Sorry, I am not quite sure how I can build a specific PR with conda build rdkit. I have not installed an RDKit build chain outside Anaconda anymore and my Kubuntu would then install yet another boost version than the one from the conda-rdkit.

@apahl
Copy link

apahl commented Dec 22, 2016

I have just done the benchmark with the latest successful build using the flags mentioned by @rvianello (-D CMAKE_CXX_FLAGS="-fpermissive" and -D RDK_BUILD_SLN_SUPPORT=OFF in the cmake cmdline of build.sh) and the performance is just the same as with the old release.
Since I do not need SLN support, I am good to go and will close #39.
Looking forward to use 2016.09.2, many thanks for all your help.

Have a happy and relaxing holiday!

Kind regards,
Axel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants