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

[waves2Foam] Compilation on Ubuntu 22.04

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Felix_Sp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 24, 2022, 11:59
Default Compilation on Ubuntu 22.04
  #1
Member
 
Felix S.
Join Date: Feb 2021
Location: Germany, Braunschweig
Posts: 85
Rep Power: 6
Felix_Sp is on a distinguished road
Hello everyone,

so I struggled a lot compiling waves2Foam for OpenFOAM ESI v2106-2206 and had a lot of

Code:
Type mismatch between actual argument at (1) and actual argument at (2) (REAL(4)/INTEGER(4))
and
Code:
/usr/bin/ld: cannot find -lwaves2Foam: No such file or directory
collect2: error: ld returned 1 exit status
errors and wanted to share my solution to this process.

I had gcc11 and g++11 installed together with gfortran11 and found that the toolbox does not compile in this version (maybe this information is present somewhere, I have not found it anywhere online). Especially the ThirdParty folder made problems during compilation.

I found that the toolbox does compile for me for gcc9, g++9 and gfortran9 and compiled successfully with the

Quote:
update-alternatives
command. I hope this does help some people who just want to try out the toolbox and are having similar problems. Maybe someone with greater knowledge on compiling can explain to me how to compile the toolbox with gcc11, g++11 and gfortran11.

Cheers
noodleluvmay and Volvoreta like this.

Last edited by Felix_Sp; September 24, 2022 at 13:55.
Felix_Sp is offline   Reply With Quote

Old   July 21, 2023, 10:52
Default
  #2
New Member
 
Hugo
Join Date: Jun 2023
Posts: 4
Rep Power: 2
Volvoreta is on a distinguished road
Hi Felix,

I am trying to install waves2Foam in Openfoam ESI v1912. However, following your method, I keep getting the same errors. The procedure was:
Code:
which gcc | xargs file
sudo ln -s /usr/bin/gcc-9 /usr/local/bin/gcc
As it did not work, I wrote in the command line:
Code:
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90
Everything appears in this post https://stackoverflow.com/questions/...-gcc-on-ubuntu

I wondering if you could be more especific in the methodology applied to solve your case.

Thanks in advance
Volvoreta is offline   Reply With Quote

Old   July 24, 2023, 02:25
Default
  #3
Member
 
Felix S.
Join Date: Feb 2021
Location: Germany, Braunschweig
Posts: 85
Rep Power: 6
Felix_Sp is on a distinguished road
Hey


It has been some time since I have compiled waves2foam. Here is a link to the general procedure.

I think the step you are missing is configuring the default commands for gcc, g++ and gfortran. So you are still not compiling with version 9. You could do so by the telling your whole system to compile with version 9 (with e.g. update-alternatives). After compiling you can switch back to whatever version you prefer for compiling.

Cheers.
Felix_Sp is offline   Reply With Quote

Old   July 25, 2023, 03:34
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Volvoreta View Post
Hi Felix,

I am trying to install waves2Foam in Openfoam ESI v1912. However, following your method, I keep getting the same errors. The procedure was:
Code:
which gcc | xargs file
sudo ln -s /usr/bin/gcc-9 /usr/local/bin/gcc
As it did not work, I wrote in the command line:
Code:
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90
Everything appears in this post https://stackoverflow.com/questions/...-gcc-on-ubuntu

I wondering if you could be more especific in the methodology applied to solve your case.

Thanks in advance
If you have OpenFOAM-v2112 or newer, there is also a WM_COMPILE_CONTROL variable (see comments in the etc/bashrc file). You could specify for example:
Code:
export WM_COMPILE_CONTROL="version=9"
this will be parsed and passed into the wmake rules and thus invoke gcc-9 and g++-9 for compilation.
https://develop.openfoam.com/Develop...piler-versions
olesen is offline   Reply With Quote

Old   July 25, 2023, 04:58
Default
  #5
New Member
 
Hugo
Join Date: Jun 2023
Posts: 4
Rep Power: 2
Volvoreta is on a distinguished road
Thank you both,

I finally achive to compile SPARSKIT2, following Felix's steps. Integers mistmatch error is solved. Now I am trying to compile lapack-3.3.1 too, but the error:

Code:
/usr/bin/ld: cannot find -lwaves2Foam: No such file or directory
collect2: error: ld returned 1 exit status
keeps appearing. I am looking for a posible solution in other threads . I attach the log file in case you could help me with the error.

Cheers
Attached Files
File Type: txt makelog.txt (151.9 KB, 4 views)
Volvoreta is offline   Reply With Quote

Reply


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] Install OpenFOAM 2112 in Ubuntu 22.04 tRock OpenFOAM Installation 6 September 25, 2023 08:37
[OpenFOAM.org] Parview 5.4.0 compilation problems on Ubuntu 18 gadieid OpenFOAM Installation 8 January 7, 2023 22:05
[OpenFOAM.com] Install OpenFOAM 2.1.x on ubuntu 22.04 i.linch OpenFOAM Installation 6 September 7, 2022 08:39
OpenFoam 2.1.x /2.2.0 compilation failed on Ubuntu 12.04/10 64bit keepfit OpenFOAM Installation 2 March 26, 2013 09:43
errors during compilation and installation of OpenFOAM-1.7.x on Ubuntu 10.04 ftec OpenFOAM Installation 7 February 23, 2011 06:07


All times are GMT -4. The time now is 04:40.