rdkit / homebrew-rdkit

Homebrew formula for rdkit
44 stars 19 forks source link

Failure to install on macOS Mojave #87

Closed rapodaca closed 3 years ago

rapodaca commented 4 years ago
**Configuration:**

Description:

Installation via Homebrew (2.2.15) fails with error ending: [ 15%] Built target coordge. I expected to be able to install using the instructions given at:

https://github.com/rdkit/homebrew-rdkit

None of the possible errors listed there appear to explain what I'm seeing. What am I missing?

A version of Boost had been installed. Also couldn't compile in that case. Deleted boost, and received the error below on attempt to install.

brew install --HEAD rdkit

Full output:

$ brew install --HEAD rdkit
==> Installing rdkit from rdkit/rdkit
==> Cloning https://github.com/rdkit/rdkit.git
Updating /Users/rich/Library/Caches/Homebrew/rdkit--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at 611c704 Fixes #3131 (#3132)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'numpy' has no attribute 'get_include'
==> cmake -DRDK_INSTALL_INTREE=OFF -DRDK_BUILD_CPP_TESTS=OFF -DRDK_INSTALL_STATI
==> make -j4
Last 15 lines from /Users/rich/Library/Logs/Homebrew/rdkit/02.make:
cd /tmp/rdkit-20200505-74362-mnomh6/External/CoordGen && /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++  -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_SERIALIZATION_DYN_LINK -DIN_COORDGEN -DIN_MAEPARSER -DRDKIT_DYN_LINK -DRDK_64BIT_BUILD -DRDK_BUILD_COORDGEN_SUPPORT -DRDK_BUILD_DESCRIPTORS3D -DRDK_HAS_EIGEN3 -DRDK_TEST_MULTITHREADED -DRDK_THREADSAFE_SSS -DRDK_USE_BOOST_SERIALIZATION -DRDK_USE_STRICT_ROTOR_DEFINITION -DRDK_USE_URF -Dcoordgen_EXPORTS -I/tmp/rdkit-20200505-74362-mnomh6/External/catch/catch/single_include/catch2 -I/tmp/rdkit-20200505-74362-mnomh6/External -I/tmp/rdkit-20200505-74362-mnomh6/External/RingFamilies/RingDecomposerLib/src/RingDecomposerLib -I/tmp/rdkit-20200505-74362-mnomh6/External/CoordGen -I/usr/local/Cellar/python@3.8/3.8.2/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I/tmp/rdkit-20200505-74362-mnomh6/Code -isystem /usr/local/include/eigen3  -std=c++11 -stdlib=libc++ -Wno-parentheses -Wno-logical-op-parentheses -Wno-format -mpopcnt -Wall -Wextra -Wno-deprecated -Wno-unused-function -fno-strict-aliasing -Wno-format -Wno-logical-op-parentheses -fPIC -stdlib=libc++ -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -fPIC   -std=gnu++11 -o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerResidue.cpp.o -c /tmp/rdkit-20200505-74362-mnomh6/External/CoordGen/coordgen/sketcherMinimizerResidue.cpp
[ 16%] Building CXX object External/CoordGen/CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerResidueInteraction.cpp.o
cd /tmp/rdkit-20200505-74362-mnomh6/External/CoordGen && /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++  -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_SERIALIZATION_DYN_LINK -DIN_COORDGEN -DIN_MAEPARSER -DRDKIT_DYN_LINK -DRDK_64BIT_BUILD -DRDK_BUILD_COORDGEN_SUPPORT -DRDK_BUILD_DESCRIPTORS3D -DRDK_HAS_EIGEN3 -DRDK_TEST_MULTITHREADED -DRDK_THREADSAFE_SSS -DRDK_USE_BOOST_SERIALIZATION -DRDK_USE_STRICT_ROTOR_DEFINITION -DRDK_USE_URF -Dcoordgen_EXPORTS -I/tmp/rdkit-20200505-74362-mnomh6/External/catch/catch/single_include/catch2 -I/tmp/rdkit-20200505-74362-mnomh6/External -I/tmp/rdkit-20200505-74362-mnomh6/External/RingFamilies/RingDecomposerLib/src/RingDecomposerLib -I/tmp/rdkit-20200505-74362-mnomh6/External/CoordGen -I/usr/local/Cellar/python@3.8/3.8.2/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I/tmp/rdkit-20200505-74362-mnomh6/Code -isystem /usr/local/include/eigen3  -std=c++11 -stdlib=libc++ -Wno-parentheses -Wno-logical-op-parentheses -Wno-format -mpopcnt -Wall -Wextra -Wno-deprecated -Wno-unused-function -fno-strict-aliasing -Wno-format -Wno-logical-op-parentheses -fPIC -stdlib=libc++ -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -fPIC   -std=gnu++11 -o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerResidueInteraction.cpp.o -c /tmp/rdkit-20200505-74362-mnomh6/External/CoordGen/coordgen/sketcherMinimizerResidueInteraction.cpp
[ 16%] Building CXX object External/CoordGen/CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerRing.cpp.o
cd /tmp/rdkit-20200505-74362-mnomh6/External/CoordGen && /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++  -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_SERIALIZATION_DYN_LINK -DIN_COORDGEN -DIN_MAEPARSER -DRDKIT_DYN_LINK -DRDK_64BIT_BUILD -DRDK_BUILD_COORDGEN_SUPPORT -DRDK_BUILD_DESCRIPTORS3D -DRDK_HAS_EIGEN3 -DRDK_TEST_MULTITHREADED -DRDK_THREADSAFE_SSS -DRDK_USE_BOOST_SERIALIZATION -DRDK_USE_STRICT_ROTOR_DEFINITION -DRDK_USE_URF -Dcoordgen_EXPORTS -I/tmp/rdkit-20200505-74362-mnomh6/External/catch/catch/single_include/catch2 -I/tmp/rdkit-20200505-74362-mnomh6/External -I/tmp/rdkit-20200505-74362-mnomh6/External/RingFamilies/RingDecomposerLib/src/RingDecomposerLib -I/tmp/rdkit-20200505-74362-mnomh6/External/CoordGen -I/usr/local/Cellar/python@3.8/3.8.2/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I/tmp/rdkit-20200505-74362-mnomh6/Code -isystem /usr/local/include/eigen3  -std=c++11 -stdlib=libc++ -Wno-parentheses -Wno-logical-op-parentheses -Wno-format -mpopcnt -Wall -Wextra -Wno-deprecated -Wno-unused-function -fno-strict-aliasing -Wno-format -Wno-logical-op-parentheses -fPIC -stdlib=libc++ -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -fPIC   -std=gnu++11 -o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerRing.cpp.o -c /tmp/rdkit-20200505-74362-mnomh6/External/CoordGen/coordgen/sketcherMinimizerRing.cpp
[ 16%] Linking CXX shared library ../../lib/libRDKitcoordgen.dylib
cd /tmp/rdkit-20200505-74362-mnomh6/External/CoordGen && /usr/local/Cellar/cmake/3.17.2/bin/cmake -E cmake_link_script CMakeFiles/coordgen.dir/link.txt --verbose=1
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -std=c++11 -stdlib=libc++ -Wno-parentheses -Wno-logical-op-parentheses -Wno-format -mpopcnt -Wall -Wextra -Wno-deprecated -Wno-unused-function -fno-strict-aliasing -Wno-format -Wno-logical-op-parentheses -fPIC -stdlib=libc++ -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -dynamiclib -Wl,-headerpad_max_install_names -compatibility_version 1.0.0 -current_version 2020.9.1 -o ../../lib/libRDKitcoordgen.2020.09.1dev1.dylib -install_name @rpath/libRDKitcoordgen.1.dylib CMakeFiles/coordgen.dir/coordgen/CoordgenFragmentBuilder.cpp.o CMakeFiles/coordgen.dir/coordgen/CoordgenFragmenter.cpp.o CMakeFiles/coordgen.dir/coordgen/CoordgenMacrocycleBuilder.cpp.o CMakeFiles/coordgen.dir/coordgen/CoordgenMinimizer.cpp.o CMakeFiles/coordgen.dir/coordgen/CoordgenTemplates.cpp.o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizer.cpp.o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerAtom.cpp.o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerBond.cpp.o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerFragment.cpp.o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerMarchingSquares.cpp.o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerMolecule.cpp.o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerResidue.cpp.o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerResidueInteraction.cpp.o CMakeFiles/coordgen.dir/coordgen/sketcherMinimizerRing.cpp.o  -Wl,-rpath,/tmp/rdkit-20200505-74362-mnomh6/lib ../../lib/libRDKitmaeparser.2020.09.1dev1.dylib /usr/local/lib/libboost_system-mt.dylib /usr/local/lib/libboost_iostreams-mt.dylib /usr/local/lib/libboost_regex-mt.dylib 
cd /tmp/rdkit-20200505-74362-mnomh6/External/CoordGen && /usr/local/Cellar/cmake/3.17.2/bin/cmake -E cmake_symlink_library ../../lib/libRDKitcoordgen.2020.09.1dev1.dylib ../../lib/libRDKitcoordgen.1.dylib ../../lib/libRDKitcoordgen.dylib
[ 16%] Built target coordgen
[ 16%] Linking CXX shared module ../../../rdkit/rdBase.so
cd /tmp/rdkit-20200505-74362-mnomh6/Code/RDBoost/Wrap && /usr/local/Cellar/cmake/3.17.2/bin/cmake -E cmake_link_script CMakeFiles/rdBase.dir/link.txt --verbose=1
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -std=c++11 -stdlib=libc++ -Wno-parentheses -Wno-logical-op-parentheses -Wno-format -mpopcnt -Wall -Wextra -Wno-deprecated -Wno-unused-function -fno-strict-aliasing -Wno-format -Wno-logical-op-parentheses -fPIC -stdlib=libc++ -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -bundle -Wl,-headerpad_max_install_names -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -o ../../../rdkit/rdBase.so CMakeFiles/rdBase.dir/RDBase.cpp.o  -Wl,-rpath,/tmp/rdkit-20200505-74362-mnomh6/lib ../../../lib/libRDKitRDBoost.2020.09.1dev1.dylib ../../../lib/libRDKitRDGeneral.2020.09.1dev1.dylib /usr/local/lib/libboost_python38-mt.dylib 
[ 16%] Built target rdBase
make: *** [all] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/rdkit/homebrew-rdkit/issues

Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC.
UnixJunkie commented 4 years ago

