3
0
Fork 0
forked from mirrors/nixpkgs

compile static libraries for blas and lapack

svn path=/nixpkgs/trunk/; revision=22549
This commit is contained in:
David Guibert 2010-07-09 13:15:56 +00:00
parent 9e8da1fa0c
commit 3563194637
3 changed files with 32 additions and 2 deletions

View file

@ -24,7 +24,17 @@ stdenv.mkDerivation {
echo >>make.inc "BLASLIB = libblas.so.3.0.3"
'';
buildPhase = ''
make
echo >>make.inc "ARCHFLAGS = "
echo >>make.inc "BLASLIB = libblas.a"
echo >>make.inc "ARCH = ar rcs"
echo >>make.inc "RANLIB = ranlib"
make
'';
installPhase = ''
install -D -m755 libblas.a "$out/lib/libblas.a"
install -D -m755 libblas.so.3.0.3 "$out/lib/libblas.so.3.0.3"
ln -s libblas.so.3.0.3 "$out/lib/libblas.so.3"
ln -s libblas.so.3.0.3 "$out/lib/libblas.so"

View file

@ -6,7 +6,7 @@ diff -Naur lapack-3.2.old/SRC/Makefile lapack-3.2/SRC/Makefile
../$(LAPACKLIB): $(ALLOBJ) $(ALLXOBJ)
- $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) $(ALLXOBJ)
+ $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) $(ALLXOBJ) -lblas
+ $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) $(ALLXOBJ) ${BLASLIB}
$(RANLIB) $@
single: $(SLASRC) $(ALLAUX) $(SCLAUX)
@ -18,7 +18,7 @@ diff -Naur lapack-3.2.old/TESTING/MATGEN/Makefile lapack-3.2/TESTING/MATGEN/Make
../../$(TMGLIB): $(SMATGEN) $(CMATGEN) $(SCATGEN) $(DMATGEN) \
$(ZMATGEN) $(DZATGEN)
- $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ)
+ $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) -lblas
+ $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) ${BLASLIB}
$(RANLIB) $@
single: $(SMATGEN) $(SCATGEN)

View file

@ -33,10 +33,30 @@ stdenv.mkDerivation {
buildPhase = ''
make clean
make lib
echo >make.inc "SHELL = ${stdenv.shell}"
echo >>make.inc "PLAT ="
echo >>make.inc "FORTRAN = gfortran"
echo >>make.inc "OPTS = -O2 -fPIC"
echo >>make.inc "DRVOPTS = \$(OPTS)"
echo >>make.inc "NOOPT = -O0 -fPIC"
echo >>make.inc "LOADER = gfortran"
echo >>make.inc "LOADOPTS = "
echo >>make.inc "TIMER = INT_ETIME"
echo >>make.inc "ARCH = ar rcs"
echo >>make.inc "RANLIB = ranlib"
echo >>make.inc "BLASLIB = "
echo >>make.inc "ARCHFLAGS ="
echo >>make.inc "LAPACKLIB = liblapack.a"
echo >>make.inc "TMGLIB = tmglib.a"
echo >>make.inc "EIGSRCLIB = eigsrc.a"
echo >>make.inc "LINSRCLIB = linsrc.a"
make clean
make lib
'';
installPhase = ''
ensureDir "$out/lib"
install -m755 *.a* "$out/lib"
install -m755 *.so* "$out/lib"
ln -sf liblapack.so.3 "$out/lib/liblapack.so"
ln -sf libtmglib.so.3 "$out/lib/libtmglib.so"