[SciPy-user] Telling setup.py where to find stuff

Robert Kern robert.kern at gmail.com
Wed Feb 15 10:25:36 CST 2006

Bill Dandreta wrote:
> Otto Maddox wrote:
>>I'm having a few troubles getting SciPy built, mostly due to mixing and
>>matching compilers out of necessity.
>>I installed Python 2.4.2 from source using Apple's GCC 4. Then, to get
>>g77, installed GCC 3.4.5 from source into /opt/local/gcc34 (normally not
>>in my PATH).
>>Numpy 0.9.4 seemed to install fine by doing
>>F77=/opt/local/gcc34/bin/g77 python setup.py install

Since numpy doesn't have any FORTRAN code, we don't expect setting the FORTRAN
compiler to have any effect.

>>The problem is that the same thing doesn't work for getting SciPy's
>>setup.py to find g77.

We don't use environment variables to determine the compiler executable.
numpy.distutils needs more information to determine the appropriate flags.

$ python setup.py config_fc --fcompiler=gnu --f77exec=/opt/local/gcc34/bin/g77

[All on one line, of course.]

>> Also, I do not know how to tell it where my fftw
>>lives (under /opt/local/lib, /opt/local/include).
>>Does anybody have any advice, please?
> Try:
> PATH=$PATH:/opt/local/lib:/opt/local/include
> export PATH

I'm pretty sure numpy.distutils won't check the PATH variable (which is meant
for executables) for library and header paths.

You can pass -L and -I arguments to build_clib and build_ext. Or you can set the
FFTW environment variable to /opt/local . Or you can create a site.cfg file in
numpy/distutils/ directory in the source[1]; see the file
numpy/distutils/system_info.py for an example.

[1] Are we still using this location? Why aren't we looking in os.getcwd()? Are
we ever not in the root of the source tree when site.cfg is supposed to be read?

Robert Kern
robert.kern at gmail.com

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter

More information about the SciPy-user mailing list