CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   ok compile but not find the solver ! (http://www.cfd-online.com/Forums/openfoam-programming-development/116960-ok-compile-but-not-find-solver.html)

immortality April 29, 2013 13:53

ok compile but not find the solver !
 
I have compiled a new solver with this message well(last lines of compiling message):
Code:

odels/basic/lnInclude -I/opt/openfoam220/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam220/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam220/src/dynamicMesh/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/rhoCentralFoamModified.o -L/opt/openfoam220/platforms/linux64GccDPOpt/lib \
        -lfiniteVolume -lfluidThermophysicalModels -lspecie -lrhoCentralFoam -lcompressibleTurbulenceModel -lcompressibleRASModels -lcompressibleLESModels -lmeshTools -lOpenFOAM -ldl  -lm -o /home/ehsan/OpenFOAM/root-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamModified
+ wmake rhoCentralDyMFoam
Making dependency list for source file rhoCentralDyMFoam.C
SOURCE=rhoCentralDyMFoam.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I.. -I../BCs/lnInclude -I/opt/openfoam220/src/finiteVolume/lnInclude -I/opt/openfoam220/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam220/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam220/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam220/src/dynamicMesh/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/rhoCentralDyMFoam.o
../createFields.H: In function ‘int main(int, char**)’:
../createFields.H:11:23: warning: unused variable ‘T’ [-Wunused-variable]
/opt/openfoam220/src/finiteVolume/lnInclude/readTimeControls.H:32:12: warning: unused variable ‘adjustTimeStep’ [-Wunused-variable]
/opt/openfoam220/src/finiteVolume/lnInclude/readTimeControls.H:35:8: warning: unused variable ‘maxCo’ [-Wunused-variable]
/opt/openfoam220/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I.. -I../BCs/lnInclude -I/opt/openfoam220/src/finiteVolume/lnInclude -I/opt/openfoam220/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam220/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam220/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam220/src/dynamicMesh/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/rhoCentralDyMFoam.o -L/opt/openfoam220/platforms/linux64GccDPOpt/lib \
        -lfiniteVolume -lfluidThermophysicalModels -lspecie -lrhoCentralFoam -lcompressibleTurbulenceModel -lcompressibleRASModels -lcompressibleLESModels -ldynamicMesh -lmeshTools -lOpenFOAM -ldl  -lm -o /opt/openfoam220/platforms/linux64GccDPOpt/bin/rhoCentralDyMFoam

but when execute this error is displayed:

Code:

ehsan@Ehsan-com:~/Desktop/WR_Central_Riemann_U_right_modular$ pyFoamPlotRunner.py --hardcopy --with-courant --no-pickled-file --procnr=4 rhoCentralFoamModified
 PyFoam WARNING on line 139 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Execution/ParallelExecution.py : which can not find a match for rhoCentralFoamModified . Hoping for the best
--------------------------------------------------------------------------
mpirun was unable to launch the specified application as it could not find an executable:

Executable: rhoCentralFoamModified
Node: Ehsan-com

while attempting to start process rank 0.
--------------------------------------------------------------------------

how to resolve?

Lieven April 29, 2013 16:57

This might help

http://www.cfd-online.com/Forums/ope...und-error.html

wyldckat April 29, 2013 19:09

Lieven is correct!
The end of the second line indicates where the solver ended up:
Quote:

Code:

/home/ehsan/OpenFOAM/root-2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamModified

"root-2.2.0" means that the solver was build while using "sudo".

immortality April 30, 2013 06:37

thanks.my modified solver is on desktop and I had compile and run another solver successfully before that is on desktop too.
the rhoCentralFoam that I have changed and have put to desktop has two folders with BCs and rhoCentralDymFoam that have their own make folders.
should I change them to USER too?
I don't know whether the solver needs them or not.but when I delete them this error displays:
with ./Allwmake
Code:

ehsan@Ehsan-com:~/Desktop/rhoCentralFoamModified$ ./Allwmake
+ wmake libso BCs
wmake error: could not change to directory 'BCs'

and with wmake:
Code:

ehsan@Ehsan-com:~/Desktop/rhoCentralFoamModified$ wmake
touch: cannot touch `Make/linux64GccDPOpt/dontIncludeDeps': Permission denied
Making dependency list for source file rhoCentralFoamModified.C
could not open file fixedRhoFvPatchScalarField.H for source file rhoCentralFoamModified.C
/bin/sh: cannot create Make/linux64GccDPOpt/dependencies: Permission denied
make: *** [Make/linux64GccDPOpt/dependencies] Error 2

what should i do?

Henning86 April 30, 2013 11:33

you have to change them to USER. otherwise you have no permission to right in the normal pass with is by default opt/

if you change it to user then it will write in your home directory.
it is pretty good explained in the user guide

immortality April 30, 2013 11:58

thanks.so the other folders in the solver(BCs and rhoCEntralDYMFoam) should be compiled also? how can find solver uses them(specially BCs folder)?
I edited BCs folder in "files" as this:
Code:

mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.C
U/maxwellSlipUFvPatchVectorField.C
T/smoluchowskiJumpTFvPatchScalarField.C
rho/fixedRhoFvPatchScalarField.C

LIB = $(FOAM_USER_LIBBIN)/librhoCentralFoamModified

is this ok?
but this error occured:
Code:

ehsan@Ehsan-com:~/Desktop/rhoCentralFoamModified/BCs$ wmake
/bin/sh: cannot create linux64GccDPOpt/files: Permission denied
make: *** [linux64GccDPOpt/files] Error 2
touch: cannot touch `Make/linux64GccDPOpt/dontIncludeDeps': Permission denied
/bin/sh: cannot create Make/linux64GccDPOpt/dependencies: Permission denied
make: *** [Make/linux64GccDPOpt/dependencies] Error 2


wyldckat April 30, 2013 19:31

Greetings to all!

@Ehsan: I can only guess that the first post you made was a result of running:
Code:

sudo ./Allwmake
This resulted in creating folders with the administrative user named "root". When folders and files are create with that user account, only that user can delete them.

The simplest solution is to now run:
Code:

sudo wclean all
which will remove the temporary build files.

After that, you can simply use:
Code:

./Allwmake
As for the other two folders: you can remove the folders "BCs" and "rhoCentralDyMFoam", if you only need to modify the main "rhoCentralFoam" solver.

Best regards,
Bruno

edit: for more information about sudo and "root": https://help.ubuntu.com/community/RootSudo

immortality May 1, 2013 04:43

thanks.yes you are right.
but now i encountered an odd error:
Code:

ehsan@Ehsan-com:~/Desktop/rhoCentralFoamModified$ sudo wclean all
[sudo] password for ehsan:
sudo: wclean: command not found

how it doen't know wclean?!!:confused:

Lieven May 1, 2013 04:57

Try the following:
Code:

$ sudo su
$ source /opt/openfoam-xxx/etc/bashrc
$ wclean all


immortality May 1, 2013 05:33

third command lead to:
Code:

root@Ehsan-com:/home/ehsan/Desktop/rhoCentralFoamModified# wclean all
No command 'wclean' found, did you mean:
 Command 'uclean' from package 'svn-buildpackage' (universe)
wclean: command not found

the second command resulted:
Code:

root@Ehsan-com:/home/ehsan/Desktop/rhoCentralFoamModified# source /opt/openfoam-220/etc/bashrc
bash: /opt/openfoam-220/etc/bashrc: No such file or directory


wyldckat May 1, 2013 05:43

:confused: OK, let's try this the other way around and lets fix the folders that were created as root. As normal user (not root), go into the folder where you have your custom solver. Then run:
Code:

sudo chown -R $USER:$USER ./
wclean all


immortality May 1, 2013 06:00

:(
Code:

ehsan@Ehsan-com:~/Desktop/rhoPimpleFoamModified$ sudo chown -R $USER:$USER
[sudo] password for ehsan:
chown: missing operand after `ehsan:ehsan'
Try `chown --help' for more information.


wyldckat May 1, 2013 06:16

I've edited my previous post... seems like you didn't see the dot symbol ".", so I added a slash "/" to make it clearer...

immortality May 1, 2013 06:35

i thought that was for end of the sentence!
wmake leads to it again:
Code:

ehsan@Ehsan-com:~/Desktop/rhoCentralFoamModified$ wmake
Making dependency list for source file rhoCentralFoamModified.C
could not open file fixedRhoFvPatchScalarField.H for source file rhoCentralFoamModified.C
SOURCE=rhoCentralFoamModified.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -IBCs/lnInclude -I/opt/openfoam220/src/finiteVolume/lnInclude -I/opt/openfoam220/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam220/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam220/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam220/src/dynamicMesh/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/rhoCentralFoamModified.o
rhoCentralFoamModified.C:37:40: fatal error: fixedRhoFvPatchScalarField.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/rhoCentralFoamModified.o] Error 1


wyldckat May 1, 2013 06:43

A dot in code is usually not the end of a sentence ;) Unless it's between quotes:
Code:

