Skip to content

Commit

Permalink
Merge branch 'master' into boost_filesystem
Browse files Browse the repository at this point in the history
Conflicts:
	boost.pri
	src/lexer.l
	tests/CMakeLists.txt
  • Loading branch information
kintel committed Jan 4, 2012
2 parents cbabbae + ba8aa51 commit fdce8d1
Show file tree
Hide file tree
Showing 77 changed files with 1,091 additions and 407 deletions.
8 changes: 8 additions & 0 deletions RELEASE_NOTES
@@ -1,3 +1,10 @@
OpenSCAD 2012.XX
================

Deprecations:
o The old include syntax "<filename.scad>" without the include keyword is no
longer supported and will cause a syntax error.

OpenSCAD 2011.12
================

Expand All @@ -13,6 +20,7 @@ o New import() statement reads the correct file format based on the filename ext
(.stl, .dxf and .off is supported)
o The color() statement now supports an alpha parameter, e.g. color(c=[1,0,0], alpha=0.4)
o The color() statement now supports specifying colors as strings, e.g. color("Red")
o The color() statement now overrides colors specified further down in the tree
o if()/else() and the ternary operator can now take any value type as parameter. false, 0, empty string and empty vector or illegal value type will evaluate as false, everything else as true.
o Strings can now be lexographically compared using the <, <=, >, >= operators
o Added PI constant.
Expand Down
4 changes: 4 additions & 0 deletions bison.pri
Expand Up @@ -22,6 +22,10 @@ unix:freebsd-g++ {
QMAKE_YACC = /usr/local/bin/bison
}

unix:netbsd* {
QMAKE_YACC = /usr/pkg/bin/bison
}

