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

[OpenFOAM.org] How to install OpenFoam from its folder

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 22, 2015, 07:32
Default How to install OpenFoam from its folder
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
I executed this command for modifying gnuplot:
Code:
sudo apt-get install libx11-dev libxt-dev libreadline-gplv2-dev glib-2.0
but it removed OpenFOAM folder, furtunately I had backed up its folder on the Desktop.
but now that I want to install it by ./Allwmake this error is shown:
Code:
ehsan@ehsan-N56JK:~/openfoam240$ ./Allwmake
./Allwmake: 4: ./Allwmake: wmakeCheckPwd: not found
Error: Current directory is not $WM_PROJECT_DIR
    The environment variables are inconsistent with the installation.
    Check the OpenFOAM entries in your dot-files and source them.
I have set the OpenFOAM bashrc address in Ubuntu bashrc like this:
Code:
. /home/ehsan/openfoam240/etc/bashrc
this is output of echo command:
Code:
ehsan@ehsan-N56JK:~/openfoam240$ echo $WM_PROJECT_DIR
/opt/openfoam240
how can install OF without downloading it again due to lack of Internet volume ?
thanks.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.

Last edited by immortality; June 22, 2015 at 09:46.
immortality is offline   Reply With Quote

Old   June 27, 2015, 08:33
Default
  #2
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
I would appreciate of your comments. it seems that the value of
WM_PROJECT_DIR should be changed to the address of the folder containing OpenFOAM. is it true? how?
thanks.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 28, 2015, 04:48
Default
  #3
New Member
 
Regis
Join Date: Jan 2012
Posts: 24
Rep Power: 14
Regis_ is on a distinguished road
If you’re looking for recompiling OpenFOAM by using Allwmake, then you are correct, you should change some variables in OpenFOAM’s bashrc file.
Check lines 45—48 and see if your $foamInstall is correct. Then you can comment line 58 out and add
Code:
export FOAM_INST_DIR=$foamInstall
I am not sure what line 58 does, so this is the approach I use. Someone may be able to give you a more detailed and accurate explanation about such line.
Keep in mind, though, that your directory is not “2.4.0”, but rather “240” so you may need to adjust that as well.
Regis_ is offline   Reply With Quote

Old   June 28, 2015, 12:10
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
thanks dear Regis, I changed the the lines to it:
Code:
# foamInstall=/opt
# foamInstall=~$WM_PROJECT
# foamInstall=/opt/$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
foamInstall=/home/ehsan
#
# END OF (NORMAL) USER EDITABLE PART
################################################################################

#
# These are the defaults for this version which should generally be
# overridden from the prefs.sh file or from command-line specification
#
#- note the location for later use (eg, in job scripts)
# : ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR
export FOAM_INST_DIR=$foamInstall
when openfoam240 is in this address:/home/ehsan
what then I have to do in next stage?
because the same message is shown again.
thanks a lot.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 29, 2015, 15:23
Default
  #5
New Member
 
Regis
Join Date: Jan 2012
Posts: 24
Rep Power: 14
Regis_ is on a distinguished road
Ehsan,

I suggest you stick with the default directory structure, which goes like this: OpenFOAM directory within your $HOME, then OpenFOAM-x.y.z, ThirdParty-x.y.z and an user folder inside the OpenFOAM directory. From the directory you listed in your first post it looks like you're not following this, and unless you're doing the appropriate modifications it won't work.

You can still do that if you want to, but you'll need to make sure the variables in OpenFOAM's bashrc are consistent. I wouldn't suggest that. You can use foamInstall=$HOME/$WM_PROJECT, or, if you really need the version number, use foamInstall=$HOME/$WM_PROJECT$WM_PROJECT_VERSION.
Regis_ is offline   Reply With Quote

Old   June 30, 2015, 06:22
Default
  #6
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
dear Regis I performed what suggested as below:
Code:
# Location of the OpenFOAM installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# foamInstall=/opt
# foamInstall=~$WM_PROJECT
# foamInstall=/opt/$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
foamInstall=$HOME/$WM_PROJECT
#
# END OF (NORMAL) USER EDITABLE PART
but the error is the same:
Code:
ehsan@ehsan-N56JK:~/Desktop/openfoam240$ ./Allwmake
./Allwmake: 4: ./Allwmake: wmakeCheckPwd: not found
Error: Current directory is not $WM_PROJECT_DIR
    The environment variables are inconsistent with the installation.
    Check the OpenFOAM entries in your dot-files and source them.

does it matter where the primary folder that we want to install OF from it is? or anywhere it be it will install in $HOME/$WM_PROJECT like Windows?
thanks a lot.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 30, 2015, 17:56
Default
  #7
New Member
 
Regis
Join Date: Jan 2012
Posts: 24
Rep Power: 14
Regis_ is on a distinguished road
Follow the instructions for compiling from source. Yes, it does matter where the primary folder is. It can be anywhere, as long as you make the appropriate modification of paths in OpenFOAM’s bashrc.

