Permalink
Browse files

Merge branch 'master' into lion

Conflicts:
	README.md
	src/linearextrude.cc
	src/parsersettings.cc
	src/value.cc
  • Loading branch information...
2 parents ebc382d + 821c064 commit 7375d72798d29820ba9d4151e5f66fca11cae334 @kintel kintel committed Jul 17, 2012
View
@@ -117,27 +117,34 @@ 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 libglut3-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
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
View
@@ -13,7 +13,7 @@ boost {
DEFINES += BOOST_STATIC
DEFINES += BOOST_THREAD_USE_LIB
DEFINES += Boost_USE_STATIC_LIBS
- BOOST_LINK_FLAGS = -lboost_thread_win32-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt
+ BOOST_LINK_FLAGS = -lboost_thread_win32-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt -lboost_chrono-mt
}
isEmpty(BOOST_LINK_FLAGS):win32 {
View
@@ -8,6 +8,24 @@ CONFIG(mingw-cross-env) {
LIBS += mingw-cross-env/lib/libglu32.a
LIBS += mingw-cross-env/lib/libopencsg.a
LIBS += mingw-cross-env/lib/libmpfr.a
+ LIBS += mingw-cross-env/lib/libgmp.a
LIBS += mingw-cross-env/lib/libCGAL.a
QMAKE_CXXFLAGS += -fpermissive
+
+
+ # Use different location for the cross-compiled binaries + .o files
+ # This allows compiling unix build + mingw build in same tree
+
+ DESTDIR=.
+
+ Release:DESTDIR = release_mingw32
+ Debug:DESTDIR = debug_mingw32
+
+ OBJECTS_DIR = $$DESTDIR/objects
+ MOC_DIR = $$DESTDIR/moc
+ RCC_DIR = $$DESTDIR/rcc
+ UI_DIR = $$DESTDIR/ui
+
}
+
+
View
@@ -85,9 +85,8 @@ QT += opengl
# and https://github.com/openscad/openscad/pull/119
# ( QT += opengl does not automatically link glu on some DSO systems. )
unix:!macx {
- !contains ( QMAKE_LIBS_OPENGL, "-lGLU" ) {
- QMAKE_LIBS_OPENGL += -lGLU
- }
+ QMAKE_LIBS_OPENGL *= -lGLU
+ QMAKE_LIBS_OPENGL *= -lX11
}
netbsd* {
@@ -104,8 +103,9 @@ netbsd* {
QMAKE_CXXFLAGS *= -fno-strict-aliasing
}
-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
@@ -122,17 +122,15 @@ 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)
+# mingw has to come after other items so OBJECT_DIRS will work properly
+CONFIG(mingw-cross-env) {
+ include(mingw-cross-env.pri)
+}
+
win32 {
FLEXSOURCES = src/lexer.l
BISONSOURCES = src/parser.y
@@ -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 \
@@ -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
+
@@ -9,21 +9,30 @@
# 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"
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
@@ -128,7 +137,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
}
@@ -146,8 +159,11 @@ build_glew()
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
+ # Fedora 64-bit
+ if [ "`ls /usr/lib64 | grep Xmu`" ]; then
+ echo "modifying glew makefile for 64 bit machine"
+ sed -ibak s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ config/Makefile.linux
+ fi
GLEW_DEST=$DEPLOYDIR make -j$NUMCPU
GLEW_DEST=$DEPLOYDIR make install
@@ -164,15 +180,22 @@ build_opencsg()
fi
tar xzf OpenCSG-$version.tar.gz
cd OpenCSG-$version
- sed -i s/example// opencsg.pro # examples might be broken without GLUT
+ sed -ibak 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
+ # Fedora 64-bit
+ if [ "`ls /usr/lib64 | grep Xmu`" ]; then
+ echo "modifying opencsg makefile for 64 bit machine"
+ sed -ibak s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ src/Makefile
+ fi
- 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 +219,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
+
+if [ ! $NUMCPU ]; then
+ echo "Note: The NUMCPU environment variable can be set for paralell builds"
+ NUMCPU=1
+fi
+
if [ ! -d $BASEDIR/bin ]; then
mkdir --parents $BASEDIR/bin
fi
@@ -211,13 +244,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
@@ -226,6 +252,31 @@ 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
+
+# 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
@@ -236,4 +287,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
@@ -238,7 +238,7 @@ build_glew()
cd glew-$version
mkdir -p $DEPLOYDIR/lib/pkgconfig
# To avoid running strip on a fat archive as this is not supported by strip
- sed -i bak -e "s/\$(STRIP) -x lib\/\$(LIB.STATIC)//" Makefile
+ sed -ibak -e "s/\$(STRIP) -x lib\/\$(LIB.STATIC)//" Makefile
if $OPTION_32BIT; then
GLEW_EXTRA_FLAGS="-arch i386"
fi
Oops, something went wrong.

0 comments on commit 7375d72

Please sign in to comment.