CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   beginner - compilation question userguide chapter3 (https://www.cfd-online.com/Forums/openfoam/78484-beginner-compilation-question-userguide-chapter3.html)

vetnav July 22, 2010 19:21

beginner - compilation question userguide chapter3
 
Hi,

I am trying to learn OpenFOAM (I installed Ubunt/Debian package), in the user guide chapter 3, there is a compilation example (3.2.4), in that on page U-79 it says "The user can compile pisoFoam by going to the $FOAM_CFD/pisoFoam directory and typing..." what is this $FOAM_CFD directory, I could not find this directory, when I type "cd $FOAM_CFD" or "echo $FOAM_CFD" there is no response in the shell.

So without wasting my time I went to "/opt/openfoam170/applications/solvers/incompressible/pisoFoam" and then typed wmake, I got following errors

mkdir: cannot create directory `linux64GccDPOpt': Permission denied
/bin/sh: cannot create linux64GccDPOpt/options: Directory nonexistent
make: *** [linux64GccDPOpt/options] Error 2
/opt/openfoam170/wmake/MakefileFiles:39: linux64GccDPOpt/options: No such file or directory
make: *** No rule to make target `linux64GccDPOpt/options'. Stop.
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created

can anyone please tell me whether I am doing this wmake in the correct directory?

Thanks
Naveen

akidess July 23, 2010 05:02

My guess is that you installed OF to /opt using root privileges, and now you are trying to compile as a regular user. This fails, because naturally compiling involves writing data to the folder which you do not have access to. You should try compiling as root, or move OF to your home directory.

wyldckat July 23, 2010 07:25

Greetings to all!

Quote:

Originally Posted by vetnav (Post 268603)
I am trying to learn OpenFOAM (I installed Ubunt/Debian package), in the user guide chapter 3, there is a compilation example (3.2.4), in that on page U-79 it says "The user can compile pisoFoam by going to the $FOAM_CFD/pisoFoam directory and typing..." what is this $FOAM_CFD directory, I could not find this directory, when I type "cd $FOAM_CFD" or "echo $FOAM_CFD" there is no response in the shell.

Hmmm... looks like a typo! It should be "$FOAM_APP/solvers/incompressible/pisoFoam" like is has at the beginning of that section. I can deduce that it happened to either one of at least two reasons:
  • since they talk about fvCFD.H a few lines back, in the writing frenzy, the writer's mind mangled FOAM_APP and fvCFD into a single word, and voilá... FOAM_CFD!
  • the other possibility is that this still has some remnants of text from earlier versions of OpenFOAM, way back when FOAM_CFD was some help variable or something like that...
Now, as for the Debian package: that version is meant to be shared between users! It's great for teaching classes or putting in servers! But when it comes to a single user in a dedicated machine, it can be a bit daunting at first.
So, as for solutions, you have plenty to choose from and here are a few:
  • You can do a hostile takeover of the folder /opt/openfoam170 by running the following command:
    Code:

    sudo chown -R $USERNAME:$USERNAME /opt/openfoam170
    And voilá, the OpenFOAM folder is now yours to torture and mangle :D
  • You can do a full copy of the folder /opt/openfoam170 into your home folder:
    Code:

    cp -r /opt/openfoam170 $HOME/OpenFOAM/OpenFOAM-1.7.0
    Then you will have to edit the file "$HOME/OpenFOAM/OpenFOAM-1.7.0/etc/bashrc" and change the line that says:
    Code:

    foamInstall=/opt
    To:
    Code:

    foamInstall=$HOME/$WM_PROJECT
    And finally, change in your home .bashrc file to point to this very same file! Start a nwe terminal and you are set to go!
  • You can partially follow the instructions available on this wiki page: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam
    I say partially, assuming you don't want to add temperature just yet :) After copying the solver folder, the key point is changing the last line in the file Make/files in the solver folder, from this:
    Code:

    EXE = $(FOAM_APPBIN)/icoFoam
    To this:
    Code:

    EXE = $(FOAM_USER_APPBIN)/my_icoFoam
    So, pretty much you just copy the folder and edit the Make/files file and your ready to compile your own solver.
    I also recently posted about this on this thread: http://www.cfd-online.com/Forums/ope...tml#post268384
Best regards and good luck!
Bruno


All times are GMT -4. The time now is 19:38.