Rice University logo
 
Top blue bar image Kiran Thyagaraja
Brain Dump
 

Archive for March, 2011

Creating a Shared Library from a Static Archive

Wednesday, March 9th, 2011
ar -x libatlas.a
gcc -fPIC -shared *.o -o libatlas.so

If you encounter an error with the linker that refers to multiple definitions of a function then pass the following option to the linker:

gcc -Xlinker -fPIC -shared *.o -o libatlas.so

Build ATLAS on Linux

Wednesday, March 9th, 2011
  1. Get the latest version of ATLAS from: http://sourceforge.net/projects/math-atlas
  2. Untar and get into the source directory.
  3. Follow these steps:
mkdir BUILD
cd BUILD
../configure -b 64 -Fa alg -fPIC --with-netlib-lapack-tarfile=<path to lapack.tgz> --prefix=/home/sam/local
make
cd lib
make shared
make ptshared
cd ..
make install