listservs | 10 Jul 20:27 2006
Picon

[f2py] f2py extensions using setuptools


Is there any documentation on building f2py extensions using  
setuptools? I am trying to put together binaries for a package that  
uses f2py using setuptools, but the extensions dont seem to work. The  
do not seem to recognize fortran files.

Thanks for any help,
Chris
--
Christopher Fonnesbeck
+ Atlanta, GA
+ fonnesbeck at mac.com
+ Contact me on AOL IM using email address

Robert Kern | 10 Jul 20:34 2006
Picon

Re: [f2py] f2py extensions using setuptools

listservs@... wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Is there any documentation on building f2py extensions using setuptools? 
> I am trying to put together binaries for a package that uses f2py using 
> setuptools, but the extensions dont seem to work. The do not seem to 
> recognize fortran files.

You will have to use numpy.distutils; nothing else gives distutils the 
capability to compile Fortran. It works just fine with setuptools, though. Just 
import setuptools before you import stuff from numpy.distutils, and most things 
should work fine.

--

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco
listservs | 11 Jul 17:58 2006
Picon

Re: [f2py] f2py extensions using setuptools


On Jul 10, 2006, at 2:34 PM, Robert Kern wrote:

> listservs@... wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> Is there any documentation on building f2py extensions using  
>> setuptools? I am trying to put together binaries for a package  
>> that uses f2py using setuptools, but the extensions dont seem to  
>> work. The do not seem to recognize fortran files.
>
> You will have to use numpy.distutils; nothing else gives distutils  
> the capability to compile Fortran. It works just fine with  
> setuptools, though. Just import setuptools before you import stuff  
> from numpy.distutils, and most things should work fine.

Thanks for your help, Robert. If I follow you correctly, by setup.py  
should look like this:

#/usr/bin/env python
from setuptools import setup
from numpy.distutils.core import Extension

flib = Extension(name='PyMC.flib',sources=['PyMC/flib.f'])
version = "1.0"

distrib = setup(
	version=version,
	author="Chris Fonnesbeck",
	author_email="fonnesbeck@...",
(Continue reading)

Robert Kern | 11 Jul 18:11 2006
Picon

Re: [f2py] f2py extensions using setuptools

listservs@... wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Jul 10, 2006, at 2:34 PM, Robert Kern wrote:
> 
>> listservs@... wrote:
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>> Is there any documentation on building f2py extensions using 
>>> setuptools? I am trying to put together binaries for a package that 
>>> uses f2py using setuptools, but the extensions dont seem to work. The 
>>> do not seem to recognize fortran files.
>>
>> You will have to use numpy.distutils; nothing else gives distutils the 
>> capability to compile Fortran. It works just fine with setuptools, 
>> though. Just import setuptools before you import stuff from 
>> numpy.distutils, and most things should work fine.
> 
> Thanks for your help, Robert. If I follow you correctly, by setup.py 
> should look like this:
> 
> #/usr/bin/env python
> from setuptools import setup
> from numpy.distutils.core import Extension

No, it should look exactly like any other numpy.distutils setup script except 
that you have "import setuptools" before anything else. You do not need to 
import anything *from* setuptools; it just has to be present. You must use the 
setup() from numpy.distutils.core.
(Continue reading)


Gmane