derohde/Fred

install error with `boost_python` in Ubuntu 18.04

woodwm opened this issue · 1 comments

Hi, I am unable to install the package because of boost_python in ubuntu 18.04. I think it maybe because of I installed miniconda3. I tried changing the python path in install boost 1.74.0 and also "-DPYTHON_EXECUTABLE" in setup.py, but it still does not work. The full error message can be found in the following.

cd py && /usr/bin/python3 ./setup.py install --user
running install
running bdist_egg
running egg_info
writing Fred.egg-info/PKG-INFO
writing dependency_links to Fred.egg-info/dependency_links.txt
writing requirements to Fred.egg-info/requires.txt
writing top-level names to Fred.egg-info/top_level.txt
reading manifest file 'Fred.egg-info/SOURCES.txt'
writing manifest file 'Fred.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
CMake Error at /home/ubuntu/miniconda3/envs/tra/lib/cmake/Boost-1.74.0/BoostConfig.cmake:141 (find_package):
  Could not find a package configuration file provided by "boost_python"
  (requested version 1.74.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.
Call Stack (most recent call first):
  /home/ubuntu/miniconda3/envs/tra/lib/cmake/Boost-1.74.0/BoostConfig.cmake:258 (boost_find_component)
  /home/ubuntu/cmake-3.17.5-Linux-x86_64/share/cmake-3.17/Modules/FindBoost.cmake:444 (find_package)
  CMakeLists.txt:21 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/Program/Fred/py/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
  File "./setup.py", line 77, in <module>
    setup(
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 172, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 158, in call_command
    self.run_command(cmdname)
  File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 24, in run
    self.build()
  File "/usr/lib/python3.8/distutils/command/install_lib.py", line 109, in build
    self.run_command('build_ext')
  File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "./setup.py", line 36, in run
    self.build_extension(ext)
  File "./setup.py", line 72, in build_extension
    subprocess.check_call(['cmake', "{}/..".format(ext.sourcedir)] + cmake_args,
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/ubuntu/Program/Fred/py/..', '-DBPY=python38', '-DBNPY=numpy38', '-DBOOST_ROOT=~/boost', '-DBOOST_LIBRARYDIR=~/boost/lib', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/ubuntu/Program/Fred/py/build/lib.linux-x86_64-3.8/Fred', '-DPYTHON_EXECUTABLE=/home/ubuntu/miniconda3/envs/tra/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
Makefile:9: recipe for target 'install' failed
make: *** [install] Error 1

I think I worked it out. boost 1.74 is not fully compatible with cmake 3.17.5, so I switched to boost 1.73 as the readme implies. The main problem is that I need to complie boost using the miniconda python rather than using the system python.