CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Installing OpenFOAM 1.6 on ubuntu 9.10 (https://www.cfd-online.com/Forums/openfoam-installation/71354-installing-openfoam-1-6-ubuntu-9-10-a.html)

nabeels December 27, 2009 16:42

Installing OpenFOAM 1.6 on ubuntu 9.10
 
Hello Friend
I'm trying to install OpenFOAM 1.6 (http://www.opencfd.co.uk/openfoam/linux64.html) on my ubuntu 1.6 laptop. After downloading the files available in the above link, I tried to unpack them using the command: tar xvfo <file_name>.
When I applied this command to the file OpenFOAM-1.6.General.gtgz, the process aborted in the middle and the following message appeared:

tar: Exiting with failure status due to previous errors

tar: OpenFOAM-1.6/doc/Doxygen/html/classFoam_1_1compressible_1_1RASModels_1_1mut
SpalartAllmarasStandardRoughWallFunctionFvPatchSca larField_51218d13afa96ba17d82c
deee1f2b25a_icgraph.md5: Cannot open: File name too long


This error has occurred for some other files, can anyone help me with what to do to be able to unpack the file successfully?http://ubuntuforums.org/images/smilies/confused.gif
Thank you in advance
Nabeel

gwierink December 28, 2009 03:20

Hi Nabeel,

Try the tar flag xvzf, i.e.
Code:

tar -xvzf OpenFOAM-1.6.General.gtgz

nabeels December 28, 2009 03:37

Quote:

Originally Posted by gwierink (Post 241020)
Hi Nabeel,

Try the tar flag xvzf, i.e.
Code:

tar -xvzf OpenFOAM-1.6.General.gtgz

I tried the command u gave me, and I got the same error message:confused:

gwierink December 28, 2009 03:48

Hmm, are you unpacking the right version (32/64 bit)? Are you on 32 or 64 bit Ubuntu?

nabeels December 28, 2009 03:52

Quote:

Originally Posted by gwierink (Post 241024)
Hmm, are you unpacking the right version (32/64 bit)? Are you on 32 or 64 bit Ubuntu?

I'm on 64 bit Ubuntu!

nabeels December 28, 2009 04:13

Quote:

Originally Posted by nabeels (Post 241026)
I'm on 64 bit Ubuntu!

yes, i used the right version

gwierink December 28, 2009 04:17

Ok, time for the next stupid question ;) ...

Are you unpacking in a directory called OpenFOAM and in the right order?

nabeels December 28, 2009 13:02

Quote:

Originally Posted by gwierink (Post 241030)
Ok, time for the next stupid question ;) ...

Are you unpacking in a directory called OpenFOAM and in the right order?

I guess so. I started unpacking OpenFOAM-1.6.General.gtgz then ThirdParty.General.gtgz and in the directory called OpenFOAM

Akuji January 10, 2010 05:27

What about tar -xzf OpenFoam-1.6.gtgz?

andy_ January 10, 2010 05:52

Try changing the name of the files so that they end in ".tgz". Then double clicking with the file manager and let Ubuntu do its own thing. If this does not work it is likely the file was corrupted when downloaded.

eros January 10, 2010 13:15

I think error come when tar try to write such long named file.
So broblem comes from filesystem limits. Try other filesystem there are many choices in linux.

--
Eerin

Disco_Caine March 9, 2010 04:29

Hi, seeing as this a topic on installing openfoam in ubuntu 9.10, ill post my doubt here. I have manage to extract the files, but when it comes to sourcing the bashrc file. Nothing happens, and then when i try to run the foaminstallationtest script, nothing happens. I think tis pretty obvious, something should happen.

I guess, my actual question is, firstly, how do i run the script? As to see all the errors and post them back here.

Also, this is where i put the command line on the bashrc, since it said the end of the file:

# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset cleanEnv cleanProg foamInstall foamOldDirs
unset _foamSource

#
. $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
-----------------------------------------------------------------------------

I hope that's fine.

Thank you in advanced

Akuji March 9, 2010 15:42

Quote:

Originally Posted by Disco_Caine (Post 249117)
. $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
-----------------------------------------------------------------------------

As i understand right, your truubble may be in incorrect command.
try to type ./$HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc

gwierink March 10, 2010 03:15

Hi GB,

It seems you have added ". $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc" at the end of the $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc file. Now . $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc is kind of sourcing itself. What you need to do is open up .bashrc in your home directory with e.g.
Code:

gedit $HOME/.bashrc
and add
Code:

