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/)
-   -   New solver compile error (http://www.cfd-online.com/Forums/openfoam-programming-development/116874-new-solver-compile-error.html)

kilroy April 26, 2013 17:33

New solver compile error
 
Hello,

I am not an expert on Linux and I am trying to compile "waveFoam" and "waveDyMFoam" solvers. I compiled the "waveFoam" solver successfully. Everything was ready for the "waveFoam" solver, I just downloaded all the files and ran the "Allwmake".

For the "waveDyMFoam" solver I followed the steps described in the wiki below:
https://sites.google.com/site/jordim...ic-mesh-motion

Basically, I modified "waveDyMFoam' from the "interDyMFoam" solver. Everything compiled fine but now when I try to run the "waveDyMFoam" solver, I get the error below:

waveDyMFoam: command not found

I am not sure what did I do wrong. I did everything exactly as described in the wiki. Maybe I should modify another file (bashrc??).

Thank you very much for your time and help,

Kilroy

nimasam April 29, 2013 04:09

you should post your compile messages here ;), then it would be easer to help you :)

However i guess you use a packaged version of OpenFOAM, if yes!, then it would be you are going to make your solver at! /opt which is written protected

nanes April 29, 2013 06:56

Step 5 of

https://sites.google.com/site/jordim...ic-mesh-motion

In the file Make/files is written that the executable will be in FOAM_USER_APPBIN.

The question is: is there waveDyMFoam in FOAM_USER_APPBIN??

FOAM_USER_APPBIN is an environment variable, you can view the content of the variable with:

echo $FOAM_USER_APPBIN

the content of this variable is a path like this:

/home/user/OpenFOAM/user-of_version/platforms/linux64GccDPOpt/bin

for example in my system is:

/home/emanuele/OpenFOAM/emanuele-2.2.x/platforms/linux64GccDPOpt/bin

To view the content of this path you can:

ls $FOAM_USER_APPBIN

Normally $FOAM_USER_APPBIN is not written protected.

kilroy April 29, 2013 09:09

@Nimasam

