CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Librairy lgfortran not found

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 3, 2016, 10:36
Default Librairy lgfortran not found
  #1
Member
 
fouad abi
Join Date: Nov 2015
Location: Geneva, Switzerland
Posts: 30
Rep Power: 3
faab is on a distinguished road
Send a message via Skype™ to faab
Hello FOAMers,

I am trying to use a stand-alone fortran code to calculate thermo properties of a fluid with given Pressure and Temperature values as input arguments. For this I need to compile the gfortran lib, but when I add the line "-lgfortran" to the Make/options file of my solver, I get (when running ./Allwmake to compile the solver) the following error message:

/home/faab/OpenFOAM/ThirdParty-2.3.0/platforms/linux64/gcc-4.8.1/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [/home/faab/OpenFOAM/faab-2.3.0/platforms/linux64Gcc48DPOpt/bin/hellChtMultiRegionFoamPorousAboveTLambda] Error 1

I have tried to look around for some info regarding this error but could not find anything relevant. Could you please help me solve this issue ?
Thanks a lot !

Faab
faab is offline   Reply With Quote

Old   March 3, 2016, 18:15
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 391
Rep Power: 11
jherb is on a distinguished road
Have you tried to add the path to the gfortran library (i.e. to the directory containing the file libgfortran.so (probably with the version number in front of the .so)) with -Lpath/of/directory to the Make/options file?
jherb is offline   Reply With Quote

Old   March 4, 2016, 05:09
Default
  #3
Member
 
fouad abi
Join Date: Nov 2015
Location: Geneva, Switzerland
Posts: 30
Rep Power: 3
faab is on a distinguished road
Send a message via Skype™ to faab
Hi Joachim,

Thank you for your reply. That's what I actually tried to do first, but it did not work. I realized that it needed the libgfortran.a file to compile, so I did what you suggested but instead I linked the compiler to the folder in my /usr path containing the ".a" file. Now it works but the libgfortran.a file I linked is from the gcc-4.4.7 version, while I'm using the 4.8.1 with Openfoam, so I'm not sure I'm doing this correctly.
faab is offline   Reply With Quote

Old   September 15, 2016, 08:12
Default
  #4
Member
 
fouad abi
Join Date: Nov 2015
Location: Geneva, Switzerland
Posts: 30
Rep Power: 3
faab is on a distinguished road
Send a message via Skype™ to faab
I renew this thread because still the issue has not been resolved, I was able to find a workaround only. The solver compiles correctly with no warning or error message when I add a link to the gfortran library (addind -L/... in the option Makefile), but when I run the solver on a testcase, at the end of the first iteration I get the following error message:
#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigSegv::sigHandler(int) at ??:?
#2
at sigaction.c:?
#3 Foam::dictionary::~dictionary() at ??:?
#4 Foam::solution::~solution() at ~/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/solution.H:49 (discriminator 1)
#5 Foam::fvSolution::~fvSolution() at ~/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/fvSolution.H:48
#6
at ~/OpenFOAM/OpenFOAM-2.3.0/applications/solvers/heatTransfer/hellChtMultiRegionFoamPorousAboveTLambda3/hellChtMultiRegionFoamPorousAboveTLambda.C:81 (discriminator 1)
#7 __libc_start_main at ??:?
#8
at ??:?
Segmentation fault (core dumped)

Thank you for your help !
Faab
faab is offline   Reply With Quote

Reply

Tags
lgfortran interface

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing OpenFoam on windows 7-64 Dadou OpenFOAM Installation on Windows, Mac and other Unsupported Platforms 10 February 11, 2014 17:20
injection problem Mark New FLUENT 0 August 4, 2013 01:30
fireFoam.1.7.x_0.4 compilation error !link OpenFOAM Installation 9 December 24, 2012 05:15
Problems in compiling paraview in Suse 10.3 platform chiven OpenFOAM Installation 3 December 1, 2009 08:21
Problems Installing OF 1.6 32 bit bucksfan OpenFOAM Installation 19 August 4, 2009 01:36


All times are GMT -4. The time now is 00:28.