optimad / mimmo

Surface manipulation and mesh morphing library
http://optimad.github.io/mimmo
GNU Lesser General Public License v3.0
99 stars 21 forks source link

cmake: Future OpenFOAM versions inclusion #130

Closed roccoarpa closed 3 years ago

roccoarpa commented 4 years ago

OpenFoam (from ESI or Foundation) inclusion in mimmo::ioofoam builds fine up to ESI OpenFOAM-plus v1806+(openfoam.com) and OpenFOAM Foundation 6(openfoam.org). Commit 85bfe0ee91882751f9406fe9eb1507afe0eaf6a5

As noted by @olesenm here( https://github.com/optimad/mimmo/commit/85bfe0ee91882751f9406fe9eb1507afe0eaf6a5#r35793705) some flaws may arise when including future OpenFoam versions, in particular:

SWITCHED SUPPORTED VERSION Now supporting ESI OpenFOAM-plus v1906+(openfoam.com) and OpenFOAM Foundation 7(openfoam.org). Retro-compatibility not investigated yet, will be addressed in a separate issue.

olesenm commented 4 years ago

The WM_PROJECT_DIR env can be considered stable. I would consider the values of FOAM_INST_DIR and/or WM_PROJECT_INST_DIR to be less reliable. These were previously used to define where a OpenFOAM and ThirdParty hierarchy could be found, but if you are building against OpenFOAM, you actually just want the directory with OpenFOAM itself.

For example,

/some/installation/path/OpenFOAM-v1906
/some/installation/path/ThirdParty-v1906

Then $WM_PROJECT_DIR should point to "/some/installation/path/OpenFOAM-v1906". The value of WM_PROJECT_INST_DIR (if set at all) would be "/some/installation/path".

For my spack installation, I have these types of paths:

/home/spack/linux-opensuse_leap15-x86_64/gcc-7.3.1/openfoam-1906-ldiybvewnkp3kpg3shbx3xxy6aybs26t
/home/spack/linux-opensuse_leap15-x86_64/gcc-7.3.1/openfoam-1906-34nfukdnib5jsp4qen2un3ow56tpliw2

So they would have the same prefix path (/home/spack/linux-opensuse_leap15-x86_64/gcc-7.3.1), but that wouldn't really help much at all.

For my os installation, I have this

/opt/openfoam1906

Again, the WM_PROJECT_DIR is much more useful.

olesenm commented 4 years ago

The wmake -show-api and -show-cxxflags starts with v1906, so probably best not to use them just yet. But they were added to make linking with OpenFOAM easier - background here: https://develop.openfoam.com/Development/OpenFOAM-plus/issues/1256

roccoarpa commented 4 years ago

Many thanks, it's clearer now.