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

Building OpenFOAM 2.2.x in usr/local, where changes necessary? (ubuntu

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2013, 05:47
Default Building OpenFOAM 2.2.x in usr/local, where changes necessary? (ubuntu
  #1
New Member
 
ae-lab VUB
Join Date: Oct 2011
Posts: 17
Rep Power: 14
aevub is on a distinguished road
Hi
I'm working on a virtual server (ubuntu 12.04 LTS) and I would like to build OpenFOAM 2.2.x under /usr/local/ so that it's accessible for all users. I work with different versions next to each other, so I used aliases.
I added in /etc/bash.bashrc
alias OF22x='. /usr/local/OpenFOAM/OpenFOAM-2.2.x/etc/bashrc'
and changed in usr/local/OpenFOAM/OpenFOAM-2.2.x/etc/bashrc the foam install to /usr/local/$WM_PROJECT_DIR

Is there some additional change needed? Because when I then start building (in new terminal, after typing OF22x and foam, which all works fine) I get an error that the environmental variables are inconstent with the installation

wmakeCheckPwd: not found
Error: Current directory is not $WM_PROJECT_DIR

Thanx for helping me out!
aevub is offline   Reply With Quote

Old   December 8, 2013, 13:23
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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 aevub,

Took me a while to see the problem here... but this should be it:
Quote:
Originally Posted by aevub View Post
and changed in usr/local/OpenFOAM/OpenFOAM-2.2.x/etc/bashrc the foam install to /usr/local/$WM_PROJECT_DIR
If you look at this line: https://github.com/OpenFOAM/OpenFOAM...etc/bashrc#L45
You'll see that the original value is:
Code:
foamInstall=$HOME/$WM_PROJECT
Which means that you should have changed it to this:
Code:
foamInstall=/usr/local/$WM_PROJECT
And not to:
Code:
foamInstall=/usr/local/$WM_PROJECT_DIR


Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   December 9, 2013, 02:09
Default
  #3
New Member
 
ae-lab VUB
Join Date: Oct 2011
Posts: 17
Rep Power: 14
aevub is on a distinguished road
Hi Bruno

Apparently, I made a mistake when asking my question, because I didn't put
Code:
foamInstall=/usr/local/$WM_PROJECT_DIR
but
Code:
foamInstall=/usr/local/$WM_PROJECT

Amazing that you found that typo.. but unfortunately it's not the reason for the error.
Any other ideas?

regards
Maaike
aevub is offline   Reply With Quote

Old   December 9, 2013, 14:20
Thumbs up
  #4
New Member
 
Erdem
Join Date: Dec 2013
Posts: 2
Rep Power: 0
vints is on a distinguished road
I was also trying to install under the "/usr/local/" folder, and had the same issue.

As explained in the building from source instructions, one should change the installation directory accordingly:

Code:
export FOAM_INST_DIR=/usr/local/OpenFOAM
foamDotFile=$FOAM_INST_DIR/OpenFOAM-2.2.2/etc/bashrc
[ -f $foamDotFile ] && . $foamDotFile
Running the "source $HOME/.bashrc" afterwards didn't raise an error.

Before this solution, I tried replacing "$HOME" with "/usr/local/" in the bashrc file, but that doesn't work.

Right now, I'm trying to solve some issues with ".\Allwmake" ...
vints is offline   Reply With Quote

Old   December 10, 2013, 02:28
Default
  #5
New Member
 
ae-lab VUB
Join Date: Oct 2011
Posts: 17
Rep Power: 14
aevub is on a distinguished road
Actually, I tried to build the 2.2.x under my home folder on my pc, and when following the guidelines provided at
http://www.tfd.chalmers.se/~hani/kur...OwnLaptop.html
but I had the same problem.
Only when I build it with
Quote:
source etc
in the bashrc file, the Allwmake works as it should...
aevub is offline   Reply With Quote

Old   December 10, 2013, 06:59
Default
  #6
New Member
 
Erdem
Join Date: Dec 2013
Posts: 2
Rep Power: 0
vints is on a distinguished road
Were you able to solve it then?

I also did an installation under home folder and it worked smoothly as told in these instructions. Now OpenFOAM and ParaView are operational.

I don't know what the trouble was with the "/usr/local" installation. Some solutions I've read mentioned checking the wmake files with "which " command. That and "echo "ing folder name variables as "$FOAM_INST_DIR" looked correct. I may not be handling permissions correctly, so that might be an issue, as well.
vints is offline   Reply With Quote

Old   December 10, 2013, 07:49
Default
  #7
New Member
 
ae-lab VUB
Join Date: Oct 2011
Posts: 17
Rep Power: 14
aevub is on a distinguished road
Well, I built OpenFOAM 2.2.x with the" source ..." in the bashrc file, and after compiling, I changed this into an alias to run different versions next to each other, and that works.

The usr/local or opt/ still doesn't work.
aevub is offline   Reply With Quote

Old   December 10, 2013, 17:05
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Greetings to all!

@aevub: As implied by vints - to diagnose, try these steps:
  1. Start a new terminal.
  2. Run these commands:
    Code:
    echo $WM_PROJECT_DIR
    echo $FOAM_INST_DIR
    Both should give you an empty line in the screen.
  3. Now source the OpenFOAM environment, by using the alias you created, namely:
    Code:
    OF22x
  4. Now run the commands from step #2 once again. This time, it should should you the correct locations where you want to install OpenFOAM.
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   December 11, 2013, 04:50
Default
  #9
New Member
 
ae-lab VUB
Join Date: Oct 2011
Posts: 17
Rep Power: 14
aevub is on a distinguished road
To check what happens with my failed /usr/local installation, I changed my alias again. After this,
Quote:
echo $WM_PROJECT_DIR
and
Quote:
echo $FOAM_INST_DIR
give me
Quote:
/usr/local/OpenFOAM/OpenFOAM-2.2.x
and
Quote:
/usr/local/OpenFOAM/
exactly what it should be.

Still, when running ./Allwmake, I get the error that the current directory is not $WM_PROJECT_DIR, although it is..
aevub is offline   Reply With Quote

Old   December 11, 2013, 15:50
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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 aevub,

Mmm... that kind of issue should only occur if something is out of place.
Try the following steps:
  1. Edit the main "Allwmake" script file and edit the very first line:
    Code:
    #!/bin/sh
  2. And change it to this:
    Code:
    #!/bin/sh -x
  3. Next time you run the script:
    Code:
    ./Allwmake
    it should give you a full output of what this script is doing.
  4. The specific complaint should come from the script "wmakeCheckPwd", which is located at the path given by this command:
    Code:
    echo $WM_PROJECT_DIR/wmake/wmakeCheckPwd
  5. Check if the script has got execution permissions:
    Code:
    ls -l $WM_PROJECT_DIR/wmake/wmakeCheckPwd
    It should give you something like this:
    Code:
    -rwxrwxr-x 1 root root 2664 Mar  9  2013 /usr/local/OpenFOAM/OpenFOAM-2.2.x/wmake/wmakeCheckPwd
    The "x" in "-rwxrwxr-x" indicates the execution permissions.
  6. Edit the script "wmakeCheckPwd" and do the same as in step #2. And try to run the Allwmake script again.
At the end of these steps, the problem should be as clear as clean water

Best regards,
Bruno
__________________
wyldckat 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.org] OpenFOAM 1.6.x Installer for Ubuntu Canesin OpenFOAM Installation 142 March 30, 2015 04:58
OpenFOAM vs Ubuntu 10.10 64 bit vkrastev OpenFOAM Installation 12 April 23, 2011 10:14
Error in apt-get update for installation of OpenFoam 1.7.1 on Ubuntu 10.10 StuntedChicken OpenFOAM Installation 1 January 9, 2011 10:43
Modified OpenFOAM Forum Structure and New Mailing-List pete Site News & Announcements 0 June 29, 2009 05:56
Building OpenFoAm on SGI Altix 64bits anne OpenFOAM Installation 8 June 15, 2006 09:27


All times are GMT -4. The time now is 17:11.