Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29065 Discussions

Additional components needed for Python calling Fortran .so file (Linux)

Simon_C
Novice
816 Views

Everyone,

We have a Python wrapper (using 'ctypes') that is able to successfully call a Fortran routine from a compiled .so file on a Linux machine.  Our aim is to be able to distribute the wrapper and .so file to users who are unlikely to have Intel Fortran, or various supporting libraries (I'm very hazy about what those are) on their machines.

The 'success' I mentioned above was obtained on a machine with Intel Fortran installed. When I sent the .so file and Python wrapper file for someone to try on a machine with no Fortran installed, she was unable to get the wrapper to work, and said that "However, I believe I am missing the 'libifport.so.5' file, which should come with the Intel compiler."

I suppose the problem can be solved by her installing some extra Intel software, but that isn't an answer that will work well for our likely users (marine chemists around the world). So my question is this: are there ifort compilation options that will include these extra software components into the .so file, so users won't require any additional software or extra files?

The compilation options I was using, which resulted in the problem I've just described, were:

   -shared -fpic -O1

After studying the manual, I tried the following which at least yields a larger .so file (this hasn't been tested yet, as I'm not a Python user myself):

   -shared -fpic  -O1 -static-intel

I'd be grateful if someone knowledgeable would provide some guidance. One of the things I'm not clear about - whether or not the above will work - is how the various 'shared' and 'static' compiler options interact with each other.

Thankyou,

Simon_C

 

 

 

0 Kudos
0 Replies
Reply