Did you try this:

pip3 install numpy
brew install rdkit --with-python3
rapodaca commented 4 years ago

Thanks for the suggestion. I took it, and got the following (puzzling) result. Boost is installed (1.72.0) "but" the minimum required is 1.56.0.

$ pip3 install numpy
Requirement already satisfied: numpy in /usr/local/lib/python3.7/site-packages (1.18.1)
$ brew install rdkit --with-python3
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
...

==> Installing rdkit from rdkit/rdkit
==> Downloading https://github.com/rdkit/rdkit/archive/Release_2019_09_1.tar.gz
Already downloaded: .../Library/Caches/Homebrew/downloads/dbc78c6529381ce39a1c4765d1b16ec83572d3c1ad3cfde3d65efc15a6bfc66f--rdkit-Release_2019_09_1.tar.gz
==> cmake -DRDK_INSTALL_INTREE=OFF -DRDK_BUILD_CPP_TESTS=OFF -DRDK_INSTALL_STATI
Last 15 lines from .../Library/Logs/Homebrew/rdkit/01.cmake:
Call Stack (most recent call first):
  CMakeLists.txt:254 (find_package)

CMake Error at /usr/local/Cellar/cmake/3.17.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find Boost (missing: python) (found suitable version "1.72.0",
  minimum required is "1.56.0")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.17.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.17.2/share/cmake/Modules/FindBoost.cmake:2162 (find_package_handle_standard_args)
  CMakeLists.txt:262 (find_package)

