473,389 Members | 1,073 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,389 software developers and data experts.

Installing ATLAS and LAPACK


The following is a first attempt to almost create a shell script for
installation of ATLAS and LAPACK. It does not work right now and it is
specific to a particular platform. It is posted here to archive it and
throw into the public domain, maybe others will find it useful. It is
at least a documentation of some relevant notes on the procedure.
Corrections and updates would be really appreciated. Alternatives to
automate this process also welcome, but not rpm (unless it can be
demonstrated that an rpm installation achieves an equivalent optimized
blas to a full compilation). Also, advice about integrating this with
compilation of python and numeric python libraries much appreciated
too, particularly the definition of some commonly accepted paths for
the library installation, so that all python compilation can link the
libraries without having to modify their configure scripts.
################################################## #####

For background about creating and using libraries with linux, see

http://www.gnu.org/software/libtool/libtool.html

http://www.dwheeler.com/program-library
http://www.faqs.org/docs/Linux-HOWTO...ary-HOWTO.html
http://www.ibiblio.org/pub/Linux/doc...ary-HOWTO.html

"In theory, code in static ELF libraries that is linked into an
executable should run slightly faster (by 1-5%) than a shared library
or a dynamically loaded library, but in practice this rarely seems to
be the case due to other confounding factors."
Locations for installation (from Program-Library-HOWTO):

3.1.2. Filesystem Placement

Shared libraries must be placed somewhere in the filesystem. Most open
source software tends to follow the GNU standards; for more information
see the info file documentation at info:standards#Directory_Variables.
The GNU standards recommend installing by default all libraries in
/usr/local/lib when distributing source code (and all commands should
go into /usr/local/bin). They also define the convention for overriding
these defaults and for invoking the installation routines.