Thank you very much for your response. Yes, I downloaded OpenFOAM as a package and it is installed under the folder "/opt" :( While I am copying or removing files I always have to use "sudo" command there. My compilation log is below:

root@meta-5:/opt/openfoam220/applications/solvers/waves2Foam/applications/solvers/solvers220/waveFoam/waveDyMFoam# wmake
Making dependency list for source file waveDyMFoam.C
SOURCE=waveDyMFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I.. -I/opt/openfoam220/src/transportModels -I/opt/openfoam220/src/transportModels/incompressible/lnInclude -I/opt/openfoam220/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam220/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam220/src/finiteVolume/lnInclude -I/opt/openfoam220/src/dynamicMesh/lnInclude -I/opt/openfoam220/src/dynamicFvMesh/lnInclude -I./../../../../../src/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -I/opt/openfoam220/src/fvOptions/lnInclude -I/opt/openfoam220/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/waveDyMFoam.o
/opt/openfoam220/src/finiteVolume/lnInclude/readTimeControls.H: In function ‘int main(int, char**)’:
/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/opt/openfoam220/src/transportModels -I/opt/openfoam220/src/transportModels/incompressible/lnInclude -I/opt/openfoam220/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam220/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam220/src/finiteVolume/lnInclude -I/opt/openfoam220/src/dynamicMesh/lnInclude -I/opt/openfoam220/src/dynamicFvMesh/lnInclude -I./../../../../../src/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -I/opt/openfoam220/src/fvOptions/lnInclude -I/opt/openfoam220/src/sampling/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/waveDyMFoam.o -L/opt/openfoam220/platforms/linux64GccDPOpt/lib \
-linterfaceProperties -ltwoPhaseInterfaceProperties -lincompressibleTransportModels -lincompressibleTurbulenceModel -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -ldynamicMesh -ldynamicFvMesh -ltopoChangerFvMesh -lmeshTools -lfvOptions -lsampling -L/home/meta/OpenFOAM/root-2.2.0/platforms/linux64GccDPOpt/lib -lwaves2Foam -lOpenFOAM -ldl -lm -o /home/meta/OpenFOAM/root-2.2.0/platforms/linux64GccDPOpt/bin/waveDyMFoam
root@meta-5:/opt/openfoam220/applications/solvers/waves2Foam/applications/solvers/solvers220/waveFoam/waveDyMFoam#


Kilroy

kilroy April 29, 2013 09:19

@Emanuele

Thank you very much for your response. When I run the command below:

echo $FOAM_USER_APPBIN

it returns:

/home/meta/OpenFOAM/root-2.2.0/platforms/linux64GccDPOpt/bin

But when I run the other command below that you have previously mentioned:

ls $FOAM_USER_APPBIN

relaxationZoneLayout
setWaveParameters
setWaveField
surfaceElevation
waveFoam


Thanks,

Kilroy

kilroy April 29, 2013 09:22

I have also discovered something. When I compile the "waveDyMFoam" and immediately after that if I try to run the solver in the same terminal window, then it runs pretty fine.

But if I close that terminal window and open a new one, then it gives the "waveDyMFoam: command not found" error when I try to run the solver.

I am really confused :(

nimasam April 29, 2013 10:10

Quote:

Originally Posted by kilroy (Post 423870)
I have also discovered something. When I compile the "waveDyMFoam" and immediately after that if I try to run the solver in the same terminal window, then it runs pretty fine.

But if I close that terminal window and open a new one, then it gives the "waveDyMFoam: command not found" error when I try to run the solver.

I am really confused :(

so after compile, type in terminal
which waveDyMFoam
then it would show from where it reads your binary file

kilroy April 29, 2013 10:22

Quote:

so after compile, type in terminal
which waveDyMFoam
then it would show from where it reads your binary file
When I run "which waveDyMFoam" command after the compile, it gives me the path below:

/home/meta/OpenFOAM/root-2.2.0/platforms/linux64GccDPOpt/bin/waveDyMFoam

which is not in the "/opt". I don't know if that is how it is supposed to be. I run "wmake" in the "/opt" folder though.

When I open a new terminal window and try to run the same command, it returns nothing.

nanes April 29, 2013 10:30

From my experience the problem is an incorrect system configuration.

When you install openfoam you must be root but when you use openfoam you don't must be root, then you must modify .bashrc of your user (meta I guess).

It' very strange to see that FOAM_USER_APPBIN is

/home/meta/OpenFOAM/root-2.2.0/platforms/linux64GccDPOpt/bin

Another problem is that in the link

https://sites.google.com/site/jordim...ic-mesh-motion

step 1 copy in WM_PROJECT_USER_DIR that non require root permissionion but I see in your compile messages that you lunch wmake from

/opt/openfoam220/applications/solvers/waves2Foam/applications/solvers/solvers220/waveFoam/waveDyMFoam

this path is different from WM_PROJECT_USER_DIR

Check your system configuration, which .bashrc have you changed?

kilroy April 29, 2013 10:30

@Emanuele

Let me check...

nimasam April 29, 2013 10:40

Quote:

Originally Posted by kilroy (Post 423899)
When I run "which waveDyMFoam" command after the compile, it gives me the path below:

/home/meta/OpenFOAM/root-2.2.0/platforms/linux64GccDPOpt/bin/waveDyMFoam

which is not in the "/opt". I don't know if that is how it is supposed to be. I run "wmake" in the "/opt" folder though.

When I open a new terminal window and try to run the same command, it returns nothing.

:) problem is solved :P, you make the binary file in root bin so when you
open new terminal, you are not root any more! so you can not find binary file!
if you want to access it you need to be root again :)
which means you should use
sudo waveDyMFoam
or type su
then using waveDyMFoam

kilroy April 29, 2013 10:52

Quote:

problem is solved :P, you make the binary file in root bin so when you
open new terminal, you are not root any more! so you can not find binary file!
if you want to access it you need to be root again
which means you should use
sudo waveDyMFoam
or type su
then using waveDyMFoam
Nima,

Yes, it works now :D

Nima, Emanuele both of you thank you so much for your help.

Kilroy


All times are GMT -4. The time now is 05:56.