CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   OF 1.7 installation problem "command not found error" (http://www.cfd-online.com/Forums/openfoam-installation/77951-1-7-installation-problem-command-not-found-error.html)

maysmech July 8, 2010 06:59

OF 1.7 installation problem "command not found error"
 
hello Foamers,
I've tried to install OF 1.7 on my Ubuntu 10.04 as has been described in http://www.cfd-online.com/Forums/ope...am-fedora.html
i've edited .bashrc and have updated the shell.
But now, i can't use OF because of "command not found" error when typing blockMesh, icoFoam and so on.
What is the problem?

wyldckat July 8, 2010 07:16

Greetings maysmech,

OK, lets "isolate and conquer":
  1. What does this output:
    Code:

    echo $WM_PROJECT_DIR
  2. If the previous shows anything, then what does this output:
    Code:

    ls $WM_PROJECT_DIR
  3. If the previous shows the contents of your base OpenFOAM folder (OpenFOAM-1.7.0 and ThirdParty-1.7.0), then so far so good!
  4. Now, did you run ./Allwmake in the folder $WM_PROJECT_DIR/OpenFOAM-1.7.0? If you did, did you make a log of the output? If not, run again like so:
    Code:

    ./Allwmake > make.log 2>&1
    Then, when it's finished running, open the file make.log and search for "Error " (including the space) and if some appear, then you've got problems building OpenFOAM.
If you've reached point 4 with success, and without errors, then you're ready to go. Otherwise, you will need to tell us a few more things:
  1. what version of Fedora are you using?
  2. what architecture of Fedora are you using: i?86 or x86_64?
  3. If there are errors listed in the make.log file, pack it with:
    Code:

    tar -cjf make.log.tar.bz2 make.log
    and post it here in attachment.
Best regards,
Bruno

maysmech July 8, 2010 08:45

Dear Bruno
Thanks,

Quote:

What does this output:
Code:

echo $WM_PROJECT_DIR

that is:
Code:

/home/maysam/OpenFOAM/OpenFOAM-1.7.0
Quote:

Now, did you run ./Allwmake in the folder $WM_PROJECT_DIR/OpenFOAM-1.7.0?
Yes, it has error 2 and 127, i tried to attach make.log but it can't be done here. i uploaded it in another site http://beyshare.com/en/download/CeSS...ke.log.tar.bz2
Quote:

what version of Fedora are you using?
what architecture of Fedora are you using: i?86 or x86_64?
I use Ubuntu 10.04 32bit.

Best regards,
maysam

wyldckat July 8, 2010 12:31

Hi maysam,

OK, apparently you seriously followed the wrong tutorial :)

Any particular reason for building your own OpenFOAM 1.7.0, instead of using the pre-built one for Ubuntu? See here: http://www.openfoam.com/download/ubuntu.php


If you really must build OpenFOAM for yourself, then you still need to install (at least) the following packages (in bold) in Ubuntu (this is the command line):
Code:

sudo apt-get install flex build-essential g++ python-dev libqt4-dev  libreadline5-dev zlib1g zlib1g-dev texinfo byacc bison
Then you can run Allwmake again!

Best regards,
Bruno

maysmech July 8, 2010 19:39

Quote:

Originally Posted by wyldckat (Post 266433)
you still need to install (at least) the following packages (in bold) in Ubuntu (this is the command line):
Code:

sudo apt-get install flex build-essential g++ python-dev libqt4-dev  libreadline5-dev zlib1g zlib1g-dev texinfo byacc bison
Then you can run Allwmake again!

i update all things you told and by running allwmake it has error yet. here is new make.log: http://beyshare.com/en/download/lvDMH3F16lGZ/make.log.tar.bz2

Best.

wyldckat July 8, 2010 19:51

Hi maysmech,

Ooops, I missed one package:
Code:

sudo apt-get install binutils-dev
And Allwmake again! :)

Best regards,
Bruno

maysmech July 9, 2010 15:41

thank you very much for your effective helps. the problem has been solved. but by typing "paraFoam" and running paraview a window with "Open data with" appears and tells that a reader for the time files could not find and show readers to select like "LSDyna" "ParaviewDatafiles" and so on. but none of them can show results.

wyldckat July 9, 2010 15:59

Hi maysmech,

OK, two things:
  1. Follow these instructions:
    Quote:

    Originally Posted by wyldckat (Post 263925)
    As for ParaView 3.8.0, you won't need to build PV3FoamReader since it already has a very good native reader built in ParaView. You can change in the script OpenFOAM-1.7.0/bin/paraFoam were it says ".OpenFOAM" to ".foam", since ParaView 3.8.0 expects that "foam" is the file extension for OpenFOAM cases.

    This way you won't have to loose more time in building stuff.
  2. I hope you are following the instructions from the User Guide when running the cavity tutorial!

