Fixes for compiling on Ubuntu

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fixes for compiling on Ubuntu

Karl Ostmo
Dear Author,
Here are some changes I had to make to compile OpenSCAD on my Ubuntu system (9.10, x86_64).

The second "else" clause of "openscad.pro" (line 23) should look like this:
else {
    INCLUDEPATH += $(PWD)/../OpenCSG-1.1.1/include
    LIBS += -lmpfr -L$(PWD)/../OpenCSG-1.1.1/lib
    QMAKE_CXXFLAGS += -frounding-math
}


And in "release-linux.sh" make the following two changes:
* on line 1 use "#!/bin/bash" instead of "#!/bin/sh"
* on line 8 "qmake" should be replaced with "qmake-qt4"


Then I am able to run the program like this:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../OpenCSG-1.1.1/lib/ ./openscad


Also, is there a way we can directly check out the trunk from SVN?

I tried the following command, but it didn't work:
svn co svn://svn.clifford.at/openscad/trunk

Karl
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fixes for compiling on Ubuntu

Clifford Wolf
Hello,

On Wed, Dec 23, 2009 at 07:31:14AM -0600, Karl Ostmo wrote:
> The second "else" clause of "[1]openscad.pro" (line 23) should look
> like this:
> else {
>   INCLUDEPATH += $(PWD)/../OpenCSG-1.1.1/include
>   LIBS += -lmpfr -L$(PWD)/../OpenCSG-1.1.1/lib
>   QMAKE_CXXFLAGS += -frounding-math
> }

The lines regarding OpenCSG-1.1.1 wouldn't be neccessary if you'd installed
OpenCSG in your system. The build documentation recommends building opencsg
like that:

        # tar -xvf OpenCSG-1.1.1.tar.gz
        # cd OpenCSG-1.1.1
        # make
        # cp -d lib/lib* /usr/local/lib/
        # cp include/opencsg.h /usr/local/include/
        # ldconfig

also that lines would only work if the OpenCSG-1.1.1 sources would have
been extracted in the same directory as the openscad sources, which is in
no way a sure assumtion.

>    And in "release-linux.sh" make the following two changes:
>    * on line 1 use "#!/bin/bash" instead of "#!/bin/sh"
>    * on line 8 "qmake" should be replaced with "qmake-qt4"

qmake-qt4 is a non-standard name for the binary invented by the debian
people and other distribution vendors to distinguish qmake from qt3 and
qmake from qt4. you could also use the debian alternatives config to change
qmake to point to the qt4 version of the tool...

however - both changes don't hurt in my setup so I've commited this changes
to the svn.

>    Then I am able to run the program like this:
>    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../OpenCSG-1.1.1/lib/ ./openscad

if you'd had installed OpenCSG in /usr/local/lib/ as the doc suggests the
LD_LIBRARY_PATH hack wouldn't be needed.

btw: your suggested command also adds the current directory to
LD_LIBRARY_PATH when LD_LIBRARY_PATH is not set already. better set it
using the ${X:+Y} substitution:

        LD_LIBRARY_PATH="../OpenCSG-1.1.1/lib/${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"

>    Also, is there a way we can directly check out the trunk from SVN?
>    I tried the following command, but it didn't work:
>    svn co svn://svn.clifford.at/openscad/trunk

please use the url from the website to access the repository. it is

        http://svn.clifford.at/openscad/trunk/

(i.e. use the http webdav/deltav protocol, not the svn protocol)

yours,
 - clifford

--
Reality corrupted. Reboot universe? (Y/N).

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fixes for compiling on Ubuntu

Clifford Wolf
In reply to this post by Karl Ostmo
Hi again,

On Wed, Dec 23, 2009 at 07:31:14AM -0600, Karl Ostmo wrote:
> The second "else" clause of "[1]openscad.pro" (line 23) should look
> like this:
> else {
>   INCLUDEPATH += $(PWD)/../OpenCSG-1.1.1/include
>   LIBS += -lmpfr -L$(PWD)/../OpenCSG-1.1.1/lib
>   QMAKE_CXXFLAGS += -frounding-math
> }

I've now cleaned up and applied the -frounding-math part.
(I didn't see that part before)

--snip--
--- openscad.pro        (revision 184)
+++ openscad.pro        (revision 185)
@@ -34,12 +34,12 @@
     INCLUDEPATH += $(PWD)/../install/include /opt/local/include
     # The -L/usr/lib is to force the linker to use system libraries over
     # MacPort libraries
     LIBS += -L/usr/lib -L$(PWD)/../install/lib -L/opt/local/lib /opt/local/lib/libgmp.a /opt/local/lib/libmpfr.a /opt/local/lib/libboost_thread-mt.a
-    QMAKE_CXXFLAGS += -frounding-math
   }
   else {
     LIBS += -lmpfr
   }
   win32:LIBS += -lboost_thread -lgmp
+  QMAKE_CXXFLAGS += -frounding-math
 }

 opencsg {
--snap--

--
"In the future, airplanes will be flown by a dog and a pilot. And the
dog's job will be to make sure that if the pilot tries to touch any of
the buttons, the dog bites him." - Scott Adams (author of Dilbert).

Loading...