From 491caa15ada3e51fd252aaa74de31178f01ff5ad Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 4 Jul 2012 04:34:00 +0200 Subject: auto-detect curl + cmake. link libs properly. use 'openscad_deps' subdir diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh index 9097850..7727c4e 100755 --- a/scripts/linux-build-dependencies.sh +++ b/scripts/linux-build-dependencies.sh @@ -15,11 +15,11 @@ # -- you can uncomment 'build_cmake' at the bottom # -BASEDIR=$HOME +BASEDIR=$HOME/openscad_deps OPENSCADDIR=$PWD SRCDIR=$BASEDIR/src DEPLOYDIR=$BASEDIR -NUMCPU=2 # paralell builds for some libraries +NUMCPU=4 # paralell builds for some libraries printUsage() { @@ -87,12 +87,10 @@ build_mpfr() cd $BASEDIR/src rm -rf mpfr-$version if [ ! -f mpfr-$version.tar.bz2 ]; then - curl -O http://www.mpfr.org/mpfr-current/mpfr-$version.tar.bz2 + curl -O http://www.mpfr.org/mpfr-$version/mpfr-$version.tar.bz2 fi tar xjf mpfr-$version.tar.bz2 cd mpfr-$version - curl -O http://www.mpfr.org/mpfr-current/allpatches - patch -N -Z -p1 < allpatches mkdir build cd build ../configure --prefix=$DEPLOYDIR --with-gmp=$DEPLOYDIR @@ -208,19 +206,33 @@ echo "Using srcdir:" $SRCDIR echo "Number of CPUs for parallel builds:" $NUMCPU mkdir -p $SRCDIR $DEPLOYDIR -#build_curl 7.26.0 +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" +echo "LD_LIBRARY_PATH modified" +echo "LD_RUN_PATH modified" + +if [ ! "`command -v curl`" ]; then + build_curl 7.26.0 +fi + # NB! For cmake, also update the actual download URL in the function -#build_cmake 2.8.8 +if [ ! "`command -v cmake`" ]; then + build_cmake 2.8.8 +fi + build_eigen 2.0.17 build_gmp 5.0.5 -build_mpfr 3.1.0 +build_mpfr 3.1.1 build_boost 1.47.0 # NB! For CGAL, also update the actual download URL in the function build_cgal 4.0 build_glew 1.7.0 build_opencsg 1.3.2 -echo "Now do this:" +echo "OpenSCAD dependencies built in " $BASEDIR +echo "To build OpenSCAD, copy/paste these lines to your shell prompt: " echo "export LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64" echo "GLEWDIR=$DEPLOYDIR OPENSCAD_LIBRARIES=$DEPLOYDIR qmake-qt4" echo "make -j$NUMCPU" -- cgit v0.10.1 From 9a05c66e1ccbdf44ad5c1bf333faff204b629619 Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 4 Jul 2012 06:33:04 +0200 Subject: document linux source build. add env variable script for linux src builds diff --git a/README.md b/README.md index b1a618d..1196621 100644 --- a/README.md +++ b/README.md @@ -79,10 +79,10 @@ To build OpenSCAD, you need some libraries and tools. The version numbers in brackets specify the versions which have been used for development. Other versions may or may not work as well. -If you're using Ubuntu, you can install these libraries from -aptitude. If you're using Mac, there is a build script that compiles -the libraries from source. Follow the instructions for the platform -you're compiling on below. +If you're using a newer version of Ubuntu, you can install these +libraries from aptitude. If you're using Mac, or an older Linux, there +are build scripts that download and compile the libraries from source. +Follow the instructions for the platform you're compiling on below. * [Qt4 (4.4 - 4.7)](http://www.qt.nokia.com/) * [CGAL (3.6 - 3.9)](http://www.cgal.org/) @@ -117,15 +117,25 @@ compilation process. After that, follow the Compilation instructions below. -### Building for Ubuntu +### Building for older Linux or without root access -If you have done this and want to contribute, fork the repo and -contribute docs on how to build for windows! +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. + + source ./scripts/setenv-linbuild.sh + +Then run the script to download & compile all the prerequisite libraries above: + + ./scripts/linux-build-dependencies.sh + +After that, follow the Compilation instructions below. ### Building for Windows -If you have done this and want to contribute, fork the repo and -contribute docs on how to build for windows! +OpenSCAD for Windows is usually cross-compiled from Linux. If you wish to +attempt an MSVC build, please see this site: +http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Windows ### Compilation diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh index 7727c4e..a789e9d 100755 --- a/scripts/linux-build-dependencies.sh +++ b/scripts/linux-build-dependencies.sh @@ -7,12 +7,9 @@ # Usage: linux-build-dependencies.sh # # Prerequisites: -# - curl -# -- you can uncomment 'build_curl' at the bottom -# -- and add $BASEDIR/bin to your PATH, i.e. in .bash_profile +# - wget # - Qt4 -# - cmake 2.8 -# -- you can uncomment 'build_cmake' at the bottom +# - cmake 2.8 ( force build_cmake at bottom if yours is too old ) # BASEDIR=$HOME/openscad_deps @@ -209,9 +206,9 @@ 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" -echo "LD_LIBRARY_PATH modified" -echo "LD_RUN_PATH modified" +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 @@ -232,8 +229,3 @@ build_glew 1.7.0 build_opencsg 1.3.2 echo "OpenSCAD dependencies built in " $BASEDIR -echo "To build OpenSCAD, copy/paste these lines to your shell prompt: " -echo "export LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64" -echo "GLEWDIR=$DEPLOYDIR OPENSCAD_LIBRARIES=$DEPLOYDIR qmake-qt4" -echo "make -j$NUMCPU" - diff --git a/scripts/setenv-linbuild.sh b/scripts/setenv-linbuild.sh new file mode 100644 index 0000000..a61b55a --- /dev/null +++ b/scripts/setenv-linbuild.sh @@ -0,0 +1,16 @@ +# BASEDIR and DEPLOYDIR must be the same as in linux-build-dependencies.sh +BASEDIR=$HOME/openscad_deps +DEPLOYDIR=$BASEDIR + +PATH=$BASEDIR/bin:$PATH +LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64 +LD_RUN_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64 +OPENSCAD_LIBRARIES=$DEPLOYDIR +GLEWDIR=$DEPLOYDIR + +echo PATH modified +echo LD_LIBRARY_PATH modified +echo LD_RUN_PATH modified +echo OPENSCAD_LIBRARIES modified +echo GLEWDIR modified + -- cgit v0.10.1 From 984f7dc3f916232375ec7efe3b240e4c286a4c3c Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 4 Jul 2012 06:56:17 +0200 Subject: Add ubuntu package list for aptitude. Add pointer to wikibooks site diff --git a/README.md b/README.md index 1196621..8533e0d 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,15 @@ compilation process. After that, follow the Compilation instructions below. +### Building for newer Ubunutu + +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 libglut3-dev libopencsg-dev libopencsg1 + +Check your library versions against the list above. After that, follow +the Compilation instructions below. + ### Building for older Linux or without root access First, make sure that you have compiler tools (build-essential on ubuntu). @@ -148,3 +157,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: +http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_OpenSCAD_from_Sources -- cgit v0.10.1 From bbef180a218aa59f03ea7bcf389ff3d1a357907d Mon Sep 17 00:00:00 2001 From: don bright Date: Tue, 3 Jul 2012 22:27:31 -0700 Subject: kludge-fix for broken Makefiles for opencsg + glew on Fedora 64bit diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh index a789e9d..286399b 100755 --- a/scripts/linux-build-dependencies.sh +++ b/scripts/linux-build-dependencies.sh @@ -16,7 +16,7 @@ BASEDIR=$HOME/openscad_deps OPENSCADDIR=$PWD SRCDIR=$BASEDIR/src DEPLOYDIR=$BASEDIR -NUMCPU=4 # paralell builds for some libraries +NUMCPU=2 # paralell builds for some libraries printUsage() { @@ -145,6 +145,10 @@ build_glew() tar xzf glew-$version.tgz cd glew-$version mkdir -p $DEPLOYDIR/lib/pkgconfig + + # uncomment this kludge for Fedora 64bit + # sed -i s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ config/Makefile.linux + GLEW_DEST=$DEPLOYDIR make -j$NUMCPU GLEW_DEST=$DEPLOYDIR make install } @@ -161,6 +165,10 @@ build_opencsg() tar xzf OpenCSG-$version.tar.gz cd OpenCSG-$version sed -i s/example// opencsg.pro # examples might be broken without GLUT + + # uncomment this kludge for Fedora 64bit + # sed -i s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ src/Makefile + qmake-qt4 make install -v lib/* $DEPLOYDIR/lib -- cgit v0.10.1 From 5b805ed5869d1f2b0bc3a9c18d565b4780a2d163 Mon Sep 17 00:00:00 2001 From: don bright Date: Tue, 3 Jul 2012 22:31:22 -0700 Subject: wget or curl required. if curl isnt there, wget will fetch + build it diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh index 286399b..aef58b9 100755 --- a/scripts/linux-build-dependencies.sh +++ b/scripts/linux-build-dependencies.sh @@ -7,7 +7,7 @@ # Usage: linux-build-dependencies.sh # # Prerequisites: -# - wget +# - wget or curl # - Qt4 # - cmake 2.8 ( force build_cmake at bottom if yours is too old ) # -- cgit v0.10.1 From def43ad3169d4dfbbcc42de41ab405af35f7ec23 Mon Sep 17 00:00:00 2001 From: don bright Date: Tue, 3 Jul 2012 22:53:37 -0700 Subject: improve script reporting and functionality (export) diff --git a/scripts/setenv-linbuild.sh b/scripts/setenv-linbuild.sh index a61b55a..d9aeea8 100644 --- a/scripts/setenv-linbuild.sh +++ b/scripts/setenv-linbuild.sh @@ -2,12 +2,14 @@ BASEDIR=$HOME/openscad_deps DEPLOYDIR=$BASEDIR -PATH=$BASEDIR/bin:$PATH -LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64 -LD_RUN_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64 -OPENSCAD_LIBRARIES=$DEPLOYDIR -GLEWDIR=$DEPLOYDIR +export PATH=$BASEDIR/bin:$PATH +export LD_LIBRARY_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64 +export LD_RUN_PATH=$DEPLOYDIR/lib:$DEPLOYDIR/lib64 +export OPENSCAD_LIBRARIES=$DEPLOYDIR +export GLEWDIR=$DEPLOYDIR +echo BASEDIR: $BASEDIR +echo DEPLOYDIR: $DEPLOYDIR echo PATH modified echo LD_LIBRARY_PATH modified echo LD_RUN_PATH modified -- cgit v0.10.1 From 9b0f148d2d71ae0d975912e1b405650a45f6b042 Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 4 Jul 2012 08:03:38 +0200 Subject: documentation for purpose of file diff --git a/scripts/setenv-linbuild.sh b/scripts/setenv-linbuild.sh index a61b55a..8e3d76d 100644 --- a/scripts/setenv-linbuild.sh +++ b/scripts/setenv-linbuild.sh @@ -1,3 +1,8 @@ +# setup env variables for building OpenSCAD against custom built +# dependency libraries from linux-build-dependencies.sh + +# run this file with 'source setenv-linbuild.sh' + # BASEDIR and DEPLOYDIR must be the same as in linux-build-dependencies.sh BASEDIR=$HOME/openscad_deps DEPLOYDIR=$BASEDIR -- cgit v0.10.1