unix:linux* {
exists(/usr/bin/bison) {
QMAKE_YACC = /usr/bin/bison
Expand Down
64 changes: 47 additions & 17 deletions boost.pri
Expand Up @@ -6,35 +6,65 @@ boost {
!isEmpty(BOOST_DIR) {
QMAKE_INCDIR += $$BOOST_DIR
message("boost location: $$BOOST_DIR")
win32:QMAKE_LIBDIR += -L$$BOOST_DIR/lib
win32: QMAKE_LIBDIR += -L$$BOOST_DIR/lib
}

win32:!CONFIG(mingw-cross-env) {
LIBS += -llibboost_thread-vc90-mt-s-1_46_1 -llibboost_program_options-vc90-mt-s-1_46_1 -llibboost_filesystem-vc90-mt-s-1_46_1 -llibboost_system-vc90-mt-s-1_46_1
}

CONFIG(mingw-cross-env) {
DEFINES += BOOST_STATIC
DEFINES += BOOST_THREAD_USE_LIB
DEFINES += Boost_USE_STATIC_LIBS
LIBS += -lboost_thread_win32-mt -lboost_program_options-mt
BOOST_LINK_FLAGS = -lboost_thread_win32-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt
}

unix {
BMT_TEST1 = /usr/lib64/libboost*thread-mt*
BMT_TEST2 = /usr/lib/libboost*thread-mt*
BMT_TEST3 = $$BOOST_DIR/lib/libboost*thread-mt*
isEmpty(BOOST_LINK_FLAGS):win32 {
BOOST_LINK_FLAGS = -llibboost_thread-vc90-mt-s-1_46_1 -llibboost_program_options-vc90-mt-s-1_46_1 -llibboost_filesystem-vc90-mt-s-1_46_1 -llibboost_system-vc90-mt-s-1_46_1 -llibboost_regex-vc90-mt-s-1_46_1
}

exists($$BMT_TEST1)|exists($$BMT_TEST2)|exists($$BMT_TEST3) {
LIBS += -lboost_thread-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt
BOOST_IS_MT = true
}
# check for OPENSCAD_LIBDIR + multithread
isEmpty(BOOST_LINK_FLAGS) {
OPENSCAD_LIBDIR = $$(OPENSCAD_LIBRARIES)
!isEmpty(OPENSCAD_LIBDIR) {
exists($$OPENSCAD_LIBDIR/lib/libboost*thread-mt*) {
BOOST_LINK_FLAGS = -lboost_thread-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt
} else {
exists($$OPENSCAD_LIBDIR/lib/libboost*thread*) {
BOOST_LINK_FLAGS = -lboost_thread -lboost_program_options -lboost_filesystem -lboost_system -lboost_regex
}
}
}
}

unix|macx {
isEmpty(BOOST_IS_MT) {
LIBS += -lboost_thread -lboost_program_options -lboost_filesystem -lboost_system -lboost_regex
# check for BOOSTDIR + multithread
isEmpty(BOOST_LINK_FLAGS) {
BOOST_DIR = $$(BOOSTDIR)
!isEmpty(BOOST_DIR) {
exists($$BOOST_DIR/lib/libboost*thread-mt*) {
BOOST_LINK_FLAGS = -lboost_thread-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt
} else {
exists($$BOOST_DIR/lib/libboost*thread*) {
BOOST_LINK_FLAGS = -lboost_thread -lboost_program_options -lboost_filesystem -lboost_system -lboost_regex
}
}
}
}

isEmpty(BOOST_LINK_FLAGS) {
unix {
BMT_TEST1 = /usr/lib64/libboost*thread-mt*
BMT_TEST2 = /usr/lib/libboost*thread-mt*
BMT_TEST3 = /usr/pkg/lib/libboost*thread-mt* # netbsd
exists($$BMT_TEST1)|exists($$BMT_TEST2)|exists($$BMT_TEST3) {
BOOST_LINK_FLAGS = -lboost_thread-mt -lboost_program_options-mt -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt
}
}
}

isEmpty(BOOST_LINK_FLAGS) {
unix|macx {
BOOST_LINK_FLAGS = -lboost_thread -lboost_program_options -lboost_filesystem -lboost_system -lboost_regex
}
}

LIBS += $$BOOST_LINK_FLAGS

}
1 change: 0 additions & 1 deletion doc/TODO.txt
Expand Up @@ -259,7 +259,6 @@ o variants of module transparent() { %child(); }
o define modules
o define functions
o built-in variables and constants (builtin-tests.scad)
o Write a regression test for the hexagonal cylinder orientation issue
o Caching
- Test that caching is actually performed (speedup + same results)
- Test the modifier characters correctly influence the cache (also when
Expand Down
6 changes: 3 additions & 3 deletions doc/release-checklist.txt
Expand Up @@ -2,8 +2,8 @@ OpenSCAD Release Checklist
--------------------------

o Update version
release-linux.sh
publish-macosx.sh
scripts/release-linux.sh
scripts/publish-macosx.sh
FIXME: Windows

o Update RELEASE_NOTES
Expand All @@ -12,7 +12,7 @@ o Tag release
git tag "openscad-2011.12"

o build source package
git archive --format=tar openscad-2011.12 --prefix=openscad-2011.12/ | gzip > openscad-2011.12.src.tar.gz
scripts/git-archive-all.py --prefix=openscad-2011.12/ openscad-2011.12.src.tar.gz

o build binaries
tar xzf openscad-2011.12.src.tar.gz
Expand Down
56 changes: 29 additions & 27 deletions doc/testing.txt
Expand Up @@ -10,7 +10,7 @@ $ cd tests
$ cmake .
$ make

Windows:
Windows + MSVC:

First, get a normal build working by following instructions at
http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Windows
Expand All @@ -22,6 +22,10 @@ Then, from the QT command prompt:
> cmake .
> nmake -f Makefile

Cross compiling Linux->Win32:

Please see openscad/tests/CMingw-cross-env.cmake for instructions.

B) Running tests

$ ctest Runs tests enabled by default
Expand Down Expand Up @@ -50,55 +54,53 @@ Adding a new regression test:
Troubleshooting:
------------------------------

0. Headless unix servers (no X11)
0. Headless unix servers

$ Xvfb :5 -screen 0 800x600x24 &
If you are attempting to run the tests on a unix-like system but only
have shell-console access, you may be able to run the tests by using a
virtual framebuffer program like Xvnc or Xvfb. For example:

$ Xvfb :5 -screen 0 800x600x24 &
$ DISPLAY=:5 ctest

1. Trouble finding libraries
Some versions of Xvfb may fail, however.

1. Trouble finding libraries on unix

To help CMAKE find eigen2, OpenCSG, CGAL, Boost, and GLEW, you can use
environment variables, just like for the main qmake & openscad.pro. Examples:

OPENCSGDIR=~/OpenCSG-1.3.2 EIGEN2DIR=~/eigen2 cmake .
OPENSCAD_LIBRARIES=~ cmake .
CGALDIR=~/CGAL-3.9 BOOSTDIR=~/boost-1.47.0 cmake .

Valid variables are as follows (see CMakeLists.txt for more info):
Valid variables are as follows:

BOOSTDIR, CGALDIR, EIGEN2DIR, GLEWDIR, OPENCSGDIR, OPENSCAD_LIBRARIES

2. Logs
2. Location of logs

Logs of test runs are found in tests/build/Testing/Temporary
Pretty-printed index.html is in a subdir of tests/build/Testing/Temporary
A pretty-printed index.html is in a subdir of tests/build/Testing/Temporary
Expected results are found in tests/regression/*
Actual results are found in tests/build/testname-output/*

3. Cross-compiling
3. Image-based tests takes a long time, they fail, and the log says 'return -11'

Cross-compiling of tests has not been automated nor tested
Imagemagick may have crashed while comparing the expected images to the
test-run generated (actual) images. You can try using the alternate
ImageMagick comparison method by by erasing CMakeCache, and re-running
cmake with -DCOMPARATOR=ncc. This will enable the Normalized Cross
Comparison method.

4. Image-based tests takes a long time, they fail, and it says 'return -11'

Imagemagick may have crashed. You can try using the alternate IM comparator
based on Normalized Cross Correlation. Pass -DCOMPARATOR=ncc to cmake

5. Testing images fails with 'morphology' not found for ImageMagick
4. Testing images fails with 'morphology not found" for ImageMagick in the log

Your version of imagemagick is old. Upgrade, or pass -DCOMPARATOR=old to
cmake. The comparison will be of lowered reliability.

6. Unexplained or bizarre errors.

This can happen on dynamic-library systems (linux) where you try to use
your own version of a library while the system still has another version
under the system paths. You can diagnose this by looking at your cmake
log as well as your sysinfo.txt file, as well as running 'ldd' against
your binaries, to make sure that the proper versions of libraries are
getting compiled and linked with the test binaries.

7. Other issues
5. Other issues

The OpenSCAD User Manual has a section on buildling. Check there for updates:
The OpenSCAD User Manual has a section on buildling. Please check there
for updates:

http://en.wikibooks.org/wiki/OpenSCAD_User_Manual

39 changes: 28 additions & 11 deletions eigen2.pri
@@ -1,20 +1,37 @@
eigen2 {

CONFIG(mingw-cross-env) {
EIGEN2_INCLUDEPATH = mingw-cross-env/include/eigen2
}

# Optionally specify location of Eigen2 using the
# EIGEN2DIR env. variable
EIGEN2_DIR = $$(EIGEN2DIR)
!isEmpty(EIGEN2_DIR) {
EIGEN2_INCLUDEPATH = $$EIGEN2_DIR
# OPENSCAD_LIBRARIES env. variable
isEmpty(EIGEN2_INCLUDEPATH) {
OPENSCAD_LIBRARIES_DIR = $$(OPENSCAD_LIBRARIES)
!isEmpty(OPENSCAD_LIBRARIES_DIR) {
exists($$OPENSCAD_LIBRARIES_DIR/include/eigen2) {
EIGEN2_INCLUDEPATH = $$OPENSCAD_LIBRARIES_DIR/include/eigen2
}
}
}
else {
CONFIG(mingw-cross-env) {
EIGEN2_INCLUDEPATH = mingw-cross-env/include/eigen2
} else {
freebsd-g++: EIGEN2_INCLUDEPATH *= /usr/local/include/eigen2
macx: EIGEN2_INCLUDEPATH *= /opt/local/include/eigen2
!macx:!freebsd-g++:!win32:EIGEN2_INCLUDEPATH *= /usr/include/eigen2

# Optionally specify location of Eigen2 using the
# EIGEN2DIR env. variable
isEmpty(EIGEN2_INCLUDEPATH) {
EIGEN2_DIR = $$(EIGEN2DIR)
!isEmpty(EIGEN2_DIR) {
EIGEN2_INCLUDEPATH = $$EIGEN2_DIR
message("EIGEN2 location: $$EIGEN2_INCLUDEPATH")
}
}

isEmpty(EIGEN2_INCLUDEPATH) {
freebsd-g++: EIGEN2_INCLUDEPATH = /usr/local/include/eigen2
macx: EIGEN2_INCLUDEPATH = /opt/local/include/eigen2
linux*: EIGEN2_INCLUDEPATH = /usr/include/eigen2
netbsd*: EIGEN2_INCLUDEPATH = /usr/pkg/include/eigen2
}

# eigen2 being under 'include/eigen2' needs special prepending
QMAKE_INCDIR_QT = $$EIGEN2_INCLUDEPATH $$QMAKE_INCDIR_QT

Expand Down
8 changes: 4 additions & 4 deletions examples/example008.scad
Expand Up @@ -20,13 +20,13 @@ difference()

intersection()
{
translate([ -125, -25, -25])
linear_extrude(height = 50, convexity = 1)
translate([ -125, -25, -26])
linear_extrude(height = 52, convexity = 1)
import(file = "example008.dxf", layer = "X");

rotate(90, [0, 1, 0])
translate([ -125, -25, -25])
linear_extrude(height = 50, convexity = 1)
translate([ -125, -25, -26])
linear_extrude(height = 52, convexity = 1)
import(file = "example008.dxf", layer = "X");
}
}
4 changes: 4 additions & 0 deletions flex.pri
Expand Up @@ -13,6 +13,10 @@ unix:freebsd-g++ {
QMAKE_LEX = /usr/local/bin/flex
}

unix:netbsd* {
QMAKE_LEX = /usr/pkg/bin/flex
}

unix:linux* {
exists(/usr/bin/flex) {
QMAKE_LEX = /usr/bin/flex
Expand Down
2 changes: 1 addition & 1 deletion libraries/MCAD
Submodule MCAD updated 1 files
+1 −1 involute_gears.scad
11 changes: 11 additions & 0 deletions openscad.pro
Expand Up @@ -86,6 +86,15 @@ linux*:exists(/usr/lib64/libGLU*)|linux*:exists(/usr/lib/libGLU*) {
LIBS += -lGLU
}

netbsd* {
LIBS += -L/usr/X11R7/lib
QMAKE_LFLAGS += -Wl,-R/usr/X11R7/lib
QMAKE_LFLAGS += -Wl,-R/usr/pkg/lib
!isEmpty(OPENSCAD_LIBDIR) {
QMAKE_LFLAGS += -Wl,-R$$OPENSCAD_LIBDIR/lib
}
}

# See Dec 2011 OpenSCAD mailing list, re: CGAL/GCC bugs.
*g++* {
QMAKE_CXXFLAGS *= -fno-strict-aliasing
Expand Down Expand Up @@ -147,6 +156,7 @@ HEADERS += src/parsersettings.h \
src/builtin.h \
src/context.h \
src/csgterm.h \
src/csgtermnormalizer.h \
src/dxfdata.h \
src/dxfdim.h \
src/dxftess.h \
Expand Down Expand Up @@ -198,6 +208,7 @@ SOURCES += src/mathc99.cc \
src/node.cc \
src/context.cc \
src/csgterm.cc \
src/csgtermnormalizer.cc \
src/polyset.cc \
src/csgops.cc \
src/transform.cc \
Expand Down

0 comments on commit fdce8d1

Please sign in to comment.