I have developped Fortran's routines that I have integrated in my Python code. So I use numpy.distutils
with the following setup.py
:
#!/usr/bin/env python
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('name', parent_package, top_path)
src = ['dir1/dir2/a.f90']
config.add_library('libname', sources=src,
extra_f90_compile_args=['-O3','-ffast-math','-funroll-loops'])
config.add_extension(name='wrapper_name', sources=['dir1/dir2/wrapper_name.f90'],
extra_f90_compile_args=['-O3','-ffast-math','-funroll-loops'], l
libraries=['libname'])
return config
if __name__ == "__main__":
from numpy.distutils.core import setup
setup(configuration=configuration)
This setup.py
works well on my macOS but not on Debian
Fortran f77 compiler: /usr/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops
Fortran f90 compiler: /usr/bin/gfortran -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops
Fortran fix compiler: /usr/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops
compile options: '-Ibuild/src.linux-x86_64-3.7/build/src.linux-x86_64-3.7/dir1/dir2 -I/YYY/anaconda3/lib/python3.7/site-packages/numpy/core/include -Ibuild/src.linux-x86_64-3.7/numpy/distutils/include -I/YYY/anaconda3/include/python3.7m -c'
extra options: '-Jbuild/temp.linux-x86_64-3.7/dir1/dir2 -Ibuild/temp.linux-x86_64-3.7/dir1/dir2'
gfortran:f90: dir1/dir2/wrapper_name.f90
dir1/dir2/wrapper_name.f90:872:8:
use a, only : RR
1
Fatal Error: Can't open module file a.mod’ for reading at (1): Aucun fichier ou dossier de ce type
compilation terminated.
error: Command "/usr/bin/gfortran -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops -Ibuild/src.linux-x86_64-3.7/build/src.linux-x86_64-3.7/dir1/dir2 -I/YYY/anaconda3/lib/python3.7/site-packages/numpy/core/include -Ibuild/src.linux-x86_64-3.7/numpy/distutils/include -I/YYY/anaconda3/include/python3.7m -c -c dir1/dir2/wrapper_name.f90 -o build/temp.linux-x86_64-3.7/dir1/dir2/wrapper_name.o -Jbuild/temp.linux-x86_64-3.7/dir1/dir2 -Ibuild/temp.linux-x86_64-3.7/dir1/dir2" failed with exit status 1
The missing .mod
seems to not be at the right place but I don't understand why it is working on macOS and not working in Debian.