Best regards,
Bruno

maysmech July 9, 2010 16:30

Quote:

Originally Posted by wyldckat (Post 266662)
Follow these instructions

i changed .OpenFOAM to .foam in the file you told (it has 3 of them). now by typing paraFoam, paraview opens and immediately closes.:confused:

maysmech July 11, 2010 05:48

the paraview version is 3.4 not 3.8. i download 3.8 version from its site. now how can i upgrade the version? i didn't find anything in forum.

wyldckat July 11, 2010 06:25

Hi maysmech,

The file "OpenFOAM-1.7.0/etc/apps/paraview3/bashrc" is used to set the environment variables to point to the ParaView installation.
Now, you have (at least) two options:
  1. Either you install/unpack the downloaded ParaView 3.8.0 in the folder defined by the paraview3/bashrc file, namely here:
    Code:

    $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-3.8.0
  2. Or you change this line in paraview3/bashrc:
    Code:

    export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION
    to where you installed ParaView. For example:
    Code:

    export ParaView_DIR=$HOME/paraview-3.8.0
Good luck!
Bruno

maysmech July 11, 2010 17:52

i've done the second one but by typing paraFoam the last version(3.4) is opening.:(

maysmech July 11, 2010 18:52

i installed OF for Ubuntu easily by:
http://www.openfoam.com/download/ubuntu.php

now i have proper paraview 3.8 and OF 1.7.
But in the OpenFOAM folder Only run is available and there isn't any OF sources which can be changeable. Now, how can i make change in OF codes?

wyldckat July 12, 2010 06:40

Hi maysam,

OK, then the quickest way right now is to run this command:
Code:

chown $USERNAME:$USERNAME -R /opt/openfoam170
This will change the ownership of the folder /opt/openfoam170 from root to your user and thus you can now use that folder!

But use this only if you really need to change the OpenFOAM's core! If you just want to build new solvers or run the tutorials, then run the commands shown near the end of the Ubuntu instructions page:
Code:

mkdir -p $FOAM_RUN
cp -r $FOAM_TUTORIALS $FOAM_RUN

This will create a work folder for yourself named "$HOME/OpenFOAM/$USERNAME-1.7.0" where you can keep your projects!

The variables "$FOAM_RUN", "$FOAM_USER_LIBBIN" and "$FOAM_USER_APPBIN" are the OpenFOAM's pre-defined paths to your cases, user libraries and user applications!

Best regards,
Bruno

claudia.h July 21, 2010 14:01

problems with user rights OF 1.7
 
Hi Bruno,

I have another question. I'm a newbie in OF and linux and i worked up to now with the OF version 1.6. I tried to install openFOAM 1.7. It runs without problems (thanks for your help again) but then I tried to change a solver (chtMultiRegionSimpleFoam). That wasn't possible because OpenFoam was situated in the folder /opt/openfoam170 from root. First I tried to adapt a solver with the superuser rights but than it wasn't possible to execute the openFoam commands.

Then I found your posting and tried to create the folder applications with cp -r $FOAM_APPBIN $FOAM_RUN. I got a folder called "linuxGccDPOpt" including files which i cant open, so I don't know if I have done this right. I thougt i get a folder which includes the folder structure from the /opt/openFoam/applications which includes also the folder solvers from which i could take one solver and adapt it. It would be very helpful for me if you could give me a hint how to get a possibility with OF 1.7 to create a new solver by adapting an existing solver.

I tried also your quick way with the aim to change the ownership from the folder /opt/openfoam170 but if I achieve the command without superuser rights I get the Info "Operation not permitted" and with the superuser rights nothing happen.

Maybe you could help me to solve this problem. Thanks!

Best Regards,
Claudia

wyldckat July 21, 2010 14:27

Hi Claudia,
Quote:

Originally Posted by claudia.h (Post 268377)
Then I found your posting and tried to create the folder applications with cp -r $FOAM_APPBIN $FOAM_RUN.

Ooops, if you hadn't pointed that out, I wouldn't have seen the blooper I made... but I fixed it now :)

OK, what you are looking for is $FOAM_APP, or $FOAM_SOLVERS and $FOAM_UTILITIES. So, I believe you want to run:
Code:

cp -r $FOAM_SOLVERS $WM_PROJECT_USER_DIR/solvers
If you run env or export, you will view the available environment variables. For example: I found about $WM_PROJECT_USER_DIR by running
Code:

export | grep $USERNAME
And another thing I mistyped... the -R in chown is before the user name and group... It should be like this:
Code:

sudo chown -R $USERNAME:$USERNAME /opt/openfoam170
Now, if by any chance the folder you just copied has the wrong permissions, then run:
Code:

chown -R $USERNAME:$USERNAME $WM_PROJECT_USER_DIR/solvers
As for building your own solvers/utilities, you will have to edit the file Make/files in the respective solver folder. Example, change the last line that has:
Code:

