Opened 3 years ago

Closed 3 years ago

#51486 closed defect (fixed)

qhull requires switches to cmake to build on 10.6.8

Reported by: chrisjogorman Owned by: mamoll (Mark Moll)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: dliessi (Davide Liessi), mojca (Mojca Miklavec), dstrubbe (David Strubbe)
Port: qhull

Description

qhull fails to build on os x 10.6.8 as /Developer/usr/bin/g++-4.2 does not understand one of the switches passed to it -Wno-sign-conversion. Not much surprise as it is a 2007 compiler. To fix this please pass -DCMAKE_C_COMPILER=/opt/local/bin/gcc-mp-4.8 -DCMAKE_CXX_COMPILER=/opt/local/bin/g++-mp-4.8 to cmake and make qhull dependent on gcc48. Perhaps there is an older compiler eg gcc47 which will work too, I just tried it with 4.8 to get it working.

Change History (11)

comment:1 Changed 3 years ago by mf2k (Frank Schima)

Keywords: build compiler removed
Owner: changed from macports-tickets@… to mmoll@…

In the future, please Cc the port maintainers (port info --maintainers qhull), if any.

comment:2 Changed 3 years ago by mamoll (Mark Moll)

I have committed a possible fix in r148997 by blacklisting llvm-gcc-4.2. Not sure what compiler MacPorts will use now on OS X 10.6.8. Can you give it a try and let me know?

comment:3 Changed 3 years ago by mamoll (Mark Moll)

The snow leopard build is still failing (https://build.macports.org/builders/buildports-snowleopard-x86_64/builds/42188) even after I set the compiler blacklist to:

compiler.blacklist  *gcc-4.2 {*gcc-4.[0-6]}

I don't understand why it is using /Developer/usr/bin/clang as the C compiler and /Developer/usr/bin/llvm-g++-4.2 as the C++ compiler.

comment:4 Changed 3 years ago by chrisjogorman

Here's an attempt at getting the build to work on snow leopard.

Index: Portfile
===================================================================
--- Portfile	(revision 149104)
+++ Portfile	(working copy)
@@ -43,6 +43,26 @@
 # see https://trac.macports.org/ticket/51486
 compiler.blacklist  *gcc-4.2 {*gcc-4.[0-6]}
 
+# qhull requires compiler with -Wno-sign-conversion
+# 10.6 doesn't have it by default 
+platform darwin 10 {
+  variant gcc47 description {build qhull with gcc47} {
+    depends_build-append  port:gcc47
+    configure.args-append -DCMAKE_C_COMPILER=${prefix}/bin/gcc-mp-4.7 \
+      -DCMAKE_CXX_COMPILER=${prefix}/bin/g++-mp-4.7
+  }
+  variant gcc48 description {build qhull with gcc48} {
+    depends_build-append  port:gcc48
+    configure.args-append -DCMAKE_C_COMPILER=${prefix}/bin/gcc-mp-4.8 \
+      -DCMAKE_CXX_COMPILER=${prefix}/bin/g++-mp-4.8
+  }
+  variant gcc5 description {build qhull with gcc5} {
+    depends_build-append  port:gcc5
+    configure.args-append -DCMAKE_C_COMPILER=${prefix}/bin/gcc-mp-5 \
+      -DCMAKE_CXX_COMPILER=${prefix}/bin/g++-mp-5
+  }
+default_variants 	+gcc5
+}
 configure.args-append   -DDOC_INSTALL_DIR=share/doc/qhull -DMAN_INSTALL_DIR=share/man/man1
 
 post-destroot {

The default variants is selected as I have gcc5 installed in my development tree and didn't want to install a new compiler to get qhull to build. I will try the other variants out and report back if there are any failures.

comment:5 Changed 3 years ago by mamoll (Mark Moll)

That seems reasonable. I have committed this in r149135. Let's see what the build bots do.

comment:6 Changed 3 years ago by dliessi (Davide Liessi)

Cc: davide.liessi@… added

Cc Me!

comment:7 Changed 3 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added

Cc Me!

comment:8 Changed 3 years ago by mojca (Mojca Miklavec)

Cc: dstrubbe@… added

Two questions (please bear in mind that I didn't try to investigate anything into details):

  • Does clang work (say, clang 3.4 or newer)? At least on 10.6 (as noted in #51359 there are problems on 10.5).
  • Would it be possible to achieve the same with the help of the compilers PortGroup (compilers-1.0.tcl)? I admit that I don't fully understand how the PortGroup works, but I'm sure there are others who could help.

comment:9 Changed 3 years ago by dstrubbe (David Strubbe)

The compilers portgroup was introduced in r149145 for qhull. Basically this just simplifies the block with gcc compilers mentioned above.

comment:10 in reply to:  3 ; Changed 3 years ago by ryandesign (Ryan Schmidt)

Replying to mmoll@…:

The snow leopard build is still failing (https://build.macports.org/builders/buildports-snowleopard-x86_64/builds/42188) even after I set the compiler blacklist to:

compiler.blacklist  *gcc-4.2 {*gcc-4.[0-6]}

I don't understand why it is using /Developer/usr/bin/clang as the C compiler and /Developer/usr/bin/llvm-g++-4.2 as the C++ compiler.

Because in Xcode 3, clang existed but clang++ did not exist therefore when configure.compiler is set to clang, MacPorts will use clang for C code and llvm-g++-4.2 for C++ code. If llvm-g++-4.2 does not work for this port, you must use the compiler_blacklist_versions portgroup and add {clang < 137} to compiler.blacklist.

If FSF GCC is not specifically required, you shouldn't force it to be used or offer compiler variants. You don't want to risk mixing FSF GCC's C++ standard library with OS X's C++ standard library. Instead, just blacklist compilers that don't work and let MacPorts choose an alternative (e.g. a newer version of clang).

comment:11 in reply to:  10 Changed 3 years ago by mamoll (Mark Moll)

Resolution: fixed
Status: newclosed

Thanks for the explanation, Ryan. I fixed this in r149962.

Note: See TracTickets for help on using tickets.