[141201] trunk/dports/math/ceres-solver/Portfile
Mark Moll
mmoll at rice.edu
Tue Oct 13 13:28:22 PDT 2015
> On Oct 12, 2015, at 5:54 PM, Joshua Root <jmr at macports.org> wrote:
>
> On 2015-10-13 08:26 , Mark Moll wrote:
>>
>>> On Oct 12, 2015, at 4:11 PM, Ryan Schmidt <ryandesign at macports.org> wrote:
>>>
>>>
>>>> On Oct 12, 2015, at 12:25 PM, mmoll at macports.org wrote:
>>>>
>>>> Revision
>>>> 141201
>>>> Author
>>>> mmoll at macports.org
>>>> Date
>>>> 2015-10-12 10:25:29 -0700 (Mon, 12 Oct 2015)
>>>> Log Message
>>>>
>>>> ceres-solver: update to version 1.11.0
>>>
>>>> +# some C demo programs are linked against a C++ library, which in turn
>>>> +# requires linking against libc++
>>>> +configure.ldflags-append -lc++
>>>
>>> libc++ is not part of Mac OS X 10.6 and earlier, and is not the default C++ runtime on OS X 10.8 and earlier. What happens with this port on those systems?
>>
>>
>> What is the appropriate way to handle this? Something like this?:
>>
>> if {${configure.cxx_stdlib} eq “libc++”} {
>> configure.ldflags-append -lc++
>> } else {
>> configure.ldflags-append -lstdc++
>> }
>
> Running $CXX to do the linking would be the right way. It must be using
> a C compiler or using ld directly currently.
The Ceres-solver CMake code is explicitly setting the linker to be $CC:
# Force CMake to link curve_fitting_c using the C linker, this is important
# when Ceres was compiled using C++11 to ensure that -std=c++11 is not passed
# through.
set_target_properties(curve_fitting_c PROPERTIES LINKER_LANGUAGE C)
If I comment out that line, everything just works. However, if the code is compiled with C++11 enabled, then the compilation fails because “-std=c++11” is not a valid C flag. If I uncomment that line and compile in C++11 mode, then I get lots of missing symbols because clang instead of clang++ is used for linking. I don’t know how to remove the flag “-std=c++11” for just one target.
Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20151013/ce4b769b/attachment.sig>
More information about the macports-dev
mailing list