Score:2

Fortran compilation error

kr flag

Dear Experts I am trying to use fortran on ubuntu 22. I am getting compilation error

yasir@yasir-X270:~/Downloads/bremge_orig$ gfortran bremge.F brebldt.F  -L  ./cern/2005/lib   -lkernlib -lmathlib -o main main.F

/usr/bin/ld: cannot find -lkernlib: No such file or directory
/usr/bin/ld: cannot find -lmathlib: No such file or directory
collect2: error: ld returned 1 exit status

But I already have these libraries in this folder:

yasir@yasir-X270:~/Downloads/bremge_orig$ ls
brebldt.F   brempa1.inc   libmathlib.a    main.F   rnpssn.o
brebldt.F~  fort.7        libpacklib.a    main.F~
bremge.F    libkernlib.a  libpdflib804.a  readme

If possible Please suggest some solution

guiverc avatar
cn flag
Ubuntu 22? So this is a Ubuntu Core 22 installation? Not a 22.04 or 22.10 system?
hr flag
If the libraries are in the *current* directory, perhaps you need `-L ./` in place of or in addition to `-L ./cern/2005/lib` ?
Score:0
do flag

You have to link against ./libkernlib.a ./libmathlib.a instead of -lkernlib -lmathlib, as the shared libraries libkernlib.so and libmathlib.so do not seem to be present.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.