[Numpy-discussion] compile fortran from python

Ioan Ferencik ioan.ferencik at tkk.fi
Sat Oct 9 07:18:17 EDT 2010


I would like to compile some Fortran  code using python,  build a  
shared library, and link to it using python. But I get a message  
saying the compiler does not recognise the extension of my file.

this is my command:

gcc -fPIC -c -shared -fno-underscoring test.f95 -o ./lib/libctest.so.1.0

what is the easiest method to achieve this?
  I suspect  I could create a custom extension and customise the  
unixccompiler object or could I just use the compiler object defined  
by f2py(fcompiler).

Cheers


Ioan Ferencik
PhD student
Aalto University
School of Science and Technology
Faculty Of Civil and Env. Engineering
Lahti Center
Tel: +358505122707





More information about the NumPy-Discussion mailing list