I was hoping to use openmp to speed up my Fortran code, which I run through f2py. However, after compiling successfully, I cannot import the module into Python.
For a Fortran95 module, for example:
module test implicit none contains subroutine readygo() real(kind = 8), dimension(10000) :: q !$OMP WORKSHARE q = 7 !$OMP END WORKSHARE end subroutine end module
Compiled and imported using the following commands:
f2py -m SOmod --fcompiler=gnu95 --f90flags='-march=native -O3 -fopenmp' -c SOtest.f95 python2 -c "import SOmod"
I get an error message. Error for import - compilation works fine with both f2py and gfortran directly (only get a warning about "Using deprecated NumPy APIs").
Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: ./SOmod.so: undefined symbol: GOMP_barrier
I get different GOMP_ * errors for different OMP directives. Without directives (but with the -openmp flag) it works.
Any help would be greatly appreciated.
source share