From b2c12d23a95ca95cb74b2399625b3f949c98f657 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Tue, 10 Jul 2012 22:52:05 -0500 Subject: features: build CGAL/OpenCSG alone. customize BASEDIR more easily diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh index aef58b9..0faf67a 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,7 +166,11 @@ 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 @@ -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 +source ./scripts/setenv-linbuild.sh +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 @@ -211,13 +222,6 @@ echo "Using srcdir:" $SRCDIR echo "Number of CPUs for parallel builds:" $NUMCPU 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,24 @@ 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 = "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 + + +# +# 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 +258,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/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 -- cgit v0.10.1 From 631ac4606dd78f5a51c298fb64a3616eef25337d Mon Sep 17 00:00:00 2001 From: Don Bright Date: Tue, 10 Jul 2012 22:52:16 -0500 Subject: script to auto-download/install dependency packages in OpenSUSE diff --git a/scripts/getpackages-opensuse.sh b/scripts/getpackages-opensuse.sh new file mode 100755 index 0000000..28e9c9d --- /dev/null +++ b/scripts/getpackages-opensuse.sh @@ -0,0 +1,6 @@ +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" -- cgit v0.10.1 From 4440cb81f98f9723cfb6d1a971a1dcc8fc8d44a9 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Tue, 10 Jul 2012 23:01:20 -0500 Subject: make name match other build script names better diff --git a/scripts/getpackages-opensuse.sh b/scripts/getpackages-opensuse.sh deleted file mode 100755 index 28e9c9d..0000000 --- a/scripts/getpackages-opensuse.sh +++ /dev/null @@ -1,6 +0,0 @@ -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/opensuse-get-dependencies.sh b/scripts/opensuse-get-dependencies.sh new file mode 100755 index 0000000..623d7d0 --- /dev/null +++ b/scripts/opensuse-get-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" -- cgit v0.10.1 From bf22cef8d94defb615bb5c3ee17d827d94704b8e Mon Sep 17 00:00:00 2001 From: don bright Date: Tue, 10 Jul 2012 23:48:29 -0500 Subject: rewrite to be compatible with ubuntu 'dash' shell diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh index 0faf67a..bfc7880 100755 --- a/scripts/linux-build-dependencies.sh +++ b/scripts/linux-build-dependencies.sh @@ -205,7 +205,7 @@ if [ ! -f $OPENSCADDIR/openscad.pro ]; then exit 0 fi -source ./scripts/setenv-linbuild.sh +. ./scripts/setenv-linbuild.sh # '.' is equivalent to 'source' SRCDIR=$BASEDIR/src DEPLOYDIR=$BASEDIR if [ ! $NUMCPU ]; then @@ -219,7 +219,7 @@ 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 if [ ! "`command -v curl`" ]; then @@ -234,13 +234,15 @@ 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 = "cgal-use-sys-libs" ]; then - build_cgal 4.0 use-sys-libs - exit -fi -if [ $1 = "opencsg" ]; then - build_opencsg 1.3.2 - exit +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 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/opensuse-get-dependencies.sh b/scripts/opensuse-get-dependencies.sh deleted file mode 100755 index 623d7d0..0000000 --- a/scripts/opensuse-get-dependencies.sh +++ /dev/null @@ -1,8 +0,0 @@ -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" -- cgit v0.10.1 From cb287b22ca4373df81cc0f5eee9c24a511f6e409 Mon Sep 17 00:00:00 2001 From: don bright Date: Tue, 10 Jul 2012 23:48:49 -0500 Subject: add build script for ubuntu that downloads binary packages too diff --git a/scripts/ubuntu-build-dependencies.sh b/scripts/ubuntu-build-dependencies.sh new file mode 100755 index 0000000..44134cf --- /dev/null +++ b/scripts/ubuntu-build-dependencies.sh @@ -0,0 +1,19 @@ +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 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 + +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" -- cgit v0.10.1 From 54f6fb27545f13eedac3c4dc2c4219e20913bc35 Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 11 Jul 2012 00:12:44 -0500 Subject: update documentation. update glew version for ubuntu package d/l diff --git a/README.md b/README.md index 1f8ada8..ef46955 100644 --- a/README.md +++ b/README.md @@ -117,14 +117,23 @@ 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. Then use a +package manager to download the appropriate packages. Scripts are +available for popular systems: -Check your library versions against the list above. After that, follow -the Compilation instructions below. +Aptitude based systems (ubuntu, debian): + + ./scripts/ubuntu-build-dependencies.sh + +Zypper based systems (opensuse) + + ./scripts/opensuse-build-dependencies.sh + +Check your binary packaged library versions to make sure they meet the +minimum requirements listed above. After that, follow the Compilation +instructions below. ### Building for older Linux or without root access diff --git a/scripts/ubuntu-build-dependencies.sh b/scripts/ubuntu-build-dependencies.sh index 44134cf..8662043 100755 --- a/scripts/ubuntu-build-dependencies.sh +++ b/scripts/ubuntu-build-dependencies.sh @@ -12,7 +12,7 @@ fi sudo apt-get install 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 + 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" -- cgit v0.10.1 From c89ff6a7e1b5243a130b79e97fd5e055f1f079bf Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 11 Jul 2012 00:34:38 -0500 Subject: update documentation diff --git a/README.md b/README.md index ef46955..47b0788 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ After that, follow the Compilation instructions below. First, make sure that you have development tools installed. Then use a package manager to download the appropriate packages. Scripts are -available for popular systems: +available for popular systems to attempt semi-automatic installation: Aptitude based systems (ubuntu, debian): @@ -132,7 +132,7 @@ Zypper based systems (opensuse) ./scripts/opensuse-build-dependencies.sh Check your binary packaged library versions to make sure they meet the -minimum requirements listed above. After that, follow the Compilation +minimum requirements listed above. After that follow the Compilation instructions below. ### Building for older Linux or without root access -- cgit v0.10.1 From 154e2c70490587d847bbc37a361e74cf8416ebe9 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Wed, 11 Jul 2012 20:20:17 -0400 Subject: create an easy build-script for fedora 17 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 bfc7880..6ff0dd8 100755 --- a/scripts/linux-build-dependencies.sh +++ b/scripts/linux-build-dependencies.sh @@ -172,8 +172,8 @@ build_opencsg() 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() -- cgit v0.10.1 From beac717910a0dab457842b3d8dfaa14cfaf46c36 Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 11 Jul 2012 19:50:26 -0500 Subject: update README, add build-essentials and ubuntu version detection diff --git a/README.md b/README.md index 47b0788..954b7f7 100644 --- a/README.md +++ b/README.md @@ -119,23 +119,19 @@ After that, follow the Compilation instructions below. ### Building for newer Linux distributions -First, make sure that you have development tools installed. Then use a -package manager to download the appropriate packages. Scripts are -available for popular systems to attempt semi-automatic installation: +Use a package manager to download development tools for your machine as +well as the appropriate packages based on the list above. Convenience +scripts are provided for some popular systems: -Aptitude based systems (ubuntu, debian): - - ./scripts/ubuntu-build-dependencies.sh - -Zypper based systems (opensuse) - - ./scripts/opensuse-build-dependencies.sh +Ubuntu, Debian: ./scripts/ubuntu-build-dependencies.sh +OpenSUSE: ./scripts/opensuse-build-dependencies.sh +Fedora, Redhat: ./scripts/fedora-build-dependencies.sh Check your binary packaged library versions to make sure they meet the minimum requirements listed above. After that follow the Compilation instructions below. -### Building for older Linux or without root access +### Building for older Linux or building without root access 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 @@ -147,6 +143,8 @@ Then run the script to download & compile all the prerequisite libraries above: ./scripts/linux-build-dependencies.sh +If you logoff your shell, you will have to re-run setenv-linbuild.sh to run +your new openscad. You can add it's contents to your .bashrc if you wish. After that, follow the Compilation instructions below. ### Building for Windows diff --git a/scripts/ubuntu-build-dependencies.sh b/scripts/ubuntu-build-dependencies.sh index 8662043..912ba80 100755 --- a/scripts/ubuntu-build-dependencies.sh +++ b/scripts/ubuntu-build-dependencies.sh @@ -1,5 +1,25 @@ + +too_old() +{ + echo "System version too low. Please try 'old linux' build (see README.md)" +} + +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 @@ -10,9 +30,9 @@ if [ "`dpkg --list | grep -i opencsg`" ]; then exit fi -sudo apt-get install 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 +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" -- cgit v0.10.1 From 3d94628e34cf016d19c2e3e2661dc1d41144d03b Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 11 Jul 2012 19:52:47 -0500 Subject: detect debian version. give advice if too old. diff --git a/scripts/ubuntu-build-dependencies.sh b/scripts/ubuntu-build-dependencies.sh index 912ba80..9c68751 100755 --- a/scripts/ubuntu-build-dependencies.sh +++ b/scripts/ubuntu-build-dependencies.sh @@ -4,6 +4,12 @@ too_old() echo "System version too low. Please try 'old linux' build (see README.md)" } +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 -- cgit v0.10.1 From 2cf86fc204dea5963dce6865d50f0062a1d97330 Mon Sep 17 00:00:00 2001 From: don bright Date: Thu, 12 Jul 2012 03:02:41 +0200 Subject: fix bug in ubuntu script. tweak README to match MacOSX section. diff --git a/README.md b/README.md index 954b7f7..9da6386 100644 --- a/README.md +++ b/README.md @@ -119,23 +119,24 @@ After that, follow the Compilation instructions below. ### Building for newer Linux distributions -Use a package manager to download development tools for your machine as -well as the appropriate packages based on the list above. Convenience +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: Ubuntu, Debian: ./scripts/ubuntu-build-dependencies.sh OpenSUSE: ./scripts/opensuse-build-dependencies.sh Fedora, Redhat: ./scripts/fedora-build-dependencies.sh -Check your binary packaged library versions to make sure they meet the -minimum requirements listed above. After that follow the Compilation +Check your library versions to make sure they meet the minimum +requirements listed above. After that follow the Compilation instructions below. ### Building for older Linux or building without root access -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. +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 @@ -143,8 +144,7 @@ Then run the script to download & compile all the prerequisite libraries above: ./scripts/linux-build-dependencies.sh -If you logoff your shell, you will have to re-run setenv-linbuild.sh to run -your new openscad. You can add it's contents to your .bashrc if you wish. +Then add LD_LIBRARY_PATH=$HOME/openscad_deps to your ~/.bashrc After that, follow the Compilation instructions below. ### Building for Windows @@ -164,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/ubuntu-build-dependencies.sh b/scripts/ubuntu-build-dependencies.sh index 9c68751..0609172 100755 --- a/scripts/ubuntu-build-dependencies.sh +++ b/scripts/ubuntu-build-dependencies.sh @@ -2,6 +2,7 @@ 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 -- cgit v0.10.1 From 018211a863ec8e1098a887641dd1c7e5ffd2d2f7 Mon Sep 17 00:00:00 2001 From: don bright Date: Fri, 13 Jul 2012 03:40:07 +0200 Subject: check versions of libraries at compile time - warn users. fix FIXME in openscad.pro diff --git a/openscad.pro b/openscad.pro index 591ed5f..048fbb5 100644 --- a/openscad.pro +++ b/openscad.pro @@ -108,6 +108,11 @@ CONFIG(mingw-cross-env) { include(mingw-cross-env.pri) } +CONFIG(skip-version-check) { + # force the use of outdated libraries + DEFINES += OPENSCAD_SKIP_VERSION_CHECK +} + # Application configuration macx:CONFIG += mdi CONFIG += cgal @@ -122,14 +127,7 @@ mdi { DEFINES += ENABLE_MDI } -# FIXME: This can be made default by now -CONFIG += progresswidget -progresswidget { - DEFINES += USE_PROGRESSWIDGET - FORMS += src/ProgressWidget.ui - HEADERS += src/ProgressWidget.h - SOURCES += src/ProgressWidget.cc -} +DEFINES += USE_PROGRESSWIDGET include(common.pri) @@ -145,9 +143,12 @@ RESOURCES = openscad.qrc FORMS += src/MainWindow.ui \ src/Preferences.ui \ - src/OpenCSGWarningDialog.ui + src/OpenCSGWarningDialog.ui \ + src/ProgressWidget.ui -HEADERS += src/parsersettings.h \ +HEADERS += src/version_check.h \ + src/ProgressWidget.h \ + src/parsersettings.h \ src/renderer.h \ src/rendersettings.h \ src/ThrownTogetherRenderer.h \ @@ -203,8 +204,10 @@ HEADERS += src/parsersettings.h \ src/system-gl.h \ src/stl-utils.h -SOURCES += src/mathc99.cc \ - src/linalg.cc \ +SOURCES += src/version_check.cc \ + src/ProgressWidget.cc \ + src/mathc99.cc \ + src/linalg.cc \ src/handle_dep.cc \ src/value.cc \ src/expr.cc \ diff --git a/src/cgal.h b/src/cgal.h index 9810340..e5e39dd 100644 --- a/src/cgal.h +++ b/src/cgal.h @@ -11,11 +11,6 @@ using boost::intmax_t; using boost::uintmax_t; #endif -#include -#if CGAL_VERSION_NR < 1030601000 - #error CGAL >= 3.6 is required! -#endif - // NDEBUG must be disabled when including CGAL headers, otherwise CGAL assertions // will not be thrown, causing OpenSCAD's CGAL error checking to fail. // To be on the safe side, this has to be done when including any CGAL header file. diff --git a/src/version_check.cc b/src/version_check.cc new file mode 100644 index 0000000..87dfeeb --- /dev/null +++ b/src/version_check.cc @@ -0,0 +1,2 @@ +#include "version_check.h" + diff --git a/src/version_check.h b/src/version_check.h new file mode 100644 index 0000000..45e00ec --- /dev/null +++ b/src/version_check.h @@ -0,0 +1,107 @@ +// version_check.h copyright 2012 don bright. released under the GPL 2, or +// later, as described in the file named 'COPYING' in OpenSCAD's project root. + +/* This file will check versions of libraries at compile time. If they +are too old, the user will be warned. If the user wishes to force +compilation, they can run + + qmake CONFIG=skip-version-check + +Otherwise they will be guided to README.md and an -build-dependencies script. + +The extensive #else #endif is to ensure only a single error is printed at +a time, to avoid confusion. +*/ + +#ifndef OPENSCAD_SKIP_VERSION_CHECK + + +#include +// set minimum numbers here. +#define GMPMAJOR 5 +#define GMPMINOR 0 +#define GMPPATCH 0 +#define SYS_GMP_VER (__GNU_MP_VERSION * 10000 + __GNU_MP_VERSION_MINOR * 100 + __GNU_MP_VERSION_PATCHLEVEL * 1) +#if SYS_GMP_VER < GMPMAJOR * 10000 + GMPMINOR * 100 + GMPPATCH * 1 +#error GNU GMP library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else + + +#include +#if MPFR_VERSION < MPFR_VERSION_NUM( 3,0,0 ) +#error GNU MPFR library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else + + +#include +#if not EIGEN_VERSION_AT_LEAST( 2,0,13 ) +#error eigen2 library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else + + +#include +// boost 1.3.5 = 103500 +#if BOOST_VERSION < 103500 +#error boost library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else + + +#ifdef ENABLE_CGAL +#include + +#if CGAL_VERSION_NR < 1030601000 +#error CGAL library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else + +#if CGAL_VERSION_NR < 1040001000 +#warning "=======================" +#warning "." +#warning "." +#warning "." +#warning "." +#warning CGAL library version is old, risking buggy behavior. Please see README.md. Compiling anyway. +#warning "." +#warning "." +#warning "." +#warning "." +#warning "=======================" +#endif // CGAL_VERSION_NR < 10400010000 +#endif //ENABLE_CGAL + +#ifdef ENABLE_OPENCSG +#include +// kludge - GLEW doesnt have compiler-accessible version numbering +#ifndef GLEW_ARB_occlusion_query2 +#error GLEW library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else + + +#include +// 1.3.2 -> 0x0132 +#if OPENCSG_VERSION < 0x0132 +#error OPENCSG library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#else +#endif // ENABLE_OPENCSG + +#include +#if QT_VERSION < 0x040603 +#error QT library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check +#endif // QT + + +#ifdef ENABLE_OPENCSG +#endif // OpenCSG +#endif // GLEW +#endif // ENABLE_OPENCSG + +#ifdef ENABLE_CGAL +#endif // CGAL error +#endif // ENABLE_CGAL + +#endif // Boost +#endif // Eigen2 +#endif // MPFR +#endif // GMP + +#endif // OPENSCAD_SKIP_VERSION_CHECK + -- cgit v0.10.1 From a872691ab50bb1c62fa357d59e0e3dd2ae586f08 Mon Sep 17 00:00:00 2001 From: don bright Date: Thu, 12 Jul 2012 18:47:34 -0700 Subject: add reminder to env-var script to re-run qmake diff --git a/scripts/setenv-linbuild.sh b/scripts/setenv-linbuild.sh index 9719533..0a85f4c 100644 --- a/scripts/setenv-linbuild.sh +++ b/scripts/setenv-linbuild.sh @@ -21,3 +21,9 @@ echo LD_RUN_PATH modified echo OPENSCAD_LIBRARIES modified echo GLEWDIR modified +if [ "`command -v qmake-qt4`" ]; then + echo "Please re-run qmake-qt4" +else + echo "Please re-run qmake" +fi + -- cgit v0.10.1 From a2a31e76315da1290deac91c7c34900378b836d2 Mon Sep 17 00:00:00 2001 From: don bright Date: Fri, 13 Jul 2012 04:31:28 +0200 Subject: detect cmake version. enable build_git diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh index aef58b9..6647d07 100755 --- a/scripts/linux-build-dependencies.sh +++ b/scripts/linux-build-dependencies.sh @@ -16,7 +16,9 @@ BASEDIR=$HOME/openscad_deps OPENSCADDIR=$PWD SRCDIR=$BASEDIR/src DEPLOYDIR=$BASEDIR -NUMCPU=2 # paralell builds for some libraries +if [ ! $NUMCPU ]; then + NUMCPU=1 # paralell builds for some libraries +fi printUsage() { @@ -24,6 +26,22 @@ printUsage() echo } +build_git() +{ + version=$1 + echo "Building git" $version "..." + cd $BASEDIR/src + rm -rf git-$version + if [ ! -f git-$version.tar.gz ]; then + curl -O http://git-core.googlecode.com/files/git-$version.tar.gz + fi + tar zxf git-$version.tar.gz + cd git-$version + ./configure --prefix=$DEPLOYDIR + make -j$NUMCPU + make install +} + build_cmake() { version=$1 @@ -208,7 +226,7 @@ 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 "(use export NUMCPU=x)" mkdir -p $SRCDIR $DEPLOYDIR export PATH=$BASEDIR/bin:$PATH @@ -226,6 +244,11 @@ fi if [ ! "`command -v cmake`" ]; then build_cmake 2.8.8 fi +if [ "`cmake --version | grep 'version 2.[1-6][^0-9]'`" ]; then + build_cmake 2.8.8 +fi + +# build_git 1.7.10.3 build_eigen 2.0.17 build_gmp 5.0.5 -- cgit v0.10.1 From e1fe9a33a6f078d2e3f9e2a7393c4a1b177b801b Mon Sep 17 00:00:00 2001 From: don bright Date: Thu, 12 Jul 2012 21:51:38 -0500 Subject: improve wording of CGAL warning + env var warning diff --git a/scripts/setenv-linbuild.sh b/scripts/setenv-linbuild.sh index 0a85f4c..290a90a 100644 --- a/scripts/setenv-linbuild.sh +++ b/scripts/setenv-linbuild.sh @@ -21,9 +21,9 @@ echo LD_RUN_PATH modified echo OPENSCAD_LIBRARIES modified echo GLEWDIR modified -if [ "`command -v qmake-qt4`" ]; then - echo "Please re-run qmake-qt4" +if [ "`command -v qmake-qt4`" ]; then + echo "Please re-run qmake-qt4 and run 'make clean' if necessary" else - echo "Please re-run qmake" + echo "Please re-run qmake and run 'make clean' if necessary" fi diff --git a/src/version_check.h b/src/version_check.h index 45e00ec..4d10b0b 100644 --- a/src/version_check.h +++ b/src/version_check.h @@ -59,7 +59,7 @@ a time, to avoid confusion. #warning "." #warning "." #warning "." -#warning CGAL library version is old, risking buggy behavior. Please see README.md. Compiling anyway. +#warning CGAL library version is old, risking buggy behavior. Please see README.md. Continuing anyway. #warning "." #warning "." #warning "." -- cgit v0.10.1 From 2aaccdcfac97f2bf432f88665261f9b582bbb8b3 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sat, 14 Jul 2012 21:05:17 -0400 Subject: Don't use grabMouse() and setFocus(). Attempt to fix #53 diff --git a/src/glview.cc b/src/glview.cc index bea5856..624b266 100644 --- a/src/glview.cc +++ b/src/glview.cc @@ -554,8 +554,6 @@ void GLView::mousePressEvent(QMouseEvent *event) { mouse_drag_active = true; last_mouse = event->globalPos(); - grabMouse(); - setFocus(); } void GLView::normalizeAngle(GLdouble& angle) -- cgit v0.10.1