vamp icon indicating copy to clipboard operation
vamp copied to clipboard

Core dumped error encountered during installation

Open Juhok303 opened this issue 1 year ago • 7 comments

Describe the bug I tried to install vamp through "pip install ./" but encountered an error. The terminal output said "Building wheel vamp (pyproject.toml) did not run successfully" and "core dumped".

A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Clone the VAMP repository
  2. Install python 3.10, cmake 3.22, scikit-build-core 0.10.7, nanobind 2.5.0, typing extensions 4.12.2, ninja 1.10.1
  3. cd vamp
  4. pip install ./

Expected behavior After step 4 above, it starts processing and building project with Ninja. The terminal says 28 C objects to be built, and I encounter this error in 22nd.

Environment:

  • OS: Ubuntu 22.04.01
  • Python version: 2.10.12
  • GCC/Clang version: GCC 11.4.0 Clang 14.0.0
  • Hardware: x86_64 12th Gen Intel Core i7-1260P
  • Thread model: posix

Additional context - Full error message:

user@ubuntu22:~/vamp$ pip install ./ Processing /home/user/vamp Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy in /home/user/anaconda3/lib/python3.12/site-packages (from vamp==0.2) (1.26.4) Building wheels for collected packages: vamp Building wheel for vamp (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for vamp (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [56 lines of output] *** scikit-build-core 0.10.7 using CMake 3.31.4 (wheel) *** Configuring CMake... loading initial cache file build/cp312-abi3-linux_x86_64/CMakeInit.txt -- The C compiler identification is GNU 11.4.0 -- The CXX compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Python: /home/user/anaconda3/bin/python (found suitable version "3.12.7", minimum required is "3.8") found components: Interpreter Development.Module Development.SABIModule -- CPM: Adding package nanobind@0 (358d452c314dbe8c07026d984ad8d5aa860f26fb) -- CPM: Adding package nigh@0 (97130999440647c204e0265d05a997dbd8da4e70) -- CPM: Adding package pdqsort@0 (b1ef26a55cdb60d236a5cb199c4234c704f46726) -- CPM: Adding package SIMDxorshift@0 (857c1a01df53cf1ee1ae8db3238f0ef42ef8e490) -- Configuring done (6.5s) -- Generating done (0.0s) -- Build files have been written to: /home/user/vamp/build/cp312-abi3-linux_x86_64 *** Building project with Ninja... [1/28] Building C object CMakeFiles/_core_ext.dir/_deps/simdxorshift-src/src/xorshift128plus.c.o [2/28] Building C object CMakeFiles/_core_ext.dir/_deps/simdxorshift-src/src/simdxorshift128plus.c.o [3/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/python.cc.o [4/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/settings.cc.o [5/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/environment.cc.o [6/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/sphere.cc.o [7/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/ur5.cc.o [8/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/panda.cc.o [9/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/fetch.cc.o [10/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_internals.cpp.o [11/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/baxter.cc.o [12/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_func.cpp.o [13/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_type.cpp.o [14/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_enum.cpp.o [15/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_ndarray.cpp.o [16/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_static_property.cpp.o [17/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/error.cpp.o [18/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/common.cpp.o [19/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/trampoline.cpp.o [20/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/implicit.cpp.o [21/28] Linking CXX static library libnanobind-static-abi3.a [22/28] Linking CXX shared module _core_ext.abi3.so /usr/include/c++/11/bits/stl_vector.h:389:11: note: type ‘struct vector’ defined in anonymous namespace cannot match across the translation unit boundary 389 | class vector : protected _Vector_base<_Tp, _Alloc> | ^ [22/28] Generating stubs/init.pyi Illegal instruction (core dumped) FAILED: stubs/init.pyi /home/user/vamp/build/cp312-abi3-linux_x86_64/stubs/init.pyi cd /home/user/vamp/build/cp312-abi3-linux_x86_64 && /home/user/anaconda3/bin/python /home/user/vamp/build/cp312-abi3-linux_x86_64/_deps/nanobind-src/src/stubgen.py -i /home/user/vamp/build/cp312-abi3-linux_x86_64 -m _core_ext -o /home/user/vamp/build/cp312-abi3-linux_x86_64/stubs/init.pyi ninja: build stopped: subcommand failed.

  *** CMake build failed
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for vamp Failed to build vamp ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (vamp)

Juhok303 avatar Feb 07 '25 07:02 Juhok303

Given the illegal instruction segfault at the end there, there might be something happening with the P & E cores on your CPU, since they like different subsets of vector extensions... Could you try adding the following to this line: https://github.com/KavrakiLab/vamp/blob/508f5aaf430fd2c175cd350429705dbe027d856b/cmake/CompilerSettings.cmake#L3C1-L3C39

set(VAMP_ARCH "-march=native -mavx2 -mno-avx512f")

Recompile and post the output of what happens?

zkingston avatar Feb 07 '25 14:02 zkingston

It still says the same message. I added the line and then "pip install ./". It failed. And I manually set VAMP_ARCH as above and then "pip install ./". It failed. The message outputs in both cases were the same as before.

In addition, the file "/home/user/vamp/build/cp312-abi3-linux_x86_64/stubs/init.pyi" was not created.

Juhok303 avatar Feb 08 '25 21:02 Juhok303

Could you try removing the -march=native flag and recompiling just with -mavx2 -noavx512f? The stubs won't be generated unless the compilation succeeds and this error with an invalid instruction is resolved.

zkingston avatar Feb 12 '25 03:02 zkingston

When I remove -march=native, new error message said:

(base) user@ubuntu22:~/vamp$ pip install ./ Processing /home/user/vamp Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy in /home/user/anaconda3/lib/python3.12/site-packages (from vamp==0.2) (1.26.4) Building wheels for collected packages: vamp Building wheel for vamp (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for vamp (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [69 lines of output] *** scikit-build-core 0.10.7 using CMake 3.31.4 (wheel) *** Configuring CMake... loading initial cache file build/cp312-abi3-linux_x86_64/CMakeInit.txt -- The C compiler identification is GNU 11.4.0 -- The CXX compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Python: /home/user/anaconda3/bin/python (found suitable version "3.12.7", minimum required is "3.8") found components: Interpreter Development.Module Development.SABIModule -- CPM: Adding package nanobind@0 (358d452c314dbe8c07026d984ad8d5aa860f26fb) -- CPM: Adding package nigh@0 (97130999440647c204e0265d05a997dbd8da4e70) -- CPM: Adding package pdqsort@0 (b1ef26a55cdb60d236a5cb199c4234c704f46726) -- CPM: Adding package SIMDxorshift@0 (857c1a01df53cf1ee1ae8db3238f0ef42ef8e490) -- Configuring done (4.9s) -- Generating done (0.0s) -- Build files have been written to: /home/user/vamp/build/cp312-abi3-linux_x86_64 *** Building project with Ninja... [1/28] Building C object CMakeFiles/_core_ext.dir/_deps/simdxorshift-src/src/xorshift128plus.c.o [2/28] Building C object CMakeFiles/_core_ext.dir/_deps/simdxorshift-src/src/simdxorshift128plus.c.o [3/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/python.cc.o [4/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/settings.cc.o [5/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/environment.cc.o FAILED: CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/environment.cc.o /usr/bin/g++ -pthread -B /home/user/anaconda3/compiler_compat -DPy_LIMITED_API=0x030C0000 -D_core_ext_EXPORTS -I/home/user/anaconda3/include/python3.12 -I/home/user/vamp/build/cp312-abi3-linux_x86_64/_deps/nanobind-src/include -isystem /home/user/vamp/build/cp312-abi3-linux_x86_64/_deps/simdxorshift-src/include -isystem /home/user/vamp/build/cp312-abi3-linux_x86_64/_deps/nigh-src/src -isystem /home/user/vamp/build/cp312-abi3-linux_x86_64/_deps/pdqsort-src -isystem /home/user/vamp/src/impl -isystem /usr/include/eigen3 -mavx2 -mno-avx512f -Wall -Wextra -O3 -DNDEBUG -O3 -fno-math-errno -fno-signed-zeros -fno-trapping-math -fno-rounding-math -ffp-contract=fast -fassociative-math -flto=auto -std=c++17 -fPIC -fvisibility=hidden -fno-stack-protector -ffunction-sections -fdata-sections -MD -MT CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/environment.cc.o -MF CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/environment.cc.o.d -o CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/environment.cc.o -c /home/user/vamp/src/impl/vamp/bindings/environment.cc In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/x86gprintrin.h:43, from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:27, from /home/user/vamp/src/impl/vamp/collision/filter.hh:11, from /home/user/vamp/src/impl/vamp/bindings/environment.cc:1: /home/user/vamp/src/impl/vamp/collision/filter.hh: In function ‘vamp::collision::morton_pdep(unsigned int, unsigned int, unsigned int)’: /usr/lib/gcc/x86_64-linux-gnu/11/include/bmi2intrin.h:46:1: error: inlining failed in call to ‘always_inline’ ‘_pdep_u32(unsigned int, unsigned int)’: target specific option mismatch 46 | _pdep_u32 (unsigned int __X, unsigned int __Y) | ^~~~~~~~~ In file included from /home/user/vamp/src/impl/vamp/bindings/environment.cc:1: /home/user/vamp/src/impl/vamp/collision/filter.hh:151:85: note: called from here 151 | return _pdep_u32(x, MORTON_X_MASK) | _pdep_u32(y, MORTON_Y_MASK) | _pdep_u32(z, MORTON_Z_MASK); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/x86gprintrin.h:43, from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:27, from /home/user/vamp/src/impl/vamp/collision/filter.hh:11, from /home/user/vamp/src/impl/vamp/bindings/environment.cc:1: /usr/lib/gcc/x86_64-linux-gnu/11/include/bmi2intrin.h:46:1: error: inlining failed in call to ‘always_inline’ ‘_pdep_u32(unsigned int, unsigned int)’: target specific option mismatch 46 | _pdep_u32 (unsigned int __X, unsigned int __Y) | ^~~~~~~~~ In file included from /home/user/vamp/src/impl/vamp/bindings/environment.cc:1: /home/user/vamp/src/impl/vamp/collision/filter.hh:151:55: note: called from here 151 | return _pdep_u32(x, MORTON_X_MASK) | _pdep_u32(y, MORTON_Y_MASK) | _pdep_u32(z, MORTON_Z_MASK); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/x86gprintrin.h:43, from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:27, from /home/user/vamp/src/impl/vamp/collision/filter.hh:11, from /home/user/vamp/src/impl/vamp/bindings/environment.cc:1: /usr/lib/gcc/x86_64-linux-gnu/11/include/bmi2intrin.h:46:1: error: inlining failed in call to ‘always_inline’ ‘_pdep_u32(unsigned int, unsigned int)’: target specific option mismatch 46 | _pdep_u32 (unsigned int __X, unsigned int __Y) | ^~~~~~~~~ In file included from /home/user/vamp/src/impl/vamp/bindings/environment.cc:1: /home/user/vamp/src/impl/vamp/collision/filter.hh:151:25: note: called from here 151 | return _pdep_u32(x, MORTON_X_MASK) | _pdep_u32(y, MORTON_Y_MASK) | _pdep_u32(z, MORTON_Z_MASK); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~ [6/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/sphere.cc.o ninja: build stopped: subcommand failed.

  *** CMake build failed
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for vamp Failed to build vamp ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (vamp)

Juhok303 avatar Feb 12 '25 18:02 Juhok303

Can you please add -mbmi2 as well?

zkingston avatar Feb 12 '25 20:02 zkingston

It went back to the first error.

I added -mbmi2, then the output was:

(base) user@ubuntu22:~/vamp$ pip install ./ Processing /home/user/vamp Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy in /home/user/anaconda3/lib/python3.12/site-packages (from vamp==0.2) (1.26.4) Building wheels for collected packages: vamp Building wheel for vamp (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for vamp (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [56 lines of output] *** scikit-build-core 0.10.7 using CMake 3.31.4 (wheel) *** Configuring CMake... loading initial cache file build/cp312-abi3-linux_x86_64/CMakeInit.txt -- The C compiler identification is GNU 11.4.0 -- The CXX compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Python: /home/user/anaconda3/bin/python (found suitable version "3.12.7", minimum required is "3.8") found components: Interpreter Development.Module Development.SABIModule -- CPM: Adding package nanobind@0 (358d452c314dbe8c07026d984ad8d5aa860f26fb) -- CPM: Adding package nigh@0 (97130999440647c204e0265d05a997dbd8da4e70) -- CPM: Adding package pdqsort@0 (b1ef26a55cdb60d236a5cb199c4234c704f46726) -- CPM: Adding package SIMDxorshift@0 (857c1a01df53cf1ee1ae8db3238f0ef42ef8e490) -- Configuring done (8.1s) -- Generating done (0.0s) -- Build files have been written to: /home/user/vamp/build/cp312-abi3-linux_x86_64 *** Building project with Ninja... [1/28] Building C object CMakeFiles/_core_ext.dir/_deps/simdxorshift-src/src/xorshift128plus.c.o [2/28] Building C object CMakeFiles/_core_ext.dir/_deps/simdxorshift-src/src/simdxorshift128plus.c.o [3/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/python.cc.o [4/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/settings.cc.o [5/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/environment.cc.o [6/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/sphere.cc.o [7/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/ur5.cc.o [8/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/panda.cc.o [9/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/fetch.cc.o [10/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_internals.cpp.o [11/28] Building CXX object CMakeFiles/_core_ext.dir/src/impl/vamp/bindings/baxter.cc.o [12/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_func.cpp.o [13/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_enum.cpp.o [14/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_type.cpp.o [15/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_static_property.cpp.o [16/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/nb_ndarray.cpp.o [17/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/error.cpp.o [18/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/common.cpp.o [19/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/implicit.cpp.o [20/28] Building CXX object CMakeFiles/nanobind-static-abi3.dir/_deps/nanobind-src/src/trampoline.cpp.o [21/28] Linking CXX static library libnanobind-static-abi3.a [22/28] Linking CXX shared module _core_ext.abi3.so /usr/include/c++/11/bits/stl_vector.h:389:11: note: type ‘struct vector’ defined in anonymous namespace cannot match across the translation unit boundary 389 | class vector : protected _Vector_base<_Tp, _Alloc> | ^ [22/28] Generating stubs/init.pyi Illegal instruction (core dumped) FAILED: stubs/init.pyi /home/user/vamp/build/cp312-abi3-linux_x86_64/stubs/init.pyi cd /home/user/vamp/build/cp312-abi3-linux_x86_64 && /home/user/anaconda3/bin/python /home/user/vamp/build/cp312-abi3-linux_x86_64/_deps/nanobind-src/src/stubgen.py -i /home/user/vamp/build/cp312-abi3-linux_x86_64 -m _core_ext -o /home/user/vamp/build/cp312-abi3-linux_x86_64/stubs/init.pyi ninja: build stopped: subcommand failed.

  *** CMake build failed
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for vamp Failed to build vamp ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (vamp)

Juhok303 avatar Feb 13 '25 01:02 Juhok303

I am unable to recreate this error locally on another CPU with P&E cores - I believe the problem lies with how exactly you are invoking the build. Can you please provide the sequence of instructions you are using to create a fresh environment (as it appears you are using anaconda) and build the package? A Dockerfile would also be appreciated.

zkingston avatar Feb 13 '25 14:02 zkingston