Open mwoussen opened 2 years ago
I managed to build the pyratp.pyd file, the procedure was :
1) f2py -m pyratp --overwrite-signature -h [source_64bits]
2) f2py -c --build-dir . --compiler=mingw32 --fcompiler=gnu95 [sources_64bits]
3) the process ends on the ld error as before
4) change #include <setjmp.h>
to #include <setjmpex.h>
in the src.win-amd64-3.7/pyratpmodule.c
file
5) rerun f2py -c --build-dir . --compiler=mingw32 --fcompiler=gnu95 [sources_64bits]
, now it's building the file pyratp.src.win-amd64-3.7.pyd
6) run the last command of f2py -c ...
, which is gfortran -Wall -g -shared .\Release\src.win-amd64-3.7\pyratpmodule.o .\Release\src.win-amd64-3.7\src.win-amd64-3.7\fortranobject.o .\Release\mod_[sources_64bits].o .\Release\src.win-amd64-3.7\pyratp-f2pywrappers.o -L"C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0" -LC:\Users\mwoussen\Anaconda3\envs\ratp\libs -LC:\Users\mwoussen\Anaconda3\envs\ratp\PCBuild\amd64 -lpython37 -lgfortran -o .\pyratp.pyd
, where ratp
is the name of my conda env
7) Then, I copy pyratp.pyd
among the Python files
Great! Thanks again for the tip. We will look at building a conda package from this work.
In the branch meson, we will test the automatic build of PyRATP using meson with @thomasarsouze
@pellem Here is the next challenge. You can create a build.sh to run f2py in conda using the code in the Makefile
@pellem
mamba install meson compilers
meson setup builddir
meson compile -C builddir
cd builddir
ipython
import pyratp
Read https://numpy.org/doc/stable/f2py/buildtools/meson.html
The file
pyratp.pyd
is not working on my configuration and doesn't seem to be built while installing the package with scons. My processor is a Intel i7-4800MQ 64 bits, with Windows 10. I installed a conda environment with Python 3.7 and the following packages :Under this conda env, I did this modifications to adapt the code in Python 3 :
print "
->print(
<>
->!=
metadata.iteritems()
->metadata.iter()
The command
python setup.py install
correctly installs the pakage but without rebuilding thepyratp.pyd
file, only copying it.The existing
pyratp.pyd
seems to be compiled for Python 2, so I tried to build it withf2py
by typing the commands described in src/f90/SConscript :f2py -m pyratp --overwrite-signature -h [source_64bits]
f2py -c --build-dir . --compiler=mingw32 --fcompiler=gnu95 [sources_64bits]
Where [sources_64bits] are the files written in src/f90/SConscript l.18-32 . The compile command (
f2py -c
) ends up with an error :I also tried using a conda environnement with Python 2, but openalea.sconsx is no longer available for this version of Python which makes the
python setup.py install
command obsolete. Then, when I recreate thepyratp.pyf
file, it calls unknown modules in the environnement sof2py -c
can't build.