1

I'm trying to create a Python module using f2py using the Intel Fortran compiler, but WITHOUT the corresponding Intel or Microsoft C compiler. I had been told that I could use the MinGW C compiler for this, though I'm starting to doubt this.

I have 32-bit Python 2.7.3 with numpy 1.8.1, Intel Fortran 11.1 (with the VS 2008 shell), and MinGW 4.8.1.

Using f2py with --fcompiler=intelv and --compiler=mingw32 seemed to work until it got time to link. I got many unresolved externals as in this posting (I'm not currently able to access the makefile referenced in the answer), along with this warning:

LNK4078: multiple '.drectve' sections found with different attributes (00100A00)

I realized that some incorrect options were being passed to ifort, so I tried calling ifort directly to link. When I did, it went ahead with the link, but when I tried to import the .pyd file, python complained that it did not have an init function defined. Looking at the .pyd file with depends, I saw that it was not linked correctly against MSVCR90.DLL or LIBIFCOREMD.DLL. I tried listing the corresponding .lib files in the link line, but that didn't appear to help with this issue.

I also tried calling link directly (with the corresponding options), but it just refused to link at all.

Am I trying to do something impossible?

Community
  • 1
  • 1
DMEIA
  • 11
  • 2
  • Microsoft has recently released a free and updated visual C++ package specifically for compiling Python 2.7. You may find it easier to use this rather than mingw32. http://www.microsoft.com/en-au/download/details.aspx?id=44266 – DaveP Mar 22 '15 at 11:51

0 Answers0