Closed HenningScheufler closed 2 months ago
@greole @MarcelKoch @bevanwsjones
OpenFOAM does not compile with gcc and the cpp std 20. (tested on Ubuntu 22.04)
The compiler version to compile NeoFOAM are quite high:
clang > 17.00
gcc incompatible (for non GPU compilation)
We could consider downgrading neofoam to cppstd 17. This would require only the implementation of std::span
OpenFOAM does not compile with gcc and the cpp std 20. (tested on Ubuntu 22.04)
Correct me if I'm wrong but the choice for cpp 20 for NeoFOAM doens't affect the compilation of Openfoam, which should can be compiled independently with cpp 14.
The compiler version to compile NeoFOAM are quite high:
Yes that is true, but that is only the case now. Ubuntu just had a new LTS release 24.04 which ships clang 18 and gcc 10. So soon this shouldn't be an issue.
For example add NeoFOAM as link target here https://github.com/exasim-project/FoamAdapter/blob/main/src/benchmarks/explicitOperators/CMakeLists.txt also have a look at: https://github.com/users/foamscience/packages/container/package/jammy-openfoam
Just wanted to mention that this is related to:
Clang is known for permissible syntactic constraints; but I'd prefer Gcc's way of doing things for this one. Here is a small playground to poke around this issue if you like to: https://godbolt.org/z/rcMG39Gaj
Solution:
DiagonalMatrix.H
header to remove <Type>
from DiagonalMatrix<Type>
(right now this works)we see this error because FoamAdapter includes some header that includes DiagonalMatrix.H
(probably dimensionSets.H
)
I would prefer the solution to contact the devs to fix this issue. The other solution is not maintainable.
I opened a issue on develop github:
https://develop.openfoam.com/Development/openfoam/-/issues/3168
The issue is that it is a problem with C++20 which OpenFOAM doesn't support at the moment. But yes maybe they'll fix it.
I created a fix for this issue
It only requires minor changes to 8 files
@HenningScheufler's patch should take care of this. But here is a fun way to solve these minor issues for future reference; that's how I did it originally to my OpenFOAM installation, there was no patch because installed from package repos 😄 Enjoy: FoamScience/openfoam-code-transformations
This is resolved with of2406
With the following build configuration FoamAdapter does not compile:
With the following error