Ask Your Question
0

libgfortran.so.3: error adding symbols: DSO missing from command line

asked 2015-08-30 07:29:01 -0600

Navalona gravatar image

Hello. I am inexperienced user in linking fortran shared library. I got the following error when compiling a program, any idea what's going wrong ? Thanks for your help.

g++ -g -Wl,--no-as-needed NuXSecData.o NuXSecFunc.o NuXSecComparison.o gVldNuXSec.o -L/home/navds/LocInstall/HEP/GENIE/lib -lGAlgorithm -lGBaryonResonance -lGBase -lGBodekYang -lGCharm -lGCoh -lGDfrc -lGDIS -lGCrossSections -lGDecay -lGElas -lGElFF -lGHEP -lGEVGCore -lGEVGModules -lGEVGDrivers -lGGiBUU -lGHadronTransp -lGFragmentation -lGInteraction -lGLlewellynSmith -lGMEC -lGMessenger -lGNuGamma -lGNuE -lGNtuple -lGNuclear -lGNumerical -lGQPM -lGPDG -lGPDF -lGQEL -lGRES -lGRegistry -lGReinSeghal -lGUtils -lGGeo -lGFluxDrivers -lGVLE -lGVHE -lGMuELoss -lGReWeight -lGNucleonDecay  -L/home/navds/LocInstall/HEP/ROOT/lib/root -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic -lMinuit -lGeom -lEG -lEGPythia6 -L/home/navds/LocInstall/HEP/PYTHIA6/pythia6428 -lPythia6 /home/navds/LocInstall/HEP/PYTHIA6/pythia6428/pythia6428.o /home/navds/LocInstall/HEP/PYTHIA6/pythia6428/pythia6_common_address.o  -L/usr/lib64 -lLHAPDF  -L/usr/lib64 -lxml2 -L/usr/local/lib -llog4cpp  -lnsl  -o /home/navds/LocInstall/HEP/GENIE/bin/gvld_nu_xsec
/bin/ld: /home/navds/LocInstall/HEP/PYTHIA6/pythia6428/pythia6428.o: undefined reference to symbol '_gfortran_transfer_real_write@@GFORTRAN_1.4'
/usr/lib64/libgfortran.so.3: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

My gcc (g++ and gfortran) version: 5.1.1

[navds@F22G580 root] $ locate libgfortran
/usr/lib/gcc/x86_64-redhat-linux/5.1.1/libgfortran.so
/usr/lib/gcc/x86_64-redhat-linux/5.1.1/libgfortran.spec
/usr/lib/gcc/x86_64-redhat-linux/5.1.1/libgfortranbegin.a
/usr/lib/gcc/x86_64-redhat-linux/5.1.1/32/libgfortran.a
/usr/lib/gcc/x86_64-redhat-linux/5.1.1/32/libgfortran.so
/usr/lib/gcc/x86_64-redhat-linux/5.1.1/32/libgfortranbegin.a
/usr/lib64/libgfortran.so.3
/usr/lib64/libgfortran.so.3.0.0
/usr/share/doc/gcc-gfortran/ChangeLog-2002.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2003.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2004.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2005.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2006.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2007.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2008.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2009.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2010.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2011.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2012.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2013.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog-2014.libgfortran.bz2
/usr/share/doc/gcc-gfortran/ChangeLog.libgfortran.bz2
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-08-31 06:14:00 -0600

marcindulak gravatar image

updated 2015-08-31 09:11:06 -0600

Check which versions of symbols are available for your gfortran:

strings /usr/lib64/libgfortran.so.3 | grep "GFORTRAN_1"

and verify which version of g++/gfortran you are actually using:

g++ --version
gfortran --version
rpm -qf /usr/lib64/libgfortran.so.3

If there is a mismatch, you will probably need to recompile /home/navds/LocInstall/HEP/PYTHIA6/pythia6428/ with gfortran-5.1.1. Otherwise try to add -lgfortran to the link line.

edit flag offensive delete link more

Comments

[navds@F22G580 ~] $ strings /usr/lib64/libgfortran.so.3 |grep "GFORTRAN_1" GFORTRAN_1.0 GFORTRAN_1.1 GFORTRAN_1.2 GFORTRAN_1.3 GFORTRAN_1.4 GFORTRAN_1.5 GFORTRAN_1.6

Navalona gravatar imageNavalona ( 2015-08-31 06:30:49 -0600 )edit

[navds@F22G580 ~] $ g++ --version g++ (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)

   [navds@F22G580 ~] $ gfortran --version
   GNU Fortran (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)

[navds@F22G580 ~] $ rpm -qf /usr/lib64/libgfortran.so.3
libgfortran-5.1.1-4.fc22.x86_64
Navalona gravatar imageNavalona ( 2015-08-31 06:32:44 -0600 )edit
1

what happens if you add -lgfortran to the g++ ... link line? Just copy the whole line into the terminal, add -lgfortran at the end, and execute such modified line.

marcindulak gravatar imagemarcindulak ( 2015-08-31 06:36:03 -0600 )edit

this solved the problem! Thank you

Navalona gravatar imageNavalona ( 2015-08-31 12:51:44 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-08-30 07:29:01 -0600

Seen: 3,993 times

Last updated: Aug 31 '15