The Filesystem Hierarchy Standard (FHS) discusses what should go where
in a distribution (see http://www.pathname.com/fhs). According to the
FHS, most libraries should be installed in /usr/lib, but libraries
required for startup should be in /lib and libraries that are not part
of the system should be in /usr/local/lib.

There isn't really a conflict between these two documents; the GNU
standards recommend the default for developers of source code, while
the FHS recommends the default for distributors (who selectively
override the source code defaults, usually via the system's package
management system). In practice this works nicely: the ``latest''
(possibly buggy!) source code that you download automatically installs
itself in the ``local'' directory (/usr/local), and once that code has
matured the package managers can trivially override the default to
place the code in the standard place for distributions. Note that if
your library calls programs that can only be called via libraries, you
should place those programs in /usr/local/libexec (which becomes
/usr/libexec in a distribution). One complication is that Red
Hat-derived systems don't include /usr/local/lib by default in their
search for libraries; see the discussion below about /etc/ld.so.conf.
Other standard library locations include /usr/X11R6/lib for X-windows.
Note that /lib/security is used for PAM modules, but those are usually
loaded as DL libraries (also discussed below).

....
3.2. How Libraries are Used
....
The list of directories to be searched is stored in the file
/etc/ld.so.conf. Many Red Hat-derived distributions don't normally
include /usr/local/lib in the file /etc/ld.so.conf. I consider this a
bug, and adding /usr/local/lib to /etc/ld.so.conf is a common ``fix''
required to run many programs on Red Hat-derived systems.
################################################## #####
# A. ATLAS INSTALLATION

1. download and extract ATLAS source, eg

cd /usr/local/src/
tar zxvf atlas3.6.0.tar.gz
cd ATLAS

#2. follow the INSTALL.txt instructions to build it and test ATLAS

../configure
make

#3. if successful, copy atlas files into common system locations, eg

mkdir -p /usr/local/lib/atlas
cp lib/Linux_P4SSE2/* /usr/local/lib/atlas/
chmod +x /usr/local/lib/atlas/lib*

mkdir -p /usr/local/include/atlas
cp include/Linux_P4SSE2/* /usr/local/include/atlas/
################################################## #####
# B. LAPACK INSTALLATION
#
#1. download and extract LAPACK source

cd /usr/local/src/
tar zxvf lapack.tgz
cd LAPACK

#2. make LAPACK with all defaults

cp INSTALL/make.inc.$PLATFORM make.inc
make

#(On my fedora core 3 system, the timing failed)

#3. if successful, install the default lapack

mkdir -p /usr/local/lib/lapack
cp lapack_LINUX.a /usr/local/lib/lapack/liblapack.a
cp blas_LINUX.a /usr/local/lib/lapack/libf77blas.a
################################################## #####
# C. compile LAPACK for ATLAS
#
#1. prepare LAPACK for recompilation

make clean
cp Makefile Makefile.backup

#3. remove all blas* entries from the Makefile all: and lib: entries

echo ""
echo " remove all blas* entries from the Makefile all: and lib:
entries"
echo ""
cat Makefile | sed s/blaslib// | sed s/blas_testing// | sed
s/blas_timing// > tmp.txt
mv -f tmp.txt Makefile

#4. edit make.inc, this is the tricky part!
#
#WRT, the BLASLIB entry of make.inc:
#
#BLASLIB here is just for testing purpose. We are not
#creating a combined LAPACK/BLAS library. They are kept
#separate. BLASLIB is the BLAS library with which you
#want to test LAPACK.
#
#When you type 'make', the installation of LAPACK begins.
#It consists of constucting the LAPACK library.
#
#LAPACK is Fortran code so you need the Fortran BLAS interface to
ATLAS:
#-L/usr/local/src/ATLAS/lib/Linux_P4SSE2 -lf77blas -latlas
#(ie, there is no requirement for the libcblas.a)
#
#To test LAPACK with the ATLAS BLAS, set:
#
#BLASLIB = -L/usr/local/src/ATLAS/lib/Linux_P4SSE2/ -lf77blas -latlas
#
#or (given standardized installation location suggested above)
#
#BLASLIB = -L/usr/local/lib/atlas/ -lf77blas -latlas
#
#When testing LAPACK with ATLAS-BLAS:
#!!!!make sure there is no -fno-f2c options!!!!
#in the option of compilation of LAPACK (see in make.inc).
#
#When done,

cp INSTALL/make.inc.LINUX make.inc
oldlib=`cat make.inc | grep BLASLIB | sed s#/#.#g`
newlib="BLASLIB = -L/usr/local/lib/atlas/ -lf77blas -latlas"
cat make.inc | sed s/$oldlib/$newlib/
cp make.inc make.inc.atlas

#5. recompile LAPACK (see the Makefile for options)

make install
make lib

################################################## #####
# D. INTEGRATE LAPACK with ATLAS INSTALLATION
#
#1. Combine the lapack_LINUX.a from the last lapack
#build with the previous optimized ATLAS
#liblapack.a, according to this web page:
#
#http://math-atlas.sourceforge.net/er...tml#completelp
#
#ATLAS provides optimized versions for 10 LAPACK driver routines:
#[S,D,C,Z]GESV [S,D,C,Z]GETRF [S,D,C,Z]GETRS [S,D,C,Z]GETRI
[S,D,C,Z]TRTRI
#[S,D,C,Z]POSV [S,D,C,Z]POTRF [S,D,C,Z]POTRS [S,D,C,Z]POTRI
[S,D,C,Z]LAUUM
#You have no reason not to use them.
#
#So,

cd /usr/local/src/ATLAS/lib/Linux_P4SSE2/
mkdir tmp
cd tmp
ar x /usr/local/src/ATLAS/lib/Linux_P4SSE2/liblapack.a
cp /usr/local/src/LAPACK/lapack_LINUX.a libcombinedlapack.a
ar r libcombinedlapack.a *.o

#2. install the combined lapack library, eg:

cp libcombinedlapack.a /usr/local/lib/atlas/
cp libcombinedlapack.a ..
cd ..
rm -rf tmp

#3. Update the system?
#
#ln -s /usr/local/lib/atlas/libcombinedlapack.a /lib/liblapack.a
#
#If, for some reason, you build a shared library, run
#ldconfig to update symbolic links and the cache in
#/etc/ld.so.cache

################################################## #
# Using the library

#A last remark: remember that LAPACK needs libf77blas.a and
#LAPACK from ATLAS needs libcblas.a; so now the new liblapack.a
#will need both. When linking programs, this looks like:
#
#-lcombinedlapack -lcblas -lf77blas -latlas
#
#
#Acknowledgement: Some very helpful comments above were
#provided by Julie Langou at cs utk edu

Nov 6 '05 #1
0 2435

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: drife | last post by:
Hello, Could someone please provide instructions for install Numeric with ATLAS and LAPACK? I've actually done this correctly, I think. But I don't see any difference in the speed. I'm...
4
by: Chris Weisiger | last post by:
I'm trying to install numeric on my MacOS X box using Darwin, with the eventual goal of satisfying all of PyGame's dependencies so I can finally start working on my semester project. I would be...
1
by: pervinder | last post by:
Hi, I am building a c++ executable which uses fortan math libs. blas, lapack etc. But when i build this on HP-UX, i get below linker errors while it build without anyissues on Sun and Linux...
0
by: Darren L. Weber | last post by:
The following is a first attempt to almost create a shell script for installation of ATLAS and LAPACK. It does not work right now and it is specific to a particular platform. It is posted here to...
3
by: eri | last post by:
Hi all I need to convert a Fortran program I wrote some months ago. I need BLAS / LAPACK routines and it seems to be very difficult to make it work under Win + MingW32 + DevCPP; so I wonder if...
7
by: taoyangsjtu | last post by:
Dear friends, Now, I have just installed the system with full fedora core 4. I had to use lapack, but I don't know how to install and use it. Can anybody tell me the installation process in...
1
by: Ken Dere | last post by:
I am trying to install numpy-0.9.8 prior to installing scipy (0.4.9) on a machine running Suse 10.0 with Python 2.4 I am able to get numpy installed to the point when I import it I can do the...
2
by: aberte | last post by:
Hi, i'm learning how to use lapack library (in particular, Intel MKL). I wish to know how I have to format the my inputs. I'm calling lapack functions from c++ (zhetri, zhemm, zgemm, zhseqr,...
1
by: Preben | last post by:
Hi, don't know if this is the correct group, but try anyway. I would like to use boostbindings from the boost sandbox together with my project where I use boost::numeric::ublas vectors and...
1
by: 1960_j | last post by:
I have tried to install numpy and scipy on python 5.2. Using gcc 2.95.3, lapack 3.1.1 and ATLAS 3.6.0. When installin numpy it seems to work but when I try to run test get error no test for numpy....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.