echo "Now this is a sentence."
OK, as for the current problem, I was too sleepy last night to write down the additional steps... The missing steps are simple:
  1. Edit the file "Make/options".
  2. Find this line:
    Code:

    -IBCs/lnInclude \
  3. Replace it with:
    Code:

    -I$(FOAM_SOLVERS)/compressible/rhoCentralFoam/BCs/lnInclude \

immortality May 1, 2013 07:10

thank you.what a genius you are!:p
it works properly now.
what was that code you told me?I never had changed anything in make/options.

wyldckat May 1, 2013 08:04

Quote:

Originally Posted by immortality (Post 424390)
what was that code you told me?I never had changed anything in make/options.

It's all (briefly) explained here: http://www.openfoam.org/docs/user/co...plications.php

immortality May 20, 2014 07:50

Hi again dear Bruno,
I want to run the case on another computer, but this error again occurs,
I tested with sudo wclean all
but this error occurs:
Code:

thesis@thesis-X58A-UD7:/media/01CB6899AE13A880/final-nazeri/rhoCentralFoamGasCont$ sudo wclean all
sudo: wclean: command not found

and this for instance, for compiling with normal user
Code:

thesis@thesis-X58A-UD7:/media/01CB6899AE13A880/final-nazeri/rhoCentralFoamGasCont$ ./Allwmake
bash: ./Allwmake: Permission denied

