[116766] trunk/dports/science/ompl/Portfile

mmoll at macports.org mmoll at macports.org
Tue Feb 11 19:58:16 PST 2014


On Feb 11, 2014, at 10:01 AM, Mark Moll <mmoll at macports.org> wrote:

> 
> On Feb 11, 2014, at 9:46 AM, Ryan Schmidt <ryandesign at macports.org> wrote:
> 
>> 
>> On Feb 6, 2014, at 11:30, mmoll at macports.org wrote:
>> 
>>> Revision
>>> 116766
>>> Author
>>> mmoll at macports.org
>>> Date
>>> 2014-02-06 09:30:22 -0800 (Thu, 06 Feb 2014)
>>> Log Message
>>> 
>>> science/ompl: add missing build dependency
>>> Modified Paths
>>> 
>>> 	• trunk/dports/science/ompl/Portfile
>>> Diff
>>> 
>>> Modified: trunk/dports/science/ompl/Portfile (116765 => 116766)
>>> 
>>> --- trunk/dports/science/ompl/Portfile	2014-02-06 16:52:52 UTC (rev 116765)
>>> +++ trunk/dports/science/ompl/Portfile	2014-02-06 17:30:22 UTC (rev 116766)
>>> 
>>> @@ -21,6 +21,7 @@
>>> 
>>>                    sha1    4772b9d3442f910d4d7bd3aa6e3615e8397fab88 \
>>> 
>>>                    rmd160  6deeb1a4664a49051961498cd0027d07936ab4cc
>>> 
>>> distname            ${name}-${version}-Source
>>> 
>>> +depends_build-append llvm-gcc42
>> 
>> How does ompl use llvm-gcc42? Would the Xcode version of llvm-gcc42 be sufficient, on those Xcode versions that include it?
>> 
>> I see that macports-llvm-gcc-4.2 is in compiler.blacklist so there’s something unusual here.
> 
> Yes, it is rather unusual. OMPL uses Py++ to generate python bindings. Py++ uses gccxml-devel. Gccxml “simulates” other compilers and generates XML files instead of object files. It cannot simulate clang. For the code that Py++ generates it doesn’t seem to matter that gccxml simulated a different compiler than the one that is eventually used to compile the python bindings. Perhaps a better approach is to define a number of variants for gccxml-devel, one for each compiler that it can simulate?
> 
> gccxml-devel can be *compiled* with many compilers, but can only *simulate* a subset of those compilers. By default it simulates the compiler that was used to compile it.

I used the compilers Portgroup to add variants to gccxml-devel (see patch below), but when I use the gccxml-devel+gcc48 variant I get errors like these when generating bindings for OMPL:

/opt/local/bin/gccxml -m64   -I"." -I"/opt/local/var/macports/build/_Users_mmoll_src_macports_dports_science_ompl/ompl/work/omplapp-0.14.1-Source/ompl/src" -I"/opt/local/var/macports/build/_Users_mmoll_src_macports_dports_science_ompl/ompl/work/omplapp-0.14.1-Source/src" -I"/opt/local/Library/Frameworks/Python.framework/Versions/3.3/include/python3.3m" -I"/opt/local/include" -I"/opt/local/include"   "bindings/util.h" -fxml="/tmp/tmpu0mqzz.xml"
In file included from /usr/include/wchar.h:90,
                 from /opt/local/include/gcc48/c++/cwchar:44,
                 from /opt/local/include/gcc48/c++/bits/postypes.h:40,
                 from /opt/local/include/gcc48/c++/bits/char_traits.h:40,
                 from /opt/local/include/gcc48/c++/string:40,
                 from /opt/local/include/gcc48/c++/stdexcept:39,
                 from bindings/util.h:40:
/usr/include/stdio.h:274: error: wrong number of arguments specified for 'deprecated' attribute
/usr/include/stdio.h:389: error: wrong number of arguments specified for 'deprecated’ attribute

This does not happen when I use the gccxml-devel+llvm variant. Any ideas what’s going on?

-- 
Mark Moll

Uncommitted patch to gccxml-devel:

Index: Portfile
===================================================================
--- Portfile	(revision 116965)
+++ Portfile	(working copy)
@@ -1,9 +1,15 @@
 # $Id$
 
 PortSystem 1.0
-PortGroup 		cmake 1.0
+PortGroup       cmake 1.0
 PortGroup       github 1.0
+PortGroup       compilers 1.0
 
+# gcxxml can be compiled with clang, but can't simulate clang. The default
+# compiler it uses is the one used to compile it
+compilers.choose cc cpp cxx
+compilers.setup gcc -clang -dragonegg
+
 categories		lang
 platforms		darwin
 maintainers		nomaintainer
@@ -12,6 +18,7 @@
 github.setup    gccxml gccxml b040a46352e4d5c11a0304e4fcb6f7842008942a
 name			gccxml-devel
 version			20130919
+revision        1
 description		generates XML description of C++ code
 long_description	generates an XML description of a C++ program from GCC's \
 				internal representation
@@ -20,7 +27,16 @@
                     sha256  d9305a79c954054eb1fb7460994a60b6776987954b1771eda56115d800980be6
 universal_variant no
 
-# gcxxml can be compiled with clang, but can't simulate clang. The default
-# compiler it uses is the one used to compile it, so to get gccxml working
-# without having to set any options it seems easier to do this:
-compiler.blacklist      *clang*
+if { ![gcc_variant_isset] && ![variant_isset llvm] } {
+    default_variants-append +gcc48
+}
+
+if { [gcc_variant_isset] } {
+    patch {
+        reinplace "s| -no-cpp-precomp||g" ${worksrcpath}/GCC/CMakeLists.txt
+    }
+    configure.cppflags-append -D_POSIX_C_SOURCE
+    depends_lib-append port:[gcc_variant_name]
+} elseif { [variant_isset llvm] } {
+    depends_lib-append port:llvm-gcc42
+}



More information about the macports-dev mailing list