Re: [f2py] f2py: error: unknown file type '' (from '--include_paths')

"Marcel Loose" <loose-JEfgvD5ZcVNmR6Xm/[email protected]> Tue, 21 Jun 2011 14:46:47 +0200
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
Hi Pearu,

Thanks for the fix. I found a work-around that works well for me: just
run f2py twice. 

The first run is to generate a signature file, using --include_paths
option with colon-separated list of include dirs.
The second run actually compiles the stuff, using multiple -I options
(one for each include dir).

What still puzzles me is how I should steer the choice of compiler, but
since that's a different topic, I'll start a new thread for that.

Best regards,
Marcel Loose.


On Tue, 2011-06-21 at 14:22 +0300, Pearu Peterson wrote:
> The fix is applied to numpy repo. See 
> https://github.com/numpy/numpy/commit/d82752c2
> 
> A general note: when using --include-paths option (for f2py
processing) 
> the you'll need to specify the corresponding include paths also via
> the -I options for compilation.
> 
> Best regards,
> Pearu
> 
> On 06/21/2011 01:59 PM, Pearu Peterson wrote:
> > Hi Marcel,
> > Thanks for the info. The issue is due to a bug in f2py and I have
> > created the corresponding ticket:
> >      http://projects.scipy.org/numpy/ticket/1874
> > The fix is easy, I'll commit it within 10min or so.
> >
> > Pearu
> >
> > On 06/21/2011 12:21 PM, Marcel Loose wrote:
> >> On Tue, 2011-06-21 at 11:46 +0300, Pearu Peterson wrote:
> >>>
> >>> On 06/21/2011 11:19 AM, Marcel Loose wrote:
> >>>> Hi all,
> >>>>
> >>>> I'm struggling with the following: I'm trying to build a Python
> >> module
> >>>> using f2py in "one go"; i.e. by using the options -c and -m.
> >> However,
> >>>> some of the Fortran sources include a file that is in a different
> >>>> directory.
> >>>>
> >>>> I've tried to specify an extra include directory using either
> >>>> '--include_paths' and '-I' anywhere on the command line, but it
just
> >>>> doesn't work.
> >>>>
> >>>> When using '--include_paths', I get both a warning and an error:
> >>>>
> >>>>            readfortrancode: could not find include file
> >> 'constants.inc'.
> >>>> Ignoring.
> >>>
> >>> What is the exact f2py command you are executing?
> >>> The message above means that f2py could not find the constants.inc
> >> file
> >>> within given include paths. The syntax for --include_paths reads:
> >>>
> >>>      --include_paths<path1>:<path2>:...
> >>>
> >>>>            :
> >>>>            :
> >>>>            error: unknown file type '' (from '--include_paths')
> >>>
> >>>> When using '-I', I only see the warning, so it seems that the
'-I'
> >>>> option is completely ignored by f2py.
> >>>
> >>> Indeed, f2py by itself does not use -I. The -I options are used
> >>> when compiling C and Fortran codes.
> >>>
> >>> HTH,
> >>> Pearu
> >>
> >> Hi Pearu,
> >>
> >> Here's the complete command:
> >>
> >> $ f2py -c -m _pytesselate pytess_simple.f pytess_roundness.f
> >> --include_paths ../../fBDSM/includes
> >>
> >> The file pytess_roundness.f does an include of "constants.inc".
> >> As you can see, the constants.inc file is present in the include
dir:
> >>
> >> $ ls -l ../../fBDSM/includes/constants.inc
> >> -rw-r--r-- 1 loose 500 294 2011-05-12 14:22
> >> ../../fBDSM/includes/constants.inc
> >>
> >> Best regards,
> >> Marcel Loose.
> >>
> >>
> >>
> >> _______________________________________________
> >> f2py-users mailing list
> >> f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
> >> http://cens.ioc.ee/mailman/listinfo/f2py-users
> >
> > _______________________________________________
> > f2py-users mailing list
> > f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
> > http://cens.ioc.ee/mailman/listinfo/f2py-users
> 
> _______________________________________________
> f2py-users mailing list
> f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
> http://cens.ioc.ee/mailman/listinfo/f2py-users