I tried the ways you've told before but its the errors are remained.
Code:

thesis@thesis-X58A-UD7:/media/01CB6899AE13A880/final-nazeri/rhoCentralFoamGasCont$ sudo chown -R $USER:$USER ./
[sudo] password for thesis:
thesis@thesis-X58A-UD7:/media/01CB6899AE13A880/final-nazeri/rhoCentralFoamGasCont$ wclean all
wclean ./
/opt/openfoam220/wmake/wclean: 137: ./Allwclean: Permission denied
thesis@thesis-X58A-UD7:/media/01CB6899AE13A880/final-nazeri/rhoCentralFoamGasCont$


wyldckat May 24, 2014 05:02

Hi Ehsan,

Quote:

Originally Posted by immortality
The Only Stupid Question Is the One that Goes Unasked.

I wonder what is the saying for those who asked the question, got the answer and then lost that answer :(.

So, here I go and repeat myself for the I don't known how many times:
  1. You're trying to run scripts on the external hard-drive, which has a non-POSIX compliant file system. In other words, no matter how much you use sudo, you will still not have enough permissions to run on that hard-drive, because it does not allow execution of scripts and applications from there. Or at least, not usually.
  2. Never use sudo to build custom applications. Unless you know what you're doing. Which in this case, clearly you don't know ;).
  3. If you're going to build or run something to be used with OpenFOAM, copy from the external hard-drive to your Linux desktop folder or any other "/home/your_user_name" folder on your Linux installation. Then you can use chmod to change the execution permissions for the scripts.
Best regards,
Bruno

immortality May 27, 2014 16:32

Quote:

Originally Posted by wyldckat (Post 493890)
Hi Ehsan,


I wonder what is the saying for those who asked the question, got the answer and then lost that answer :(.

So, here I go and repeat myself for the I don't known how many times:
  1. You're trying to run scripts on the external hard-drive, which has a non-POSIX compliant file system. In other words, no matter how much you use sudo, you will still not have enough permissions to run on that hard-drive, because it does not allow execution of scripts and applications from there. Or at least, not usually.
  2. Never use sudo to build custom applications. Unless you know what you're doing. Which in this case, clearly you don't know ;).
  3. If you're going to build or run something to be used with OpenFOAM, copy from the external hard-drive to your Linux desktop folder or any other "/home/your_user_name" folder on your Linux installation. Then you can use chmod to change the execution permissions for the scripts.
Best regards,
Bruno

Hi dear Bruno,
I copied the folder of edited solver to the desktop but the above errors repeated again. although my adviser saw my code and surprised by what I've done with OpenFOAM :) and said that there is no need to run there again:p but why same commands don't act on the PC in his room?


All times are GMT -4. The time now is 04:08.