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

Editable Installation/Compilation failing #43

Open
ThomasBaycroft opened this issue Jan 22, 2025 · 4 comments
Open

Editable Installation/Compilation failing #43

ThomasBaycroft opened this issue Jan 22, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@ThomasBaycroft
Copy link
Collaborator

ThomasBaycroft commented Jan 22, 2025

When trying to compile to run a model, or when performing the: "pip install --no-build-isolation -ve . -Ceditable.rebuild=true" command, I get an error from the c++ which seems to be coming from DNest4

*** Building project with Unix Makefiles...
  [  1%] Building CXX object CMakeFiles/dnest4.dir/src/vendor/DNest4/code/Barrier.cpp.o
  In file included from /Users/thomasbaycroft/Documents/Python_packages/testing/kima/src/vendor/DNest4/code/Barrier.cpp:1:
  /Users/thomasbaycroft/Documents/Python_packages/testing/kima/src/vendor/DNest4/code/Barrier.h:4:10: fatal error: 'mutex' file not found
      4 | #include <mutex>
        |          ^~~~~~~
  1 error generated.
  make[2]: *** [CMakeFiles/dnest4.dir/src/vendor/DNest4/code/Barrier.cpp.o] Error 1
  make[1]: *** [CMakeFiles/dnest4.dir/all] Error 2
  make: *** [all] Error 2

  *** CMake build failed
  error: subprocess-exited-with-error

From a quick google, it seems that was maybe removed from the standard c++ library and that could be the issues. I have tried older versions of cmake back to 3.24.1 (any earlier and it crashes) and the error always appears.

kima still works if I do the normal pip install from pypi, this is only an issue on the git cloned version which I use for testing and developing

@j-faria
Copy link
Contributor

j-faria commented Jan 28, 2025

Can you find out the version of the compiler that it's trying to use? It might be at the start of the output of the pip install command.

@j-faria j-faria added the bug Something isn't working label Jan 28, 2025
@ThomasBaycroft
Copy link
Collaborator Author

ThomasBaycroft commented Jan 29, 2025

Here is the error message with a bit more of the earlier lines that show the compiler information:

  *** scikit-build-core 0.10.7 using CMake 3.31.2 (editable)
  *** Configuring CMake...
  loading initial cache file build/cp311-cp311-macosx_10_16_x86_64/CMakeInit.txt
  -- The CXX compiler identification is AppleClang 16.0.0.16000026
  -- The C compiler identification is AppleClang 16.0.0.16000026
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/clang++ - 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: /Library/Developer/CommandLineTools/usr/bin/clang - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Found Python: /Users/thomasbaycroft/opt/anaconda3/envs/kima_new/bin/python (found suitable version "3.11.11", minimum required is "3.8") found components: Interpreter Development.Module Development.SABIModule
  -- Configuring done (1.8s)
  -- Generating done (0.4s)
  -- Build files have been written to: /Users/thomasbaycroft/Documents/Python_packages/testing/kima/build/cp311-cp311-macosx_10_16_x86_64
  *** Building project with Unix Makefiles...
  [  1%] Building CXX object CMakeFiles/dnest4.dir/src/vendor/DNest4/code/Barrier.cpp.o
  In file included from /Users/thomasbaycroft/Documents/Python_packages/testing/kima/src/vendor/DNest4/code/Barrier.cpp:1:
  /Users/thomasbaycroft/Documents/Python_packages/testing/kima/src/vendor/DNest4/code/Barrier.h:4:10: fatal error: 'mutex' file not found
      4 | #include <mutex>
        |          ^~~~~~~
  1 error generated.
  make[2]: *** [CMakeFiles/dnest4.dir/src/vendor/DNest4/code/Barrier.cpp.o] Error 1
  make[1]: *** [CMakeFiles/dnest4.dir/all] Error 2
  make: *** [all] Error 2

@j-faria
Copy link
Contributor

j-faria commented Jan 31, 2025

This action just ran the same command

pip install --no-build-isolation -ve . -Ceditable.rebuild=true

while trying to emulate your environment (as much as I could):

Python 3.11.9
pip 25.0 [...]
cmake version 3.31.5
Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Target: x86_64-apple-darwin22.6.0

Two ideas:

  • can you try setting the deployment target before running pip, as in
    MACOS_DEPLOYMENT_TARGET=10.14 pip install --no-build-isolation -ve . -Ceditable.rebuild=true

  • I needed to run pip install scikit_build_core nanobind wheel beforehand, but I don't think this is the issue here

@ThomasBaycroft
Copy link
Collaborator Author

Even running this:
MACOS_DEPLOYMENT_TARGET=10.14` pip install --no-build-isolation -ve . -Ceditable.rebuild=true
I still get the same error, installing the packages doesn't help I had done that anyway.

I'm wondering if its an issue with compatibility with apple clang version 16, but I'm having trouble downgrading it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants