diff options
Diffstat (limited to 'academic/suitesparse/suitesparse.SlackBuild')
-rw-r--r-- | academic/suitesparse/suitesparse.SlackBuild | 239 |
1 files changed, 14 insertions, 225 deletions
diff --git a/academic/suitesparse/suitesparse.SlackBuild b/academic/suitesparse/suitesparse.SlackBuild index 9750a951ef..e7948ba7e6 100644 --- a/academic/suitesparse/suitesparse.SlackBuild +++ b/academic/suitesparse/suitesparse.SlackBuild @@ -5,7 +5,7 @@ # Written by Pablo Santamaria (pablosantamaria@gmail.com) PRGNAM=suitesparse -VERSION=${VERSION:-3.4.0} +VERSION=${VERSION:-4.0.2} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -38,31 +38,6 @@ else LIBDIRSUFFIX="" fi -amd_version=2.2.0 -amd_version_major=2 -btf_version=1.1.0 -btf_version_major=1 -camd_version=2.2.0 -camd_version_major=2 -ccolamd_version=2.7.1 -ccolamd_version_major=2 -cholmod_version=1.7.1 -cholmod_version_major=1 -colamd_version=2.7.1 -colamd_version_major=2 -csparse_version=2.2.3 -csparse_version_major=2 -cxsparse_version=2.2.3 -cxsparse_version_major=2 -klu_version=1.1.0 -klu_version_major=1 -ldl_version=2.0.1 -ldl_version_major=2 -umfpack_version=5.4.0 -umfpack_version_major=5 -spqr_version=1.1.2 -spqr_version_major=1 - set -e rm -rf $PKG @@ -79,209 +54,23 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -# Set common configuration for the SuiteSparse -cp $CWD/UFconfig.mk UFconfig - -mkdir -p Doc/{AMD,BTF,CAMD,CCOLAMD,CHOLMOD,COLAMD,KLU,LDL,UMFPACK,SPQR} Lib Include - -pushd AMD - pushd Lib - make CFLAGS="$SLKCFLAGS -fPIC" - popd - pushd ../Lib - gcc -shared -Wl,-soname,libamd.so.${amd_version_major} -o \ - libamd.so.${amd_version} ../AMD/Lib/*.o -lm - ln -sf libamd.so.${amd_version} libamd.so.${amd_version_major} - ln -sf libamd.so.${amd_version} libamd.so - cp -p ../AMD/Lib/*.a ./ - popd - cp -p Include/*.h ../Include - cp -p README.txt Doc/License Doc/ChangeLog Doc/*.pdf ../Doc/AMD -popd - -pushd BTF - pushd Lib - make CFLAGS="$SLKCFLAGS -fPIC" - popd - pushd ../Lib - gcc -shared -Wl,-soname,libbtf.so.${btf_version_major} -o \ - libbtf.so.${btf_version} ../BTF/Lib/*.o - ln -sf libbtf.so.${btf_version} libbtf.so.${btf_version_major} - ln -sf libbtf.so.${btf_version} libbtf.so - cp -p ../BTF/Lib/*.a ./ - popd - cp -p Include/*.h ../Include - cp -p README.txt Doc/* ../Doc/BTF -popd - -pushd CAMD - pushd Lib - make CFLAGS="$SLKCFLAGS -fPIC" - popd - pushd ../Lib - gcc -shared -Wl,-soname,libcamd.so.${camd_version_major} -o \ - libcamd.so.${camd_version} ../CAMD/Lib/*.o -lm - ln -sf libcamd.so.${camd_version} libcamd.so.${camd_version_major} - ln -sf libcamd.so.${camd_version} libcamd.so - cp -p ../CAMD/Lib/*.a ./ - popd - cp -p Include/*.h ../Include - cp -p README.txt Doc/ChangeLog Doc/License Doc/*.pdf ../Doc/CAMD -popd - -pushd CCOLAMD - pushd Lib - make CFLAGS="$SLKCFLAGS -fPIC" - popd - pushd ../Lib - gcc -shared -Wl,-soname,libccolamd.so.${ccolamd_version_major} -o \ - libccolamd.so.${ccolamd_version} ../CCOLAMD/Lib/*.o -lm - ln -sf libccolamd.so.${ccolamd_version} libccolamd.so.${ccolamd_version_major} - ln -sf libccolamd.so.${ccolamd_version} libccolamd.so - cp -p ../CCOLAMD/Lib/*.a ./ - popd - cp -p Include/*.h ../Include - cp -p README.txt Doc/* ../Doc/CCOLAMD -popd - -pushd COLAMD - pushd Lib - make CFLAGS="$SLKCFLAGS -fPIC" - popd - pushd ../Lib - gcc -shared -Wl,-soname,libcolamd.so.${colamd_version_major} -o \ - libcolamd.so.${colamd_version} ../COLAMD/Lib/*.o -lm - ln -sf libcolamd.so.${colamd_version} libcolamd.so.${colamd_version_major} - ln -sf libcolamd.so.${colamd_version} libcolamd.so - cp -p ../COLAMD/Lib/*.a ./ - popd - cp -p Include/*.h ../Include - cp -p README.txt Doc/* ../Doc/COLAMD -popd - -# CHOLMOD can also be compiled to use the METIS library, but it is not -# used here because its licensing terms exclude it from Octave. -pushd CHOLMOD - pushd Lib - make CFLAGS="$SLKCFLAGS -fPIC" - popd - pushd ../Lib - gcc -shared -Wl,-soname,libcholmod.so.${cholmod_version_major} -o \ - libcholmod.so.${cholmod_version} ../CHOLMOD/Lib/*.o \ - -lblas -lgfortran -lgfortranbegin -llapack \ - libamd.so.${amd_version_major} \ - libcamd.so.${camd_version_major} libcolamd.so.${colamd_version_major} \ - libccolamd.so.${ccolamd_version_major} -lm - ln -sf libcholmod.so.${cholmod_version} libcholmod.so.${cholmod_version_major} - ln -sf libcholmod.so.${cholmod_version} libcholmod.so - cp -p ../CHOLMOD/Lib/*.a ./ - popd - cp -p Include/*.h ../Include - cp -p README.txt Doc/*.pdf ../Doc/CHOLMOD - cp -p Cholesky/License.txt ../Doc/CHOLMOD/Cholesky_License.txt - cp -p Core/License.txt ../Doc/CHOLMOD/Core_License.txt - cp -p MatrixOps/License.txt ../Doc/CHOLMOD/MatrixOps_License.txt - cp -p Partition/License.txt ../Doc/CHOLMOD/Partition_License.txt - cp -p Supernodal/License.txt ../Doc/CHOLMOD/Supernodal_License.txt -popd +for lib in SuiteSparse_config AMD CAMD COLAMD BTF KLU LDL CCOLAMD UMFPACK CHOLMOD CXSparse SPQR RBio; do + make -C $lib library CFLAGS="$SLKCFLAGS -DNPARTITION" +done -# CXSparse is a superset of CSparse, and the two share common header -# names, so it does not make sense to build both. -pushd CXSparse - pushd Lib - make CFLAGS="$SLKCFLAGS -fPIC" - popd - pushd ../Lib - gcc -shared -Wl,-soname,libcxsparse.so.${cxsparse_version_major} -o \ - libcxsparse.so.${cxsparse_version} ../CXSparse/Lib/*.o -lm - ln -sf libcxsparse.so.${cxsparse_version} libcxsparse.so.${cxsparse_version_major} - ln -sf libcxsparse.so.${cxsparse_version} libcxsparse.so - cp -p ../CXSparse/Lib/*.a ./ - popd - cp -p Include/cs.h ../Include - mkdir ../Doc/CXSparse/ - cp -p Doc/* ../Doc/CXSparse -popd - -pushd KLU - pushd Lib - make CFLAGS="$SLKCFLAGS -fPIC" - popd - pushd ../Lib - gcc -shared -Wl,-soname,libklu.so.${klu_version_major} -o \ - libklu.so.${klu_version} ../KLU/Lib/*.o \ - libamd.so.${amd_version_major} libcolamd.so.${colamd_version_major} \ - libbtf.so.${btf_version_major} libcholmod.so.${cholmod_version_major} - ln -sf libklu.so.${klu_version} libklu.so.${klu_version_major} - ln -sf libklu.so.${klu_version} libklu.so - cp -p ../KLU/Lib/*.a ./ - popd - cp -p Include/*.h ../Include - cp -p README.txt Doc/lesser.txt ../Doc/KLU -popd - -pushd LDL - pushd Lib - make CFLAGS="$SLKCFLAGS -fPIC" - popd - pushd ../Lib - gcc -shared -Wl,-soname,libldl.so.${ldl_version_major} -o \ - libldl.so.${ldl_version} ../LDL/Lib/*.o - ln -sf libldl.so.${ldl_version} libldl.so.${ldl_version_major} - ln -sf libldl.so.${ldl_version} libldl.so - cp -p ../LDL/Lib/*.a ./ - popd - cp -p Include/*.h ../Include - cp -p README.txt Doc/ChangeLog Doc/lesser.txt Doc/*.pdf ../Doc/LDL -popd - -pushd UMFPACK - pushd Lib - make CFLAGS="$SLKCFLAGS -fPIC" - popd - pushd ../Lib - gcc -shared -Wl,-soname,libumfpack.so.${umfpack_version_major} -o \ - libumfpack.so.${umfpack_version} ../UMFPACK/Lib/*.o \ - -lblas -lgfortran -lgfortranbegin -llapack \ - libamd.so.${amd_version_major} -lm - ln -sf libumfpack.so.${umfpack_version} libumfpack.so.${umfpack_version_major} - ln -sf libumfpack.so.${umfpack_version} libumfpack.so - cp -p ../UMFPACK/Lib/*.a ./ - popd - cp -p Include/*.h ../Include - cp -p README.txt Doc/License Doc/ChangeLog Doc/gpl.txt Doc/*.pdf ../Doc/UMFPACK -popd - -pushd SPQR - pushd Lib - make CFLAGS="$SLKCFLAGS -fPIC" - popd - pushd ../Lib - g++ -shared -Wl,-soname,libspqr.so.${spqr_version_major} -o \ - libspqr.so.${spqr_version} ../SPQR/Lib/*.o \ - -lblas -lgfortran -lgfortranbegin -llapack \ - libcholmod.so.${cholmod_version_major} -lm - ln -sf libspqr.so.${spqr_version} libspqr.so.${spqr_version_major} - ln -sf libspqr.so.${spqr_version} libspqr.so - cp -p ../SPQR/Lib/*.a ./ - popd - cp -p Include/*.h* ../Include - cp -p README{,_SPQR}.txt - cp -p README_SPQR.txt Doc/* ../Doc/SPQR -popd - -cp -p UFconfig/UFconfig.h Include - -mkdir -p $PKG/usr/lib${LIBDIRSUFFIX} -cp -a Lib/* $PKG/usr/lib${LIBDIRSUFFIX} +mkdir -p $PKG/usr/lib$LIBDIRSUFFIX mkdir -p $PKG/usr/include/suitesparse -cp -a Include/* $PKG/usr/include/suitesparse - -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +for lib in SuiteSparse_config AMD CAMD COLAMD BTF KLU LDL CCOLAMD UMFPACK CHOLMOD CXSparse SPQR RBio; do + make -C $lib INSTALL_LIB="$PKG/usr/lib$LIBDIRSUFFIX" INSTALL_INCLUDE="$PKG/usr/include/suitesparse" install +done mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a README.txt Doc/* $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README.txt $PKG/usr/doc/$PRGNAM-$VERSION +for lib in AMD CAMD COLAMD BTF KLU LDL CCOLAMD UMFPACK CHOLMOD CXSparse SPQR RBio; do + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/$lib + cp -a $lib/Doc/README* $lib/Doc/*.pdf $lib/Doc/ChangeLog $lib/Doc/License* \ + $PKG/usr/doc/$PRGNAM-$VERSION/$lib || true +done cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install |