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

Could NOT find Boost (missing: python37) [cmake 3.15, boost 1.67.0] #20

Closed
alanbchristie opened this issue Dec 3, 2019 · 7 comments
Closed

Comments

@alanbchristie
Copy link

I'm building everything from source on CentOS 7 and encounter the following error when I run cmake for libmolgrid: -

-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda-10.2 (found version "10.2") 
-- Found Boost: /opt/boost/include (found version "1.67.0") found components:  regex unit_test_framework program_options system filesystem iostreams 
-- Found PythonLibs: /usr/local/lib/libpython3.7m.so (found version "3.7.5") 
-- Found PythonInterp: /usr/bin/python3 (found version "3.7.5") 
CMake Error at /usr/local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Boost (missing: python37) (found version "1.67.0")
Call Stack (most recent call first):
  /usr/local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-3.15/Modules/FindBoost.cmake:2161 (find_package_handle_standard_args)
  python/CMakeLists.txt:12 (find_package)

I believe I have installed boost with python but I'm perplexed by the error. I've not written C/C++ for a long time and although I don't fully understand the cmake syntax I think I understand the basic. It's the error that is not that clear to me. Does it mean cmake has found boost and python but does not think boost is built with python (which I believe it is)?

My environment is: -

  • centos 7
  • cmake 3.15.5
  • gcc 8.3.1
  • python 3.7.5 (installed from source)
  • boost 1.67.0 (from source)
  • openbabel 3.0.0 (from source)

If I nobble (comment-out) the offending line from python//CMakeLists.txt, i.e. if I remove:-

find_package( Boost COMPONENTS system filesystem python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} REQUIRED )
``

...then `cmake` completes and I am able to successfully build `libmolgrid` (although this is clearly wrong).

1. What have I not done to cause this error? Or...
1. What `-D` options can I use to safely progress through `cmake`?
@dkoes
Copy link
Contributor

dkoes commented Dec 3, 2019

Do you have boost-python installed? There is some disagreement between distributions of what the suffix of this library should be, which might be the problem (e.g. on Ubuntu I have libboost_python-py36).

@alanbchristie
Copy link
Author

alanbchristie commented Dec 3, 2019

Mmm - not sure (you can tell this whole area is new to me) and the whole area for Python 3 is rather confusing and poorly documented. I'm not using conda and installing the system package is pointless (I guess) - because I'm not using the system python.

One day unix might actually move away form Python 2 (especially with it being mothballed in about 4 weeks!). One can dream.

I've installed boost and it claims to have built everything. I'm new to this area of code, is boost-python part of a different repo?

@dkoes
Copy link
Contributor

dkoes commented Dec 3, 2019

Look in /usr/lib (or possibly /usr/lib/x86_64-linux-gnu, whereever boost is installed) and look for libboost_python*

There are several variants of boost packages. You need the equivalent of the libboost-all-dev package, which has the libboost-python-dev package as a dependency.

@alanbchristie
Copy link
Author

Ah, in my /opt/boost/lib/ is see libboost-python27.* ... even though I followed instructions and used --with-python and --with-python-version and --with-python-root for Python 3.7.

@alanbchristie
Copy link
Author

alanbchristie commented Dec 3, 2019

This is starting to look like a boost problem then. My boost installation command is...

./bootstrap.sh \
        --prefix=/opt/boost \
        --with-python=/usr/bin/python3 \
        --with-python-version=3.7 \
        --with-python-root=/usr/local/lib/python3.7
./b2 -j4 install

And what gets built (amongst other things) are some libraries prefixed with libboost_python27.*.

@dkoes
Copy link
Contributor

dkoes commented Dec 3, 2019

I've never had trouble building boost. I would try a clean checkout of boost or asking for help on their mailing list.

@alanbchristie
Copy link
Author

Solved It's not about the python installation, although I have links to built binary in the form of:-

ln -s /usr/local/bin/python3.7 /usr/bin/python3
ln -s /usr/local/bin/pip3.7 /usr/bin/pip3

Without a ~/user-config.jam boost appears to build for the system python, regardless of the supplied bootstrap args. A home-directory user-config jam file that just contains the following instructs boost to build the libboost_python37 files:-

using python : 3.7 ;

Thanks for the hints - hopefully back on course now.

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

2 participants