CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   OpenFoam ./Allmake permission problem. (http://www.cfd-online.com/Forums/openfoam-installation/113032-openfoam-allmake-permission-problem.html)

liguifan February 10, 2013 23:06

OpenFoam ./Allmake permission problem.
 
I am try to program my own solver under /opt/openfoam211, however, after modify the original script, I use the Allwmake to recompile. Then lots of error comes up. I think this is because of permission under /opt directory.

I copied openfoam211 folder to /home/OpenFOAM/ and use ./Allwmake again. The error now are:
Quote:

Error: Current directory is not /opt/openfoam211
Error: Current directory is not $WM_PROJECT_DIR
The environment variables are inconsistent with the installation.
Check the OpenFOAM entries in your dot-files and source them.
I am not sure how to solve the problem. Could anyone tell me what you normally do when you want to compile your own solvers ?

James

blacksquirrel February 11, 2013 06:33

Hello James,

Try this tutorial:
http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

1.) you don't need to copy the complete openfoam211 folder, you simply need a folder for your solver in $WM_PROJECT_USER_DIR/applications/solvers/
2.) Therefore you don't need to use Allwmake, but simply wmake in your solver directory
3.) To prevent the permission problem with the /opt directory, all of your solvers are compiled in $FOAM_USER_APPBIN (probably found in /home/user/OpenFOAM/user-2.1.1/platforms), instead of FOAM_APPBIN. You declare this in yoursolverdirectory/Make/files --> see the tutorial

Hope this helps.

liguifan February 12, 2013 14:32

Quote:

Originally Posted by blacksquirrel (Post 407089)
Hello James,

Try this tutorial:
http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

1.) you don't need to copy the complete openfoam211 folder, you simply need a folder for your solver in $WM_PROJECT_USER_DIR/applications/solvers/
2.) Therefore you don't need to use Allwmake, but simply wmake in your solver directory
3.) To prevent the permission problem with the /opt directory, all of your solvers are compiled in $FOAM_USER_APPBIN (probably found in /home/user/OpenFOAM/user-2.1.1/platforms), instead of FOAM_APPBIN. You declare this in yoursolverdirectory/Make/files --> see the tutorial

Hope this helps.

Thanks for the quick reply.

After I follow the tutorial provided, I found there is another problem when I use 'wmake'
The terminal says" make: *** No rule to make target `icoFoam.dep', needed by `Make/linuxGccDPOpt/dependencies'. Stop."

I am not sure why this happen? Have you met some problem like this?

liguifan February 12, 2013 14:38

I have solved the above problem by making some small change, however even I use wmake not in /opt folder, it still says that I don't have permission.

Quote:

liguifan@liguifan-laptop:~/OpenFOAM/liguifan-2.1.1/application/solvers/my_icoFoam$ wmake
Making dependency list for source file my_icoFoam.C
SOURCE=my_icoFoam.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/my_icoFoam.o
/opt/openfoam211/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/opt/openfoam211/src/finiteVolume/lnInclude/readPISOControls.H:3: warning: unused variable ‘nOuterCorr’
/opt/openfoam211/src/finiteVolume/lnInclude/readPISOControls.H:12: warning: unused variable ‘momentumPredictor’
/opt/openfoam211/src/finiteVolume/lnInclude/readPISOControls.H:15: warning: unused variable ‘transonic’
g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linuxGccDPOpt/my_icoFoam.o -L/opt/openfoam211/platforms/linuxGccDPOpt/lib \
-lfiniteVolume -lOpenFOAM -ldl -lm -o /opt/openfoam211/platforms/linuxGccDPOpt/bin/my_icoFoam
/usr/bin/ld: cannot open output file /opt/openfoam211/platforms/linuxGccDPOpt/bin/my_icoFoam: Permission denied
collect2: ld returned 1 exit status
make: *** [/opt/openfoam211/platforms/linuxGccDPOpt/bin/my_icoFoam] Error 1
From the prompt, I don't know why it still try to access folder in /opt rather than in ~/OpenFoam

Cheers!

wyldckat February 12, 2013 17:17

Greetings to all!

Quoting the wiki page:
Quote:

Now go into the Make subdirectory and open the 'files' file with your favorite editor. Change it to read:
Code:

my_icoFoam.C

EXE = $(FOAM_USER_APPBIN)/my_icoFoam


It's "FOAM_USER_APPBIN", not "FOAM_APPBIN" ;)

Best regards,
Bruno


All times are GMT -4. The time now is 02:30.