-- Configuring incomplete, errors occurred!
See also "/tmp/rdkit-20200507-3232-19v8q26/rdkit-Release_2019_09_1/CMakeFiles/CMakeOutput.log".

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/rdkit/homebrew-rdkit/issues
UnixJunkie commented 4 years ago

Maybe try this:

pip3 install boost-python3
# or pip3 install boost-python
# I son't have a Mac to test right now
brew install rdkit --with-python3
rapodaca commented 4 years ago

I get the following:

$ pip3 install boost-python
ERROR: Could not find a version that satisfies the requirement boost-python (from versions: none)
ERROR: No matching distribution found for boost-python

and

$ pip3 install boost-python3
ERROR: Could not find a version that satisfies the requirement boost-python3 (from versions: none)
ERROR: No matching distribution found for boost-python3

Trying brew:

$ brew install boost-python3
Warning: boost-python3 1.72.0_1 is already installed and up-to-date
To reinstall 1.72.0_1, run `brew reinstall boost-python3`

Finally, the same error as originally reported with brew install rdkit --with-python3.

UnixJunkie commented 4 years ago

Just an idea: uninstall all boost things (we want them to be reinstalled). And you are right, boost-python3 should be installed by brew. Then, retry the

brew install rdkit --with-python3

brew should install boost and all the required dependencies.

