Open davidesk opened 3 years ago
This appears to be actually an issue that is not related to the python wrapper but to compiling class itself.
You should take into account that the makefile assumes that you are on a unix-based system and to make it work with Windows you must adjust the file accordingly. For examples, it seems that you want to use gcc as compiler rather than the visual Studio compiler for Windows such that this will not work when you haven't gcc installed on your machine.
I have installed gcc, so I guess that the issue must refer to something else... Do you have any idea if there are other options I need to change in the Makefile?
I wonder if it fails right away or whether it is something which only happens in context of the class
target of the makefile (which is in line 141, the line where it fails for you).
Could you try to run make libclass.a
and when this works try 'make classy'. You will then have the python wrapper but not the separate class executable, which you would not really need in your case.
You could also run make classy
right away as it implies the libclass.a
make target. I just suggest the split in case the first step already fails.
The make libclass.a
command generates the following message:
process_begin: CreateProcess(NULL, pwd, ...) failed.
Makefile:4: pipe: No error
make: 'libclass.a' is up to date.
while with make classy
I get:
process_begin: CreateProcess(NULL, pwd, ...) failed.
Makefile:4: pipe: No error
cp python/setup.py python/autosetup.py
process_begin: CreateProcess(NULL, cp python/setup.py python/autosetup.py, ...) failed.
make (e=2): Impossible to find specified file.
make: *** [Makefile:176: classy] Error 2
OK. I guess I see what is happening.
During the make classy
step there are a few commands executed that seem to assume a unix-based system and might not work on Windows.
For example in line 176
cp python/setup.py python/autosetup.py
may cause trouble.
I am no expert in Windows, but there might be no program called cp
in windows to copy python/setup.py
to python/autosetup.py
. You may need to adjust this command there.
Also one should be aware that on unix-based systems a (forward) slash is used for file paths whereas windows uses backslashes as far as I know. But this should have caused troubles before in the Makefile.
Another problematic bit could be export CC=$(CC)
in line 180
cd python; export CC=$(CC); $(PYTHON) autosetup.py install || $(PYTHON) autosetup.py install --user
as this will set the environment variable CC
to the compiler in use (gcc
in this case). I am not sure if this works on Windows
Thanks, I'll try to find a way to translate these commands then. I have tried to repeat the whole process in the Ubuntu shell in the Windows terminal and the wrapper is installed; however, when executing the program using python program.py
I get
segmentation fault (core dumped)
which is odd, since the program works just fine on my linux machine :(
Hi all, I'm encountering huge problems when trying to install the Python wrapper on my windows machine. I'm using Spyder, installed with Anaconda. When using the
make
command Anaconda prompt in theclass_public-2.9.4
folder I get the following error:process_begin: CreateProcess(NULL, pwd, ...) failed. Makefile:4: pipe: No error gcc -O4 -ffast-math -fopenmp -g -fPIC -o class build/growTable.o build/dei_rkck.o build/sparse.o build/evolver_rkck.o build/evolver_ndf15.o build/arrays.o build/parser.o build/quadrature.o build/hyperspherical.o build/common.o build/trigonometric_integrals.o build/input.o build/background.o build/thermodynamics.o build/perturbations.o build/primordial.o build/nonlinear.o build/transfer.o build/spectra.o build/lensing.o build/hyrectools.o build/helium.o build/hydrogen.o build/history.o build/output.o build/class.o -lm process_begin: CreateProcess(NULL, gcc -O4 -ffast-math -fopenmp -g -fPIC -o class build/growTable.o build/dei_rkck.o build/sparse.o build/evolver_rkck.o build/evolver_ndf15.o build/arrays.o build/parser.o build/quadrature.o build/hyperspherical.o build/common.o build/trigonometric_integrals.o build/input.o build/background.o build/thermodynamics.o build/perturbations.o build/primordial.o build/nonlinear.o build/transfer.o build/spectra.o build/lensing.o build/hyrectools.o build/helium.o build/hydrogen.o build/history.o build/output.o build/class.o -lm, ...) failed. make (e=2): Impossible to find the specified file. make: *** [Makefile:141: class] Error 2
Did anyone manage to install the wrapper on a Windows machine? Thank you very much.