gfortran message 
Author Message
 gfortran message

When compiling my code with gfortran and its -c switch, i always get the
following kind of messages:

gfortran: -rpath=<path_to_gfortran_root>/gfortran/current/lib: linker
input file unused because linking not done

I have the impression that this is simply an informational
message and that it doesn't do much harm, but I was wondering
what exactly caused it and how I can avoid this message in a
clean way.

Any suggestions?
Bart

--
        "Share what you know.  Learn what you don't."



Mon, 24 Nov 2008 17:45:31 GMT  
 gfortran message
Quote:

> When compiling my code with gfortran and its -c switch, i always get the
> following kind of messages:

> gfortran: -rpath=<path_to_gfortran_root>/gfortran/current/lib: linker
> input file unused because linking not done

> I have the impression that this is simply an informational
> message and that it doesn't do much harm, but I was wondering
> what exactly caused it and how I can avoid this message in a
> clean way.

If you want to avoid the message, don't incorporate any (unneeded)
compiled objects or libraries in the gfortran -c command.  The main use
of the warning is for those of us who forget to remove -c and would like
to know why gfortran did not start the linker.


Mon, 24 Nov 2008 20:37:26 GMT  
 gfortran message

Quote:

> If you want to avoid the message, don't incorporate any (unneeded)
> compiled objects or libraries in the gfortran -c command.

I'm not quite sure if I understand what you mean... consider the
following hello world:

program hello_world

  print *, "Hello world"

end program hello_world

which i compile with:

$ gfortran -c hello_world.f95
gfortran: -rpath=/cw/fortran/bin/../gfortran/current/lib: linker input file unused because linking not done

Then for as far as I know I am not incorporating any (unneeded) objects or
libraries in the gfortran -c command but still I get the warning message.

Without the -c option, i don't get the warning (which is how I expect it to be)
but i'm still a bit confused why I also get the warning with the -c option.

If i understand you correctly, then you say that the warning is given to remind
the user to the fact that linking is not done... but if a user specifies
the -c option, he explicitly tells the compiler not to link so I guess the user
then *knows* he is not linking and shouldn't be warned about that?  Or am I
misunderstanding/misinterpreting things here?

Bart

--
        "Share what you know.  Learn what you don't."



Mon, 24 Nov 2008 21:46:32 GMT  
 gfortran message

Quote:
> $ gfortran -c hello_world.f95
> gfortran: -rpath=/cw/fortran/bin/../gfortran/current/lib: linker input file unused because linking not done

Hum. Where do you get you gfortran from? Is it home-compiled (with which
"configure" command-line) or is it a binary package?

--
FX



Mon, 24 Nov 2008 22:08:18 GMT  
 gfortran message

Quote:

> Without the -c option, i don't get the warning (which is how I expect it to be)
> but i'm still a bit confused why I also get the warning with the -c option.

> If i understand you correctly, then you say that the warning is given to remind
> the user to the fact that linking is not done... but if a user specifies
> the -c option, he explicitly tells the compiler not to link so I guess the user
> then *knows* he is not linking and shouldn't be warned about that?  Or am I
> misunderstanding/misinterpreting things here?

That's my understanding.  If you use the -c option with objects which
could be used only when linking, you get the warning to remind you that
you didn't request link.


Mon, 24 Nov 2008 22:08:47 GMT  
 gfortran message

Quote:

> Hum. Where do you get you gfortran from? Is it home-compiled (with which
> "configure" command-line) or is it a binary package?

I've downloaded it from http://gcc.gnu.org/wiki/GFortranBinaries
more specifically
http://quatramaran.ens.fr/~coudert/gfortran/gfortran-linux.tar.gz

Our local setup here at work requires us to use a kind of wrapper script
to run gfortran:


#!/bin/bash

dir=`dirname $0`


Why are you asking this exactly?

Regards,
Bart

--
        "Share what you know.  Learn what you don't."



Mon, 24 Nov 2008 22:28:54 GMT  
 gfortran message

Quote:


>>Hum. Where do you get you gfortran from? Is it home-compiled (with which
>>"configure" command-line) or is it a binary package?

> I've downloaded it from http://gcc.gnu.org/wiki/GFortranBinaries
> more specifically
> http://quatramaran.ens.fr/~coudert/gfortran/gfortran-linux.tar.gz

> Our local setup here at work requires us to use a kind of wrapper script
> to run gfortran:


> #!/bin/bash

> dir=`dirname $0`



Which means that even your simple "gfortran -c foo.f95" example actually
invokes "gfortran -Wl,-rpath="some/path" -c foo.f95", and I would
presume the warning message is arising because of the linker option
-Wl... when the linker is not invoked.


Mon, 24 Nov 2008 23:14:56 GMT  
 gfortran message

Quote:

> Our local setup here at work requires us to use a kind of wrapper script
> to run gfortran:
...
> exec "$dir/../gfortran/current/bin/gfortran"


...

Quote:
> Why are you asking this exactly?

