CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] OpenFoam deug mode (https://www.cfd-online.com/Forums/openfoam-installation/190756-openfoam-deug-mode.html)

FMurad July 21, 2017 11:05

OpenFoam deug mode
 
Dear Foamers,

I'm somewhat new to this forum and to openfoam. My problem is the following: I installed openfoam correctly in my opt case and copied it to home case. Everything works fine, I've could even change some things in my simpleFoam solver and recompile it and in the "release"(WM_COMPILE_OPTION=Opt) mode everything works fine.
The problems appears when I try to compile in the debug mode (I want to compile from my home directory). Here are the steps that I've done:

1) First thing, I change the WM_COMPILE_OPTION in the home/.../etc/bashrc file to Debug. Just to be sure I type echo $WM_COMPILE_OPTION and it really is changed to Debug

2)I try to recompile Openfoam using the Allwmake script and it gives the following error:
wmakeCheckPwd error: Current directory is not /opt/openfoam4
Allwmake 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.

3) Ok...so I saw that Allwmake script check if the current directory is the same as the one stored in the WM_PROJECT_DIR enviroment variable (which is the directory of my opt installation). I, then, change this to WM_PROJECT_USER_DIR which is my home directory and it gives the following error:

gcc -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -O3 -fPIC dirToString.c -o /opt/openfoam4/wmake/platforms/linux64Gcc/dirToString
/usr/bin/ld: cannot open output file /opt/openfoam4/wmake/platforms/linux64Gcc/dirToString: Permission denied
collect2: error: ld returned 1 exit status
Makefile:67: recipe for target '/opt/openfoam4/wmake/platforms/linux64Gcc/dirToString' failed
make: *** [/opt/openfoam4/wmake/platforms/linux64Gcc/dirToString] Error 1

It smees that the problem is something in the wmake files, but I can't figure out what to do.

4) Not having many options here, I try to execute the Allwmake files in the lib directory (home/.../src) and the following error occurs:

+ wmakeLnInclude OpenFOAM
+ wmakeLnInclude OSspecific/POSIX
+ Pstream/Allwmake libso
+ wmake libso dummy
mkdir: cannot create directory ‘/opt/openfoam4/platforms/linux64GccDPInt32Debug’: Permission denied
/opt/openfoam4/wmake/makefiles/general:156: recipe for target '/opt/openfoam4/platforms/linux64GccDPInt32Debug/lib/dummy/libPstream.so' failed
make: *** [/opt/openfoam4/platforms/linux64GccDPInt32Debug/lib/dummy/libPstream.so] Error 1

5) Then I try to compile manually a single lib in the debug mode (in my case, the "openFOAM" lib home/.../src/OpenFOAM) with the wmake command, and it gives:

error: /opt/openfoam4/platforms/linux64GccDPInt32Debug/lib/libOSspecific.o: No such file or directory
/opt/openfoam4/wmake/makefiles/general:156: recipe for target '/home/fmurad/OpenFOAM/fmurad-4.1/run//platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so' failed
make: *** [/home/fmurad/OpenFOAM/fmurad-4.1/run//platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so] Error 1

I am probably missing something, could you please help me? my openfoam version is openfoam 4 and I've downloaded it from https://openfoam.org/download/4-1-ubuntu/ . I am also using ubuntu 16.10. Thanks for the help.

ArminAlavi August 10, 2019 10:58

same problem here
 
Hi
I have sort of the same problem, i change the $WM_COMPILE_OPTION in opt/openfoam6/etc/bashrc to "Debug" and try compiling OpenFOAM by using the ./Allwmake command in the terminal but i get the following respond.




Allwmake /opt/openfoam6
make: Nothing to be done for 'all'.
Allwmake: no ThirdParty directory found - skipping
Allwmake src
no git description found
Allwmake src/Pstream
wmake dummy
mkdir: cannot create directory ‘/opt/openfoam6/platforms/linux64GccDPInt32Debug’: Permission denied
/bin/sh: 1: cannot create /opt/openfoam6/platforms/linux64GccDPInt32Debug/src/Pstream/dummy/options: Directory nonexistent
make: *** No rule to make target '/opt/openfoam6/platforms/linux64GccDPInt32Debug/src/Pstream/dummy/options'. Stop.
/bin/sh: 1: cannot create /opt/openfoam6/platforms/linux64GccDPInt32Debug/src/Pstream/dummy/options: Directory nonexistent
make: *** No rule to make target '/opt/openfoam6/platforms/linux64GccDPInt32Debug/src/Pstream/dummy/options', needed by 'all'. Stop.
wmake error: file '/opt/openfoam6/platforms/linux64GccDPInt32Debug/src/Pstream/dummy/sourceFiles' could not be created in /opt/openfoam6/src/Pstream/dummy



Have you solved your problem yet? if you have please help me solve mine.
thank you in advance

wyldckat August 15, 2019 19:56

Quick answer: It's preferable that you build from source code in your own home folder. The reason here is that the installation at "/opt" can only be accessible with root permissions (super-user).

As a workaround, you can run the following command:
Code:

sudo chown -R $USER:$USER /opt/openfoam6
This will change the ownership of the folder "/opt/openfoam6" and make it your own. Then you can use that folder as your own and not need to use sudo.

If you want to do things correctly, you can either try following the installation instructions from:

ArminAlavi August 24, 2019 05:41

Hi wyldckat , Thank you very much for your answer. I somehow solved the authority problem by changing the permissions of opt folder. now i have a problem with recompiling OpenFOAM. one of the libraries is missing in the compilation process and causes the errot "no such file or directory...".
Now this is my main concern that if I compiled OpenFoam once successfully why is it missing a library when i try to compile it again?

wyldckat August 25, 2019 09:04

Quick answer: The installation provided in the Deb package does not provide all dependency libraries for compiling from source code, because OpenFOAM is already compiled in the provided installation.

See the instructions given here: https://openfoam.org/download/source...r-compilation/ - under the section "Installing dependent packages on Ubuntu (versions 16.04 or above)"


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