[f2py] OpenMP - again

Paul Anton Letnes <[email protected]> Sat, 4 Sep 2010 11:31:36 +0200
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
Dear f2py fans.

I finally got an OpenMP example up and running. It even gives a decent speedup (1.8-ish) on my 2-core laptop! The only disadvantage is that I have not managed to pass the "-fopenmp" flag to the final compile-and-link command, meaning that if I simply run "make" (Makefile included, of course) the resulting python module is not linked to libopenmp. I managed to fix this by manually copying the final build command and adding the "-fopenmp" flag by hand - see detailed instructions in the Makefile.

Can anyone please tell me how I can "automagically" get the -fopenmp flag into the final build command? I believe that will make this example more complete. Also, feel free to suggest improvements to this example!

And to the devs - thanks for writing f2py, it is an impressive piece of software :-)

Best regards,
Paul.

PS:
The final build command is, on my machine:
/opt/local/bin/gfortran -Wall -Wall -undefined dynamic_lookup -bundle build/build/src.macosx-10.6-x86_64-2.6/wrappermodule.o build/build/src.macosx-10.6-x86_64-2.6/fortranobject.o build/wrapper.o build/build/src.macosx-10.6-x86_64-2.6/wrapper-f2pywrappers2.o fortranmodule.o -L/opt/local/lib/gcc44/gcc/x86_64-apple-darwin10/4.4.4 -lgfortran -o ./wrapper.so
It should be (note the -fopenmp flag in the beginning):
/opt/local/bin/gfortran -fopenmp -Wall -Wall -undefined dynamic_lookup -bundle build/build/src.macosx-10.6-x86_64-2.6/wrappermodule.o build/build/src.macosx-10.6-x86_64-2.6/fortranobject.o build/wrapper.o build/build/src.macosx-10.6-x86_64-2.6/wrapper-f2pywrappers2.o fortranmodule.o -L/opt/local/lib/gcc44/gcc/x86_64-apple-darwin10/4.4.4 -lgfortran -o ./wrapper.so

_______________________________________________
f2py-users mailing list
f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
http://cens.ioc.ee/mailman/listinfo/f2py-users
OpenMP-example.zip (application/zip, 1.6 KB) - not displayed