[SciPy-User] NumPy error

nitin chandra nitinchandra1 at gmail.com
Mon Oct 5 15:26:29 EDT 2009


Hello Everyone,

I have a System Configured with P4 1.8GHz, 256 DDR RAM, 80 GB HDD PATA
which has FC10 with the default kernel 2.6.27 installed.

I have Installed following from source / tar.gz / gz files in /opt/<software>

I Installed Python 2.6.2, LAPACK-3.2.1, XBLAS-1.0.248, ATLAS-3.9.14 (
Linux_P4ESSE2 ), FFTW-3.2.2, nose-0.11.1,

Stuck at NumPy-1.3.0rc2 and will install Scipy next. I created various
Log file duing the process of './configure' or 'make'

Attached is a file with various parameters given during installation.

my lapack_LINUX.a = liblapack.a = 15MB

( I have already spent 3 weeks, to this point.... desperatly need some
guidance / help ... and let me know where am i going wrong ) .

TIA

Nitin

I am getting the following error :-

ERRORS


[root at mi newpy]# python
Python 2.6.2 (r262:71600, Sep 28 2009, 21:33:37)
[GCC 4.3.2 20081105 (Red Hat 4.3.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/python262/lib/python2.6/site-packages/numpy/__init__.py",
line 130, in <module>
    import add_newdocs
  File "/opt/python262/lib/python2.6/site-packages/numpy/add_newdocs.py",
line 9, in <module>
    from lib import add_newdoc
  File "/opt/python262/lib/python2.6/site-packages/numpy/lib/__init__.py",
line 13, in <module>
    from polynomial import *
  File "/opt/python262/lib/python2.6/site-packages/numpy/lib/polynomial.py",
line 18, in <module>
    from numpy.linalg import eigvals, lstsq
  File "/opt/python262/lib/python2.6/site-packages/numpy/linalg/__init__.py",
line 47, in <module>
    from linalg import *
  File "/opt/python262/lib/python2.6/site-packages/numpy/linalg/linalg.py",
line 22, in <module>
    from numpy.linalg import lapack_lite
ImportError: /opt/atlas/lib/liblapack.so: undefined symbol: blas_zhemv2_x_
>>>
[1]+  Stopped                 /opt/python262/bin/python
[root at mi newpy]# cat ~/.bash_profile
-------------- next part --------------





===========================================================================================================

INSTALLING FFTW

;;;this is for double precision

#./configure --prefix=/opt/fftw332 --enable-shared --enable-threads --enable-sse2 --enable-portable-binary

#make

#make install

RUN THE ./configure 2nd TIME
;;;This is for single precesion

#./configure --prefix=/opt/fftw332 --enable-shared --enable-threads --enable-sse --enable-portable-binary \
--enable-float

#make >make.log

#make install >make.install.log


============================================================================================================
XBLAS.tar.gz INSTALLAITON

# tar zxvf xblas.tar.gz

# cd xblas-1.0.248

# autoconf

# CC=gcc FC=gfortran ./configure --prefix=/opt/xblas 

# m4 Makefile.m4 >Makefile

# make makefiles > makefiles.log

# make > make.log

To UNINSTALL

# make clean

============================================================================================================
LAPACK-3.2.0 INSTALLATION

#tar zxvf lapack.tgz

#cd lapack-3.2.1

#cp INSTALL/make.inc.gfortran make.inc


          >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
IMPORTANT :-
INSTALL ATLAS IN A BOGUS/TEMP DIR, WHICH YOU WILL DELETE AFTER DOING THE FOLLOWING:
"BOGUS INSTALL"

# tar zxvf atlas3.9.14.tar.bz2

# mv ATLAS ATLAS_tmp

# cd ATLAS_tmp

# /home/nitin/newpy/ATLAS-3.9.14/configure -Si cputhrchk 0 -b 32 -D c -DPentiumP4=1790 \
--dylibs -Fa alg -fPIC

           <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

AFTER RUNNING THE ./configure (above), THIS WILL MAKE A make.inc FILE


EDIT LAPACK/make.inc : COPY from ATLAS_tmp (./configure creates) make.inc


SEARCH FOR THE FOLLOWING LINE AND Copy after = 

    F77FLAGS = -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -fPIC -m32 -fPIC



PASTE into LAPACK/make.inc OPT= :


FORTRAN = gfortran -fimplicit-none -g
OPTS    = -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -fPIC -m32 -fPIC
DRVOPTS = $(OPTS)
NOOPT   = -fomit-frame-pointer -mfpmath=387 -m32
LOADER  = gfortran -g
LOADOPTS= $(OPTS)


further down Un-Commnet the lines and add the path:


USEXBLAS    = Yes
XBLASLIB    = /home/nitin/newpy/xblas-1.0.248/libxblas.a
#XBLASLIB    = -lxblas


save and exit


#joe Makefile (nano/pico/vi)

edit 

  all: lapack_install lib lapack_testing blas_testing

save and exit

# make blaslib > blaslib.log

# make > make.log

# cp lapack_LINUX.a liblapack.a

# cp liblapack.a /home/nitin/newpy/Linux_P4ESSE2/lib/. (Overwrite? y)
;;; this liblapack.a = lapack_LINUX.a = 15MB approx (at least more than 6MB)


The following is in Makefile

   all:lapack_install lib lapack_testing blas_testing ;;; for the time being 
                                                      ;;; removed 'testing' & 
                                                      ;;; 'timing'


{{{

OR 
# ld -o /opt/atlas/lib/liblapack.so -shared --whole-archive\
--export-dynamic /home/nitin/newpy/lapack-3.2.1/liblapack.a

}}}


# rm -Rf ATLAS_tmp/


TO UNINSTALL 

[ LAPACK ]#rm -vfr lapack_LINUX.a blas_LINUX.a tmglib_LINUX.a lapacklib.a

# make clean

==========================================================================================

ATLAS INSTALLATIONS INSTRUCTIONS

# tar jxvf atlas-3.9.14.tar.bz2


;;;Rename ATLAS direcotry to ATLAS-3.9.14

# mv ATLAS ATLAS-3.9.14  ;;; Rename the directory, convineant

;;; Turn off CPU throttling when installing ATLAS ,  Fedora 

# /usr/bin/cpufreq-selector -g performance

;;; On my Core2Duo, cpufreq-selector only changes the parameters of the first CPU, 
;;; regardless of which cpu you specify. I suspect this is a bug, because on earlier 
;;; systems, the remaining CPUs were controlled via a logical link to 
;;; /sys/devices/system/cpu/cpu0/. In this case, the only way I found to force the 
;;; second processor to also run at its peak frequency was to issue the following as 
;;; root after setting CPU0 to performance: 

 
   cp /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor \
      /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor


# cd .. (one up dir)  ;;; Out of ATLAS-3.9.14 dir
/home/nitin/newpy

# mkdir Linux_P4ESSE2 ;;; Make a new dir Or as.... Linux_C2D64SSE3 (Core2Duo)


# /home/nitin/newpy/ATLAS-3.9.14/configure --with-netlib-lapack=/home/nitin/newpy/lapack-3.2.1/lapack_LINUX.a\
--dylibs -b 32 -D c -DPentiumP4=1790 --prefix=/opt/atlas -Ss flapack=/home/nitin/newpy/lapack-3.2.1/SRC\
 -Fa alg -fPIC -Si cputhrchk 0 > config.log

;;; takes a good amount of an hour ...frankly depending on your machine config.

# make check > check.log

# make time > time.log

# make install > install.log

[Linux_P4ESSE2]# cd lib

# make shared > shared.log

# cp -f *.so /opt/atlas/lib/.

# cd ..

[Linux_P4ESSE2]# cd bin

# make xdlutst_dyn >xdlutst.log


( export ATLAS=/usr/local/lib/atlas )


UNINSTALL 

[Linux_P4ESSE2]# make clean


=====================================================================================

INSTALLING nose

#tar zxvf nose-0.11.1.tar.tar

# cd nose-0.11.1

#/opt/python262/bin/python setup.py install --prefix=/opt/python262 2>&1 | tee nose.log


=====================================================================================
INSTALLING numpy

# tar zxvf numpy-1.2.1.tar.gz

# cd numpy-1.2.1

# cp site.cfg.example site.cfg

# joe site.cfg

[DEFAULT]
library_dirs = /usr/local/lib:/opt/atlas/lib:/opt/fftw332/lib:/opt/python262/lib
include_dirs = /usr/local/include:/opt/atlas/include:/opt/fftw332/include:/opt/python262/include

[blas_opt]
libraries = f77blas, cblas, atlas

[lapack_opt]
libraries = lapack, f77blas, cblas, atlas, g2c

[fftw]
libraries = fftw3, fftw3f

[fftw_opt]
libraries = fftw3_threads, fftw3f_threads

SAVE and EXIT


# /opt/python262/bin/python setup.py -v config_fc build_ext --fcompiler=gnu95 build | tee build.log


# /opt/python262/bin/python setup.py install --prefix=/opt/python262 2>&1 | tee install.log


# source ~/.bashrc

TO UN-INSTALL numpy

Remove dir 'build'

Remove /opt/python262/lib/python2.6/site-packages/numpy-*.egg

and 

Remove -rvf /opt/python262/lib/python2.6/site-packages/numpy/  ;;; numpy/ direcotry


================================================================================

INSTALLING SciPy

/home/nitin/newpy/scipy-0.7.1.tar.gz

# tar zxvf scipy-0.7.1.tar.gz

# cd scipy-0.7.1

# 




XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



ERRORS 


[root at mi newpy]# python
Python 2.6.2 (r262:71600, Sep 28 2009, 21:33:37)
[GCC 4.3.2 20081105 (Red Hat 4.3.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/python262/lib/python2.6/site-packages/numpy/__init__.py", line 130, in <module>
    import add_newdocs
  File "/opt/python262/lib/python2.6/site-packages/numpy/add_newdocs.py", line 9, in <module>
    from lib import add_newdoc
  File "/opt/python262/lib/python2.6/site-packages/numpy/lib/__init__.py", line 13, in <module>
    from polynomial import *
  File "/opt/python262/lib/python2.6/site-packages/numpy/lib/polynomial.py", line 18, in <module>
    from numpy.linalg import eigvals, lstsq
  File "/opt/python262/lib/python2.6/site-packages/numpy/linalg/__init__.py", line 47, in <module>
    from linalg import *
  File "/opt/python262/lib/python2.6/site-packages/numpy/linalg/linalg.py", line 22, in <module>
    from numpy.linalg import lapack_lite
ImportError: /opt/atlas/lib/liblapack.so: undefined symbol: blas_zhemv2_x_
>>>
[1]+  Stopped                 /opt/python262/bin/python
[root at mi newpy]# cat ~/.bash_profile


More information about the SciPy-User mailing list