diff options
author | Marius Kintel <marius@kintel.net> | 2012-07-13 19:05:42 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-07-13 19:05:42 (GMT) |
commit | a7a8679461e33b3ff99336dc71a060ef1a76cf09 (patch) | |
tree | 989f1ed5b298b873e800d43ed9817d8dd7752333 | |
parent | 38a4585d1a9abe9c779c5d0677bfc81c407db371 (diff) | |
parent | 2cf86fc204dea5963dce6865d50f0062a1d97330 (diff) |
Merge pull request #142 from openscad/opensuse
Opensuse
-rw-r--r-- | README.md | 29 | ||||
-rwxr-xr-x | scripts/fedora-build-dependencies.sh | 29 | ||||
-rwxr-xr-x | scripts/linux-build-dependencies.sh | 64 | ||||
-rwxr-xr-x | scripts/opensuse-build-dependencies.sh | 8 | ||||
-rw-r--r-- | scripts/setenv-linbuild.sh | 15 | ||||
-rwxr-xr-x | scripts/ubuntu-build-dependencies.sh | 46 |
6 files changed, 155 insertions, 36 deletions
@@ -117,20 +117,26 @@ compilation process. After that, follow the Compilation instructions below. -### Building for newer Ubunutu +### Building for newer Linux distributions -sudo apt-get install libqt4-dev libqt4-opengl-dev libxmu-dev cmake \ - libglew1.5-dev bison flex libeigen2-dev git-core libboost-all-dev \ - libXi-dev libcgal-dev libopencsg-dev libopencsg1 +First, make sure that you have development tools installed to get GCC. +Then after you've cloned this git repository, use a package manager to +download packages for the dependency libraries listed above. Convenience +scripts are provided for some popular systems: -Check your library versions against the list above. After that, follow -the Compilation instructions below. +Ubuntu, Debian: ./scripts/ubuntu-build-dependencies.sh +OpenSUSE: ./scripts/opensuse-build-dependencies.sh +Fedora, Redhat: ./scripts/fedora-build-dependencies.sh -### Building for older Linux or without root access +Check your library versions to make sure they meet the minimum +requirements listed above. After that follow the Compilation +instructions below. -First, make sure that you have compiler tools (build-essential on ubuntu). -Then after you've cloned this git repository, run the script that sets up the -environment variables. +### Building for older Linux or building without root access + +First, make sure that you have development tools installed to get GCC. +Then after you've cloned this git repository, run the script that sets +up the environment variables. source ./scripts/setenv-linbuild.sh @@ -138,6 +144,7 @@ Then run the script to download & compile all the prerequisite libraries above: ./scripts/linux-build-dependencies.sh +Then add LD_LIBRARY_PATH=$HOME/openscad_deps to your ~/.bashrc After that, follow the Compilation instructions below. ### Building for Windows @@ -157,5 +164,5 @@ Then run make. Finally you might run 'make install' as root or simply copy the If you had problems compiling from source, raise a new issue in the [issue tracker on the github page](https://github.com/openscad/openscad/issues). -The four subsections of this site can also be helpful: +This site and it's subpages can also be helpful: http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_OpenSCAD_from_Sources diff --git a/scripts/fedora-build-dependencies.sh b/scripts/fedora-build-dependencies.sh new file mode 100755 index 0000000..7481a63 --- /dev/null +++ b/scripts/fedora-build-dependencies.sh @@ -0,0 +1,29 @@ +echo "Tested on Fedora 17. If this fails try 'old linux' build (see README.md)" +sleep 2 + +# Fedora 17 has CGAL 4 +#if [ "`yum list installed | grep -i cgal`" ]; then +# echo "Please make sure you have removed all cgal packages and retry" +# exit +#fi + +if [ "`yum list installed | grep -i opencsg`" ]; then + echo "Please make sure you have removed all opencsg packages and retry" + exit +fi + +sudo yum install qt-devel bison flex eigen2-devel \ + boost-devel mpfr-devel gmp-devel glew-devel CGAL-devel gcc pkgconfig git + +#echo "now copy/paste the following to install CGAL and OpenCSG from source:" +#echo "sudo BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh cgal-use-sys-libs" + +echo +echo "Now copy/paste the following to install OpenCSG from source:" +echo +# https://bugzilla.redhat.com/show_bug.cgi?id=144967 +echo "sudo echo /usr/local/lib | sudo tee -a /etc/ld.so.conf.d/local.conf" +echo "sudo ldconfig" +echo "sudo BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh opencsg" +echo + diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh index aef58b9..6ff0dd8 100755 --- a/scripts/linux-build-dependencies.sh +++ b/scripts/linux-build-dependencies.sh @@ -9,15 +9,8 @@ # Prerequisites: # - wget or curl # - Qt4 -# - cmake 2.8 ( force build_cmake at bottom if yours is too old ) # -BASEDIR=$HOME/openscad_deps -OPENSCADDIR=$PWD -SRCDIR=$BASEDIR/src -DEPLOYDIR=$BASEDIR -NUMCPU=2 # paralell builds for some libraries - printUsage() { echo "Usage: $0" @@ -128,7 +121,11 @@ build_cgal() fi tar xzf CGAL-$version.tar.gz cd CGAL-$version - cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DGMP_INCLUDE_DIR=$DEPLOYDIR/include -DGMP_LIBRARIES=$DEPLOYDIR/lib/libgmp.so -DGMPXX_LIBRARIES=$DEPLOYDIR/lib/libgmpxx.so -DGMPXX_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_LIBRARIES=$DEPLOYDIR/lib/libmpfr.so -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DBOOST_ROOT=$DEPLOYDIR -DCMAKE_BUILD_TYPE=Debug + if [ $2 = use-sys-libs ]; then + cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DCMAKE_BUILD_TYPE=Debug + else + cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DGMP_INCLUDE_DIR=$DEPLOYDIR/include -DGMP_LIBRARIES=$DEPLOYDIR/lib/libgmp.so -DGMPXX_LIBRARIES=$DEPLOYDIR/lib/libgmpxx.so -DGMPXX_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_LIBRARIES=$DEPLOYDIR/lib/libmpfr.so -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DBOOST_ROOT=$DEPLOYDIR -DCMAKE_BUILD_TYPE=Debug + fi make -j$NUMCPU make install } @@ -169,10 +166,14 @@ build_opencsg() # uncomment this kludge for Fedora 64bit # sed -i s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ src/Makefile - qmake-qt4 + if [ "`command -v qmake-qt4`" ]; then + qmake-qt4 + else + qmake + fi make - install -v lib/* $DEPLOYDIR/lib - install -v include/* $DEPLOYDIR/include + cp -av lib/* $DEPLOYDIR/lib + cp -av include/* $DEPLOYDIR/include } build_eigen() @@ -196,11 +197,21 @@ build_eigen() make install } + + +OPENSCADDIR=$PWD if [ ! -f $OPENSCADDIR/openscad.pro ]; then echo "Must be run from the OpenSCAD source root directory" exit 0 fi +. ./scripts/setenv-linbuild.sh # '.' is equivalent to 'source' +SRCDIR=$BASEDIR/src +DEPLOYDIR=$BASEDIR +if [ ! $NUMCPU ]; then + NUMCPU=1 # paralell builds for some libraries +fi + if [ ! -d $BASEDIR/bin ]; then mkdir --parents $BASEDIR/bin fi @@ -208,16 +219,9 @@ fi echo "Using basedir:" $BASEDIR echo "Using deploydir:" $DEPLOYDIR echo "Using srcdir:" $SRCDIR -echo "Number of CPUs for parallel builds:" $NUMCPU +echo "Number of CPUs for parallel builds:" $NUMCPU "(export NUMCPU=x to modify)" mkdir -p $SRCDIR $DEPLOYDIR -export PATH=$BASEDIR/bin:$PATH -export LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64:$LD_LIBRARY_PATH -export LD_RUN_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64:$LD_RUN_PATH -echo "PATH modified temporarily" -echo "LD_LIBRARY_PATH modified temporarily" -echo "LD_RUN_PATH modified temporarily" - if [ ! "`command -v curl`" ]; then build_curl 7.26.0 fi @@ -227,6 +231,26 @@ if [ ! "`command -v cmake`" ]; then build_cmake 2.8.8 fi +# Singly build CGAL or OpenCSG +# (Most systems have all libraries available as packages except CGAL/OpenCSG) +# (They can be built singly here by passing a command line arg to the script) +if [ $1 ]; then + if [ $1 = "cgal-use-sys-libs" ]; then + build_cgal 4.0 use-sys-libs + exit + fi + if [ $1 = "opencsg" ]; then + build_opencsg 1.3.2 + exit + fi +fi + + +# +# Main build of libraries +# edit version numbers here as needed. +# + build_eigen 2.0.17 build_gmp 5.0.5 build_mpfr 3.1.1 @@ -236,4 +260,4 @@ build_cgal 4.0 build_glew 1.7.0 build_opencsg 1.3.2 -echo "OpenSCAD dependencies built in " $BASEDIR +echo "OpenSCAD dependencies built and installed to " $BASEDIR diff --git a/scripts/opensuse-build-dependencies.sh b/scripts/opensuse-build-dependencies.sh new file mode 100755 index 0000000..623d7d0 --- /dev/null +++ b/scripts/opensuse-build-dependencies.sh @@ -0,0 +1,8 @@ +echo "tested on OpenSUSE 12. If this fails try 'old linux' build (see README.md)" + +sudo zypper install libeigen2-devel mpfr-devel gmp-devel boost-devel \ + libqt4-devel glew-devel cmake git + +echo "now copy/paste the following to install CGAL and OpenCSG from source:" +echo "sudo BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh cgal-use-sys-libs" +echo "sudo BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh opencsg" diff --git a/scripts/setenv-linbuild.sh b/scripts/setenv-linbuild.sh index 9719533..e77d969 100644 --- a/scripts/setenv-linbuild.sh +++ b/scripts/setenv-linbuild.sh @@ -1,10 +1,15 @@ -# setup env variables for building OpenSCAD against custom built -# dependency libraries from linux-build-dependencies.sh +# setup environment variables for building OpenSCAD against custom built +# dependency libraries. called by linux-build-dependencies.sh -# run this file with 'source setenv-linbuild.sh' +# run this file with 'source setenv-linbuild.sh' every time you re-login +# and want to build or run openscad against custom libraries installed +# into BASEDIR. -# BASEDIR and DEPLOYDIR must be the same as in linux-build-dependencies.sh -BASEDIR=$HOME/openscad_deps +# copy this file to your .bashrc if desired. + +if [ ! $BASEDIR ]; then + BASEDIR=$HOME/openscad_deps +fi DEPLOYDIR=$BASEDIR export PATH=$BASEDIR/bin:$PATH diff --git a/scripts/ubuntu-build-dependencies.sh b/scripts/ubuntu-build-dependencies.sh new file mode 100755 index 0000000..0609172 --- /dev/null +++ b/scripts/ubuntu-build-dependencies.sh @@ -0,0 +1,46 @@ + +too_old() +{ + echo "System version too low. Please try 'old linux' build (see README.md)" + exit +} + +if [ "`cat /etc/issue | grep 'Debian GNU/Linux 6.0'`" ]; then + too_old +fi +if [ "`cat /etc/issue | grep 'Debian GNU/Linux 5'`" ]; then + too_old +fi +if [ "`cat /etc/issue | grep 'Ubunutu 10'`" ]; then + too_old +fi +if [ "`cat /etc/issue | grep 'Ubunutu 9'`" ]; then + too_old +fi +if [ "`cat /etc/issue | grep 'Ubunutu 8'`" ]; then + too_old +fi +if [ "`cat /etc/issue | grep 'Ubunutu 7'`" ]; then + too_old +fi + +echo "tested on Ubuntu 12. If this fails try 'old linux' build (see README.md)" + + +if [ "`dpkg --list | grep -i cgal`" ]; then + echo "Please make sure you have run apt-get purge on all cgal packages" + exit +fi + +if [ "`dpkg --list | grep -i opencsg`" ]; then + echo "Please make sure you have run apt-get purge on all opencsg packages" + exit +fi + +sudo apt-get install build-essential libqt4-dev libqt4-opengl-dev \ + libxmu-dev cmake bison flex libeigen2-dev git-core libboost-all-dev \ + libXi-dev libmpfr-dev libgmp-dev libboost-dev libglew1.6-dev + +echo "now copy/paste the following to install CGAL and OpenCSG from source:" +echo "sudo BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh cgal-use-sys-libs" +echo "sudo BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh opencsg" |