Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[photran] Problem setting linker options correctly for Intel Fortran (and solution)

Hi,

For the second time this month, Eclipse managed to destroy my project
settings, requiring me to recreate settings from memory. The biggest
problem has convincing Photran to specifying linker options in the
counterintuitive and picky order the Intel linker expects.

Photran behaves as I would expect, placing linker options before
arguments. Unfortunately, the Intel linker is "special" and wants linker
options placed _after_ the list of files to be linked.

Fighting with this for a close to a day, I finally realized that

Project > Preferences > Settings > Tool Settings > Intel Fortran Linker
> Command Line Pattern

needs to changed from the intuitive and sensible default of:

${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}

to the Byzantine and moronic:

${COMMAND} ${INPUTS} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT}

in order for the Intel linker to work properly.

As much as it pains me to do so, I suggest adjusting Photran's default
settings for the Intel toolchain to cope with their linker's "special
needs" and creative expectations about command line ordering. Frankly,
I'd rather Intel would fix their linker CLI to behave like every other
CLI app written since about 1985 but I suspect it's easier just to have
Photran make an exception for this.

Also, if anyone knows how to automatically back up and recover compiler
and linker settings in Eclipse (preferably in a way that can be stored
in Mercurial without causing Eclipse to start on fire later), you will
be my new best friend. I've spent too many man-hours of egregious
frustration trying to reassemble my dev environment after Eclipse
torched something, claimed "This is not a CDT project" and steadfastly
refused to do anything useful (hints: get rid of stray files and don't
store project settings in Mercurial - that last one was an accident
precipitated by bad MercurialEclipse UI design). My source code is
easily recoverable but reconstituting the list of include files,
libraries, and options is painful, especially when the Intel linker as
Yoda options interprets does.

Hopefully this helps avert frustration; thanks for any help you can provide,

-- Bob


Back to the top