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

[OpenFOAM.com] Can gcc changed with source ing different openfoam version etc/bashrc

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 14, 2021, 22:05
Default Can gcc changed with source ing different openfoam version etc/bashrc
  #1
New Member
 
caoxuxiang's Avatar
 
Xuxiang Cao
Join Date: Jun 2016
Posts: 11
Rep Power: 10
caoxuxiang is on a distinguished road
hi guys.
i installed openfoam-6 with linux system gcc, etc/bashrc (export WM_COMPILER_TYPE=system), the gcc version is 4.8.0;
now i want install openfoam-v2106. there are some errors in compiled ADIOS2 with gcc-4.8.5, so i changed to gcc-7.5(etc/bashrc export WM_COMPILER_TYPE=ThirdParty), it works well.

my question is:

when i open a new terminal, source openfoam-6/etc/bashrc, the gcc version is 4.8.5; then i source openfoam-v2016/etc/bashrc, the gcc version is 7.5.0;
but then i source openfoam-6/etc/bashrc again, the gcc version still is 7.5.0;
is there has a way, when i source the different openfoam version the gcc can changed rightly?

many thanks.

xuxiang
caoxuxiang is offline   Reply With Quote

Old   December 15, 2021, 13:25
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Not really sure what they are using in openfoam6 for setting/clearing things, but you need to check what is still set. Use the command "env" to display your settings.
Code:
env
There you will find various entries. First thing to check is if the value for WM_COMPILER_TYPE is still somehow set to ThirdParty. Next check your PATH. This very likely somehow did not get its values cleaned properly when switching versions.
Code:
echo "$PATH" | tr ':' '\n'
This will give you a more readable version of what your PATH contains. This is where the foamCleanPath script comes into play. You can use that to cleanup various environment settings - examples in the etc/bashrc, etc/config.sh/settings ...


Of course, depending on how you have switched between versions (edited your ~/.bashrc file, placed extra setup files elsewhere), it could be that you are causing the problem yourself but just don't recognize where.


olesen is offline   Reply With Quote

Old   December 16, 2021, 03:41
Default
  #3
New Member
 
caoxuxiang's Avatar
 
Xuxiang Cao
Join Date: Jun 2016
Posts: 11
Rep Power: 10
caoxuxiang is on a distinguished road
thanks olesen

now i creat a .sh file in special version path, the file contains the loaded environment modules.
i was installed of in hpc cluster. and i changed all export WM_COMPILER_TYPE=system
this can also be solved.

xuxiang
caoxuxiang 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 v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 15:24
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 tlcoons OpenFOAM Installation 13 April 20, 2016 18:34
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 10:17
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 06:18
Source Pack Installation OpenFOAM Version 2.1.0 on Redhat Linux Indrajit OpenFOAM Installation 1 April 1, 2012 05:39


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