Fortran What causes undefined reference errors in gfortran compilation?

  • Thread starter Thread starter SAks
  • Start date Start date
  • Tags Tags
    Gfortran
AI Thread Summary
The user is encountering compilation issues with Fortran while trying to link the BLAS library. The initial error indicates that the linker cannot find the BLAS library, suggesting it may not be installed or is located in a non-standard directory. To resolve this, the user is advised to specify the library's directory using the -L option followed by the full path. After attempting this, a new error arises related to an undefined reference to `MAIN__`, indicating a potential issue with the main program structure in the Fortran code or missing required components. Further troubleshooting is needed to address the undefined reference error.
SAks
Messages
6
Reaction score
0
Hi friends!
I am a complete newbie to fortran..
I've been trying to compile linpack but keep getting following error..

[SAks@localhost Desktop]$ gfortran schdc.f -lblas
/usr/bin/ld: cannot find -lblas
collect2: ld returned 1 exit status


please advise..

Thanks in advance
 
Technology news on Phys.org
It means that the 'blas' library either is not installed, or is not in the location where the compiler (actually the linker) expects to find it.

If that library is in a non-standard location, e.g. /foo/bar/blas.a or /foo/bar/blas.dylib or whatever filename extension your OS uses for libraries, then you can tell the linker to search the directory /foo/bar for libraries, in addition to wherever it already searches:

gfortran schdc.f -L/foo/bar -lblas

You might have to add a slash: -L/foo/bar/ (it's been a long time since I had to do this)

The main thing is to give the full directory path.
 
@jtbell
thanks for responding..
I did give the whole path, now some new problem..
this is what i get..

[SAks@localhost Desktop]$ gfortran schdc.f -L/home/SAks/Desktop -lblas
/usr/lib/gcc/x86_64-redhat-linux/4.4.5/libgfortranbegin.a(fmain.o): In function `main':
(.text+0x26): undefined reference to `MAIN__'
collect2: ld returned 1 exit status
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.

Similar threads

Replies
6
Views
2K
Replies
9
Views
9K
Replies
5
Views
10K
Replies
16
Views
6K
Replies
4
Views
7K
Replies
3
Views
12K
Replies
6
Views
2K
Back
Top