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/)
-   -   Error compiling in Ubuntu for Windows (https://www.cfd-online.com/Forums/openfoam-programming-development/233256-error-compiling-ubuntu-windows.html)

Tibbz2 January 19, 2021 09:02

Error compiling in Ubuntu for Windows
 
Hi,

I have recently switched from using OpenFoam on my native linux laptop to running on a Windows PC.

I have installed OF through Ubuntu for Windows, but upon trying to compile my own fvOptions source (a modified actuation disk source) I get an error:

Code:


In file included from /home/pmxtl3/OpenFOAM/ThirdParty-v1812/platforms/linux64/gcc-6.3.0/include/c++/6.3.0/x86_64-pc-linux-gnu/bits/c++config.h:507:0,
                from /home/pmxtl3/OpenFOAM/ThirdParty-v1812/platforms/linux64/gcc-6.3.0/include/c++/6.3.0/cstdint:38,
                from /home/pmxtl3/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/int16.H:38,
                from /home/pmxtl3/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/int.H:38,
                from /home/pmxtl3/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/label.H:39,
                from /home/pmxtl3/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/fieldTypes.H:32,
                from /home/pmxtl3/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude/fvMatricesFwd.H:32,
                from /home/pmxtl3/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude/fvOption.H:47,
                from cellSetOption/cellSetOption.H:54,
                from cellSetOption/cellSetOption.C:26:
/home/pmxtl3/OpenFOAM/ThirdParty-v1812/platforms/linux64/gcc-6.3.0/include/c++/6.3.0/x86_64-pc-linux-gnu/bits/os_defines.h:39:22: fatal error: features.h: No such file or directory
 #include <features.h>
                      ^

Does anyone know how I can get around this?

Thanks!

Tobermory January 19, 2021 09:50

I had this a while back ... have you installed the build-essential package:
Code:

sudo apt-get install build-essential
?

Tibbz2 January 19, 2021 14:56

Quote:

Originally Posted by Tobermory (Post 793739)
I had this a while back ... have you installed the build-essential package:
Code:

sudo apt-get install build-essential
?

Thank you, that worked!

OlivierM January 19, 2021 15:20

Could not find mandatory etc entry (mode=ugo) 'controlDict'
 
hello

I have just installed OFv2012 on ubuntu 20.04 LTS WSL2.

I went through the install process
(https://www.openfoam.com/download/in...ry-windows.php)
but it fails at the final validation

Here is the error message:

#
~/OpenFOAM/OpenFOAM-v2012/tutorials/incompressible/icoFoam/cavity$ blockMesh
--> FOAM FATAL ERROR :
Could not find mandatory etc entry (mode=ugo)
'controlDict'
#

would it be anyone who knows what could be wrong ?

thank you

Tobermory January 19, 2021 16:07

Yes - this is an easy one to answer - the error message says "I can't find controlDict". This lives in folder system ... which doesn't exist at the location you are trying to run blockMesh from. For that tutorial, there are 3 subfolders inside $FOAM_TUTORIALS/incompressible/icoFoam/cavity ... you need to cd into one of them before running blockMesh. Either that, or run the Allrun script from the location that you are at the moment, and it will run the cases for you.

OlivierM January 20, 2021 00:42

Could not find mandatory etc entry (mode=ugo)
 
thanks Tobermory,

unfortunately it's still not OK.

here is the final check of the installation from the tutorial:

#
mkdir -p /mnt/c/Users/<USER>/tutorial
cd /mnt/c/Users/<USER>/tutorial
cp -ar $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity .
cd cavity
blockMesh
icoFoam
touch cavity.foam
#

but the cp command fails:
#
cp: cannot stat '/incompressible/icoFoam/cavity/cavity': No such file or directory
#

and therefore the blockMesh command fails as well:
#
--> FOAM FATAL ERROR :
Could not find mandatory etc entry (mode=ugo)
'controlDict'
#

Very strange as I had not such issue with previous OFv2006


Then if I copy all the cavity tutorails and execute ./Allrun then I get the following error:
#
-bash: ./Allrun: Permission denied
#


Moreover I have also made a test installing all OFv2012 under <USER> and the problem remains.



I cannot see what's wrong. do you have any idea ?

thanks

Tobermory January 20, 2021 06:18

Apologies - I was too hasty in my earlier reply. It looks like you may have some file permission errors for the folder you are trying to write into - check the permissions (with ls -l, for example), and update with chmod (you may need to talk with your system supervisor if you don't have the access permissions to change things).

OlivierM January 20, 2021 15:34

Could not find mandatory etc entry (mode=ugo)
 
thanks, however the issues remains.

I took a case I was running fine with OFv2006 and copy it similarly in the working directory but I am not anymore able to run it..

Here the return of the simpleFoam command:

#
$ simpleFoam
--> FOAM FATAL ERROR :
Could not find mandatory etc entry (mode=ugo)
'controlDict'
#

that's very disturbing.
Has anyone get any suggestion how I can solve this ?

Many thanks

pgh January 21, 2021 06:14

Hi
Go inside the /opt/OpenFOAM/OpenFOAM-v2012 and then source etc/bashrc
i.e cd /opt/OpenFOAM/OpenFOAM-v2012
source etc/bashrc

run command
echo $FOAM_TUTORIALS
and post the output here

OlivierM January 21, 2021 10:04

scripts/pyFoamPlotRunner.py' not found in metadata
 
Hi,
many thanks for helping

here the command return:

/opt/OpenFOAM/OpenFOAM-v2012/tutorials

meanwhile I have discoverED that I cannot make running a case built in v2006 and pasted in the v2012 working directory (whatever it is)

but I can run it if I copy its component folders (0/constant/system) in a native v2012 duplicated tutorial case .

I should be very happy with that
but now pyFoam don't want to work and I get this error with the command 'pyFoamPlotRunner.py simpleFoam':

pkg_resources.ResolutionError: Script 'scripts/pyFoamPlotRunner.py' not found in metadata at '/home/<USER>/.local/lib/python3.8/site-packages/PyFoam-2020.5.dist-info'

do you have any idea what the problem could be ?


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