Building 2013.1 from source for the Mac 10.8.3

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Building 2013.1 from source for the Mac 10.8.3

devlaam
Today i tried to build openscad for the Mac from source.
I succeeded but this was not without some difficulties.
Just to help others out, i share this with you.

My Mac Book Pro is: 10.8.3 (latest version at this moment)

First, follow the manual at https://github.com/openscad/openscad/
You need: Xcode, Cmake and git. I assume you have them.

Now, define a suitable empty directory (Tools) and

Tools $ git clone git://github.com/openscad/openscad.git
Tools $ cd openscad
openscad $ git submodule update --init
openscad $ source setenv_mjau.sh

Subsequently i tried:
openscad # ./scripts/macosx-build-dependencies.sh

But that was no success:

Detected Mountain Lion (10.8) or later
Using gcc compiler
Setting build target to 10.6 or later
Building 64-bit binaries
Using basedir: /Volumes/DATA/Bedrijf/Projecten/HexArt/Software/Tools/openscad/../libraries
Building Qt 4.8.4 ...

This is the Qt for Mac OS X Open Source Edition.

You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU General Public License (GPL) versions 3.

You have already accepted the terms of the  license.

Creating qmake. Please wait...
g++ -c -o project.o -arch i386 -pipe -DQMAKE_OPENSOURCE_EDITION -fconstant-cfstrings -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -Igenerators/integrity -I/Volumes/DATA/Bedrijf/Projecten/HexArt/Software/Tools/libraries/src/qt-everywhere-opensource-src-4.8.4/include -I/Volumes/DATA/Bedrijf/Projecten/HexArt/Software/Tools/libraries/src/qt-everywhere-opensource-src-4.8.4/include/QtCore -I/Volumes/DATA/Bedrijf/Projecten/HexArt/Software/Tools/libraries/src/qt-everywhere-opensource-src-4.8.4/src/corelib/global -I/Volumes/DATA/Bedrijf/Projecten/HexArt/Software/Tools/libraries/src/qt-everywhere-opensource-src-4.8.4/src/corelib/xml -I/Volumes/DATA/Bedrijf/Projecten/HexArt/Software/Tools/libraries/src/qt-everywhere-opensource-src-4.8.4/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/Volumes/DATA/Bedrijf/Projecte
 n/HexArt
 /
Software/Tools/libraries/src/qt-everywhere-opensource-src-4.8.4/mkspecs/macx-llvm -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DEPRECATED  project.cpp
g++: error: unrecognized command line option '-fconstant-cfstrings'
gmake: *** [project.o] Error 1
openscad $ g++
g++: fatal error: no input files
compilation terminated.
openscad $ g++ --version
g++ (MacPorts gcc47 4.7.3_0) 4.7.3
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Since openscad can now also be installed with macports,
i decided to give that  a try (as root)

~ $ cd ..
~ $ sudo port install openscad

This works like a dream, but the goal is to build the application
from source in my own git repository. In any case, all the dependencies
should now be installed on the system. Lets check:

openscad $ ./scripts/check-dependencies.sh
depname     minimum     found       OKness      
qt4         4.4         4.8.4       OK          
cgal        3.6         4.1         OK          
gmp         5.0         5.0.5       OK          
mpfr        3.0         3.1.1       OK          
boost       1.35        1.53        OK          
opencsg     1.3.2       1.3.2       OK          
glew        1.5.4       1.7.0       OK          
eigen       2.0.0       3.1.3       OK          
gcc         4.2         4.7.3       OK          
bison       2.4         2.7         OK          
flex        2.5.35      2.5.37      OK          
make        3           3.82        OK          
~/Library/Frameworks/Sparkle.framework...
/Library/Frameworks/Sparkle.framework...
OS X: Sparkle.framework found in /Library  

So that seems okay. Time to build the application.

openscad $ qmake
(... some messages)

openscad $ make
(... compilation works with warnings, then at linking:)
ld: warning: directory not found for option '-L[path]/openscad/../libraries/install/lib'
ld: library not found for -lboost_thread
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Hmm, i cleaned up the libraries dir after the
./scripts/macosx-build-dependencies.sh failed,
but this may be needed somehow

openscad $ mkdir - ../libraries/install/lib

The error is more severe. Why is the lib not found when the dependencies
where ok? It turns out that i have multithreaded-save libs on the system
whereas make is looking for the bare ones, see:
http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html

For me the most easy solution was just copy and rename the libs:

Tools $ cp /opt/local/lib/*-mt.a  libraries/install/lib/
Tools $ cd libraries/install/lib/
lib $ ls | grep -e "\-mt.a" | sed -e 's/-mt.a//' -e 's/.*/&-mt.a &.a/' | xargs -n 2 mv

So let us try again (cd-to-openscad):

openscad $ make
openscad $ open OpenSCAD.app

