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

[OpenFOAM.org] Problem Compiling openFOAM on WSL

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 26, 2023, 11:41
Default Problem Compiling openFOAM on WSL
  #1
New Member
 
Join Date: Jul 2013
Posts: 21
Rep Power: 13
Leifheit is on a distinguished road
Hi everyone,


I am trying to compile openfoam on WSL2 using Ubuntu 20.04. Installing openfoam via packet manager (apt-get) works fine, compiling it myself does not. Already tried on WSL2 using Ubuntu 22.04. with same results. On a virtual machine with Ubuntu 22.04. compiling works just fine.


Here some information that might be useful:


lsb_release -a:


Code:
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.5 LTS
Release:        20.04
Codename:       focal
gcc -v:


Code:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.1.0-1ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --disable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-2V7zgg/gcc-11-11.1.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-2V7zgg/gcc-11-11.1.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.1.0 (Ubuntu 11.1.0-1ubuntu1~20.04)
Here is the last lines of command line output when I try to run Allwmake in the OF directory:


Code:
/mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/List.C:46:37: error: ‘class Foam::List<char>’ has no member named ‘size_’; did you mean ‘size’?
   46 |             << "bad size " << this->size_
      |                               ~~~~~~^~~~~
      |                               size
In file included from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/List.H:311,
                 from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/HashTable.C:30,
                 from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/HashTable.H:566,
                 from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/objectRegistry.H:38,
                 from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/time.h:42,
                 from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/gthr.h:148,
                 from /usr/include/c++/11/ext/atomicity.h:35,
                 from /usr/include/c++/11/bits/basic_string.h:39,
                 from /usr/include/c++/11/string:55,
                 from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/string.H:51,
                 from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/word.H:42,
                 from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/int32.H:43,
                 from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/int.H:38,
                 from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/label.H:39,
                 from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/labelList.H:47,
                 from /mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/UPstream.H:42,
                 from UPstream.C:26:
/mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/ListI.H: In instantiation of ‘void Foam::List<T>::size(int) [with T = char]’:
/mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/DynamicListI.H:45:18:   required from ‘Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList(int) [with T = char; unsigned int SizeInc = 0; unsigned int SizeMult = 2; unsigned int SizeDiv = 1]’
/mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/ISstreamI.H:42:5:   required from here
/mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/ListI.H:166:15: error: ‘size_’ is not a member of ‘Foam::UList<char>’
  166 |     UList<T>::size_ = n;
      |               ^~~~~
/mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/ListI.H: In instantiation of ‘void Foam::List<T>::size(int) [with T = int]’:
/mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/DynamicListI.H:377:31:   required from ‘T& Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator()(int) [with T = int; unsigned int SizeInc = 0; unsigned int SizeMult = 2; unsigned int SizeDiv = 1]’
/mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/UPstream.H:437:39:   required from here
/mnt/d/openFOAM/compileOF/OpenFOAM-10/src/OpenFOAM/lnInclude/ListI.H:166:15: error: ‘size_’ is not a member of ‘Foam::UList<int>’
make: *** [/mnt/d/openFOAM/compileOF/OpenFOAM-10/wmake/rules/General/transform:26: /mnt/d/openFOAM/compileOF/OpenFOAM-10/platforms/linux64GccDPInt32Opt/src/Pstream/dummy/UPstream.o] Error 1
Any hints would be highly appreciated


Can also use a virtual machine to do OF programming but I like WSL much better.


Best Regards,


Leif
Leifheit 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
what is problem my OpenFoam setting? Lee97 Main CFD Forum 0 September 1, 2022 09:57
If my problem diverges in OpenFOAM ver3, will it work in 5 quarkz OpenFOAM Running, Solving & CFD 3 April 26, 2018 03:09
[swak4Foam] problem in compiling groovyBC in OpenFoam 1.71 javad814 OpenFOAM Community Contributions 4 July 31, 2011 05:33
OpenFOAM Install problem masb OpenFOAM 3 May 25, 2009 12:32
Problem installing OpenFOAM 1.5 installation on RHEL 4. vwsj84 OpenFOAM Installation 4 April 23, 2009 05:48


All times are GMT -4. The time now is 14:33.