I know installing rdkit with brew is painful. Everybody is just dreaming that pip install rdkit would just work one day... Because, the reproducibility of brew builds is just bad.

rapodaca commented 4 years ago

Followed the advice, but got nowhere. I'm seeing what I saw before.

brew uninstall boost-python3
Uninstalling /usr/local/Cellar/boost-python3/1.72.0_1... (472 files, 20MB)

brew install rdkit --with-python3
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
...
==> Updated Formulae
...
==> Deleted Formulae
...

==> Installing rdkit from rdkit/rdkit
==> Installing dependencies for rdkit/rdkit/rdkit: boost-python3
==> Installing rdkit/rdkit/rdkit dependency: boost-python3
==> Downloading https://homebrew.bintray.com/bottles/boost-python3-1.72.0_1.moja
Already downloaded: .../Library/Caches/Homebrew/downloads/7e3f7b6eaef5f2d309fd4429a50298277d3ce6b587a0ca3c0a0ac213220ab67d--boost-python3-1.72.0_1.mojave.bottle.tar.gz
==> Pouring boost-python3-1.72.0_1.mojave.bottle.tar.gz
Warning: boost-python3 dependency gcc was built with a different C++ standard
library (libstdc++ from clang). This may cause problems at runtime.
🍺  /usr/local/Cellar/boost-python3/1.72.0_1: 472 files, 20MB
==> Installing rdkit/rdkit/rdkit --with-python3
==> Downloading https://github.com/rdkit/rdkit/archive/Release_2019_09_1.tar.gz
Already downloaded: /Users/rich/Library/Caches/Homebrew/downloads/dbc78c6529381ce39a1c4765d1b16ec83572d3c1ad3cfde3d65efc15a6bfc66f--rdkit-Release_2019_09_1.tar.gz
==> cmake -DRDK_INSTALL_INTREE=OFF -DRDK_BUILD_CPP_TESTS=OFF -DRDK_INSTALL_STATI
Last 15 lines from .../Library/Logs/Homebrew/rdkit/01.cmake:
Call Stack (most recent call first):
  CMakeLists.txt:254 (find_package)

CMake Error at /usr/local/Cellar/cmake/3.17.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find Boost (missing: python) (found suitable version "1.72.0",
  minimum required is "1.56.0")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.17.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.17.2/share/cmake/Modules/FindBoost.cmake:2162 (find_package_handle_standard_args)
  CMakeLists.txt:262 (find_package)

-- Configuring incomplete, errors occurred!
See also "/tmp/rdkit-20200511-32081-1xpw9g7/rdkit-Release_2019_09_1/CMakeFiles/CMakeOutput.log".

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/rdkit/homebrew-rdkit/issues

Ideas?

UnixJunkie commented 4 years ago

Try the anaconda installer. I don't like it and I don't use it but it is the officially supported way to install rdkit...

Maybe, boost was updated in brew recently, and this new boost version breaks the rdkit build on Mac.

UnixJunkie commented 4 years ago

Maybe open an issue in rdkit's tracker, stating your boost version and the error you get. Maybe some boost expert will tell you what modification is needed when calling cmake so that compilation works with this particular boost version.

UnixJunkie commented 4 years ago

Yes, I think rdkit's build is broken because of a boost update in brew. This has happened multiple times in the past. To the point where I was shipping a fixed version of boost in the brew formula. But then, some people complained about the rdkit build time that sky rocketed.

cthoyt commented 4 years ago

@UnixJunkie is it possible to pin the version of boost and boost-python3 in the RDKit formula? I feel like this is a problem that never goes away :/

UnixJunkie commented 4 years ago

Yes, it was done in the past. But some users started to complain that the rdkit brew formula was taking ages to install. The short term solution would be to fix rdkit build with whatever boost version is in brew nowadays. I'll gladly accept any PR.

UnixJunkie commented 3 years ago

You might try this:

# backup your brew installed packages list
brew list --formula > my_brew_packages.txt
# uninstall all of them
brew uninstall --force $(cat my_brew_packages.txt)
# install rdkit from scratch
brew install rdkit --with-python3