bigARTM installation: Cmake Could NOT find Boost - python

I have an issue with bigARTM topic modelling library installing for python 3.7 on MacOs:
Firstly, I install Boost with pip install boost and Cmake with same line
and then, as follows in documentation for bigARTM(https://bigartm.readthedocs.io/en/stable/installation/linux.html#step-2-python-packages), do:
git clone --branch=stable https://github.com/bigartm/bigartm.git
cd bigartm
mkdir build && cd build
and ran Cmake ..
But get an error:
-- Build type: Release
CMake Error at /Users/username/opt/anaconda3/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Boost (missing: Boost_INCLUDE_DIR)
Call Stack (most recent call first):
/Users/username/opt/anaconda3/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/Users/username/opt/anaconda3/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.16/Modules/FindBoost.cmake:2179 (find_package_handle_standard_args)
CMakeLists.txt:134 (find_package)
I understand that Boost lib is the problem, but I had installed earlier.
What has go wrong? How to fix it? What should I do to have bigARTM installed?
Thanks in advance!

Related

CMake Error: could NOT find Python (missing: Python_NumPy_INCLUDE_DIRS NumPy) (found version "2.7.17")

I encounter with this error during my build
CMake Error at /opt/cmake-3.21.1-linux-x86_64/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Python (missing: Python_NumPy_INCLUDE_DIRS NumPy) (found
version "2.7.17")
Call Stack (most recent call first):
/opt/cmake-3.21.1-linux-x86_64/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/opt/cmake-3.21.1-linux-x86_64/share/cmake-3.21/Modules/FindPython.cmake:556 (find_package_handle_standard_args)
faiss/python/CMakeLists.txt:116 (find_package)
I've already installed sudo apt-get install python-dev and also tried adding
-DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
Still get the same error. My python is in /home/dfw/anaconda3/bin/python and its version is 3.7.11. My cmake version is 3.21.1. How can I fix this?
Cmake finds a python installed by apt in the /usr folder. There are two ways to tell Cmake the special location of python :
Set the Python3_ROOT_DIR variable
Set the CMAKE_PREFIX_PATH variable.
Defining the PYTHON_INCLUDE_DIR and PYTHON_LIBRARY variables on the command line does not work because these variables are overridden when you call find_package(python3).
Also when installing python-dev into the system you can explicitly specify that version 3 is required.
sudo apt-get install python3-dev

attempting to upgrade pyarrow results in errors

I ran this command to upgrade pyarrow from 2.0.0 to 3.0.0:
pip3 install --user --upgrade pyarrow
I got these errors:
Failed building wheel for pyarrow
...
-- Could NOT find Arrow (missing: Arrow_DIR)
-- Checking for module 'arrow'
-- No package 'arrow' found
CMake Error at /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Arrow (missing: ARROW_INCLUDE_DIR ARROW_LIB_DIR
ARROW_FULL_SO_VERSION ARROW_SO_VERSION)
Call Stack (most recent call first):
/usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake_modules/FindArrow.cmake:419 (find_package_handle_standard_args)
cmake_modules/FindArrowPython.cmake:46 (find_package)
CMakeLists.txt:214 (find_package)
How can I resolve this?
Pyarrow version 3.0 stopped shipping manylinux1 source in favor of only shipping manylinux2010 and manylinux2014 wheels.
This means that starting with pyarrow 3.0 you will need pip >= 19.0 if you would like to avoid building from source.
Please also note that the default version of pip on Ubuntu 18 is pip version 9 and so you will need to upgrade pip (I've found most users with this issues seem to be coming from Ubuntu 18).

Unable to find the requested Boost libraries

Platform:macOS High Sierra
Hello,
I tried to use the method Building from source to install RDkit, there is something wrong when I entered cmake ..,the terminal shows that
CMake Warning at
/usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/FindBoost.cmake:1723 (message):
No header defined for python-py36; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:202 (find_package)
CMake Error at /usr/local/Cellar/cmake/3.12.0/share/cmake/Modules/FindBoost.cmake:2044 (message):
Unable to find the requested Boost libraries.
Boost version: 1.67.0
Boost include path: /usr/local/include
Could not find the following Boost libraries:
boost_python
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
But I have added /usr/local/Cellar/boost/lib and /usr/local/Cellar/boost-python/lib to the ~/.bash_profile.
My ~/.bash_profile is written like this:
export RDBASE=/Users/wangzhicheng/Software/RDkit/rdkit-Release_2018_03_3
export PYTHONPATH=$RDBASE
export DYLD_LIBRARY_PATH=$RDBASE/lib:/usr/local/Cellar/boost/1.67.0_1/lib:/usr/local/Cellar/boost-python/1.67.0/lib:/usr/local/lib:/usr/local/Cellar/boost-python3/1.67.0_1/lib
export PATH="/Users/wangzhicheng/anaconda3/bin:$PATH"
By the way, I had already installed boost, boost-python3 by homebrew.
So where is the problem?
I think I've found the solution to this problem.
The reason for the problem cmake want to find libboost_python3.dylib in your library folder but in fact this file is called libboost_python3x.dylib(x is depended on your python version), so you just need to type following command in your terminal:
cd /usr/local/lib
sudo ln -s libboost_python3x.dylib libboost_python3.dylib
and you can solve this error!

Install fb-python on Linux machine

I am trying to install fb-python library -a bridge between Lua and Python:
https://github.com/facebookarchive/fblualib/tree/master/fblualib/python
on my Linux machine using the command
cd fblualib/fblualib/python
luarocks make rockspec/fbpython-0.1-1.rockspec
however all my attempts are encountering the error below:
cmake -E make_directory build &&
cd build &&
cmake -DROCKS_PREFIX=/home/current_user/torch/install/lib/luarocks/rocks/fbpython/0.1-1 \
-DROCKS_LUADIR=/home/current_user/torch/install/lib/luarocks/rocks/fbpython/0.1-1/lua \
-DROCKS_LIBDIR=/home/current_user/torch/install/lib/luarocks/rocks/fbpython/0.1-1/lib \
.. &&
make
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
REQUIRED_ARGS (missing: GLOG_INCLUDE_DIR GLOG_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315
(_FPHSA_FAILURE_MESSAGE)
cmake/FindGlog.cmake:21 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:27 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
The file throwing the error is this: https://github.com/facebookarchive/fblualib/blob/master/fblualib/cmake/FindGlog.cmake
However, I have installed the Glog library https://github.com/google/glog/releases: given that I don't have sudo access to the machine, I set ./configure to a custom location that I probably need to specify now for the GLOG_INCLUDE_DIR and GLOG_LIBRARY flags. How to do this? Any suggestion is appreciated. Thank you!

Issue with Boost and CMake on Mac Sierra when install dlib

So I've installed Boost via brew, similarly installed with cmake and python:
brew install boost --with-python3
brew install boost-python
brew install cmake
I'm currently using miniconda3 (python3.6) and am trying to install Dlib. So far I can install dlib fine, but when it comes to python setup, it fails. Dlib can be obtained by cloning the repo dlib_repo
Here I do python setup.py install, Getting the following errors
-- Detecting CXX compile features - done
CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1518 (message):
No header defined for python-py34; skipping header check
Call Stack (most recent call first):
/Users/userx/dlib/dlib/cmake_utils/add_python_module:61 (FIND_PACKAGE)
CMakeLists.txt:6 (include)
-- Could NOT find Boost
CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1518 (message):
No header defined for python-py35; skipping header check
Call Stack (most recent call first):
/Users/userx/dlib/dlib/cmake_utils/add_python_module:63 (FIND_PACKAGE)
CMakeLists.txt:6 (include)
-- Could NOT find Boost
CMake Warning at /usr/local/Cellar/cmake/3.7.2/share/cmake/Modules/FindBoost.cmake:1518 (message):
No header defined for python3; skipping header check
Call Stack (most recent call first):
/Users/userx/dlib/dlib/cmake_utils/add_python_module:66 (FIND_PACKAGE)
CMakeLists.txt:6 (include)
-- Boost version: 1.61.0
-- Found the following Boost libraries:
-- python3
-- Found PythonLibs: /Users/userx/miniconda3/lib/libpython3.5.dylib (found suitable version "3.5.2", minimum required is "3.4")
-- USING BOOST_LIBS: /Users/userx/miniconda3/lib/libboost_python3.dylib
-- USING PYTHON_LIBS: /Users/userx/miniconda3/lib/libpython3.5.dylib
...
...
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.cpp.o] Error 1
make[1]: *** [dlib_build/CMakeFiles/dlib.dir/all] Error 2
make: *** [all] Error 2
error: cmake build failed!
So here, I felt cmake couldn't find the boost variables, so I added these to my .bashrc and restarted my shell.
export BOOST_ROOT="/usr/local/Cellar/boost/1.63.0"
export BOOST_INCLUDE="/usr/local/Cellar/boost/1.63.0/include"
export BOOST_LIBDIR="/usr/local/Cellar/boost/1.63.0/lib"
Note these paths were found them via brew info and checked them to ensure correctness.
I'm using a macbook with Sierra OS - as I know Sierra has changed the way a lot of builds happen.
I have also tried to remove boost and download from the site and build directly, but same problem persists.
Any help much appreciated
It might be caused by the CMAKE_PREFIX_PATH setting.
I met the same problem and I solved it by this sequence:
First I install the boost using this:
brew install boost-python --with-python3
then I found the BOOST Not Found error when running the following commands to install the dlib 19.7.0:
pip install dlib --upgrade
So I edit the Bash Profile with following commands:
nano ~/.bash*le
and add the following line into this file:
export CMAKE_PREFIX_PATH="/usr/local:/usr/local/Cellar/boost/1.65.1:$PATH"
Notice
I am using the boost 1.65.1, which is installed at /usr/local/Cellar/boost/1.65.1, you might change it to the location that you install boost with brew.
after this step, I run pip install dlib --upgrade again on both python2.7.14 and 3.6.1 and 3.6.3, everything goes on the right way now.
I did the same in my system, except for one difference:
python3 setup.py install
Instead of
python setup.py install
And I don't see that error.

Categories