. $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
at the end of that file and save it. Then, you need to make the shell aware of the new environment variable by sourcing it with
Code:

. $HOME/.bashrc
(notice the dot (".") at the start) or by just opening a new terminal.

Also, I'd remove the line you added to $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc.

Disco_Caine March 10, 2010 04:13

Hi gijs, i did what you said, i removed what i had added to the bashrc and then i followed your steps, and i got this error:

bash: /home/gustavo/OpenFOAM/OpenFOAM-1.6/.OpenFOAM-1.6/bashrc: No such file or directory

What is strange is that its looking for it OpenFOAM-1.6/OpenFOAM-1.6, ofcourse, i dont have the OpenFOAM-1.6 duplicated, that part i did right.

I also get the error just by adding the /, akuji.

My guess is that maybe i deleted something wrong, or its not removed, hidden there, and that's what causing it to mess up?

gwierink March 10, 2010 04:18

Hi Gustavo,

This line
Quote:

bash: /home/gustavo/OpenFOAM/OpenFOAM-1.6/.OpenFOAM-1.6/bashrc: No such file or directory
looks like you have the wrong line in $HOME/.bashrc. Are you sure that in $HOME/.bashrc it reads
Code:

. $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
and not
Code:

. $HOME/OpenFOAM/OpenFOAM-1.6/.OpenFOAM-1.6/bashrc
?

Disco_Caine March 10, 2010 04:33

Quote:

Originally Posted by gwierink (Post 249296)
Hi Gustavo,

This line
looks like you have the wrong line in $HOME/.bashrc. Are you sure that in $HOME/.bashrc it reads
Code:

. $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
and not
Code:

. $HOME/OpenFOAM/OpenFOAM-1.6/.OpenFOAM-1.6/bashrc
?


I am so positive it's correct, i shall copy it:

Code:


if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

. $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc

I copied a little more just to show that i put it way at the end of the file.

Like, i did delete everything openFOAM yesterday, perhaps there is a conflict somewhere?

gwierink March 10, 2010 05:35

Quote:

Code:

if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi

. $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
The above really looks like you added ". $HOME/OpenFOAM/openFOAM-1.6/etc/bashrc" to the file $HOME/OpenFOAM/openFOAM-1.6/etc/bashrc. :confused:

You need to add ". $HOME/OpenFOAM/openFOAM-1.6/etc/bashrc" to the end of file $HOME/.bashrc, not to the end of file $HOME/OpenFOAM/openFOAM-1.6/etc/bashrc! :)

Disco_Caine March 10, 2010 06:01

Quote:

Originally Posted by gwierink (Post 249308)
The above really looks like you added ". $HOME/OpenFOAM/openFOAM-1.6/etc/bashrc" to the file $HOME/OpenFOAM/openFOAM-1.6/etc/bashrc. :confused:

You need to add ". $HOME/OpenFOAM/openFOAM-1.6/etc/bashrc" to the end of file $HOME/.bashrc, not to the end of file $HOME/OpenFOAM/openFOAM-1.6/etc/bashrc! :)

I do not fully understand what you are telling me, because i added ". $HOME/OpenFOAM/openFOAM-1.6/etc/bashrc" to the file i opened with gedit $HOME/.bashrc, just like you said earlier.

However, from what you said, i decided to look at the hidden files in the home directory, and the .bashrc (in home) says this:

At the top:

Code:

. ~/OpenFOAM/OpenFOAM-1.6/.OpenFOAM-1.6/bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

At the bottom:

Code:

if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

. /$HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc

So, obviously something is wrong, should i delete that line from the bashrc (the top line)?

gwierink March 10, 2010 06:21

Ah, right. These things can be a bit confusing sometimes at a distance via a forum :).

In the file .bashrc in the home dir ($HOME/.bashrc) there should be only one line that reads
Code:

. $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
Both
Code:

. ~/OpenFOAM/OpenFOAM-1.6/.OpenFOAM-1.6/bashrc
and
Code:

. /$HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
are wrong. So, I would delete ". ~/OpenFOAM/OpenFOAM-1.6/.OpenFOAM-1.6/bashrc" and ". /$HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc" from $HOME/.bashrc
and put in ". $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc" (without the parentheses of course :)).

Disco_Caine March 10, 2010 06:59

ok gijs, i think that just about did it!

Well at least i typed this in the terminal: . $HOME/.bashrc (should i type source instead of the period?)

And nothing happened, just a new line came, i think that is good. Now i have to run the foamInstallationScript.

