stack-of-tasks / eigenpy

Efficient bindings between Numpy and Eigen using Boost.Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation error when building from source

arjung128 opened this issue · comments

Hi, I have been getting a compilation error when trying to build eigenpy from source. Here are the commands I'm using:

git clone --single-branch -b v2.7.10 git@github.com:stack-of-tasks/eigenpy.git
cd eigenpy && git submodule update --init && mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR/libs-install

And here's the stack trace I'm getting:

[ 68%] Building CXX object unittest/CMakeFiles/geometry.dir/geometry.cpp.o
cd /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build/unittest && /usr/bin/c++  -Dgeometry_EXPORTS -I/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build -isystem /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build/include -I/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include -isystem /usr/include/eigen3  -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion  -O3 -DNDEBUG -fPIC   -o CMakeFiles/geometry.dir/geometry.cpp.o -c /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/unittest/geometry.cpp
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
                 from /usr/include/boost/python/scope.hpp:8,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/python/main.cpp:6:
/usr/include/boost/python/detail/wrap_python.hpp:50:11: fatal error: pyconfig.h: No such file or directory
 # include <pyconfig.h>
           ^~~~~~~~~~~~
compilation terminated.
python/CMakeFiles/eigenpy_pywrap.dir/build.make:65: recipe for target 'python/CMakeFiles/eigenpy_pywrap.dir/main.cpp.o' failed
make[2]: *** [python/CMakeFiles/eigenpy_pywrap.dir/main.cpp.o] Error 1
make[2]: Leaving directory '/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build'
CMakeFiles/Makefile2:1547: recipe for target 'python/CMakeFiles/eigenpy_pywrap.dir/all' failed
make[1]: *** [python/CMakeFiles/eigenpy_pywrap.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
                 from /usr/include/boost/python/args.hpp:8,
                 from /usr/include/boost/python.hpp:11,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/fwd.hpp:14,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigen-typedef.hpp:8,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigenpy.hpp:10,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/unittest/user_type.cpp:8:
/usr/include/boost/python/detail/wrap_python.hpp:50:11: fatal error: pyconfig.h: No such file or directory
 # include <pyconfig.h>
           ^~~~~~~~~~~~
compilation terminated.
unittest/CMakeFiles/user_type.dir/build.make:65: recipe for target 'unittest/CMakeFiles/user_type.dir/user_type.cpp.o' failed
make[2]: *** [unittest/CMakeFiles/user_type.dir/user_type.cpp.o] Error 1
make[2]: Leaving directory '/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build'
CMakeFiles/Makefile2:1646: recipe for target 'unittest/CMakeFiles/user_type.dir/all' failed
make[1]: *** [unittest/CMakeFiles/user_type.dir/all] Error 2
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
                 from /usr/include/boost/python/args.hpp:8,
                 from /usr/include/boost/python.hpp:11,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/fwd.hpp:14,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigen-typedef.hpp:8,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigenpy.hpp:10,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/unittest/matrix.cpp:7:
/usr/include/boost/python/detail/wrap_python.hpp:50:11: fatal error: pyconfig.h: No such file or directory
 # include <pyconfig.h>
           ^~~~~~~~~~~~
compilation terminated.
unittest/CMakeFiles/matrix.dir/build.make:65: recipe for target 'unittest/CMakeFiles/matrix.dir/matrix.cpp.o' failed
make[2]: *** [unittest/CMakeFiles/matrix.dir/matrix.cpp.o] Error 1
make[2]: Leaving directory '/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build'
CMakeFiles/Makefile2:1720: recipe for target 'unittest/CMakeFiles/matrix.dir/all' failed
make[1]: *** [unittest/CMakeFiles/matrix.dir/all] Error 2
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
                 from /usr/include/boost/python/args.hpp:8,
                 from /usr/include/boost/python.hpp:11,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/fwd.hpp:14,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigen-typedef.hpp:8,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigenpy.hpp:10,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/unittest/geometry.cpp:11:
/usr/include/boost/python/detail/wrap_python.hpp:50:11: fatal error: pyconfig.h: No such file or directory
 # include <pyconfig.h>
           ^~~~~~~~~~~~
compilation terminated.
unittest/CMakeFiles/geometry.dir/build.make:65: recipe for target 'unittest/CMakeFiles/geometry.dir/geometry.cpp.o' failed
make[2]: *** [unittest/CMakeFiles/geometry.dir/geometry.cpp.o] Error 1
make[2]: Leaving directory '/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build'
CMakeFiles/Makefile2:1683: recipe for target 'unittest/CMakeFiles/geometry.dir/all' failed
make[1]: *** [unittest/CMakeFiles/geometry.dir/all] Error 2
make[1]: Leaving directory '/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build'
Makefile:143: recipe for target 'all' failed
make: *** [all] Error 2

Any ideas why this might be happening, and what can be done to resolve it? Thanks in advance!

git clone --single-branch -b v2.7.10 git@github.com:stack-of-tasks/eigenpy.git
cd eigenpy && git submodule update --init && mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR/libs-install

Could you show the output of cmake?

Cloning into 'eigenpy'...
remote: Enumerating objects: 4574, done.
remote: Counting objects: 100% (1269/1269), done.
remote: Compressing objects: 100% (527/527), done.
remote: Total 4574 (delta 683), reused 1202 (delta 647), pack-reused 3305
Receiving objects: 100% (4574/4574), 1.30 MiB | 13.73 MiB/s, done.
Resolving deltas: 100% (2633/2633), done.
Note: checking out '93841abf0a67812e38d64baa398639c5d34d9219'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

Submodule 'cmake' (https://github.com/jrl-umi3218/jrl-cmakemodules.git) registered for path 'cmake'
Cloning into '/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/cmake'...
Submodule path 'cmake': checked out 'e319590e7c73bbe22b86108031722a134d13349b'
-- Package version (ROS package.xml): 2.7.9
-- The CXX compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Performing Test R-pedantic
-- Performing Test R-pedantic - Success
-- Performing Test R-Wno-long-long
-- Performing Test R-Wno-long-long - Success
-- Performing Test R-Wall
-- Performing Test R-Wall - Success
-- Performing Test R-Wextra
-- Performing Test R-Wextra - Success
-- Performing Test R-Wcast-align
-- Performing Test R-Wcast-align - Success
-- Performing Test R-Wcast-qual
-- Performing Test R-Wcast-qual - Success
-- Performing Test R-Wformat
-- Performing Test R-Wformat - Success
-- Performing Test R-Wwrite-strings
-- Performing Test R-Wwrite-strings - Success
-- Performing Test R-Wconversion
-- Performing Test R-Wconversion - Success
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
CMake Warning at cmake/doxygen.cmake:494 (message):
  Failed to find Doxygen, documentation will not be generated.
Call Stack (most recent call first):
  cmake/post-project.cmake:59 (_setup_project_documentation)
  CMakeLists.txt:51 (PROJECT)


-- CMake versions older than 3.12 may warn when looking to Boost components. Custom macros are used to find it.
-- For CMake < 3.18, Development.Module is not available. Falling back to Development
-- For CMake < 3.14, NumPy is not available. Falling back to custom FIND_NUMPY()
-- Found PythonInterp: /data02/arjung2/drawers/fresh-yosemite-v3/venv/bin/python (found version "3.8.3")
-- PythonInterp: /data02/arjung2/drawers/fresh-yosemite-v3/venv/bin/python
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.6m.so (found version "3.8.3")
-- PythonLibraries: /usr/lib/x86_64-linux-gnu/libpython3.6m.so
-- PythonLibraryDirs: /usr/lib/x86_64-linux-gnu
-- PythonLibVersionString: 3.8.3
-- Python site lib: lib/python3.8/site-packages
-- Python include dirs: /home/arjung2/anaconda3/include/python3.8
-- checking for numpy
--   NUMPY_INCLUDE_DIRS=/data02/arjung2/drawers/fresh-yosemite-v3/venv/lib/python3.8/site-packages/numpy/core/include
--   NUMPY_VERSION=1.23.1
-- NumPy include dir: /data02/arjung2/drawers/fresh-yosemite-v3/venv/lib/python3.8/site-packages/numpy/core/include
-- Boost version: 1.65.1
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   python3
-- Boost_PYTHON_LIBRARY: /usr/lib/x86_64-linux-gnu/libboost_python3.so
VERBOSEPython3::NumPy is not available. Falling back to old-school links to libraries / include_dirs
-- Configuring done
-- Generating done
-- Build files have been written to: /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build

You have several Python versions on your OS. You should inform cmake which one you want to use using for instance:
-DPYTHON_EXECUTABLE=$(which python).
If I were you, I would delete /data02/arjung2/drawers/fresh-yosemite-v3/venv/bin/python.

Hi @jcarpent, thanks for the suggestion.

I removed /data02/arjung2/drawers/fresh-yosemite-v3/venv and added the flag to tell cmake which python to use:

git clone --single-branch -b v2.7.10 git@github.com:stack-of-tasks/eigenpy.git
cd eigenpy && git submodule update --init && mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR/libs-install -DPYTHON_EXECUTABLE=$(which python)

Now, the python versions seem to line up in the cmake output (all 3.8, unlike above):

-- Package version (ROS package.xml): 2.7.10
-- The CXX compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Performing Test R-pedantic
-- Performing Test R-pedantic - Success
-- Performing Test R-Wno-long-long
-- Performing Test R-Wno-long-long - Success
-- Performing Test R-Wall
-- Performing Test R-Wall - Success
-- Performing Test R-Wextra
-- Performing Test R-Wextra - Success
-- Performing Test R-Wcast-align
-- Performing Test R-Wcast-align - Success
-- Performing Test R-Wcast-qual
-- Performing Test R-Wcast-qual - Success
-- Performing Test R-Wformat
-- Performing Test R-Wformat - Success
-- Performing Test R-Wwrite-strings
-- Performing Test R-Wwrite-strings - Success
-- Performing Test R-Wconversion
-- Performing Test R-Wconversion - Success
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
CMake Warning at cmake/doxygen.cmake:494 (message):
  Failed to find Doxygen, documentation will not be generated.
Call Stack (most recent call first):
  cmake/post-project.cmake:59 (_setup_project_documentation)
  CMakeLists.txt:56 (project)


-- CMake versions older than 3.12 may warn when looking to Boost components. Custom macros are used to find it.
-- For CMake < 3.18, Development.Module is not available. Falling back to Development
-- For CMake < 3.14, NumPy is not available. Falling back to custom FIND_NUMPY()
-- Found PythonInterp: /home/arjung2/anaconda3/bin/python (found version "3.8.3")
-- PythonInterp: /home/arjung2/anaconda3/bin/python
-- Found PythonLibs: /home/arjung2/anaconda3/lib/libpython3.8.so (found version "3.8.3")
-- PythonLibraries: /home/arjung2/anaconda3/lib/libpython3.8.so
-- PythonLibraryDirs: /home/arjung2/anaconda3/lib
-- PythonLibVersionString: 3.8.3
-- Python site lib: lib/python3.8/site-packages
-- Python include dirs: /home/arjung2/anaconda3/include/python3.8
-- checking for numpy
--   NUMPY_INCLUDE_DIRS=/home/arjung2/anaconda3/lib/python3.8/site-packages/numpy/core/include
--   NUMPY_VERSION=1.21.2
-- NumPy include dir: /home/arjung2/anaconda3/lib/python3.8/site-packages/numpy/core/include
-- Boost version: 1.65.1
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   python3
-- Boost_PYTHON_LIBRARY: /usr/lib/x86_64-linux-gnu/libboost_python3.so
VERBOSEPython3::NumPy is not available. Falling back to old-school links to libraries / include_dirs
-- Configuring done
-- Generating done
-- Build files have been written to: /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build

However, I am still getting the same make error as above:

[ 68%] Building CXX object unittest/CMakeFiles/geometry.dir/geometry.cpp.o
cd /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build/unittest && /usr/bin/c++  -Dgeometry_EXPORTS -I/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build -isystem /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build/include -I/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include -isystem /usr/include/eigen3  -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion  -O3 -DNDEBUG -fPIC   -o CMakeFiles/geometry.dir/geometry.cpp.o -c /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/unittest/geometry.cpp
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
                 from /usr/include/boost/python/scope.hpp:8,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/python/main.cpp:6:
/usr/include/boost/python/detail/wrap_python.hpp:50:11: fatal error: pyconfig.h: No such file or directory
 # include <pyconfig.h>
           ^~~~~~~~~~~~
compilation terminated.
python/CMakeFiles/eigenpy_pywrap.dir/build.make:65: recipe for target 'python/CMakeFiles/eigenpy_pywrap.dir/main.cpp.o' failed
make[2]: *** [python/CMakeFiles/eigenpy_pywrap.dir/main.cpp.o] Error 1
make[2]: Leaving directory '/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build'
CMakeFiles/Makefile2:1547: recipe for target 'python/CMakeFiles/eigenpy_pywrap.dir/all' failed
make[1]: *** [python/CMakeFiles/eigenpy_pywrap.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
                 from /usr/include/boost/python/args.hpp:8,
                 from /usr/include/boost/python.hpp:11,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/fwd.hpp:14,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigen-typedef.hpp:8,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigenpy.hpp:10,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/unittest/matrix.cpp:7:
/usr/include/boost/python/detail/wrap_python.hpp:50:11: fatal error: pyconfig.h: No such file or directory
 # include <pyconfig.h>
           ^~~~~~~~~~~~
compilation terminated.
unittest/CMakeFiles/matrix.dir/build.make:65: recipe for target 'unittest/CMakeFiles/matrix.dir/matrix.cpp.o' failed
make[2]: *** [unittest/CMakeFiles/matrix.dir/matrix.cpp.o] Error 1
make[2]: Leaving directory '/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build'
CMakeFiles/Makefile2:1720: recipe for target 'unittest/CMakeFiles/matrix.dir/all' failed
make[1]: *** [unittest/CMakeFiles/matrix.dir/all] Error 2
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
                 from /usr/include/boost/python/args.hpp:8,
                 from /usr/include/boost/python.hpp:11,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/fwd.hpp:14,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigen-typedef.hpp:8,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigenpy.hpp:10,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/unittest/user_type.cpp:8:
/usr/include/boost/python/detail/wrap_python.hpp:50:11: fatal error: pyconfig.h: No such file or directory
 # include <pyconfig.h>
           ^~~~~~~~~~~~
compilation terminated.
unittest/CMakeFiles/user_type.dir/build.make:65: recipe for target 'unittest/CMakeFiles/user_type.dir/user_type.cpp.o' failed
make[2]: *** [unittest/CMakeFiles/user_type.dir/user_type.cpp.o] Error 1
make[2]: Leaving directory '/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build'
CMakeFiles/Makefile2:1646: recipe for target 'unittest/CMakeFiles/user_type.dir/all' failed
make[1]: *** [unittest/CMakeFiles/user_type.dir/all] Error 2
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
                 from /usr/include/boost/python/args.hpp:8,
                 from /usr/include/boost/python.hpp:11,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/fwd.hpp:14,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigen-typedef.hpp:8,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/include/eigenpy/eigenpy.hpp:10,
                 from /data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/unittest/geometry.cpp:11:
/usr/include/boost/python/detail/wrap_python.hpp:50:11: fatal error: pyconfig.h: No such file or directory
 # include <pyconfig.h>
           ^~~~~~~~~~~~
compilation terminated.
unittest/CMakeFiles/geometry.dir/build.make:65: recipe for target 'unittest/CMakeFiles/geometry.dir/geometry.cpp.o' failed
make[2]: *** [unittest/CMakeFiles/geometry.dir/geometry.cpp.o] Error 1
make[2]: Leaving directory '/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build'
CMakeFiles/Makefile2:1683: recipe for target 'unittest/CMakeFiles/geometry.dir/all' failed
make[1]: *** [unittest/CMakeFiles/geometry.dir/all] Error 2
make[1]: Leaving directory '/data02/arjung2/drawers/fresh-yosemite-v3/libs/eigenpy/build'
Makefile:143: recipe for target 'all' failed
make: *** [all] Error 2

Any ideas what could be going on? Thank you so much for your patience, I really appreciate it.

@jcarpent This works on Ubuntu 20.04. Thanks so much for your help!!