[MacPorts] #51840: [openscad] [2015.03-3_0] [build error]

MacPorts noreply at macports.org
Wed Sep 28 06:26:14 CEST 2016


#51840: [openscad] [2015.03-3_0] [build error]
-----------------------+------------------------
  Reporter:  moala@…   |      Owner:  dstrubbe@…
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:  2.3.4
Resolution:            |   Keywords:
      Port:  openscad  |
-----------------------+------------------------

Comment (by ken.cunningham.webuse@…):

 I realized these instructions were not 100% clear, so I redid this process
 tonight to install openscad on 10.6 with [wiki:LibcxxOnOlderSystems]
 installed. The cxx11 upgrade is obviously required for this one. There are
 several steps, and I haven't yet managed to determine how to put all these
 in the portfiles, so these are manual steps.

 The first problem is OpenCSG. By default, when you build it, it builds
 against libstdc++ despite having MacPorts set up for libc++. After
 building OpenCSG, you get

 {{{
 MacPro2010:lib admin$ ls -la
 total 256
 drwxr-xr-x  6 root  admin     204 Sep 27 20:40 .
 drwxr-xr-x  4 root  admin     136 Sep 27 20:40 ..
 -rwxr-xr-x  1 root  admin  100452 Sep 27 20:40 libopencsg.1.4.0.dylib
 lrwxr-xr-x  1 root  admin      22 Sep 27 20:40 libopencsg.1.4.dylib ->
 libopencsg.1.4.0.dylib
 lrwxr-xr-x  1 root  admin      22 Sep 27 20:40 libopencsg.1.dylib ->
 libopencsg.1.4.0.dylib
 lrwxr-xr-x  1 root  admin      22 Sep 27 20:40 libopencsg.dylib ->
 libopencsg.1.4.0.dylib
 $ otool -L libopencsg.1.4.0.dylib
 libopencsg.1.4.0.dylib:
         /opt/local/lib/libopencsg.1.dylib (compatibility version 1.4.0,
 current version 1.4.0)
         /opt/local/lib/libGLEW.2.0.0.dylib (compatibility version 2.0.0,
 current version 2.0.0)
         /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
 (compatibility version 1.0.0, current version 1.0.0)
         /System/Library/Frameworks/AGL.framework/Versions/A/AGL
 (compatibility version 1.0.0, current version 1.0.0)
         /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
 version 7.9.0)
         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
 version 125.2.11)
 }}}
  so that is obviously a problem. `sudo port clean opencsg`, and `sudo port
 opencsg configure` it. Then go into the opencsg build directory, and edit
 src/Makefile. Change the settings of CXXFLAGS, LIBS, and possibly the
 MACOSX_DEPLOYMENT_TARGET to the following:

 {{{
 ####### Compiler, tools and options

 CC            = /opt/local/bin/clang-mp-3.7
 CXX           = /opt/local/bin/clang++-mp-3.7
 DEFINES       =
 CFLAGS        = -pipe -O2 -Wall -W -fPIC $(DEFINES)
 CXXFLAGS      = -pipe -std=c++11 -stdlib=libc++ -O2 -Wall -W -fPIC
 $(DEFINES)
 INCPATH       = -I/opt/local/libexec/qt4/share/mkspecs/macx-g++ -I.
 -I../include -I..
 -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers
 -I/System/Library/Frameworks/AGL.framework/Headers
 LINK          = /opt/local/bin/clang++-mp-3.7
 LFLAGS        = -headerpad_max_install_names -single_module -dynamiclib
 -compatibility_version  1.4 -current_version    1.4.0 -install_name
 /usr/local/lib/libopencsg.1.dylib
 LIBS          = $(SUBLIBS) -stdlib=libc++  -lGLEW -framework OpenGL
 -framework AGL
 AR            = ar cq
 RANLIB        = ranlib -s
 QMAKE         = /opt/local/libexec/qt4/bin/qmake
 TAR           = tar -cf
 COMPRESS      = gzip -9f
 COPY          = cp -f
 SED           = sed
 COPY_FILE     = cp -f
 COPY_DIR      = cp -f -R
 STRIP         =
 INSTALL_FILE  = $(COPY_FILE)
 INSTALL_DIR   = $(COPY_DIR)
 INSTALL_PROGRAM = $(COPY_FILE)
 DEL_FILE      = rm -f
 SYMLINK       = ln -f -s
 DEL_DIR       = rmdir
 MOVE          = mv -f
 CHK_DIR_EXISTS= test -d
 MKDIR         = mkdir -p
 export MACOSX_DEPLOYMENT_TARGET = 10.6

 =======================
 }}}

 Then, rebuild OpenCSG `sudo port install opencsg`, and you should get a
 properly linked library against libc++:

 {{{
 $ otool -L libopencsg.1.4.0.dylib
 libopencsg.1.4.0.dylib:
         /opt/local/lib/libopencsg.1.dylib (compatibility version 1.4.0,
 current version 1.4.0)
         /opt/local/lib/libGLEW.2.0.0.dylib (compatibility version 2.0.0,
 current version 2.0.0)
         /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
 (compatibility version 1.0.0, current version 1.0.0)
         /System/Library/Frameworks/AGL.framework/Versions/A/AGL
 (compatibility version 1.0.0, current version 1.0.0)
         /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current
 version 3.7.1)
         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
 version 125.2.11)
         /usr/lib/libc++abi.dylib (compatibility version 1.0.0, current
 version 3.7.0)
 }}}

 then `sudo port configure openscad`. It will bring in cgal:

 {{{
 --->  Building cgal
 --->  Staging cgal into destroot
 --->  Installing cgal @4.9_0
 --->  Activating cgal @4.9_0
 }}}

 and then, if you try, it will fail to build openscad. if you get that far,
 go into the openscad build directory, and `sudo make clean` to clean out
 the wrongly built binaries.

 edit the Makefile in the openscad build directory. Then you need to change
 three things, the deployment target, the CXX flags, and the
 OBJECTIVE_CXXFLAGS, like so:

 {{{
 export MACOSX_DEPLOYMENT_TARGET = 10.6

 change to this:
 CXXFLAGS      = -pipe -std=c++11 -stdlib=libc++ -fno-strict-aliasing
 -frounding-math -I/opt/local/include/glib-2.0
 -I/opt/local/lib/glib-2.0/include -I/opt/local/include
 -I/opt/local/include/harfbuzz -I/opt/local/include/freetype2
 -I/opt/local/include/fontconfig -O2 $(DEFINES)


 and

 change to this:
 ####### Custom Compiler Variables
 QMAKE_COMP_QMAKE_OBJECTIVE_CXXFLAGS = -pipe \
                 -stdlib=libc++ \
                 -O2 \
                 \
                 -W

 }}}

 then `sudo port build openscad`, and the build proceeds through to
 completion.

 {{{
 --->  Computing dependencies for openscad
 --->  Building openscad
 --->  Staging openscad into destroot
 --->  Installing openscad @2015.03-3_0
 --->  Activating openscad @2015.03-3_0
 --->  Cleaning openscad
 --->  Updating database of binaries
 --->  Scanning binaries for linking errors
 --->  No broken files found.
 }}}

 {{{
   openscad @2015.03-3_0 (active) platform='darwin 10' archs='x86_64'
 }}}

 You are now the proud owner of software that does not exist in the wild.

 Now to figure out (if I can) how to Portfile these changes.

-- 
Ticket URL: <https://trac.macports.org/ticket/51840#comment:6>
MacPorts <https://www.macports.org/>
Ports system for the Mac operating system


More information about the macports-tickets mailing list