And it worked!

Base configuration ok.

critical systems ok.

Thank you so much for your time gijs, and for your patience. I know it is hard, but you have no idea how much you have helped me!

gwierink March 10, 2010 07:09

Fantastic! That is good to hear, I am happy it works now! Happy foaming! :)

Quote:

should i type source instead of the period?
The dot and "source" are equivalent, so you can choose.

Quote:

nothing happened, just a new line came, i think that is good.
Yep, that's good, you're just making the shell aware of new environment variables (in this case that OF has its own bashrc and that it should be read).

Javed March 17, 2010 02:01

Hi, I am installing OF-1.6 on Ubuntu 8.1.
I have extracted files successfully into the Home/<username>/OpenFoam/
But not able to source bashrc file.
Also from the comments of previous forum had confused me, which file to edit bashrc i n home location or from OpenFoam/OpenFOAM-1.6/etc location.
I m getting following msg after using source bashrc command..


bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/bin/foamCleanPath: No such file or directory
bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/bin/foamCleanPath: No such file or directory
bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/bin/foamCleanPath: No such file or directory
bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/etc/settings.sh: No such file or directory
bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/etc/aliases.sh: No such file or directory
bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/etc/apps/paraview3/bashrc: No such file or directory
bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/etc/apps/ensight/bashrc: No such file or directory
bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/bin/foamCleanPath: No such file or directory
bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/bin/foamCleanPath: No such file or directory
bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/bin/foamCleanPath: No such file or directory

plz help me

gwierink March 17, 2010 02:37

Hi Javed,

There are two bashrc files; one of OpenFOAM (that lives in ~/OpenFOAM/OpenFOAM-1.6/etc/) and one of your system (the user that is) (that lives in ~/.bashrc). Now, for a normal installation of OF (no compilation) you only need to change ~/.bashrc (notice the dot (".")) to make the shell aware of OF's environment variables. So, the recipe is as follows:
  1. Extract the files in the right location (which you seemingly already did)
  2. Open file ~/.bashrc
    Code:

    gedit ~/.bashrc &
  3. Add the line
    Code:

    . $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
    to file ~/.bashrc (notice the dot "." in the code to add)
  4. Save file ~/.bashrc
  5. Source the newly edited ~/.bashrc by
    Code:

    . $HOME/.bashrc
    (notice the dot again)

Javed March 17, 2010 03:14

Thanks Gijs for the quick reply.
I followed the same procedure considering . in every single command. But still getting the error like

iyer@iyer-desktop:~$ . $HOME/.bashrc
bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/etc/bashrc: No such file or directory

want to clear two things
1) i m editing ~/.bashrc file of system and typing the command . $HOME/.bashrc in my home directory (name-/home/iyer).
2) Should i run :/$ source OpenFOAM-1.6/etc/bashrc before editing bashrc file.

I need ur help. plz reply. Thanks

Javed March 17, 2010 03:39

Sir, One more thing, we i remove the . $HOME/OpenFoam/OpenFOAM-1.6/etc/bashrc form the ~/.bashrc file,
1) I m neither getting an error or comment see the following.(as per ur direction)
iyer@iyer-desktop:~$ . $HOME/.bashrc
iyer@iyer-desktop:~$


but when i check in the OpenFoam command I m getting one error as follow

iyer@iyer-desktop:~/OpenFoam$ source /OpenFOAM-1.6/etc/bashrc
bash: /OpenFOAM-1.6/etc/bashrc: No such file or directory


I m not getting what is going on..plz help

gwierink March 17, 2010 04:37

ok, let's get some things vlear here
 
Hi Javed,

Quote:

we i remove the . $HOME/OpenFoam/OpenFOAM-1.6/etc/bashrc form the ~/.bashrc file,
1) I m neither getting an error or comment see the following.(as per ur direction)
Ok, now things are getting a bit messy here :). I'll try to explain what to do and why.

First, let's get some syntax clear:
  • "$HOME" is the same as "~"
  • "source" is the same as "."
  • "OF" means "OpenFOAM" ;)

Now, the idea behind the "environment variable and sourcing" stuff is that OF has its own bashrc file, through which OF makes the shell (the terminal where you type and calculate stuff) aware of the different parts OF needs to run. There it is stated what C++ compiler to use, where it is, what ParaView to use etc. The thing is that you need to make your "own shell" (the terminal you open to type commands) aware of these rules for OF (stated in the $HOME/OpenFoam/OpenFOAM-1.6/etc/bashrc file). To do that, you do not need to change $HOME/OpenFoam/OpenFOAM-1.6/etc/bashrc, but you need to make $HOME/.bashrc aware of $HOME/OpenFoam/OpenFOAM-1.6/etc/bashrc. This is done by adding the line
Code:

