[f2py] f2py on MacOS with pg compiler

Josef Koller jkoller at lanl.gov
Fri Apr 9 01:53:55 EEST 2010


Hi,
I'm trying to wrap fortran code on my Mac OS 10.5 with f2py using the  
portland group compiler. I setup a simple hello.f  program

C File hello.f
      subroutine foo (a)
      integer a
      print*, "Hello from Fortran!"
      print*, "a=",a
      end

and enter
 > f2py -c -m hello hello.f --fcompiler=pg
but I get that pgf77-Error-Unknown switch: -fpic

I did some digging and, indeed, pgf77 has no option -fpic on Mac OS.
I found in numpy/distutils/fcompiler/py.py settings for portland  
compiler, took out -fpic and -shared but
then I get

missing required architecture x86_64 in file
Undefined symbols:
  "_MAIN_", referenced from:
      _main in f90main.o
ld: symbol(s) not found

I don't know where to go from here. Can anybody help? It seems to be a  
combination of Mac OS and pg compiler.

Thank,
  Josef



More information about the f2py-users mailing list