Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Pearu Peterson <pearu.peterson-Re5JQEeQqe8AvxtiuMwx3w <at> public.gmane.org>
Subject: Re: [f2py] f2py can't find ifort
Newsgroups: gmane.comp.python.f2py.user
Date: Thursday 17th July 2008 18:03:52 UTC (over 8 years ago)
On Thu, Jul 17, 2008 at 4:13 PM, Ryan Sobash
 wrote:
> On Thu, Jul 17, 2008 at 2:00 AM, Pearu Peterson
>  wrote:
>> On Thu, Jul 17, 2008 at 1:02 AM, Ryan Sobash
 wrote:
>>> Although the output indicates f2py found my ifort executable, it fails
>>> by saying it can't find a Fortran compiler. It works fine with
>>> gfortran, but I want it to use ifort (the code runs 5x faster compiled
>>> with ifort).
>>>
>>> It's probably something simple...I'm a f2py novice. Below is the
>>> output when I run f2py... Thanks!
>>>
>> ...
>>> warning: build_ext: f77_compiler=intel is not available.
>>
>> What is exactly the f2py command line that you are using?
>>
>> Pearu
>
> I was able to have f2py use the ifort compiler with the following
command:
>
>  f2py --f77exec=/opt/intel/fc/10.1.013/bin/ifort -m modulename -c
filename.f

This command would use gcc for linking the extension module but it
is crucial to use ifort for that. Otherwise one needs to specify compiler
libraries and library paths manually which is not an optimal solution.
For optimal solution, see below.

> Although, when I import the module I get an ImportError:
>
> ImportError: ./probs.so: undefined symbol: for_write_seq_lis
>
> I assume I need to manually link in some libraries?

You should first setup the environment properly for intel fortran compiler,
read its installation instructions. (It is quite common mistake to ignore
these instructions and as a result, there will be difficulties in using the
Intel compilers. It's not enough to specify the path to the compiler
executable,
one also needs setup intel shared library paths that the final shared
library needs).

If this is done properly, then use the following command

  f2py -c --fcompiler=intel -m modulename filename.f

that should now detect intel compiler and use appropiate
linker commands to build a working extension module.

You can also execute

  f2py -c --help-fcompiler

to see which compilers are detected and then use appropiate --fcompiler
option.

HTH,
Pearu
 
CD: 3ms