CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

OpenFoam ./Allmake permission problem.

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 10, 2013, 23:06
Default OpenFoam ./Allmake permission problem.
  #1
Member
 
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 14
liguifan is on a distinguished road
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
liguifan is offline   Reply With Quote

Old   February 11, 2013, 06:33
Default
  #2
Member
 
Join Date: Jun 2011
Posts: 53
Rep Power: 14
blacksquirrel is on a distinguished road
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.
blacksquirrel is offline   Reply With Quote

Old   February 12, 2013, 14:32
Default
  #3
Member
 
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 14
liguifan is on a distinguished road
Quote:
Originally Posted by blacksquirrel View Post
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 is offline   Reply With Quote

Old   February 12, 2013, 14:38
Default
  #4
Member
 
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 14
liguifan is on a distinguished road
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!
liguifan is offline   Reply With Quote

Old   February 12, 2013, 17:17
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 07:55
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 07:25
Problem with mpirun with OpenFOAM jiejie OpenFOAM 3 July 7, 2010 20:30
OpenFOAM paraView problem Ronnfors OpenFOAM 2 September 22, 2009 06:32
OpenFOAM 1.6 CreatePatch Problem TarifaPirata OpenFOAM Bugs 1 September 10, 2009 05:35


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