scikit-build icon indicating copy to clipboard operation
scikit-build copied to clipboard

How to append, rather than overwrite, the `CMAKE_MODULE_PATH` that skbuild determines?

Open Helveg opened this issue 3 years ago • 1 comments

I have a binary extension which ships its own CMake modules, and they aren't detected because scikit-build sets CMAKE_MODULE_PATH itself to a specific absolute path. Is there an argument that allows me to append paths to this? My current workaround is to pass -- -DCMAKE_MODULE_PATH=<my_path>:<skbuild_path> but it requires me to manually check what path scikit-build uses on that machine/Python-env. It doesn't seem to be documented anywhere and seems like a generic enough issue to document a workaround for.

(I found this related issue for cmake config module autodetection: https://github.com/scikit-build/scikit-build/issues/510)

Helveg avatar Jun 06 '22 14:06 Helveg

And by extension, how would I do this during a cibuildwheel run?

(The last line is indicative that the extension's CMake modules weren't loaded)

Building wheel...

    + rm -rf /tmp/cibuildwheel/built_wheel
    + mkdir -p /tmp/cibuildwheel/built_wheel
    + python -m pip wheel /project --wheel-dir=/tmp/cibuildwheel/built_wheel --no-deps
  error: subprocess-exited-with-error

  × Building wheel for nest-simulator (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [156 lines of output]
      Not searching for unused variables given on the command line.
      -- The C compiler identification is GNU 10.2.1
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /opt/rh/devtoolset-10/root/usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- The CXX compiler identification is GNU 10.2.1
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /opt/rh/devtoolset-10/root/usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /project/_cmake_test_compile/build
      -- The CXX compiler identification is GNU 10.2.1
      -- The C compiler identification is GNU 10.2.1
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /opt/rh/devtoolset-10/root/usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /opt/rh/devtoolset-10/root/usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
      -- Looking for include file inttypes.h
      -- Looking for include file inttypes.h - found
      -- Looking for include file mach-o/dyld.h
      -- Looking for include file mach-o/dyld.h - not found
      -- Looking for include file mach/mach.h
      -- Looking for include file mach/mach.h - not found
      -- Looking for include file memory.h
      -- Looking for include file memory.h - found
      -- Looking for include file stdint.h
      -- Looking for include file stdint.h - found
      -- Looking for include file sys/types.h
      -- Looking for include file sys/types.h - found
      -- Looking for C++ include istream
      -- Looking for C++ include istream - found
      -- Looking for C++ include ostream
      -- Looking for C++ include ostream - found
      -- Looking for C++ include sstream
      -- Looking for C++ include sstream - found
      -- Looking for stddef.h
      -- Looking for stddef.h - found
      -- Check size of long long
      -- Check size of long long - done
      -- Check size of u_int16_t
      -- Check size of u_int16_t - done
      -- Check size of uint16_t
      -- Check size of uint16_t - done
      -- Check size of u_int64_t
      -- Check size of u_int64_t - done
      -- Check size of uint64_t
      -- Check size of uint64_t - done
      -- Looking for NAN
      -- Looking for NAN - found
      -- Looking for isnan
      -- Looking for isnan - found
      -- Looking for M_E
      -- Looking for M_E - found
      -- Looking for M_PI
      -- Looking for M_PI - found
      -- Looking for expm1
      -- Looking for expm1 - not found
      -- Host triple: x86_64-pc-linux
      -- Target triple: x86_64-pc-linux
      -- Found Python: /opt/python/cp38-cp38/bin/python (found suitable version "3.8.13", minimum required is "3.8") found components: Interpreter Development.Module
      -- Found PythonInterp: /opt/python/cp38-cp38/bin/python (found version "3.8.13")
      -- Found Cython: /tmp/pip-build-env-pjtncniu/overlay/bin/cython (Required is at least version "0.28.3")
      -- Found PythonLibs: libpython3.8.a (found version "3.8.13")
      -- Found LTDL: /usr/local/lib/libltdl.so (found version "2.4.7")
      -- Could NOT find Readline (missing: READLINE_LIBRARY NCURSES_LIBRARY READLINE_INCLUDE_DIR)
      -- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1")
      -- Could NOT find GSL (missing: GSL_INCLUDE_DIR GSL_LIBRARY GSL_CBLAS_LIBRARY) (found version "")
      -- Found OpenMP_C: -fopenmp (found version "4.5")
      -- Found OpenMP_CXX: -fopenmp (found version "4.5")
      -- Found OpenMP: TRUE (found version "4.5")
      -- Could NOT find Boost (missing: Boost_INCLUDE_DIR) (Required is at least version "1.69.0")
      -- Check the abort exitcode.
      -- Check the abort exitcode. Permission denied
      -- Check the segmentation fault exitcode.
      -- Check the segmentation fault exitcode. Permission denied
      -- Check whether the compiler ignores cmath makros.
      -- Check whether the compiler ignores cmath makros. OFF
      -- Check whether the compiler does NOT include <*.h> headers ISO conformant.
      -- Check whether the compiler does NOT include <*.h> headers ISO conformant. OFF
      -- Check whether the compiler respects symbolic signal names in signal.h.
      -- Check whether the compiler respects symbolic signal names in signal.h. OFF
      -- Check static template member declaration.
      -- Check static template member declaration. OFF
      -- Check for STL vector capacity base unity.
      -- Check for STL vector capacity base unity. ON
      -- Check for STL vector capacity doubling strategy.
      -- Check for STL vector capacity doubling strategy. ON
      -- Check whether the compiler fails with ICE.
      -- Check whether the compiler fails with ICE. OFF
      -- Check if ::nan is available from cmath.
      -- Check if ::nan is available from cmath. ON
      -- Check if ::isnan is available from cmath.
      -- Check if ::isnan is available from cmath. ON
      -- Check if Random123 generators work.
      -- Check if Random123 generators work. ON
      -- NEST version: reinvention-of-the-wheel@6880e7c669
      CMake Error at pynest/CMakeLists.txt:31 (cython_add_module):
        Unknown CMake command "cython_add_module".

Helveg avatar Jun 07 '22 16:06 Helveg