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" 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 = '' 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" 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.3"
ln -s libblas.so.3.0.3 "$out/lib/libblas.so" 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) ../$(LAPACKLIB): $(ALLOBJ) $(ALLXOBJ)
- $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) $(ALLXOBJ) - $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) $(ALLXOBJ)
+ $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) $(ALLXOBJ) -lblas + $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) $(ALLXOBJ) ${BLASLIB}
$(RANLIB) $@ $(RANLIB) $@
single: $(SLASRC) $(ALLAUX) $(SCLAUX) 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) \ ../../$(TMGLIB): $(SMATGEN) $(CMATGEN) $(SCATGEN) $(DMATGEN) \
$(ZMATGEN) $(DZATGEN) $(ZMATGEN) $(DZATGEN)
- $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) - $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ)
+ $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) -lblas + $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) ${BLASLIB}
$(RANLIB) $@ $(RANLIB) $@
single: $(SMATGEN) $(SCATGEN) single: $(SMATGEN) $(SCATGEN)

View File

@ -33,10 +33,30 @@ stdenv.mkDerivation {
buildPhase = '' buildPhase = ''
make clean make clean
make lib 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 = '' installPhase = ''
ensureDir "$out/lib" ensureDir "$out/lib"
install -m755 *.a* "$out/lib"
install -m755 *.so* "$out/lib" install -m755 *.so* "$out/lib"
ln -sf liblapack.so.3 "$out/lib/liblapack.so" ln -sf liblapack.so.3 "$out/lib/liblapack.so"
ln -sf libtmglib.so.3 "$out/lib/libtmglib.so" ln -sf libtmglib.so.3 "$out/lib/libtmglib.so"