[CMake] problem with mac linker flags

Cochran, Bill cochranwk at ornl.gov
Wed Dec 22 19:53:18 EST 2010


Thanks for your help.  I think something is misconfigured somewhere.  On a different machine with the same software, everything works.  I was hoping someone would have seen something similar and point me to a potential solution.

Bill
Sent with Good (www.good.com)


 -----Original Message-----
From: 	Richard Wackerbarth [mailto:richard at nfsnet.org]
Sent:	Wednesday, December 22, 2010 07:07 PM Eastern Standard Time
To:	Bill Hoffman
Cc:	David Cole; cmake at cmake.org; Cochran, Bill
Subject:	Re: [CMake] problem with mac linker flags

I guess that "correctly" might be a matter of opinion.

It can be argued that
1) The compiler and the linker should be treated as independent programs and not as programs accessed through a common portal (like gcc). The user should send only compiler flags to the compiler and only linker flags to the linker, or
2) A common portal should always accept the "pass this to the linker" prefix and the user should always use the prefix, or
3) The portal should accept flags without the prefix requirement and "process them correctly", or
4) The CMake module providing the interface should handle all of the cases transparently.

None of those interpretations is "incorrect". Some individuals may prefer one and others another.

Personally, I feel that "correctly" should mean that the user never needs to specify the prefix. Further, for "compatibility", those prefix flags should get stripped (and later reinserted if the particular installation requires them). Far too often, the users are "programming to the implementation" rather than "specifying the concept". This leads to highly non-portable code because the user is having to handle each, and every, special case. IMHO, the special cases need to be pushed into the middle-ware.

Richard

On Dec 22, 2010, at 5:14 PM, Bill Hoffman wrote:

> On 12/22/2010 6:08 PM, Richard Wackerbarth wrote:
>> I track "next" very closely.
>> I looks as if Brad added the -Wl, to both Darwin-GNU and to Darwin-icc.
>> 
>> If Bill Hoffman is correct and " The intel compiler does not want and can not have the -Wl, syntax.", then there is a problem with one of Brad's two edits.
>> 
>> However, Bill Cochran should try "next" (or tonight's "nightly").
>> I do not have his compiler on any of my systems.
>> 
> 
> I was not correct.  :)
> 
> However, I still say the bug is with mpicc as it is not handling the flag correctly.  The mac gcc does pass this flag to the linker without the -Wl syntax.  Both gcc and the intel compiler will accept the -Wl, syntax so that is the safer way to go.
> 
> -Bill



More information about the CMake mailing list