fudge icon indicating copy to clipboard operation
fudge copied to clipboard

When building from source (not with a pip install), there is trouble finding numpy headers

Open brown170 opened this issue 1 year ago • 0 comments

This is the traceback:

➜  fudge git:(master) ✗ make PYTHON=python3             
for submodule in xData PoPs numericalFunctions brownies Merced crossSectionAdjustForHeatedTarget pqu; do if [[ `git diff $submodule` ]]; then echo 'INFO: Have you executed "git submodule update --recursive"?'; break; fi; done
INFO: Have you executed "git submodule update --recursive"?
python3 getFudgeVersion.py
if [[ -d crossSectionAdjustForHeatedTarget/build ]]; then rm -rf crossSectionAdjustForHeatedTarget/build; fi
cd crossSectionAdjustForHeatedTarget; python3 setup.py --quiet build 
find crossSectionAdjustForHeatedTarget/build -iname "*crossSectionAdjustForHeatedTarget*" \
	  -ipath "*build/lib*/crossSectionAdjustForHeatedTarget*/*crossSectionAdjustForHeatedTarget*" \
	  -exec cp {} crossSectionAdjustForHeatedTarget/lib \;
export PYTHONPATH=/Users/dbrown/Desktop/fudge:/Users/dbrown/Desktop/x4i:`pwd`; cd numericalFunctions; python3 setup.py --quiet build
find numericalFunctions/build -ipath "numericalFunctions/build/lib*/numericalFunctions/*" ! -iname "__init__.py" \
	  -exec cp {} numericalFunctions/lib \;
cd fudge/processing/resonances; /Library/Developer/CommandLineTools/usr/bin/make PYTHON=python3
python3 setup.py --quiet build
In file included from getBreitWignerSums.c:13:
In file included from /opt/homebrew/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayobject.h:5:
In file included from /opt/homebrew/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h:22:
/opt/homebrew/lib/python3.12/site-packages/numpy/_core/include/numpy/__multiarray_api.h:1480:10: fatal error: 'numpy/_public_dtype_api_table.h' file not found
#include "numpy/_public_dtype_api_table.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
make[1]: *** [build] Error 1
make: *** [inplace2] Error 2

When I change line 13 of getBreitWignerSums.c, "#include <arrayobject.h>" -> "#include <numpy/arrayobject.h>", I get a different include error:

➜  fudge git:(master) ✗ make PYTHON=python3                                    
for submodule in xData PoPs numericalFunctions brownies Merced crossSectionAdjustForHeatedTarget pqu; do if [[ `git diff $submodule` ]]; then echo 'INFO: Have you executed "git submodule update --recursive"?'; break; fi; done
python3 getFudgeVersion.py
if [[ -d crossSectionAdjustForHeatedTarget/build ]]; then rm -rf crossSectionAdjustForHeatedTarget/build; fi
cd crossSectionAdjustForHeatedTarget; python3 setup.py --quiet build 
find crossSectionAdjustForHeatedTarget/build -iname "*crossSectionAdjustForHeatedTarget*" \
	  -ipath "*build/lib*/crossSectionAdjustForHeatedTarget*/*crossSectionAdjustForHeatedTarget*" \
	  -exec cp {} crossSectionAdjustForHeatedTarget/lib \;
export PYTHONPATH=/Users/dbrown/Desktop/fudge:/Users/dbrown/Desktop/x4i:`pwd`; cd numericalFunctions; python3 setup.py --quiet build
find numericalFunctions/build -ipath "numericalFunctions/build/lib*/numericalFunctions/*" ! -iname "__init__.py" \
	  -exec cp {} numericalFunctions/lib \;
cd fudge/processing/resonances; /Library/Developer/CommandLineTools/usr/bin/make PYTHON=python3
python3 setup.py --quiet build
getBreitWignerSums.c:13:10: fatal error: 'numpy/arrayobject.h' file not found
#include <numpy/arrayobject.h>    /* for numpy c interface */
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
make[1]: *** [build] Error 1
make: *** [inplace2] Error 2

I'm running macOS 14, using homebrew's version of python3.12. I can get this error with clang (as above) or homebrew's gcc, suggesting a numpy or fudge issue.

brown170 avatar Sep 18 '24 17:09 brown170