CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Problems with compiling new solver (https://www.cfd-online.com/Forums/openfoam-programming-development/136792-problems-compiling-new-solver.html)

Philipp Dietrich June 4, 2014 08:02

Problems with compiling new solver
 
Hello,

I just installed OpenFOAM 2.3.0 on openSUSE 13.1.
The simulation of the tutorials went fine, however I cannot compile a solver (based on http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam from the openFOAM-Wiki).

If I try to compile the solver "myicoFoam", which only differs from "icoFoam" in the name, with "wmake", I get the following error-message:

Code:

Making dependency list for source file myicoFoam.C
SOURCE=myicoFoam.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM-2.3.0/src/finiteVolume/lnInclude -I/opt/OpenFOAM-2.3.0/src/sampling/lnInclude -IlnInclude -I. -I/opt/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude -I/opt/OpenFOAM-2.3.0/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/myicoFoam.o
In file included from myicoFoam.C:53:0:
/opt/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’:
/opt/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable]
    const int nOuterCorr =
              ^
/opt/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/readPISOControls.H:12:16: warning: unused variable ‘momentumPredictor’ [-Wunused-variable]
    const bool momentumPredictor =
                ^
/opt/OpenFOAM-2.3.0/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable]
    const bool transonic =
                ^
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM-2.3.0/src/finiteVolume/lnInclude -I/opt/OpenFOAM-2.3.0/src/sampling/lnInclude -IlnInclude -I. -I/opt/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude -I/opt/OpenFOAM-2.3.0/src/OSspecific/POSIX/lnInclude  -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/myicoFoam.o -L/opt/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib \
    -lfiniteVolume -lsampling -lOpenFOAM -ldl  -lm -o /opt/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/bin/myicoFoam
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot open output file /opt/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/bin/myicoFoam: Permission denied
collect2: error: ld returned 1 exit status
make: *** [/opt/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/bin/myicoFoam] Error 1

If I use "sudo wmake" to compile, I get this error:

Code:

wmake error: environment variable $WM_OPTIONS not set
The environment variables in the .bashrc-File are set according to the instruction on: http://www.openfoam.org/download/suse.php

Is there anything I missed?
Thank you for your help in advance.
Philipp Dietrich

alexeym June 4, 2014 10:19

Hi,

change line

Code:

EXE = $(FOAM_APPBIN)/myicoFoam
in Make/files file to

Code:

EXE = $(FOAM_USER_APPBIN)/myicoFoam
As in fact compilation is successful, you just don't have permissions to write executable into

Code:

/opt/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/bin/

Philipp Dietrich June 9, 2014 07:14

Thanks a lot.
That was the error.

alyucel October 2, 2014 19:03

Quote:

Originally Posted by alexeym (Post 495564)
Hi,

change line

Code:

EXE = $(FOAM_APPBIN)/myicoFoam
in Make/files file to

Code:

EXE = $(FOAM_USER_APPBIN)/myicoFoam
As in fact compilation is successful, you just don't have permissions to write executable into

Code:

/opt/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/bin/

why ı have to write this way ? EXE = $(FOAM_USER_APPBIN)/myicoFoam ?

alexeym October 3, 2014 01:30

Hi,

Quote:

Originally Posted by alyucel (Post 512739)
why ı have to write this way ? EXE = $(FOAM_USER_APPBIN)/myicoFoam ?

not quite sure I've got the question right, but the answer is "by convention".


All times are GMT -4. The time now is 10:03.