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

Error compiling in Ubuntu for Windows

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 19, 2021, 09:02
Default Error compiling in Ubuntu for Windows
  #1
New Member
 
Tobias
Join Date: Oct 2020
Posts: 4
Rep Power: 5
Tibbz2 is on a distinguished road
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!
Tibbz2 is offline   Reply With Quote

Old   January 19, 2021, 09:50
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14
Tobermory will become famous soon enough
I had this a while back ... have you installed the build-essential package:
Code:
sudo apt-get install build-essential
?
Tobermory is offline   Reply With Quote

Old   January 19, 2021, 14:56
Default
  #3
New Member
 
Tobias
Join Date: Oct 2020
Posts: 4
Rep Power: 5
Tibbz2 is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
I had this a while back ... have you installed the build-essential package:
Code:
sudo apt-get install build-essential
?
Thank you, that worked!
Tibbz2 is offline   Reply With Quote

Old   January 19, 2021, 15:20
Default Could not find mandatory etc entry (mode=ugo) 'controlDict'
  #4
New Member
 
Join Date: Dec 2020
Posts: 26
Rep Power: 5
OlivierM is on a distinguished road
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
OlivierM is offline   Reply With Quote

Old   January 19, 2021, 16:07
Default
  #5
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14
Tobermory will become famous soon enough
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.
Tobermory is offline   Reply With Quote

Old   January 20, 2021, 00:42
Post Could not find mandatory etc entry (mode=ugo)
  #6
New Member
 
Join Date: Dec 2020
Posts: 26
Rep Power: 5
OlivierM is on a distinguished road
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
OlivierM is offline   Reply With Quote

Old   January 20, 2021, 06:18
Default
  #7
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14
Tobermory will become famous soon enough
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).
Tobermory is offline   Reply With Quote

Old   January 20, 2021, 15:34
Default Could not find mandatory etc entry (mode=ugo)
  #8
New Member
 
Join Date: Dec 2020
Posts: 26
Rep Power: 5
OlivierM is on a distinguished road
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
OlivierM is offline   Reply With Quote

Old   January 21, 2021, 06:14
Default
  #9
pgh
Senior Member
 
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10
pgh is on a distinguished road
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
pgh is offline   Reply With Quote

Old   January 21, 2021, 10:04
Default scripts/pyFoamPlotRunner.py' not found in metadata
  #10
New Member
 
Join Date: Dec 2020
Posts: 26
Rep Power: 5
OlivierM is on a distinguished road
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 ?
OlivierM is offline   Reply With Quote

Reply


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
Ubuntu instabilities and hardware settings Andrew2 Hardware 5 May 6, 2020 23:19
[OpenFOAM.org] Can't find installation instruction for Openfoam 2.4.x , on Ubuntu 16.04 titanium OpenFOAM Installation 14 February 20, 2020 11:46
openfoam-2.3.0 on ubuntu natty 11.04 mickjazz OpenFOAM Installation 1 August 5, 2014 13:01
Ansys 13 - License problem on Ubuntu MarTar ANSYS 4 February 3, 2012 02:13
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 14:25


All times are GMT -4. The time now is 15:06.