Also, these errors are telling you what’s wrong: the current directory is not $WM_PROJECT_DIR. If you don’t what directory is this, use echo $WM_PROJECT_DIR. Remember to source the bashrc when you make changes.
Regis_ is offline   Reply With Quote

Old   July 1, 2015, 08:46
Default
  #8
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
it shows nothing for the address of $WM_PROJECT_DIR
Code:
ehsan@ehsan-N56JK:~$ echo $WM_PROJECT_DIR

ehsan@ehsan-N56JK:~$ echo $WM_PROJECT
and if it be showed I have to copy openfoam240 folder to there and install from that place?
thanks.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   July 5, 2015, 15:47
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: Detailed instructions for Ubuntu 14.04 and OpenFOAM 2.4.0 has been available at openfoamwiki.net since the 13th of June 2015: http://openfoamwiki.net/index.php/In...M-2.4.0/Ubuntu
wyldckat is offline   Reply With Quote

Old   August 5, 2015, 06:06
Default
  #10
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
I tried the page but the problem didn't solve. the OF folder exists but doesn't install
clearly saying I want to install Debian package of OF offline, not the source package online.
appreciate helps.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 8, 2015, 13:22
Default
  #11
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
I think the previous installation of OF still uses the environmental variables, it's why echo command dosn't show anything.
now how can I uninstall it completely?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 8, 2015, 16:16
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Ehsan,

Not sure what is your current folder structure, but assuming the previous posts are still valid:
  1. Move the source code you rescued from the Deb package from the "Desktop" folder to the real folder. For example:
    Code:
    mkdir ~/OpenFOAM
    mv ~/Desktop/openfoam240 ~/OpenFOAM/OpenFOAM-2.4.0
  2. Rectify the file "~/OpenFOAM/OpenFOAM-2.4.0/etc/bashrc" for restoring it to the correct folder path, namely the block mentioned in a previous post, where you should modify it to have this:
    Code:
    ################################################################################
    # USER EDITABLE PART: Changes made here may be lost with the next upgrade
    #
    # either set $FOAM_INST_DIR before sourcing this file or set
    # 'foamInstall' below to where OpenFOAM is installed
    #
    # Location of the OpenFOAM installation
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    foamInstall=$HOME/$WM_PROJECT
    # foamInstall=~$WM_PROJECT
    # foamInstall=/opt/$WM_PROJECT
    # foamInstall=/usr/local/$WM_PROJECT
    #
    # END OF (NORMAL) USER EDITABLE PART
    ################################################################################
  3. You will also need to fix this block in the same file:
    Code:
    # Location of installation
    # ~~~~~~~~~~~~~~~~~~~~~~~~
    export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
    export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/openfoam240
    Change it to this:
    Code:
    # Location of installation
    # ~~~~~~~~~~~~~~~~~~~~~~~~
    export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
    export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
  4. Save and close the file.
  5. Edit the file "~/.bashrc" and remove any references you have for OpenFOAM 2.4.0.
  6. Start a new terminal. Check if you have any loaded OpenFOAM environment working:
    Code:
    echo $WM_PROJECT_DIR
    • If it outputs nothing, then no environment is loaded.
    • If it outputs anything, then you need to comment out any lines related to the loaded OpenFOAM version, in the file "~/.bashrc".
  7. Now, even if you don't need to download the source code folder for OpenFOAM 2.4.0, you still need to download the "ThirdParty-2.4.0" package. Furthermore, you will still need to install the necessary packages for compiling OpenFOAM, ParaView and so on. Therefore, you will still to perform most of the steps from these instructions: http://openfoamwiki.net/index.php/In...u#Ubuntu_14.04 - the only difference is that you don't need to download the "OpenFOAM-2.4.0.tgz" package.

If you still have problems with installing packages via apt-get, then you will have to also have to install aptitude:
Code:
sudo apt-get install aptitude
then use aptitude instead of apt-get. For example:
Code:
sudo aptitude install build-essential
Good luck! Best regards,
Bruno
immortality likes this.
__________________
wyldckat is offline   Reply With Quote

Old   August 9, 2015, 12:20
Default
  #13
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
Thank you very much. the problem resolved and both installed properly.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality 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] Docker OpenFOAM install error on Mac OS X dersh OpenFOAM Installation 10 May 6, 2016 13:49
[OpenFOAM.org] A Mac OS X of23x Development Environment Using Docker rt08 OpenFOAM Installation 1 February 28, 2016 20:00
Suggestion for a new sub-forum at OpenFOAM's Forum wyldckat Site Help, Feedback & Discussions 20 October 28, 2014 10:04
Install openFOAM from with proxy server Dhruval OpenFOAM Installation 3 October 18, 2014 16:38
[waves2Foam] trying to install the waves2Foam toolbox with OpenFoam 2.3.0 andr5w5 OpenFOAM Community Contributions 4 July 5, 2014 10:47


All times are GMT -4. The time now is 14:32.