Slackware This Forum is for the discussion of Slackware Linux.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
12-31-2009, 12:37 PM
#1
Member
Registered: Oct 2009
Location: Japan
Distribution: Arch, Debian, Slackware
Posts: 994
Rep:
Adapting slackbuild of SuiteSparse for Slackware 12.2 to conform to Slackware64
Hi Forum
This is a SlackBuild from Slacky.eu for Slackware 12.2 which I wish to adapt to Slackware64 13
Code:
#!/bin/sh
# Heavily based on the Slackware 12.1 SlackBuild
# http://www.cise.ufl.edu/research/sparse/SuiteSparse/
# Packager Michelino Chionchio - www.slacky.eu
CWD=`pwd`
TMP=${TMP:-/tmp/tgz}
PKG=$TMP/package-suitesparse
NAME=suitesparse
VERSION=3.1.0
CHOST=i486
ARCH=${ARCH:-i486}
BUILD=2mch
METIS=metis
METISVERSION=4.0
SOURCE=http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-$VERSION.tar.gz
SOURCEMETIS=http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/$METIS-$METISVERSION.tar.gz
if [ ! -e SuiteSparse-$VERSION.tar.gz ]; then
wget -c $SOURCE
fi
if [ ! -e $METIS-$METISVERSION.tar.gz ]; then
wget -c $SOURCEMETIS
fi
if [ "$ARCH" = "i386" ]; then
SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2"
fi
if [ ! -d $TMP ]; then
mkdir -p $TMP
fi
if [ ! -d $PKG ]; then
mkdir -p $PKG
fi
cd $TMP
tar zxvf $CWD/SuiteSparse-$VERSION.tar.gz
cd SuiteSparse/UFconfig
sed -i s/"CFLAGS = -O"/"CFLAGS = $SLKCFLAGS -fPIC -fexceptions -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"/ UFconfig.mk
sed -i s/"-D_LARGEFILE64_SOURCE3"/"-D_LARGEFILE64_SOURCE"/ UFconfig.mk
sed -i s/"F77FLAGS = -O"/"F77FLAGS = $SLKCFLAGS"/ UFconfig.mk
sed -i s/'CHOLMOD_CONFIG ='/'CHOLMOD_CONFIG = -DNPARTITION'/ UFconfig.mk
sed -i s/'METIS = ..\/..\/metis-4.0\/libmetis.a'/'METIS = '/ UFconfig.mk
sed -i s/'METIS_PATH = ..\/..\/metis-4.0'/'METIS_PATH = '/ UFconfig.mk
cd ..
tar zxvf $CWD/$METIS-$METISVERSION.tar.gz
cd $METIS-$METISVERSION
sed -i s/"-O2"/"$SLKCFLAGS"/ Makefile.in
make || exit 1
mkdir -p $PKG/usr/bin
cp -a graphchk kmetis mesh2dual mesh2nodal oemetis onmetis partdmesh partnmesh pmetis $PKG/usr/bin
cd ..
make || exit 1
# Build shared library
AMDV=2.2
AMDM=2
cd AMD/Lib
gcc -shared -Wl,-soname,libamd.so.${AMDM} -o libamd.so.${AMDV} `ls *.o`
cd ../../
BTFV=1.0
BTFM=1
cd BTF/Lib
gcc -shared -Wl,-soname,libbtf.so.${BTFM} -o libbtf.so.${BTFV} `ls *.o`
cd ../../
CAMDV=2.2
CAMDM=2
cd CAMD/Lib
gcc -shared -Wl,-soname,libcamd.so.${CAMDM} -o libcamd.so.${CAMDV} `ls *.o`
cd ../../
CCOLAMDV=2.7
CCOLAMDM=2
cd CCOLAMD/Lib
gcc -shared -Wl,-soname,libccolamd.so.${CCOLAMDM} -o libccolamd.so.${CCOLAMDV} `ls *.o`
cd ../../
CHOLMODV=1.6
CHOLMODM=1
cd CHOLMOD/Lib
gcc -shared -Wl,-soname,libcholmod.so.${CHOLMODM} -o libcholmod.so.${CHOLMODV} `ls *.o`
cd ../../
COLAMDV=2.7
COLAMDM=2
cd COLAMD/Lib
gcc -shared -Wl,-soname,libcolamd.so.${COLAMDM} -o libcolamd.so.${COLAMDV} `ls *.o`
cd ../../
CSparseV=2.2.0
CSparseM=2
cd CSparse/Lib
gcc -shared -Wl,-soname,libcsparse.so.${CSparseM} -o libcsparse.so.${CSparseV} `ls *.o`
cd ../../
CXSparseV=2.2.0
CXSparseM=2
cd CXSparse/Lib
gcc -shared -Wl,-soname,libcxsparse.so.${CXSparseM} -o libcxsparse.so.${CXSparseV} `ls *.o`
cd ../../
KLUV=1.0
KLUM=1
cd KLU/Lib
gcc -shared -Wl,-soname,libklu.so.${KLUM} -o libklu.so.${KLUV} `ls *.o`
cd ../../
LDLV=2.0
LDLM=2
cd LDL/Lib
gcc -shared -Wl,-soname,libldl.so.${LDLM} -o libldl.so.${LDLV} `ls *.o`
cd ../../
UMFPACKV=5.0.2
UMFPACKM=5
cd UMFPACK/Lib
gcc -shared -Wl,-soname,libumfpack.so.${UMFPACKM} -o libumfpack.so.${UMFPACKV} `ls *.o` -lblas -lm
cd ../../
# Done !
mkdir -p $PKG/usr/doc/$NAME-$VERSION
for i in AMD/ CAMD/ CHOLMOD/ LDL/ UFcollection/ BTF/ CCOLAMD/ COLAMD/ CSparse/ CXSparse/ KLU/ RBio/ UMFPACK/;
do mkdir -p $PKG/usr/doc/$NAME-$VERSION/$i && cp -a $i/Doc/* $i/README.txt $PKG/usr/doc/$NAME-$VERSION/$i; done
cp -a README.txt $PKG/usr/doc/$NAME-$VERSION
rm $PKG/usr/doc/$NAME-$VERSION/*/Makefile
mkdir -p $PKG/usr/doc/$METIS-$METISVERSION.1
cp -a $METIS-$METISVERSION/Doc/* $METIS-$METISVERSION/{CHANGES,FILES,INSTALL,VERSION} $PKG/usr/doc/$METIS-$METISVERSION.1
mkdir -p $PKG/usr/lib/
for i in AMD/ CAMD/ CHOLMOD/ LDL/ BTF/ CCOLAMD/ COLAMD/ CSparse/ CXSparse/ KLU/ UMFPACK/;
do cp -a $i/Lib/{*.a,*.so.*} $PKG/usr/lib/; done
cp -a $METIS-$METISVERSION/*.a $PKG/usr/lib/
mkdir -p $PKG/usr/include/$NAME
for i in AMD/ CAMD/ CHOLMOD/ LDL/ BTF/ CCOLAMD/ COLAMD/ CXSparse/ KLU/ UMFPACK/;
do cp -a $i/Include/*.h $PKG/usr/include/$NAME; done
cp -a UFconfig/*.h $PKG/usr/include/$NAME
cp -a $METIS-$METISVERSION/Lib/*.h $PKG/usr/include/$NAME
cd $PKG/usr/include/
ln -s ./suitesparse ./umfpack
cd $PKG/usr/doc/$NAME-$VERSION
for I in *; do mv $I $(echo $I | tr '[A-Z]' '[a-z]'); done
cd $PKG/usr/lib
ln -sf libamd.so.${AMDV} libamd.so.${AMDM}
ln -sf libamd.so.${AMDV} libamd.so
ln -sf libbtf.so.${BTFV} libbtf.so.${BTFM}
ln -sf libbtf.so.${BTFV} libbtf.so
ln -sf libcamd.so.${CAMDV} libcamd.so.${CAMDM}
ln -sf libcamd.so.${CAMDV} libcamd.so
ln -sf libccolamd.so.${CCOLAMDV} libccolamd.so.${CCOLAMDM}
ln -sf libccolamd.so.${CCOLAMDM} libccolamd.so
ln -sf libcholmod.so.${CHOLMODV} libcholmod.so.${CHOLMODM}
ln -sf libcholmod.so.${CHOLMODV} libcholmod.so
ln -sf libcolamd.so.${COLAMDV} libcolamd.so.${COLAMDM}
ln -sf libcolamd.so.${COLAMDV} libcolamd.so
ln -sf libcsparse.so.${CSparseV} libcsparse.so.${CSparseM}
ln -sf libcsparse.so.${CSparseV} libcsparse.so
ln -sf libcxsparse.so.${CXSparseV} libcxsparse.so.${CXSparseM}
ln -sf libcxsparse.so.${CXSparseV} libcxsparse.so
ln -sf libklu.so.${KLUV} libklu.so.${KLUM}
ln -sf libklu.so.${KLUV} libklu.so
ln -sf libldl.so.${LDLV} libldl.so.${LDLM}
ln -sf libldl.so.${LDLV} libldl.so
ln -sf libumfpack.so.${UMFPACKV} libumfpack.so.${UMFPACKM}
ln -sf libumfpack.so.${UMFPACKV} libumfpack.so
cd $PKG
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \;
find . -perm 666 -exec chmod 644 {} \;
find . -perm 664 -exec chmod 644 {} \;
find . -perm 444 -exec chmod 644 {} \;
chown -R root:root .
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc
cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
requiredbuilder -v -y -s $CWD $PKG
makepkg -l y -c n $CWD/../$NAME-$VERSION-$ARCH-$BUILD.tgz
if [ "$1" = "--cleanup" ]; then
rm -rf $TMP
fi
Clearly, this does not conform to the structure of AlienBob's Slackbuilds, or the SlackBuilds from SlackBuilds.org.
This will drop libraries inside /usr/lib... which clearly does not adhere to Slackware64 13 standards.
I guess that simply changing the ARCH and CHOST variables won't be enough...
Can somebody poit to me the changes to be performed so as not to trash my system ( again ) ...
?
BRGDS
Alex
12-31-2009, 12:54 PM
#2
Member
Registered: Aug 2006
Distribution: Slackware
Posts: 804
Rep:
I'm no expert, but it looks like you can just change all of the /usr/lib entries to /usr/lib64.
1 members found this post helpful.
12-31-2009, 01:10 PM
#3
Member
Registered: Oct 2009
Location: Japan
Distribution: Arch, Debian, Slackware
Posts: 994
Original Poster
Rep:
Hi ManwhichMakesaMeal
At first sight yes... this should be enough...
But this is a very important cornerstone... it is a library... if it gets incorrectly built, every other standalone application I build against it will be "ill-made"...
I had a similar issue with the slackbuild of Python 2.5.2 for Slackware 12.2 under Slackware64 13...
From then on, everything I built was trash....
I mean... it worked, but not to the expectations...
BRGDS
Alex
12-31-2009, 01:22 PM
#4
Member
Registered: Aug 2006
Distribution: Slackware
Posts: 804
Rep:
You may be able to do something like a
Code:
sed -i s/"/usr/lib"/"/usr/lib${LIBDIRSUFFIX}" Makefile.in
after
Code:
sed -i s/"-O2"/"$SLKCFLAGS"/ Makefile.in
and then put
after
Code:
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2"
This may or may not work, as I haven't dl'd the source and tried to build it.
1 members found this post helpful.
All times are GMT -5. The time now is 07:38 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News