Perhaps because it matters?  :-) You should not get that message from a
"normal" gfortran compilation, so he is trying to figure out what is
triggering it. And I think you just provided the answer. It is the
wrapper script. That -Wl option in the wrapper script is a linker
option. GFortran is warning you that you have specified an option that
only makes sense when linking, but you aren't linking. That seems like a
sensible warning to me.

GFortran has no way of knowing that the option came from the wrapper
script instead of from "you".

--
Richard Maine                     | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov            |       -- Mark Twain



Mon, 24 Nov 2008 23:21:13 GMT  
 gfortran message

Quote:

> Which means that even your simple "gfortran -c foo.f95" example actually
> invokes "gfortran -Wl,-rpath="some/path" -c foo.f95", and I would
> presume the warning message is arising because of the linker option
> -Wl... when the linker is not invoked.

Hmm... actually... i cannot remember why exaclty we are using that
wrapper script for gfortran again... I've just checked, and also
without the wrapper script (and thus without the -Wl,-rpath=...
option) all my code compiles fine...   Could
it be that older versions of gfortran required adding these
compiler-options in order to be able to run gfortran in some or
the other way?

Best wishes,
Bart

--
        "Share what you know.  Learn what you don't."



Tue, 25 Nov 2008 02:12:35 GMT  
 gfortran message


Quote:

>> Which means that even your simple "gfortran -c foo.f95" example actually
>> invokes "gfortran -Wl,-rpath="some/path" -c foo.f95", and I would
>> presume the warning message is arising because of the linker option
>> -Wl... when the linker is not invoked.

> Hmm... actually... i cannot remember why exaclty we are using that
> wrapper script for gfortran again... I've just checked, and also
> without the wrapper script (and thus without the -Wl,-rpath=...
> option) all my code compiles fine...   Could
> it be that older versions of gfortran required adding these
> compiler-options in order to be able to run gfortran in some or
> the other way?

It is probably related to how you had gfortran installed on your system.
In particular, you need to tell your dynamic linker where libgfortran.so
lives, and you may have not set LD_LIBRARY_PATH or run ldconfig.

--
Steve
http://troutmask.apl.washington.edu/~kargl/



Tue, 25 Nov 2008 02:16:46 GMT  
 gfortran message

Quote:

> It is probably related to how you had gfortran installed on your system.
> In particular, you need to tell your dynamic linker where libgfortran.so
> lives, and you may have not set LD_LIBRARY_PATH or run ldconfig.

Hmm... i have been writing to quick... actually... I *do* need
those options... compiling goes fine without them, but from the
moment I execute a compiled program, there's a problem of a
library not being found.

For as far as I understand from Google, I could set the
LD_RUN_PATH environment variable so as to avoid the wrapper script
that adds the -Wl,-rpath=... option, right?

If that is correct, than the only thing left to do is convince
our sysadmins to add the path to the gfortran library to
all users their LD_RUN_PATH :-)

Regards,
Bart

--
        "Share what you know.  Learn what you don't."



Tue, 25 Nov 2008 02:40:39 GMT  
 gfortran message


Quote:

>> It is probably related to how you had gfortran installed on your system.
>> In particular, you need to tell your dynamic linker where libgfortran.so
>> lives, and you may have not set LD_LIBRARY_PATH or run ldconfig.

> Hmm... i have been writing to quick... actually... I *do* need
> those options... compiling goes fine without them, but from the
> moment I execute a compiled program, there's a problem of a
> library not being found.

> For as far as I understand from Google, I could set the
> LD_RUN_PATH environment variable so as to avoid the wrapper script
> that adds the -Wl,-rpath=... option, right?

I don't know.  My system runs ldconfig at boot, and so libgfortran.so
is correctly added to linker's hints file.

Quote:
> If that is correct, than the only thing left to do is convince
> our sysadmins to add the path to the gfortran library to
> all users their LD_RUN_PATH :-)

Optionally, the wrapper script can set the environment.  Here's
the wrapper I use to pick up bleeding edge gfortran in my work
directory.  Note, I use -static to avoid the library issues
because my shared libraries change too often.

troutmask:kargl[201] cat ~/../sgk/bin/gfc4x
#! /bin/sh
PATH=$HOME/work/4x/bin:$PATH
export PATH

--
Steve
http://troutmask.apl.washington.edu/~kargl/



Tue, 25 Nov 2008 02:53:38 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Parsing gfortran error messages in emacs

2. Replace standard MESSAGE function in C4 with own message function

3. How to mapp clarion message to my message procedure

4. output color message (text) to a message box (string)

5. output color message (text) to a message box (string)

6. How to retrive forwarded message from multipart message body

7. building mpich1.2.7p1 with gcc4.0.2/gfortran

8. Polyhedron's compiler comparison updated with gfortran

9. Preprocessor for gfortran

10. automatic arrays with negative size in g95 and gfortran

11. gfortran matmul

12. gfortran and ifort, compatible binary files??

 

 
Powered by phpBB® Forum Software