EXE = $(FOAM_APPBIN)/chtMultiRegionFoam
To:
Code:

EXE = $(FOAM_USER_APPBIN)/chtMultiRegionFoam2
Best regards and good luck!
Bruno

claudia.h July 21, 2010 17:26

solver problems
 
Hi Bruno,

thanks a lot!!! With your help i could copy the solvers and utilities folders in my home folder. First I tried to copy the chtMultiRegionSimpleFoam without changes in order to find out if the wmake command works. I changed the code in the Make/files and than I tried to carry out the wmake command in the terminal. First I thought it works but then I get an error.

cannot open output file /opt/openfoam170/applications/bin/linuxGccDPOpt/mychtMultiRegionSimpleFoam Permission denied

I tried to copy the folder bin like the others (solvers, utilities) with:
cp -r $FOAM_BIN $WM_PROJECT_USER_DIR/bin

but this doesn't works. I got a error:
cp: missing destination file operand
"cp --help" gives more information

I tried cp --help but i have not really an idea. So I used the command
sudo chown -R $USERNAME:$USERNAME /opt/openfoam170

After this I could achiev the command wmake. But now I have another Problem. I tried to run the tutorial chtMultiRegionSimpleFoam with my new solver mychtMultiRegionSimpleFoam (which up to now only has another name). I changed in the Allrun file the first line #!/bin/sh to #!/bin/bash and changed on line 37 the name to mychtMultiRegionSimpleFoam.
Then I started the tutorial with ./Allrun - I got no error, and the folders bottomAir, heater and so on in the folder 0 were created but nothing else (with the original solver there were log.files created and files for the writeIntervals). When i delete in the Allrun skript at line 37 "runApplication" and then achiev ./Allrun the solver works - I could see the result in paraView but in OF there are no folders with the Information of Temperature for the Iterations. I have no idea what happens. Maybe you also now something about how to solve this problem. Thanks for your help!

Best Regards, Claudia

wyldckat July 22, 2010 06:20

Hi Claudia,

Quote:

Originally Posted by claudia.h (Post 268405)
I tried to copy the folder bin like the others (solvers, utilities) with:
cp -r $FOAM_BIN $WM_PROJECT_USER_DIR/bin

Uhm... the command you are looking for is this:
Code:

cp -r $FOAM_APPBIN $WM_PROJECT_USER_DIR/bin
The variable "$FOAM_BIN" doesn't exist, and thus the cp command only saw this:
Code:

cp -r $WM_PROJECT_USER_DIR/bin
Which leads to nowhere...

As for your other problem, I've got a feeling you skipped a crucial step that I already wrote about in the previous post:
Quote:

As for building your own solvers/utilities, you will have to edit the file Make/files in the respective solver folder. Example, change the last line that has:
Code:

EXE = $(FOAM_APPBIN)/chtMultiRegionFoam
To:
Code:

EXE = $(FOAM_USER_APPBIN)/chtMultiRegionFoam2

Let me remind you that in Linux/OpenFOAM, one wrong letter, letter case, digit, space or symbol, and you will get a GIGO situation: Garbage In - Garbage Out :(
So be veeeery careful with the changes you do to the code, otherwise what looks OK is in fact wrong :(

Best regards,
Bruno

maysmech October 6, 2010 08:15

Quote:

Originally Posted by wyldckat (Post 266433)
Hi maysam,

OK, apparently you seriously followed the wrong tutorial :)

Any particular reason for building your own OpenFOAM 1.7.0, instead of using the pre-built one for Ubuntu? See here: http://www.openfoam.com/download/ubuntu.php


If you really must build OpenFOAM for yourself, then you still need to install (at least) the following packages (in bold) in Ubuntu (this is the command line):
Code:

sudo apt-get install flex build-essential g++ python-dev libqt4-dev  libreadline5-dev zlib1g zlib1g-dev texinfo byacc bison
Then you can run Allwmake again!

Best regards,
Bruno

after i want update above comments this error is displayed:
Code:

user@user-laptop:~/OpenFOAM$ sudo apt-get install libreadline5-dev
Reading package lists... Done
Building dependency tree     
Reading state information... Done
E: Couldn't find package libreadline5-dev

what is the reason?

wyldckat October 6, 2010 08:19

Hi Maysam,

Quote:

Originally Posted by maysmech (Post 278077)
after i want update above comments this error is displayed:
Code:

user@user-laptop:~/OpenFOAM$ sudo apt-get install libreadline5-dev
Reading package lists... Done
Building dependency tree     
Reading state information... Done
E: Couldn't find package libreadline5-dev

what is the reason?

Which Ubuntu version are you using?

Best regards,
Bruno


All times are GMT -4. The time now is 09:46.