[SciPy-dev] Compilation problems (and solutions...) on HP-UX B.11.00

Nicolas Pernetty nicopernetty at yahoo.fr
Fri May 6 08:01:35 CDT 2005


Hello,

I've just almost managed to get scipy 0.3.2 compiled, up and running on
HP-UX B.11.00 and here are some issues I had to deal with :

1) There should be some way to choose the fortran 77 compilers instead
of manually editing the .py files, but maybe there is an environment
flag I'm not aware of ?

2) ./Lib/xplt/src/play/unix/fpuset.c had to be modified in order to have
it compiled correctly on HP-UX :

****************************************************************
#elif defined(FPU_HPUX)

/* man pages: fpsetmask
 * library: -lm */
/* HPUX turns off FP_X_* without this (_INCLUDE_HPUX_SOURCE) */
#ifndef _HPUX_SOURCE
#define _HPUX_SOURCE 1
#endif
#include <math.h>
void u_fpu_setup(void)
{
  fpsetmask(FP_X_INV | FP_X_DZ | FP_X_OFL);  /* 0x1c */
  fpsetfastmode(1);    /* fast underflows */
}
****************************************************************

has to be replaced by

****************************************************************
#elif defined(FPU_HPUX)

/* man pages: fpsetmask
 * library: -lm */
/* HPUX turns off FP_X_* without this (_INCLUDE_HPUX_SOURCE) */
#ifndef _HPUX_SOURCE
#define _HPUX_SOURCE 1
#endif
#include <fenv.h>
void
u_fpu_setup(int when)
{
  if (when <= 0) {
    fesettrapenable(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
  }
}
****************************************************************

3) In addtion to 2), you have to add math library '-lm' in order to
compile fpuset.c.
I solved it by editing  ./Lib/xplt/config_pygist.py and replace the line
297:
elif self.try_link("#define FPU_HPUX\n"+testcode,
by
elif self.try_link("#define
FPU_HPUX\n"+testcode,libraries=[self.mathlib],

4) I had a "Bus Error (core dumped)" when calling the gamma.c function
in  ./Lib/special/cephes/gamma.c during the test scipy.test(level=1)
It seems that the global variable P and Q are incorrectly defined, so I
decided to use decimal configuration and add at the top of the file :
#undef MIEEE
#define UNK
It seems to take care of the problem and I had no more errors when
calling scipy.test(level=1)

5) When calling :
python
import scipy
scipy.test(level=1, verbosity=2)

The computer gets locked, it seems to get stuck in an infinite loop. I
have to manually kill the python process

But If I type :
python -v
import scipy
scipy.test(level=1, verbosity=2)

thus having displayed all the imported modules, everything goes fine !
All tests gets tested and are ok...

Don't know if it's a python problem or a scipy problem though...

6) Can you add to the INSTALL.txt file that in order to get scipy
find the fftw and ATLAS libraries you have to use an environment var
locating both the libraries AND the headers ?
I spent more than an hour before understanding that I have to use
export ATLAS=/usr/local/lib/atlas:/usr/local/include/atlas
instead of just
export ATLAS=/usr/local/lib/atlas

Hope that all this will help others and this great piece of software !

Regards,




More information about the Scipy-dev mailing list