I'm working in a Linux system ( Ubuntu 12.04 ), using ifort linking the main program main.f90 and library lib.a. If I use command
ifort main.f90 /home/tom/lib/lib.a
then everything is fine. But if I use
ifort -L/home/tom/lib main.f90 lib.a
then ifort gives an error
ifort: error #10236: File not found: 'lib.a'
Why the -L specification doesn't work? When I want to use the environment variable LIBRARY_PATH ? It still gives me that error, why that happen? Must I specify the full path every time I link the library?