1

I would like to revisit this question as I have a slightly more complicated case.

I am working on a package that includes many subpackages, some containing fortran source code that I have compiled with f2py during development.

I now want to write a setup.py file for the package for distribution with pip or conda.

Say I used the following f2py command to compile:

f2py -c --fcompiler='intelem' --opt='-xhost -O3 -ipo' \
    --f90flags='-qopenmp -qopenmp-link=static -static-intel' \
    -I/opt/intel/include -L/opt/intel/lib -liomp5 \
    -m module_name module_name.f90 \
    only: subroutine_1 subroutine_2 ... subroutine_n :

can I pass this entire command to the f2py_options keyword argument of numpy.distutils.core.Extension or do I need to break it down to: include_dirs, library_dirs, libraries, extra_f90_compile_args, etc.?

Where would the --opt flags go? and the only: ... : declaration?

One more question: Can I have a different set of compiler options (gnu/intel) and pass some kind of keyword argument to pip or conda? is that the best practice?

Thanks!

Shahar
  • 886
  • 1
  • 10
  • 22

0 Answers0