Re: [Numpy-discussion] seeking help with f2py_options

2008-06-21 Thread Pearu Peterson
On Sat, June 21, 2008 3:28 pm, Helmut Rathgen wrote:
> Dear all,
>
> I am trying to write a setp.py based on numpy.distutils for a mixed
> python/fortran90 package.
>
> I'd like to specify the fortran compiler, such as the path to the
> compiler, compiler flags, etc. in setup.py.
>
> I seemed to understand that this should be done by passing 'f2py_options
> = [ "...", "..." ]' to numpy.distutils.core.Extension()
>
> However, I get errors such as
>
> [EMAIL PROTECTED]:~/src/testdistutils$ python setup.py build
> running build
> running scons
> customize UnixCCompiler
> Found executable /usr/bin/gcc
> customize GnuFCompiler
> Could not locate executable g77
> Could not locate executable f77
> customize IntelFCompiler
> Found executable /opt/intel/fc/10.0.026/bin/ifort
> customize IntelFCompiler
> customize UnixCCompiler
> customize UnixCCompiler using scons
> running config_cc
> unifing config_cc, config, build_clib, build_ext, build commands
> --compiler options
> running config_fc
> unifing config_fc, config, build_clib, build_ext, build commands
> --fcompiler options
> running build_src
> building extension "mrcwaf" sources
> f2py options: ['--fcompiler=intel',
> '--f90exec=/opt/intel/fc/10.0.026/bin/ifort', '--opt="-O3 -xW -ipo"',
> '--noarch']
> f2py: src/mrcwaf/mrcwaf.pyf
> Unknown option '--fcompiler=intel'
>
>
> How to use f2py_options - or should flags be passed in a different way?
>

Note that --fcompiler= and other such options are actually options
to numpy.distutils (f2py script would just pass these options
forward to numpy.distutils). f2py_options can contain only f2py
specific options.
Hence you should try to modify sys.path
in the beggining of the setup.py file to specify the fortran
compiler options. For example, in setup.py file, insert:

import sys
sys.path.extend('config_fc --fcompiler=intel '.split())

See
  python setup.py config_fc --help
  python setup.py build_ext --help
for more information about possible options.

HTH,
Pearu

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] seeking help with f2py_options

2008-06-21 Thread Helmut Rathgen
Dear all,

I am trying to write a setp.py based on numpy.distutils for a mixed 
python/fortran90 package.

I'd like to specify the fortran compiler, such as the path to the 
compiler, compiler flags, etc. in setup.py.

I seemed to understand that this should be done by passing 'f2py_options 
= [ "...", "..." ]' to numpy.distutils.core.Extension()

However, I get errors such as

[EMAIL PROTECTED]:~/src/testdistutils$ python setup.py build
running build
running scons
customize UnixCCompiler
Found executable /usr/bin/gcc
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelFCompiler
Found executable /opt/intel/fc/10.0.026/bin/ifort
customize IntelFCompiler
customize UnixCCompiler
customize UnixCCompiler using scons
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands 
--compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands 
--fcompiler options
running build_src
building extension "mrcwaf" sources
f2py options: ['--fcompiler=intel', 
'--f90exec=/opt/intel/fc/10.0.026/bin/ifort', '--opt="-O3 -xW -ipo"', 
'--noarch']
f2py: src/mrcwaf/mrcwaf.pyf
Unknown option '--fcompiler=intel'


How to use f2py_options - or should flags be passed in a different way?

Any help is greatly appreciated!

Thank you in advance!

Kind Regards,

Helmut Rathgen


-- 
Dipl. Phys. Helmut Rathgen
Physics of Complex Fluids | Faculty of Science and Technology
University of Twente | Postbus 217 | 7500 AE Enschede | The Netherlands
office +31 (0)53 489 3093   home +31 (0)53 478 2346
fax+31 (0)53 489 1096   cell +31 (0)61 645 8938
sipsip:[EMAIL PROTECTED]
http://pcf.tnw.utwente.nl/people/phd_students/h_rathgen_helmut.doc/
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion