[f2py] f2py on MacOS with pg compiler

Josef Koller <[email protected]>
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.