conda-rdkit icon indicating copy to clipboard operation
conda-rdkit copied to clipboard

2016.09.2 rdkit build error on fedora 25

Open rvianello opened this issue 8 years ago • 21 comments

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 avatar Nov 29 '16 21:11 rvianello

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 avatar Dec 09 '16 13:12 rvianello

@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?

rvianello avatar Dec 19 '16 09:12 rvianello

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

greglandrum avatar Dec 19 '16 09:12 greglandrum

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

rvianello avatar Dec 19 '16 09:12 rvianello

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)

greglandrum avatar Dec 19 '16 09:12 greglandrum

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

apahl avatar Dec 19 '16 10:12 apahl

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

apahl avatar Dec 19 '16 11:12 apahl

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.

greglandrum avatar Dec 19 '16 11:12 greglandrum

I used USE_BOOST_MULTIPRECISION_DEFAULT=0 conda build rdkit.

apahl avatar Dec 19 '16 13:12 apahl

Here is the boost ticket: https://svn.boost.org/trac/boost/ticket/12181

sigh. those kind of look like real errors too.

On Mon, Dec 19, 2016 at 8:14 AM, Axel Pahl [email protected] wrote:

I used USE_BOOST_MULTIPRECISION_DEFAULT=0 conda build rdkit.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rdkit/conda-rdkit/issues/37#issuecomment-267961129, or mute the thread https://github.com/notifications/unsubscribe-auth/AJbioC4VgpqXyFJKD_0S6jvFHkWyDW29ks5rJoMYgaJpZM4K_haY .

bp-kelley avatar Dec 19 '16 17:12 bp-kelley

-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.

rvianello avatar Dec 19 '16 18:12 rvianello

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.

apahl avatar Dec 20 '16 12:12 apahl

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)

greglandrum avatar Dec 20 '16 13:12 greglandrum

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.

apahl avatar Dec 20 '16 15:12 apahl

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?

rvianello avatar Dec 21 '16 09:12 rvianello

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.

greglandrum avatar Dec 21 '16 09:12 greglandrum

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

apahl avatar Dec 21 '16 15:12 apahl

@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.

rvianello avatar Dec 21 '16 15:12 rvianello

Axel, could you try this PR?

https://github.com/rdkit/rdkit/pull/1225

Specifically it adds the following to Code/GraphMol/ChemReactions/CMakeList.txt

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5) if(Boost_VERSION LESS 106200) set_property(SOURCE Enumerate/Enumerate.cpp APPEND_STRING PROPERTY COMPILE_FLAGS " -fpermissive ") endif() endif()

rdkit_library(ChemReactions

On Wed, Dec 21, 2016 at 10:16 AM, Riccardo Vianello < [email protected]> wrote:

@apahl https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rdkit/conda-rdkit/issues/37#issuecomment-268547429, or mute the thread https://github.com/notifications/unsubscribe-auth/AJbioJ8_OjK6ZLE-zoLXPzg50PmbwGNcks5rKUK-gaJpZM4K_haY .

bp-kelley avatar Dec 21 '16 15:12 bp-kelley

@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 avatar Dec 21 '16 16:12 apahl

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 https://github.com/rdkit/conda-rdkit/issues/39. Looking forward to use 2016.09.2, many thanks for all your help.

Have a happy and relaxing holiday!

Kind regards,
Axel

apahl avatar Dec 22 '16 08:12 apahl