CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.com] Running source before compiling? (https://www.cfd-online.com/Forums/openfoam-installation/203582-running-source-before-compiling.html)

TU_Hiwi July 1, 2018 16:31

Running source before compiling?
 
Hey guy,

i am quite new to openfoam. I am currently trying to build OpenFOAM-v1806 from source on xubuntu 18.04, using this guide. Why am i building from source? my Boss wants me to.
The third command is
Code:

source ~/OpenFOAM/OpenFOAM-v1806/etc/bashrc
which returns the error:
Code:

hgl@hgl-ThinkPad-T530:~$source $HOME/OpenFOAM/OpenFOAM-v1806/etc/bashrc
No completion added for /home/hgl/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/bin
... incorrect platform, or not yet compiled?

it should be the correct Platform (Bash) but it is not yet compiled, since the guide states the link to the build guide just after this command.

So I assume the guide is in this case not that clear an i have to build openfoam before running source? And do i have to rerun source every time i rebooted the system? As I said, i am totally knew to this whole thing.

Thanks for your help and sorry if this isn't the smartest question.

Greetings

Phicau July 1, 2018 20:48

Hi Lukas,

everything is alright, just follow the guide and continue building. The script is only stating that there are no executable files in that folder, because it has just been created and they will only appear as you compile the code.

Yes, you need to source every time you open a new terminal, unless you include the sourcing line in your .bashrc file.

Best,

Pablo

LuckyTran July 3, 2018 11:34

I just want to add for clarification that source is name of a shell command that runs/executes the file, which in this case is the file: ~/OpenFOAM/OpenFOAM-v1806/etc/bashrc

You can open this file to see for yourself what exactly is being done. Essentially the bashrc script creates a bunch of environmental variables that will be used at some point and it also sources some more files.

When you open a fresh shell/terminal (not even a reboot), these environmental variables do not exist. So yes you will need to "source" this bashrc many times in your lifetime unless, as already mentioned, you add it this line into your .bashrc or .localsh file.

This sourcing you don't have to deal with in windows because these environmental variables are created usually by the installer that comes with the software and the environmental variables are automatically re-created at system boot-up. Well, here you are the installer.


All times are GMT -4. The time now is 01:58.