. $HOME/OpenFoam/OpenFOAM-1.6/etc/bashrc
to $HOME/.bashrc and sourcing $HOME/.bashrc. The dot (".") at the start of the line to add is shorthand for "source". Every time you open up a terminal $HOME/.bashrc is sourced (kind of checked for rules). So, if you add
Code:

. $HOME/OpenFoam/OpenFOAM-1.6/etc/bashrc
to your $HOME/.bashrc, OF's "rules" are automatically sourced when you start a terminal. Then, the terminal recognizes OF commands like "foam", "run", "blockMesh" etc.

When you remove the line
Code:

. $HOME/OpenFoam/OpenFOAM-1.6/etc/bashrc
from $HOME/.bashrc and then source $HOME/.bashrc by
Code:

. $HOME/.bashrc
or
Code:

source $HOME/.bashrc
no erro is given because the shell doesn't care whether you source OF or not. It only complains when you write something wrong in it or something with the wrong path.

So, to make a long story short, do this:
Quote:

  1. Open file ~/.bashrc Code:
    gedit ~/.bashrc &
  2. Add the line Code:
    . $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
    to file ~/.bashrc (notice the dot "." in the code to add)
  3. Save file ~/.bashrc
  4. Source the newly edited ~/.bashrc by Code:
    . $HOME/.bashrc
    (notice the dot again)

Then, your two other questions.
Quote:

1) i m editing ~/.bashrc file of system and typing the command . $HOME/.bashrc in my home directory (name-/home/iyer).
Yes, you need to edit ~/.bashrc (which btw is the same as $HOME/.bashrc) and source ~/.bashrc. It doesn't matter "where" you do that, you don't have to be in your home dir. Alternatively, you could just close the terminal and open a new one. Then, ~/.bashrc is automatically sourced.

Quote:

2) Should i run :/$ source OpenFOAM-1.6/etc/bashrc before editing bashrc file.
No, you don't need to do that. This is what ~/.bashrc does for you when you source ~/.bashrc or open a new terminal, because you put the line ". $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc" in ~/.bashrc. By the way, "OpenFOAM-1.6/etc/bashrc" is a relative path, that is it doesn't work from just any directory, but only when you are in the ~/OpenFOAM directory.



Quote:

iyer@iyer-desktop:~$ . $HOME/.bashrc
bash: /home/iyer/OpenFOAM/OpenFOAM-1.6/etc/bashrc: No such file or directory
Right, did you unpack OF in ~/OpenFOAM? If so, the path name is right and it looks like you actually deleted (or renamed) the file /home/iyer/OpenFOAM/OpenFOAM-1.6/etc/bashrc. If you have done that, please put it back into place (for the reason explained above).

Hope this clears up some things. :)

Javed March 18, 2010 00:21

Thanks Gijs,

I have successfully installed the openfoam, thanks a lot for the procedure(step by step:)) u sent.
Can u plz do one more favour just want to know how to open GUI , or any link which can guide for further work.

Thanks a lot again.
Javed

gwierink March 18, 2010 02:58

You're very welcome Javed, I'm glad it worked :).

Quote:

how to open GUI
Well, to my knowledge, OF-1.4.1 had a GUI called FoamX, but OF-1.5 and later not anymore. It is better and more powerful IMHO if you learn command line. It may be a bit challenging in the beginning, but you'll learn.

Quote:

any link which can guide for further work
I suggest you start with some tutorials in the user guide (lives in $HOME//OpenFOAM/OpenFOAM-1.6/doc) and then there are some nice tuts in the wiki.

Javed March 18, 2010 07:04

Thanks Gijs for the encouragement..
I will start from the tuts now..

Thanks a lot again for the help..

vishal May 3, 2010 08:34

Hi,

It worked for me also to set up .bashrc file. Thanks for your valuable advice.

openfoam May 9, 2010 06:23

openfoam installation
 
please send me the detail procedure for installation of openfoam1.6 working on ubuntu 9.10, 32 bit system

gwierink May 10, 2010 03:09

Hi Venkatesh,

Quote:

please send me the detail procedure for installation of openfoam1.6 working on ubuntu 9.10, 32 bit system
Please have a look at Mads' script and cookbook in this thread.


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