I'm using OpenFOAM-Extend-4.1-20201102-11cb6d.tar.gz.
Compiling FOAM-Extend with GCC 11 resulted in a bunch of errors.
In file included from primitives/Lists/PackedBoolList.C:26: primitives/Lists/PackedBoolList.H: At global scope: primitives/Lists/PackedBoolList.H:122:46: error: class Foam::UList<unsigned int> Foam::UList<unsigned int>::UList is private within this context 122 | explicit inline PackedBoolList(const UList<label>& indices); | ^~~~~~~~~~~~ In file included from primitives/Lists/PackedBoolList.H:46, from primitives/Lists/PackedBoolList.C:26: lnInclude/PackedList.H:147:7: note: declared private here 147 | class PackedList | ^~~~~~~~~~ In file included from primitives/Lists/PackedBoolList.C:26:
May I ask you for help?
Best regards,
Robert
Hi,
I think I fixed all of this, around 15/Sep. I assume you are using the master branch. Can you please re-pull and check.
I am no Ubuntu-20.04
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
and it compiles without errors.
Please let me know,
Hrv
Hi Hrvoje,
I will explain it in more details.
I was building FOAM-Extend 4.1 from the master branch, commit 11cb6dafc53a5d3ce3292dc3135bfc0f7378907e – November 2nd 2020; with GCC 10.2, 10.3 and 11.2.
The first two compilers compiled just fine, and the last one, 11.2, fails with the error below.
You suggested to pull the latest changes from the master branch, however, the last commit to the master branch is from July 7th, 2021, thus it doesn’t contain the fix.
The changes from September 15th belong to the nextRelease branch, thus, I used the tip of that branch, commit ff9c6040d5b1cd65f31e0b3b8776b6f5b3a38144 – September 27th 2021.
While compiling the suggested release with GCC 11.2, I get exactly the same errors like with the commit 11cb6d.
Commands executed to clone the repository and checkout the commit:
$ git clone https://git.code.sf.net/p/foam-extend/foam-extend-4.1.git
$ git checkout ff9c60
GCC version:
$ gcc --version
gcc (GCC) 11.2.0
CentOS release:
$ rpm -q centos-linux-release
centos-linux-release-8.4-1.2105.el8.noarch
If necessary, I can provide the complete build log with all the commads being executed.
Best regards/Lijepi pozdrav,
Robert
Dr. rer. nat. Robert Mijaković | HPC System Software Architect
LuxProvide
3, Op der Poukewiss | L-7795 Bissen
Grand-Duchy of Luxembourg
M (+352) 691 396 474
robert.mijakovic@lxp.lurobert.mijakovic@lxp.lu | www.luxprovide.luhttp://www.luxprovide.lu/
From: Hrvoje Jasak hjasak@users.sourceforge.nethjasak@users.sourceforge.net
Sent: Thursday, 7 October 2021 16:35
To: [foam-extend:tickets] 68@tickets.foam-extend.p.re.sourceforge.net68@tickets.foam-extend.p.re.sourceforge.net
Subject: [foam-extend:tickets] #68 Compiling FOAM-Extend with GCC 11
Hi,
I think I fixed all of this, around 15/Sep. I assume you are using the master branch. Can you please re-pull and check.
I am no Ubuntu-20.04
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
and it compiles without errors.
Please let me know,
Hrv
[tickets:#68]https://sourceforge.net/p/foam-extend/tickets/68/ Compiling FOAM-Extend with GCC 11
Status: open
Milestone: 1.0
Created: Thu Oct 07, 2021 02:13 PM UTC by Robert Mijakovic
Last Updated: Thu Oct 07, 2021 02:13 PM UTC
Owner: nobody
I'm using OpenFOAM-Extend-4.1-20201102-11cb6d.tar.gz.
Compiling FOAM-Extend with GCC 11 resulted in a bunch of errors.
In file included from primitives/Lists/PackedBoolList.C:26:
primitives/Lists/PackedBoolList.H: At global scope:
primitives/Lists/PackedBoolList.H:122:46: error: class Foam::UList<unsigned int=""> Foam::UList<unsigned int="">::UList is private within this context</unsigned></unsigned>
In file included from primitives/Lists/PackedBoolList.H:46,
lnInclude/PackedList.H:147:7: note: declared private here
In file included from primitives/Lists/PackedBoolList.C:26:
May I ask you for help?
Best regards,
Robert
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/foam-extend/tickets/68/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Tickets: #68
Hi Hrvoje,
I will explain it in more details.
I was building FOAM-Extend 4.1 from the master branch, commit 11cb6dafc53a5d3ce3292dc3135bfc0f7378907e – November 2nd 2020; with GCC 10.2, 10.3 and 11.2.
The first two compilers compiled just fine, and the last one, 11.2, fails with the error below.
You suggested to pull the latest changes from the master branch, however, the last commit to the master branch is from July 7th, 2021, thus it doesn’t contain the fix.
The changes from September 15th belong to the nextRelease branch, thus, I used the tip of that branch, commit ff9c6040d5b1cd65f31e0b3b8776b6f5b3a38144 – September 27th 2021.
While compiling the suggested release with GCC 11.2, I get exactly the same errors like with the commit 11cb6d.
Commands executed to clone the repository and checkout the commit:
GCC version:
CentOS release:
If necessary, I can provide the complete build log with all the commads being executed.
Best regards/Lijepi pozdrav,
Robert
Hi guys,
any news on this ticket?
How can I help so that we make it work?
Best regards,
Robert
Hi guys,
GCC 11 switched the default mode for C++ to -std=gnu++17 instead of -std=gnu++14.
The problem is that GCC 11 FOAM-Extend code is not in accordance with C++17 standard.
The code compiled fine when I switched GCC 11 back to -std=c++14, 2014 ISO C++ standard plus amendments.
Best regards,
Robert
Hi,
I have the same problem. Would you please elaborate on how to approach this problem. Where do I switch the -std flag?
Best regards,
Christoph
Hi,
You can switch the flag in
linux64Gcc/c++
(or equivalent) in
foam-extend-5.0/wmake/rules
I have now compiled everything using c++-17 and there was only one fix in NamedEnum. The rest compiles fine. If you wish to use this, please check out the nextRelease branch, as follows:
git clone -b nextRelease <blah blah=""> foam-extend-5.0</blah>
and compile. Most porting changes are in the nextRelease branch, as we are due for foam-extend-5.0 anyway.
Hi,
thank you for you help!
I now tried as you suggested and pulled the nextRelease branch and tried to compile. I still get the same errors, such as:
Throughout the compilation.
I tried to modify the CC flag in the rules/linux64Gcc/c++ file yet that did not solve anything.
Any other idea what I am doing wrong?
Thank you!
This is bizarre. I am on gcc-9.3.0 and there isn't a problem. I think it will be because of unsigned ints. I don't want to change a compiler, and this is not related to c++-17 (I tried).
What you can do is to take this constructor from label - there are 2:
and add 2 more, which instead of label use unsigned int, eg:
using a cast in the implementation code. I had to change one like that in NamedEnum.
Hope this helps; if there are more of them, they will be all the same. Is there anything in the compiler release notes about unsigned?
Hrv
I added the two constructors and had to add some others witht he same error.
I got than an error regarding the typedef
I tried to fix that by modifying the following:
Still the error arises as:
Sorry I am not very advanced in c++ so I am a bit lost here.
I looked now (as the error message suggests) into the PackedList.H and by switching the base class (private List unsigned int ) from private to public (public List unsigned int ) the error seems to vanish.
Last edit: Christoph 2021-11-23
Hello,
same story here, using gcc 11.2.0 on gentoo system with a fresh clone of nextRelease branch.
It does not compile , even with -std=c++14 instruction, I had to use the trick provided by Christoph to get it compiled.