CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Parallel installation of OF1.6ext and OF220 (http://www.cfd-online.com/Forums/openfoam-installation/121430-parallel-installation-of1-6ext-of220.html)

miro2000 July 28, 2013 17:38

Parallel installation of OF1.6ext and OF220
 
Hello everyone,

I'm trying to install both OF 1.6ext and OF2.2.0 so I can run both.
I have successfully installed OF 2.2.0 and it works fine. However, It's making problems when I try to install OF 1.6ext.
I have followed the installation instructions and it works until I try to run ./Allwmake. As I see it, the installation folder is set to //opt/openFoam220 which wrong.
The problem is that I'm relatively new to linux and I don't quite now whats going on here.

The error:
Error: Current directory is not $WM_PROJECT_DIR
The environment variable are not consistent with the installation.
Check the OpenFOAM entries in your dot-files and source them.
When I run: echo $WM_PROJECT_DIR
He says: /opt/OpenFOAM-1.6-ext
and sometimes he says /opt/openFoam220

I tried to change the path in etc/bashrc, but no effect. What exactly am I doing when I change that path?

Thank you for help, sorry if topic exists, didn't find it.
P.S. I'm running Ubuntu 12.04

wyldckat August 21, 2013 13:07

Greetings Miro,

Quick answer - Read the instructions on this blog post: Advanced tips for working with the OpenFOAM shell environment

Best regards,
Bruno

miro2000 August 22, 2013 02:29

That's it. Thanks :)

c0sk August 22, 2013 06:57

Hi,
I am having problems installing the 1.6 ext alongside OF 2.2.0. When I try to source the bashrc file ( located in home/user/OpenFOAM/OpenFoam 1.6-ext/etc/) i get the following error:
bash: /opt/OpenFOAM-1.6-ext/bin/foamEtcFile: No such file or directory
bash: /opt/OpenFOAM-1.6-ext/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.6-ext/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.6-ext/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.6-ext/etc/settings.sh: No such file or directory
bash: /opt/OpenFOAM-1.6-ext/etc/aliases.sh: No such file or directory
bash: /opt/OpenFOAM-1.6-ext/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.6-ext/bin/foamCleanPath: No such file or directory
bash: /opt/OpenFOAM-1.6-ext/bin/foamCleanPath: No such file or directory
which is true cause just OF2.2.0 is in opt whereas 1.6ext is in home folder.
When I run: echo $WM_PROJECT_DIR
He says: /opt/OpenFOAM-1.6-ext (which does not exist)!
I read trough tens of post but could get around it. I might have understood that I have to add : alias of16ext='. $HOME/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc'
somewhere but I dont know exactly where (linux newbie :( ) :confused::confused:
Any suggestions? Thanks!!

wyldckat August 22, 2013 07:12

Greetings c0sk and welcome to the forum!

Uhm, did you read the instructions on this blog post: Advanced tips for working with the OpenFOAM shell environment ??

Best regards,
Bruno

c0sk August 22, 2013 07:15

Quote:

Originally Posted by wyldckat (Post 447420)
Greetings c0sk and welcome to the forum!

Uhm, did you read the instructions on this blog post: Advanced tips for working with the OpenFOAM shell environment ??

Best regards,
Bruno

yeah! it says to edit the bashrc file. Does it mean the one in openfoam220/etc or the one in OpenFoam 1.6 ext/etc ?
Thanks for the reply and the welcome message :D

wyldckat August 22, 2013 07:26

Quote:

Originally Posted by c0sk (Post 447421)
yeah! it says to edit the bashrc file. Does it mean the one in openfoam220/etc or the one in OpenFoam 1.6 ext/etc ?

I think you're reading things waaaay too fast ;)
With OpenFOAM, you need to have a very close attention to all details, or you'll end up trying to simulate a car larger than the planet Earth ;)

Quote:

Edit "~/.bashrc", remove or comment any lines you've got there and add lines like these:
Code:

alias of220='. /opt/openfoam220/etc/bashrc'
alias of16ext='. $HOME/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc'


The file "~/.bashrc" is the same as "$HOME/.bashrc", which you can see the location for it by running:
Code:

echo $HOME/.bashrc
I'll add this description to my blog post.

c0sk August 22, 2013 07:45

Quote:

Originally Posted by wyldckat (Post 447426)
I think you're reading things waaaay too fast ;)
With OpenFOAM, you need to have a very close attention to all details, or you'll end up trying to simulate a car larger than the planet Earth ;)



The file "~/.bashrc" is the same as "$HOME/.bashrc", which you can see the location for it by running:
Code:

echo $HOME/.bashrc
I'll add this description to my blog post.

ahaha true :D i tried that option earlier and it says that is in home/user/ but I can't see such file and if I run the command ~.bashrc it says permission denied. How do I open this file? :(

wyldckat August 22, 2013 07:59

It all depends on the Linux Distribution you are using, namely on how to edit the file.

The idea is that once you have the full path to the file (given by the echo command), you should use a text editor to open that file, by giving the full path to it.


I was going to give a description on how to see the files in question, but since you said you are new to Linux, I suggest that you read this tutorial: http://linuxcommand.org/learning_the_shell.php
In case you didn't notice, this is one of the first suggestions I make on the blog post.

Happy reading!

c0sk August 22, 2013 08:22

Quote:

Originally Posted by wyldckat (Post 447433)
It all depends on the Linux Distribution you are using, namely on how to edit the file.

The idea is that once you have the full path to the file (given by the echo command), you should use a text editor to open that file, by giving the full path to it.


I was going to give a description on how to see the files in question, but since you said you are new to Linux, I suggest that you read this tutorial: http://linuxcommand.org/learning_the_shell.php
In case you didn't notice, this is one of the first suggestions I make on the blog post.

Happy reading!

Thanks!
I used that tutorial to learn the basic last week, I now tried gedit ~/.bashrc and a text editor opened which is full of text and the last lines now are
#source /opt/openfoam220/etc/bashrc
#source /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc
#source /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc
#source /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc
#source /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc
alias of220='. /opt/openfoam220/etc/bashrc'
alias of16ext='. $HOME/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc'

I did leave the rest of the text unchanged. Even after this if I try of16ext I still get the same error!:confused: :(

edit:
restarted my laptop and tried again, this is what i got this time :

andc0sk@ubuntu:~$ of16ext
Sourcing: /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/etc/settings.sh
Environment variables defined for OpenMPI:
OPENMPI_BIN_DIR : /usr/bin
OPENMPI_LIB_DIR : /usr/lib/openmpi/lib
OPENMPI_INCLUDE_DIR : /usr/lib/openmpi/include /usr/lib/openmpi/include/openmpi
OPENMPI_COMPILE_FLAGS : -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread
OPENMPI_LINK_FLAGS : -pthread -L/usr/lib/openmpi/lib -lmpi -lopen-rte -lopen-pal -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl

MPI_HOME : /usr
MPI_ARCH_PATH : /usr
OPAL_PREFIX : /usr
PINC : -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread
PLIBS : -pthread -L/usr/lib/openmpi/lib -lmpi -lopen-rte -lopen-pal -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl
MESQUITE_DIR is initialized to:
METIS_DIR is initialized to:
PARMETIS_DIR is initialized to:
PARMGRIDGEN_DIR is initialized to:
LIBCCMIO_DIR is initialized to:
SCOTCH_DIR is initialized to:
CMAKE_DIR is initialized to:
M4_DIR is initialized to:
BISON_DIR is initialized to:
FLEX_DIR is initialized to:
ZOLTAN_DIR is initialized to:
PYTHON_DIR is initialized to:
QT_DIR is initialized to:
PARAVIEW_DIR is initialized to:
Sourcing: /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/etc/aliases.sh

Is this what is supposed to look like? Can I keep going with the installation procedure even though I did restart my laptop at some point during the process?

wyldckat August 22, 2013 08:52

Details, you need to have a lot of attention to the details! ;)
I'll quote from my blog post:
Quote:

This way, the game play has changed: now whenever you start a new terminal/console window or tab, the OpenFOAM environment is not available by default.
You didn't need to restart the laptop completely, all you need to do was to start a new terminal window! :) But hey, restarting was a sure way be certain that it was all in place.

As for the output you got: yes, that's normal for 1.6-ext to provide so much information by default. You can go forward with the building process.
By the way, you can also find building instructions for 1.6-ext here: http://openfoamwiki.net/index.php/In...enFOAM-1.6-ext

c0sk August 23, 2013 06:42

Thank you so much!!! Finally managed to get it working!:D

c0sk August 27, 2013 13:08

Got another problem :( In the tutorials/incompressible/icoDyMFoam/movingBlockRBF/ I tried to run the ./Allrun command but it just does not execute and goes back to the empty command line. Can it be related to something that went wrong with the installation procedure?:confused:


Edit: I do believe the problem is due to the fact that when I try ./Allrun, the wmake command which should compile the RBFMotionSolver is trying to source the files in the opt/openfoam220 directory. This is happening because I uncommented source /opt/openfoam220/etc/bashrc by removing the # (which I wrote last week) in the -bashrc file, otherwishe, I was not be able to run any OpenFoam tutorials. How can I correct this and get both things working?

wyldckat August 27, 2013 16:59

I thought you had everything under control... OK:
  1. Please post the last lines of your "~/.bashrc" file, as long as they do not contain any sensitive information. Perhaps there is one or two lines that are present and shouldn't be.
  2. When you start a new terminal window or tab, do you run only of220 or of16ext once at the beginning of each terminal?
Best regards,
Bruno

c0sk August 28, 2013 06:32

Ok my bashrc file last lines are:
Code:

#source /opt/openfoam220/etc/bashrc
#source /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc
#source /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc
#source /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc
#source /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc
alias of220='. /opt/openfoam220/etc/bashrc'
alias of16ext='. $HOME/OpenFOAM/OpenFOAM-1.6-ext/etc/bashrc'

I did run of16ext before the current session and tried ./Allrun again, same problem, when I go in RBFMotionsolver in tutorials/incpmpressible/icoDyMFoam/movingBlockRBF and try wmake i get the following:

c0sk August 28, 2013 06:33

Code:


g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/dynamicMesh/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/meshMotion/RBFMotionSolver/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/meshTools/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/triSurface/lnInclude -IlnInclude -I. -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64Gcc46DPOpt/RBFMotionFunctionObject.o -L/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/lib/linux64Gcc46DPOpt \
              -lOpenFOAM -liberty -ldl  -lm -o OpenFOAM.out
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
Make/linux64Gcc46DPOpt/RBFMotionFunctionObject.o: In function `Foam::RBFMotionSolver const& Foam::objectRegistry::lookupObject<Foam::RBFMotionSolver>(Foam::word const&) const [clone .constprop.88]':
RBFMotionFunctionObject.C:(.text+0x13f7): undefined reference to `typeinfo for Foam::RBFMotionSolver'
RBFMotionFunctionObject.C:(.text+0x14d2): undefined reference to `Foam::RBFMotionSolver::typeName'
RBFMotionFunctionObject.C:(.text+0x1555): undefined reference to `Foam::RBFMotionSolver::typeName'
Make/linux64Gcc46DPOpt/RBFMotionFunctionObject.o: In function `Foam::RBFMotionFunctionObject::execute()':
RBFMotionFunctionObject.C:(.text+0x178a): undefined reference to `Foam::RBFMotionSolver::movingPoints() const'
RBFMotionFunctionObject.C:(.text+0x17c3): undefined reference to `Foam::RBFMotionSolver::movingPoints() const'
RBFMotionFunctionObject.C:(.text+0x1da6): undefined reference to `Foam::RBFMotionSolver::setMotion(Foam::Field<Foam::Vector<double> > const&)'
Make/linux64Gcc46DPOpt/RBFMotionFunctionObject.o: In function `Foam::RBFMotionFunctionObject::start()':
RBFMotionFunctionObject.C:(.text+0x2878): undefined reference to `Foam::RBFMotionSolver::movingPoints() const'
Make/linux64Gcc46DPOpt/RBFMotionFunctionObject.o: In function `Foam::List<Foam::word> Foam::objectRegistry::names<Foam::RBFMotionSolver>() const':
RBFMotionFunctionObject.C:(.text._ZNK4Foam14objectRegistry5namesINS_15RBFMotionSolverEEENS_4ListINS_4wordEEEv[Foam::List<Foam::word> Foam::objectRegistry::names<Foam::RBFMotionSolver>() const]+0x61): undefined reference to `typeinfo for Foam::RBFMotionSolver'
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1

sorry for the double post but it did not let me write this all at once:p

wyldckat August 31, 2013 15:22

Hi c0sk,

Although you ran Allrun, something is broken in the function "compileLibrary" that Allrun is using, because of this output:
Quote:

Originally Posted by c0sk (Post 448493)
Code:

g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/dynamicMesh/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/meshMotion/RBFMotionSolver/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/meshTools/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/triSurface/lnInclude -IlnInclude -I. -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64Gcc46DPOpt/RBFMotionFunctionObject.o -L/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/lib/linux64Gcc46DPOpt \
          -lOpenFOAM -liberty -ldl  -lm -o OpenFOAM.out


The last file name "OpenFOAM.out" means that you're trying to build a library as an application.

Check the contents of the file "OpenFOAM-1.6-ext/bin/tools/RunFunctions" and check if the function has this code:
Code:

compileLibrary ()
{
    echo "Compiling $1 application"
    wmake libso $1
}

In addition, the foolproof way of making sure that the library builds properly is to change the following line in the Allrun script:
Code:

compileLibrary RBFMotionFunction
To this:
Code:

wmake libso RBFMotionFunction

edit: I forgot to mention that even though regular forum members cannot delete posts, they can edit their own posts! So you didn't need to double-post ;)

Best regards,
Bruno

c0sk September 1, 2013 10:17

Quote:

Originally Posted by wyldckat (Post 449097)
Hi c0sk,

In addition, the foolproof way of making sure that the library builds properly is to change the following line in the Allrun script:
Code:

compileLibrary RBFMotionFunction
To this:
Code:

wmake libso RBFMotionFunction


Best regards,
Bruno

Erhm, the Allrun file in the directory is completely empty :confused: This might be why it just doesn't do anything.
On the other hand, I checked the RunFunctions file and the code is there :rolleyes:

wyldckat September 1, 2013 10:47

You can always copy "Allrun" from the original folder at "$FOAM_TUTORIALS/incompressible/icoDyMFoam/movingBlockRBF", or from online: http://sourceforge.net/p/openfoam-ex...ovingBlockRBF/

c0sk September 1, 2013 12:06

Quote:

Originally Posted by wyldckat (Post 449209)
You can always copy "Allrun" from the original folder at "$FOAM_TUTORIALS/incompressible/icoDyMFoam/movingBlockRBF", or from online: http://sourceforge.net/p/openfoam-ex...ovingBlockRBF/

SORTED! I suppose, copied the code into the script, run of16ext in a new terminal and then run ./Allrun in the directory. Did not any error message this time and I did not have to change any line in the Allrun script.
Code:


andc0sk@ubuntu:~/OpenFOAM/OpenFOAM-1.6-ext/tutorials/incompressible/icoDyMFoam/movingBlockRBF$ ./Allrun
Compiling RBFMotionFunction application
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file RBFMotionFunctionObject.C
SOURCE=RBFMotionFunctionObject.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/dynamicMesh/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/dynamicMesh/meshMotion/RBFMotionSolver/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/meshTools/lnInclude    -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/triSurface/lnInclude -IlnInclude -I. -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude -I/home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64Gcc46DPOpt/RBFMotionFunctionObject.o
'/home/andc0sk/OpenFOAM/andc0sk-1.6-ext/lib/linux64Gcc46DPOpt/libRBFMotionFunction.so' is up to date.
Running blockMesh on /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/tutorials/incompressible/icoDyMFoam/movingBlockRBF
Running icoDyMFoam on /home/andc0sk/OpenFOAM/OpenFOAM-1.6-ext/tutorials/incompressible/icoDyMFoam/movingBlockRBF

That's correct, right?
THANK YOU SO MUCH!!!!! :D


All times are GMT -4. The time now is 21:13.