library not found for -lgfortran
Mark Brethen
mark.brethen at gmail.com
Tue Jul 8 10:35:38 PDT 2014
Sent from my iPhone
> On Jul 8, 2014, at 11:56 AM, Sean Farley <sean at macports.org> wrote:
>
>
> Mark Brethen writes:
>
>> Sent from my iPhone
>>
>>> On Jul 8, 2014, at 10:47 AM, Sean Farley <sean at macports.org> wrote:
>>>
>>>
>>> Ryan Schmidt writes:
>>>
>>>>>> On Jul 8, 2014, at 7:34 AM, Mark Brethen wrote:
>>>>>>
>>>>>>> On Jul 8, 2014, at 3:05 AM, Ryan Schmidt wrote:
>>>>>>>
>>>>>>> On Jul 7, 2014, at 11:28 PM, Mark Brethen wrote:
>>>>>>>
>>>>>>> I was told that until a patch is submitted, I can just add -L/opt/local/lib/gcc48 to the LDFLAGS environment variable. So I put this in the portfile:
>>>>>>>
>>>>>>> configure.ldflags-append "-L${prefix}/lib/gcc48"
>>>>>>>
>>>>>>> I'm thinking that "gcc48" should be replaced by a variable, but what do I use?
>>>>>>
>>>>>> MacPorts doesn't provide a variable suitable for that. If you have gcc variants, you could append to configure.ldflags in each variant, adjusting the path as needed for each gcc version.
>>>>>
>>>>> I have:
>>>>>
>>>>> compilers.choose fc
>>>>> compilers.setup -dragonegg -g95 require_fortran
>>>>>
>>>>> if {![fortran_variant_isset]} {
>>>>> default_variants-append +gcc48
>>>>> }
>>>>>
>>>>> configure.ldflags-append "-L${prefix}/lib/gcc48 -lgfortran"
>>>
>>> This kind of information can only be reliably found out at configure
>>> time. In other words, why isn't the FreeCAD project figuring this out
>>> based on the fortran compiler with a configure test?
>> They are aware that this needs to be patched. In the meantime they suggested setting it.
>
> This is a big deal.
>
>>>>> If the user has set a different version of gcc this won't work.
>>>>
>>>> Oh, you don't create the compiler variants manually; you have the compilers portgroup do it for you. I'm not sure how the author of that portgroup intended for this situation to be handled. Maybe it does provide a variable for the currently–selected variant. Sean?
>>>
>>> This situation smells awfully like something else is going on here. This
>>> might mean that the linker should be FC instead of CC or CXX but that's
>>> just a thought.
>>
>> I don't know. For now, maybe I should restrict it to gcc48 like so
>>
>> compilers.setup -dragonegg -g95 -gcc +gcc48 require_fortran
>
> You probably want just +gfortran (which points to the latest one in macports)
Is the lib path the same (L${prefix}/lib/gcc48 -lgfortran")?
More information about the macports-dev
mailing list