CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

error running Allrun script

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 1, 2014, 20:45
Default error running Allrun script
  #1
New Member
 
Join Date: Jan 2014
Posts: 6
Rep Power: 12
jul059 is on a distinguished road
hello,

I am new to linux and OpenFOAM. I'm trying to run the motorBike tutorial. When I try to run it with sudo ./Allrun, I get the following error :

Code:
./Allrun: 3: .: Can't open /bin/tools/RunFunctions
I understand this can be a problem with the variable $WM_PROJECT_DIR. Here's what I get with echo $WM_PROJECT_DIR :

Code:
/opt/openfoam211
So, anyone knows why I get this error?
jul059 is offline   Reply With Quote

Old   May 2, 2014, 03:47
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

did you do

Code:
$ source /opt/openfoam211/etc/bash
before running the script? If yes, show, please, your environment with a command

Code:
$ export | grep -E '(WM_|FOAM_)'
to see if it really set up.
alexeym is offline   Reply With Quote

Old   May 2, 2014, 08:11
Default
  #3
New Member
 
Join Date: Jan 2014
Posts: 6
Rep Power: 12
jul059 is on a distinguished road
Thanks for the help. Here's what I get with this command :

Code:
declare -x FOAM_APP="/opt/openfoam211/applications"
declare -x FOAM_APPBIN="/opt/openfoam211/platforms/linux64GccDPOpt/bin"
declare -x FOAM_EXT_LIBBIN="/opt/ThirdParty-2.1.1/platforms/linux64GccDPOpt/lib"
declare -x FOAM_INST_DIR="/opt"
declare -x FOAM_JOB_DIR="/opt/jobControl"
declare -x FOAM_LIBBIN="/opt/openfoam211/platforms/linux64GccDPOpt/lib"
declare -x FOAM_MPI="openmpi-system"
declare -x FOAM_RUN="/home/julien/OpenFOAM/julien-2.1.1/run"
declare -x FOAM_SETTINGS=""
declare -x FOAM_SIGFPE=""
declare -x FOAM_SITE_APPBIN="/opt/site/2.1.1/platforms/linux64GccDPOpt/bin"
declare -x FOAM_SITE_LIBBIN="/opt/site/2.1.1/platforms/linux64GccDPOpt/lib"
declare -x FOAM_SOLVERS="/opt/openfoam211/applications/solvers"
declare -x FOAM_SRC="/opt/openfoam211/src"
declare -x FOAM_TUTORIALS="/opt/openfoam211/tutorials"
declare -x FOAM_USER_APPBIN="/home/julien/OpenFOAM/julien-2.1.1/platforms/linux64GccDPOpt/bin"
declare -x FOAM_USER_LIBBIN="/home/julien/OpenFOAM/julien-2.1.1/platforms/linux64GccDPOpt/lib"
declare -x FOAM_UTILITIES="/opt/openfoam211/applications/utilities"
declare -x WM_ARCH="linux64"
declare -x WM_ARCH_OPTION="64"
declare -x WM_CC="gcc"
declare -x WM_CFLAGS="-m64 -fPIC"
declare -x WM_COMPILER="Gcc"
declare -x WM_COMPILER_LIB_ARCH="64"
declare -x WM_COMPILE_OPTION="Opt"
declare -x WM_CXX="g++"
declare -x WM_CXXFLAGS="-m64 -fPIC"
declare -x WM_DIR="/opt/openfoam211/wmake"
declare -x WM_LDFLAGS="-m64"
declare -x WM_LINK_LANGUAGE="c++"
declare -x WM_MPLIB="SYSTEMOPENMPI"
declare -x WM_OPTIONS="linux64GccDPOpt"
declare -x WM_OSTYPE="POSIX"
declare -x WM_PRECISION_OPTION="DP"
declare -x WM_PROJECT="OpenFOAM"
declare -x WM_PROJECT_DIR="/opt/openfoam211"
declare -x WM_PROJECT_INST_DIR="/opt"
declare -x WM_PROJECT_USER_DIR="/home/julien/OpenFOAM/julien-2.1.1"
declare -x WM_PROJECT_VERSION="2.1.1"
declare -x WM_THIRD_PARTY_DIR="/opt/ThirdParty-2.1.1"
jul059 is offline   Reply With Quote

