CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[waves2Foam] Compilation error: cannot find -lwaves2Foam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By katiuskas

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2022, 13:46
Unhappy Compilation error: cannot find -lwaves2Foam
  #1
New Member
 
Pere
Join Date: Mar 2022
Location: Mallorca
Posts: 16
Rep Power: 4
katiuskas is on a distinguished road
Dear all,

I am having problems installing waves2Foam on my system (Ubuntu 20.04, running on Windows 10 via WSL). I have OpenFoam v2012. Following the waves2Foam manual, I first installed the required third-party dependencies (that is gfortran, git, SVN and GSL). However, I get this error when running the ./Allwmake command in /applications/utilities/waves2Foam, during the solver compilation step:

/usr/bin/ld: cannot find -lwaves2Foam
/usr/bin/ld: cannot find -lwaves2FoamGABC
/usr/bin/ld: cannot find -lwaves2FoamSampling
collect2: error: ld returned 1 exit status


I attach a partial log of the compilation since I think the errors are just for the PRE-PROCESSING and SOLVER compilation. A similar case was presented by bknorris (waves2Foam on an Ubuntu 18.04 with OpenFOAM 1712), but I tried what lppferreira suggests with no success.

Has anyone experienced something similar or knows a workaround? Thanks!

**Edit**
I've found the same issue here -Can't find libraries for waves2Foam installation-, but unfortunately the proposed solution did not work for me.
Attached Files
File Type: txt compile_log.txt (19.7 KB, 21 views)

Last edited by katiuskas; March 23, 2022 at 12:49.
katiuskas is offline   Reply With Quote

Old   March 22, 2022, 07:05
Default Problem update
  #2
New Member
 
Pere
Join Date: Mar 2022
Location: Mallorca
Posts: 16
Rep Power: 4
katiuskas is on a distinguished road
I have the feeling that the error may be originated already in the LIBRARY compilation, which occurs before PRE-PROCESSING and SOLVER. During the LIBRARY compilation, I get four different errors (see attached file for an example, full log was too long):
/usr/bin/ld: cannot find -lgfortran
/usr/bin/ld: cannot find -lwaves2Foam
Attached Files
File Type: txt library_error.txt (3.1 KB, 13 views)
katiuskas is offline   Reply With Quote

Old   March 29, 2022, 08:35
Smile Found a solution
  #3
New Member
 
Pere
Join Date: Mar 2022
Location: Mallorca
Posts: 16
Rep Power: 4
katiuskas is on a distinguished road
Dear all,

After some days of investigation, I think I found a solution. The error comes from waves2Foam not finding the gfortran library (libgfortran.so). Turns out waves2Foam is not looking for it in the right directory, so going into waves2Foam/src/waves2Foam/Make/options.220 one should add the following at the end of the file (also do the same for the options.220 file located inside the waves2FoamGABC/Make folder):

Code:
LIB_INC = \
-I$(GFORTRAN_PATH) \
Where $GFORTRAN_PATH is the path to the folder containing the library libgfortran.so, in my case /usr/lib/gcc/x86_64-linux-gnu/9/. I had thus to run the following line:
Code:
export GFORTRAN_PATH = /usr/lib/gcc/x86_64-linux-gnu/9/
Personally, I found out about this solution at a later time so I did not try it. Thus, I cannot ensure this will work, but it should be equivalent to what I ended up doing. What I did instead was to create a link for the libgfortran.so file into the OpenFoam library folder, which waves2Foam automatically checks. In my case:

Code:
ln -s  /usr/lib/gcc/x86_64-linux-gnu/9/libgfortran.so /opt/OpenFOAM/OpenFOAM-v2012/platforms/linux64Gcc63DPInt32Opt/lib
After that, just go to the waves2Foam folder, run ./Allwmake and you’re done. This error does not seem to be caused by the WSL compatibility, since it also appears in another installation I tried on CentOS. Thus, I hypothesize it has more to do with the OpenFOAM version, in this case v2012.

Hope this can help someone
Echofox likes this.
katiuskas is offline   Reply With Quote

Old   May 12, 2023, 05:15
Thumbs up
  #4
New Member
 
Join Date: Nov 2020
Posts: 1
Rep Power: 0
Echofox is on a distinguished road
Thank you! It works and helps me a lot!
Echofox is offline   Reply With Quote

Reply

Tags
2012, compilation, error, waves2foam, windows


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM.com] Can't find libraries for waves2Foam installation Bulb44 OpenFOAM Installation 3 September 14, 2021 11:17
[OpenFOAM.org] RHEL 7.8 Issues installing ParaView - Third Party install not creating OpenMPI browny OpenFOAM Installation 2 April 24, 2021 06:18
Cannot find functionObject file residuals vava10 OpenFOAM Pre-Processing 2 November 14, 2020 13:21
[swak4Foam] swak4Foam compilation can't find -lOpenFOAM BobR OpenFOAM Community Contributions 4 August 10, 2015 15:49
[foam-extend.org] Installing foam-extend 3.1 on Ubuntu 14.04 stephie OpenFOAM Installation 16 April 23, 2015 17:18


All times are GMT -4. The time now is 13:23.