Yes, time to hack!
 
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Building 2013.1 from source for the Mac 10.8.3

kintel
Administrator
On 2013-05-09, at 16:30 , Ruud Vlaming wrote:
>
> g++: error: unrecognized command line option '-fconstant-cfstrings'
> gmake: *** [project.o] Error 1
> openscad $ g++
> g++: fatal error: no input files
> compilation terminated.
> openscad $ g++ --version
> g++ (MacPorts gcc47 4.7.3_0) 4.7.3

It looks like you have installed your own GCC from MacPorts and are using that as your default compiler.
Somehow, our build scripts for Qt doesn't like that compiler. I've only tested the build script with the compilers shipped by Apple..

> Why is the lib not found when the dependencies where ok?

The check-dependencies script is not 100% in sync with the build system, so things like boost are sometimes reported wrongly.

> It turns out that i have multithreaded-save libs on the system
> whereas make is looking for the bare ones, see:

If you set $BOOSTDIR to point to your Boost installation, this should work. It's just in the case of fallback to system install that we don't know where to look, and fall back to using a non-mt install.
This could perhaps be fixed in boost.pri..

The correct fix would be to support gcc-4.7 from MacPorts.

 -Marius

PS. Using the instructions to build on a clean 10.8 box worked out of the box for me
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Building 2013.1 from source for the Mac 10.8.3

devlaam
On 09-05-13 17:25, Marius Kintel wrote:
> On 2013-05-09, at 16:30 , Ruud Vlaming wrote:
>>
>> g++: error: unrecognized command line option '-fconstant-cfstrings'
>> g++ (MacPorts gcc47 4.7.3_0) 4.7.3
>
> It looks like you have installed your own GCC from MacPorts and
 > are using that as your default compiler.
Yep, that is true.

> The correct fix would be to support gcc-4.7 from MacPorts.
Or, maybe easier, a remark in the instructions which compiler
version to use (eg. use default x.y.z one).

> PS. Using the instructions to build on a clean 10.8 box worked out of the box for me
I do not doubt it. But who has a 'clean machine' these days? The idea
of my post was: report what i found, others may profit. BTW, for most
users it is best to just download the app from the site. Works
perfectly. Second best: use macports. Works perfectly too. This is
already much better than my average experience with open source apps!

So: very well done!


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Building 2013.1 from source for the Mac 10.8.3

donbright
The check dependency script was not written for mac osx. It is only mentioned under the 'building on unix/bsd' section of the README, not under the Mac section.

After several people have used it on mac osx and been confused, I feel like maybe check-dependencies should be disabled on Mac OSX.

-DB


On Thu, May 9, 2013 at 11:20 AM, Ruud Vlaming <[hidden email]> wrote:
On 09-05-13 17:25, Marius Kintel wrote:
> On 2013-05-09, at 16:30 , Ruud Vlaming wrote:
>>
>> g++: error: unrecognized command line option '-fconstant-cfstrings'
>> g++ (MacPorts gcc47 4.7.3_0) 4.7.3
>
> It looks like you have installed your own GCC from MacPorts and
 > are using that as your default compiler.
Yep, that is true.

> The correct fix would be to support gcc-4.7 from MacPorts.
Or, maybe easier, a remark in the instructions which compiler
version to use (eg. use default x.y.z one).

> PS. Using the instructions to build on a clean 10.8 box worked out of the box for me
I do not doubt it. But who has a 'clean machine' these days? The idea
of my post was: report what i found, others may profit. BTW, for most
users it is best to just download the app from the site. Works
perfectly. Second best: use macports. Works perfectly too. This is
already much better than my average experience with open source apps!

So: very well done!


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Building 2013.1 from source for the Mac 10.8.3

kintel
Administrator
On 2013-05-10, at 01:36 , Don Bright wrote:
>
> After several people have used it on mac osx and been confused, I feel like maybe check-dependencies should be disabled on Mac OSX.
>
..or ported :)

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Building 2013.1 from source for the Mac 10.8.3

donbright
lol no problem, donations of a mac will be gladly accepted.


On Thu, May 9, 2013 at 6:37 PM, Marius Kintel <[hidden email]> wrote:
On 2013-05-10, at 01:36 , Don Bright wrote:
>
> After several people have used it on mac osx and been confused, I feel like maybe check-dependencies should be disabled on Mac OSX.
>
..or ported :)

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Building 2013.1 from source for the Mac 10.8.3

kintel
Administrator
On 2013-05-10, at 01:50 , Don Bright wrote:

> lol no problem, donations of a mac will be gladly accepted.
>
Hm, yeah I hear you - I'm looking for a MacBook Air to be able to debug the rendering issues on Intel GPUs..

Once I get the ball rolling in terms of sponsorships/donations, I think I'll create a wiki/webpage which would specify what we could need in addition to developer time; things like computer hardware, EC2, webspace, buildbot accounts etc.

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566