Old   May 2, 2014, 09:49
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, environment variables are correct. Don't know, maybe they weren't set up in the terminal where you've executed Allrun script.
alexeym is offline   Reply With Quote

Old   May 3, 2014, 15:27
Default
  #5
New Member
 
Join Date: Jan 2014
Posts: 6
Rep Power: 12
jul059 is on a distinguished road
I forgot to say,
Code:
source /opt/openfoam211/etc/bash
gives the following error :
Code:
bash: /opt/openfoam211/etc/bash: No such file or directory
jul059 is offline   Reply With Quote

Old   May 3, 2014, 16:06
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Oh, sorry, maybe it's autocorrect but the right command is

Code:
source /opt/openfoam211/etc/bashrc
alexeym is offline   Reply With Quote

Old   May 3, 2014, 23:45
Default
  #7
New Member
 
Join Date: Jan 2014
Posts: 6
Rep Power: 12
jul059 is on a distinguished road
I ran
Code:
source /opt/openfoam211/etc/bashrc
and the result is the same.

When I run
Code:
sudo ./Allrun
I get the following :
Code:
./Allrun: 3: .: Can't open /bin/tools/RunFunctions
But if I run it without sudo, I get the following :
Code:
cp: cannot create regular file `constant/triSurface/motorBike.obj.gz': Permission denied
blockMesh already run on /home/julien/OpenFOAM/julien-2.1.1/run/incompressible/simpleFoam/motorBike: remove log file to re-run
snappyHexMesh already run on /home/julien/OpenFOAM/julien-2.1.1/run/incompressible/simpleFoam/motorBike: remove log file to re-run
potentialFoam already run on /home/julien/OpenFOAM/julien-2.1.1/run/incompressible/simpleFoam/motorBike: remove log file to re-run
simpleFoam already run on /home/julien/OpenFOAM/julien-2.1.1/run/incompressible/simpleFoam/motorBike: remove log file to re-run
How do we explain that the script seems to execute further without sudo?

As I said, I am new to OpenFOAM AND Linux...
jul059 is offline   Reply With Quote

Old   May 4, 2014, 02:43
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, you've got 2 problems here

1. If you run Allrun with sudo, script has different set of environment variables

2. You don't have write permission in /opt/openfoam211/tutorials

So you can do something like this:

Code:
$ source /opt/openfoam211/etc/bashrc
$ cd $FOAM_RUN
$ cp -r $FOAM_TUTORIALS .
$ cd tutorials
$ ./Allrun
These commands will copy tutorials folder for your home folder where you have write permission, and after you'll be able to run them.
alexeym is offline   Reply With Quote

Old   May 5, 2014, 17:31
Default
  #9
New Member
 
Join Date: Jan 2014
Posts: 6
Rep Power: 12
jul059 is on a distinguished road
I was finally able to run the script. The source of my problem was rather obscure : a faulty hard drive. I replaced it, reinstalled CAELinux and everything is fine.

Thank you for your help!
jul059 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
script Allrun doesn't work after beeing copied on another disk hard drive nakor OpenFOAM Installation 3 September 12, 2012 15:16
Trying to understand Allrun script j-avdeev OpenFOAM Running, Solving & CFD 4 November 16, 2011 02:47
How can i activate the Allrun script? spk OpenFOAM 2 October 2, 2011 17:28
Ubuntu: Allrun script issue fletc900 OpenFOAM Bugs 2 July 2, 2010 16:58
Empty Allrun script mwild OpenFOAM Bugs 4 August 25, 2009 02:43


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