Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build from source on openbsd 7.4 #457

Open
minrk opened this issue Feb 23, 2024 · 2 comments
Open

Cannot build from source on openbsd 7.4 #457

minrk opened this issue Feb 23, 2024 · 2 comments

Comments

@minrk
Copy link

minrk commented Feb 23, 2024

I've been testing out pyzmq's updated build system on scikit-build-core (great experience so far!).

openbsd doesn't have wheels, so this package attempts to build cmake, which in turn requires system-installed cmake (it would be super nice if #33 could be solved, so I didn't need to install cmake to get cmake).

Currently, building the cmake wheel fails with:

  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc - broken
  CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (mes
sage):
    The C compiler

      "/usr/bin/cc"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: '/tmp/pip-install-kjsyd9hs/cmake_53a116a403e347e2803e32ebc0544
c72/_skbuild/openbsd-7.4-arm64-3.10/cmake-build/CMakeProject-build/CMakeFiles/CM
akeScratch/TryCompile-vovk2d'

      Run Build Command(s): /usr/local/bin/cmake -E env VERBOSE=1 /usr/bin/make 
-f Makefile cmTC_eda68/fast
      /usr/bin/make  -f CMakeFiles/cmTC_eda68.dir/build.make CMakeFiles/cmTC_eda
68.dir/build
      Building C object CMakeFiles/cmTC_eda68.dir/testCCompiler.c.o
      /usr/bin/cc   -D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1
 -D_BSD_SOURCE=1  -MD -MT CMakeFiles/cmTC_eda68.dir/testCCompiler.c.o -MF CMakeF
iles/cmTC_eda68.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_eda68.dir/testCCompil
er.c.o -c /tmp/pip-install-kjsyd9hs/cmake_53a116a403e347e2803e32ebc0544c72/_skbu
ild/openbsd-7.4-arm64-3.10/cmake-build/CMakeProject-build/CMakeFiles/CMakeScratc
h/TryCompile-vovk2d/testCCompiler.c
      Linking C executable cmTC_eda68
      /usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_eda68.dir/link.t
xt --verbose=1
      /usr/bin/cc -D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -
D_BSD_SOURCE=1  -lstdc++ -lgcc -lrt  CMakeFiles/cmTC_eda68.dir/testCCompiler.c.o
 -o cmTC_eda68  -Wl,-rpath-link,/usr/X11R6/lib:/usr/local/lib:/home/vm
a5/build/bundled/lib
      ld: error: unable to find library -lgcc
      ld: error: unable to find library -lrt
      cc: error: linker command failed with exit code 1 (use -v to see invocatio
n)

I don't know why cmake is looking for libgcc and librt, which don't make sense on openbsd, so I don't know if that's an issue for cmake itself or this package. FWIW, building my package after lowering the cmake requirement in my pyproject.toml to accept the system cmake (3.27.5) doesn't have this issue.

@minrk
Copy link
Author

minrk commented Feb 23, 2024

forgot to include the diagnostic info:

      Python: 3.10.13
      platform: OpenBSD-7.4-arm64-aarch64-64bit-ELF
      machine: arm64
      bits: 64
      pip: n/a
      setuptools: 69.1.0
      scikit-build: 0.17.6
      PEP517_BUILD_BACKEND=setuptools.build_meta
      =============================DEBUG ASSISTANCE=============================

  An error occurred while building with CMake.
    Command:
      /usr/local/bin/cmake --build . --target install --config Release --
    Install target:
      install
    Source directory:
      /tmp/pip-install-kjsyd9hs/cmake_53a116a403e347e2803e32ebc0544c72
    Working directory:
      /tmp/pip-install-kjsyd9hs/cmake_53a116a403e347e2803e32ebc0544c72/_skbuild/
openbsd-7.4-arm64-3.10/cmake-build
  Please check the install target is valid and see CMake's output for more infor
mation.

@jcfr
Copy link
Contributor

jcfr commented Mar 27, 2024

While investigating this issue, I took some notes:


Reviewing the change log associated with CMake 3.28.21, it is mentioned:

Source: Restore compilation on OpenBSD

After review the associated merge request MR-90852, it does not seem related to this issue.


Reviewing the commit history, I also noticed Kitware/CMake@e527c2d (LinkerId: Fix detection of linker tool for Clang on OpenBSD) introduced through MR-90863, it also does not seem related to this issue.

Footnotes

  1. https://discourse.cmake.org/t/cmake-3-28-2-available-for-download/9961

  2. https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9085

  3. https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9086

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants