-
Notifications
You must be signed in to change notification settings - Fork 196
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
problems building on os X stddef.h and math.h not found #5159
Comments
Thanks for reporting this issue. Ah, I see now that you mentioned you used |
Thanks for the report @arunpersaud and @RemiLehe for the guidance. @arunpersaud do you prefer changing WarpX C++ code and compiling that ("developer" install) or do you like to use WarpX and extend it solely with input files and Python workflows ("user" install)? In the latter case, using our pre-compiled conda packages is the fastest way to success: https://warpx.readthedocs.io/en/latest/install/users.html You currently picked the developer install. From the error, I think your XCode package on macOS needs an update - likely because of a macOS operating system update (e.g., macOS 12 to 13 or 14) since XCode was first installed. For macOS and brew, here are a few general macOS hints: |
Related issues: We fixed issues on SUSE Linux, which had multiple Python versions installed in the system root path. python3 -m venv $HOME/venvs/warpx-cpu
source $HOME/venvs/warpx-cpu and have it active to compile, pip install and run to have exactly one Python narrowed down for usage. The alternative for a system-wide install with multiple system-wide Python versions is to set a CMake hint: We still try to find out what the XCode/Apple Developer SDK/Brew interaction is that is broken on the mac system. Looks like the developer SDK is out of sync (14.4 on a 14.6 system) or so. Something like https://stackoverflow.com/a/78664080/2719194 |
Just to confirm that the venv solution worked. One step I had to do for WarpX to compile was We also got it to run by setting -DPython_EXECUTABLE to the correct version (which on my system had to be the same one that python3 points to, which was python3.11). Setting the exectuable to the path of python3.12 did not work and cmake tried to use python3.11 in some places. |
looked a bit more into this and the problem seems to be that
looks for python3, which on my computer points to 3.11 and not 3.12 and this doesn't take into account python_EXECUTABLE. One solution is to add
before the above include call and setting the python_EXECUTABLE to 3.12 |
Then limiting from the command line via You are right, |
just confirming that -DPYBIND11_PYTHON_VERSION=3.12 works on my linux box. The full cmake command to configure the build that I used was:
|
Note: Typo |
@arunpersaud I think I found a robust fix for your issue via PR #5390 The regular https://cmake.org/cmake/help/latest/module/FindPython.html logic will now apply and in particular you can set these hints to select a Python prefix path location and these options if multiple are present at the same path/location. Examples: cmake -S . -B build_py -DWarpX_DIMS="1;2;RZ;3" -DWarpX_PYTHON=ON -DPython_ROOT_DIR=/usr -DPython_FIND_STRATEGY=LOCATION or cmake -S . -B build_py -DWarpX_DIMS="1;2;RZ;3" -DWarpX_PYTHON=ON -DPython_FIND_VERSION=3.12.6 -DPython_FIND_VERSION_EXACT=TRUE and/or combinations of these. As before: If you are in a venv or |
Reuse our `find_package(Python ...)` call and use new CMake logic in pybind11. https://pybind11.readthedocs.io/en/stable/compiling.html#modules-with-cmake https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-version-selection X-ref: openPMD/openPMD-api#1677 (comment) Fix ECP-WarpX#5159 Signed-off-by: Axel Huebl <axel.huebl@plasma.ninja>
I'm using a M1 mac with most packages installed via brew (including python).
I'm trying to follow the cmake instructions from https://warpx.readthedocs.io/en/latest/install/users.html.
I tried this both on the 24.08 tag and the latest git commit (3dda26f)
Creating the build files seems to work:
But when I try to compile it, I run into errors:
I also see errors in regards to <stdint.h>, <stdlib.h>, and <math.h>.
Is this a problem when creating the build scripts or just some issue with my CC-compiler not knowing the path to these files (which seems odd to me)?
Let me know if I should upload any more files or logs.
The text was updated successfully, but these errors were encountered: