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

CMake Error:Could not find a package configuration file provided by "boost_python" #3913

Open
ys0123 opened this issue Mar 11, 2021 · 12 comments

Comments

@ys0123
Copy link

ys0123 commented Mar 11, 2021

Configuration:

RDKit version: 2020.09.4
Host OS: CentOS 7.4
Docker Container:ubuntu 20.04
Python version : 3.8.5
Are you using conda? No
If you are not using conda: how did you install the RDKit? Build form source

Description:

  1. I installed boost-1.72.0 from source and it looks like it's working properly.
git clone https://github.com/boostorg/boost.git
cd boost
git checkout boost-1.72.0
git submodule update --init --recursive
./bootstrap.sh
./b2 --prefix=/usr/local -j18
./b2 install --prefix=/usr/local -j18

sample program(main.cpp and CMakeLists.txt).
cmake .
:
-- Configuring done
-- Generating done
-- Build files have been written to: /root/boost_test

make
:
[ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[100%] Linking CXX executable main
[100%] Built target main

  1. next I installed rdkit 2020_09_4 on ubuntu 20.04 in docker container. but I got an error.
export INCLUDE="/usr/local/include/boost:$INCLUDE"
export LIBRARY_PATH="/usr/local/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"


RDBASE=/root/rdkit
RDKIT_BRANCH=Release_2020_09_4
git clone https://github.com/rdkit/rdkit.git

cd $RDBASE
git checkout $RDKIT_BRANCH
git submodule update --init --recursive

PYTHONPATH=$RDBASE
LD_LIBRARY_PATH=$RDBASE/lib:$LD_LIBRARY_PATH

mkdir build
cd build
cmake -D RDK_BUILD_INCHI_SUPPORT=ON -D PYTHON_EXECUTABLE=/usr/bin/python3 ..

CMake Error at /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake:120 (find_package):
Could not find a package configuration file provided by "boost_python"
(requested version 1.72.0) with any of the following names:
boost_pythonConfig.cmake
boost_python-config.cmake
Add the installation prefix of "boost_python" to CMAKE_PREFIX_PATH or set
"boost_python_DIR" to a directory containing one of the above files. If
"boost_python" provides a separate development package or SDK, be sure it
has been installed.

Expected behavior
CMake would complete successfully.

I'm not sure what is wrong. Any suggestions will be helpful!

@greglandrum
Copy link
Member

Try adding -DBoost_NO_BOOST_CMAKE=TRUE to your cmake command.

@ys0123
Copy link
Author

ys0123 commented Mar 11, 2021

I don't understand the difference between -D Boost_NO_BOOST_CMAKE = TRUE and FALSE.
How does it affect the rdkit or python?
I want to run it in FALSE if possible.

@ys0123
Copy link
Author

ys0123 commented Mar 11, 2021

I tried adding -DBoost_NO_BOOST_CMAKE=TRUE. but another error happed.

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Boost (missing: python) (found suitable version "1.72.0",
minimum required is "1.58.0")
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindBoost.cmake:2179 (find_package_handle_standard_args)
CMakeLists.txt:287 (find_package)

What should I do?

@greglandrum
Copy link
Member

That's not necessarily actually an error. If you think it is, please provide the entire output from running cmake

@ys0123
Copy link
Author

ys0123 commented Mar 11, 2021

this is a logs.

cmake -D Boost_NO_BOOST_CMAKE=TRUE -D RDK_BUILD_INCHI_SUPPORT=ON -D PYTHON_EXECUTABLE=/usr/bin/python3 ..

-- Found Catch2 source in /root/rdkit/External/catch/catch
CATCH: /root/rdkit/External/catch/catch/single_include/catch2
-- Could NOT find InChI in system locations (missing: INCHI_LIBRARY INCHI_INCLUDE_DIR)
CUSTOM_INCHI_PATH = /root/rdkit/External/INCHI-API
-- Found InChI software locally
CMake Warning at /usr/share/cmake-3.16/Modules/FindBoost.cmake:2020 (message):
No header defined for python-py38; skipping header check (note: header-only
libraries have no designated component)
Call Stack (most recent call first):
CMakeLists.txt:279 (find_package)

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Boost (missing: python) (found suitable version "1.72.0",
minimum required is "1.58.0")
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindBoost.cmake:2179 (find_package_handle_standard_args)
CMakeLists.txt:287 (find_package)

-- Configuring incomplete, errors occurred!
See also "/root/rdkit/build/CMakeFiles/CMakeOutput.log".

@ys0123
Copy link
Author

ys0123 commented Mar 11, 2021

when -D Boost_DEBUG=ON this is a result.
-DBoost_DEBUG=ON.zip

@greglandrum
Copy link
Member

That error message is indicating that it couldn't find boost::python
If you're planning on building the RDKit with Python support, then you also need to be sure to build boost::python when you build the rest of boost.

@ys0123
Copy link
Author

ys0123 commented Mar 15, 2021

Thanks!
Could you tell me how to build boost::python?
Isn't it enough below?

git clone https://github.com/boostorg/boost.git
cd boost
git checkout boost-1.72.0
git submodule update --init --recursive
./bootstrap.sh
./b2 --prefix=/usr/local -j18
./b2 install --prefix=/usr/local -j18

@greglandrum
Copy link
Member

here's general boost building instructions: https://www.boost.org/doc/libs/1_70_0/more/getting_started/unix-variants.html
and here are build instructions for boost::python: https://www.boost.org/doc/libs/1_70_0/libs/python/doc/html/building.html

Note that this is no longer an RDKit question and that we cannot help with building boost. If you need help building boost, it's probably a better idea to use a pre-built version. There's likely one available directly from your linux distribution that you can use.

@ys0123
Copy link
Author

ys0123 commented Mar 16, 2021

Thank you so much! I will try it later.

it's probably a better idea to use a pre-built version.

I tried to install pre-built version of boost 1.71(apt install libboost-all-dev ) and build RDKIT 2020_09_05 from source.
but I got a lots of error from RDKIT like this.

  Target "MolEnumerator_static" links to target "Boost::system" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  Code/GraphMol/MolEnumerator/CMakeLists.txt:1 (rdkit_library)

CMake Error at Code/cmake/Modules/RDKitUtils.cmake:55 (add_library):
  Target "MolEnumerator_static" links to target "Boost::iostreams" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  Code/GraphMol/MolEnumerator/CMakeLists.txt:1 (rdkit_library)

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

So I tried to install boost from source.
Could you tell me boost version to build rdkit?

(And I don't want to use anaconda to install rdkit. because it's not free recently.)

@Amar1729
Copy link

Amar1729 commented Jul 28, 2021

This is very old, but for anybody finding this you may need:

./bootstrap.sh --with-python=$(which python) --with-python-version=3.6 --with-python-root=~/.pyenv/versions/3.6-dev/

./b2 --with-python install

Those paths are what I used (compiling with pyenv's Python) but you may need to change the locations to reflect your Python installation (likely will need to use the paths of the apt-installed Python).

Before compiling rdkit, you can check whether boost properly built its python extensions by looking for any libboost_python*so* files under the PREFIX you installed boost.

I know OP isn't using pyenv but these links for useful for me:

@rishavpandey160999
Copy link

rishavpandey160999 commented Sep 17, 2022

In this way? - - >
cmake -DBoost_NO_BOOST_CMAKE=TRUE

And do I have to run this in "Fairsoft" directory?

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