# OpenFOAM Int64 Catalyst is not loading properly because of a missing symbol

**URL:** <https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861>\
**Category:** In Situ Support\
**Created:** [June 20, 2022, 9:17pm UTC](https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861 "2022-06-20T21:17:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertsawko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robertsawko/32/6283_2.png) [@robertsawko](https://discourse.paraview.org/u/robertsawko)\
**Post date:** [June 20, 2022, 9:17pm UTC](https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861/1 "2022-06-20T21:17:33Z")

</div>

Hello,

I am really sorry for this desperate plea, but I’d like to ask @utkarsh.ayachit and @olesenm for some help. I’ve been enjoying Catalyst V2 in ESI OpenFOAM for a while now, but now I am finally getting to a more serious benchmarking exercise and I needed to recompile OpenFOAM with `Int64` labels to support larger meshes. Unfortunately, in two identical test cases Catalyst V2 does not load in the `Int64` version.

The problem is a missing symbol `_ZN4Foam14functionObject7executeEi`. My adaptor function object for both versions contains it and `nm` says it’s undefined:

```auto
nm -gD libnaiveHexCatalyst2Foam.so | grep _ZN4Foam14functionObject7executeEi
                 U _ZN4Foam14functionObject7executeE

```

After happily browsing through OpenFOAM `platforms/linux64GccDpInt*Opt/lib` directories for `32` and `64` I found that the symbol is defined as `T` in my `32` version but not `64`.

I would appreciate some advice. I do not know how to connect the symbols appearing in `.so` files with OpenFOAM compilation process or code. Could this be a bug or an issue with my compilation? I am happy to learn a little more about this as I often get stuck in chasing these symbol dependencies but I’ve been a bit rudderless for a while so would be really grateful if you could point me in the right direction. Thanks.

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)\
**Post date:** [June 21, 2022, 7:00am UTC](https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861/2 "2022-06-21T07:00:33Z")

</div>

@Francois_Mazen @nicolas.vuaille

---

<div class="post-metadata">

**Author:** ![olesenm](https://discourse.paraview.org/user_avatar/discourse.paraview.org/olesenm/32/17416_2.png) [@olesenm](https://discourse.paraview.org/u/olesenm)\
**Post date:** [June 21, 2022, 1:47pm UTC](https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861/3 "2022-06-21T13:47:13Z")

</div>

Not much time at the moment to test anything, but did notice that building against the most recent paraview fails anyhow with the following:

```auto
Could not find the VTK package with the following required components:
IOFFMPEG.

```

This all feels like such a moving target ☹

---

<div class="post-metadata">

**Author:** ![robertsawko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robertsawko/32/6283_2.png) [@robertsawko](https://discourse.paraview.org/u/robertsawko)\
**Post date:** [June 21, 2022, 6:29pm UTC](https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861/4 "2022-06-21T18:29:19Z")

</div>

Thanks for a reply, @olesenm. I should have mentioned that this is still built against 5.9.1. Thinking about it, it may be that the problem is not on the PV side or my PV build, but my OF `Int64` build. Could you direct me as to why `_ZN4Foam14functionObject7executeEi` is not present in `Int64` but present in `Int32`? Where and how should I even look for the difference between the two? I am happy to do the testing myself.

In the interest of full disclosure, I’d like to solve this issue before August, as I am aiming to submit something for [ISAV2022 workshop](https://dav.lbl.gov/events/ISAV2022/). I will definitely acknowledge all the support I am getting from this forum, but also happy to co-author if that’s of interest.

---

<div class="post-metadata">

**Author:** ![Dave\_DeMarle](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dave_demarle/32/27_2.png) [@Dave\_DeMarle](https://discourse.paraview.org/u/Dave_DeMarle)\
**Post date:** [June 21, 2022, 8:11pm UTC](https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861/5 "2022-06-21T20:11:50Z")

</div>

Hmmm,

c++filt \_ZN4Foam14functionObject7executeEi  
returns the more legible:  
Foam::functionObject::execute(int)

My wild guess (knowing next to nothing about OpenFOAM’s build system) is that the argument type get modified based on your Int64/Inte32 setting and that that leads to a mismatch with what Catalyst V2 wants.

hth in some way and good luck on you submission.

---

<div class="post-metadata">

**Author:** ![olesenm](https://discourse.paraview.org/user_avatar/discourse.paraview.org/olesenm/32/17416_2.png) [@olesenm](https://discourse.paraview.org/u/olesenm)\
**Post date:** [June 22, 2022, 8:34am UTC](https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861/6 "2022-06-22T08:34:29Z")

</div>

This is a pretty good shout. There are in fact two different functionObject execute methods:

- bool execute()
- bool execute(const label subIndex)

So with WM\_LABEL\_SIZE=64, the second signature will be `execute(int64_t)` instead of `execute(int32_t)`

---

<div class="post-metadata">

**Author:** ![robertsawko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robertsawko/32/6283_2.png) [@robertsawko](https://discourse.paraview.org/u/robertsawko)\
**Post date:** [June 23, 2022, 2:00pm UTC](https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861/7 "2022-06-23T14:00:32Z")

</div>

Thanks, @Dave_DeMarle, that’s a great suggestion. I did not know about `c++filt` command. Very useful tool.

So I have now confirmed that everything is OK with OpenFOAM as it contains:

```auto
nm -gD libOpenFOAM.so | grep functionObject | grep execute
00000000006046e0 T _ZN4Foam14functionObject25unavailableFunctionObject7executeEv
00000000006046b0 T _ZN4Foam14functionObject7executeEl
000000000061c680 T _ZN4Foam15functionObjects11timeControl7executeEl
000000000061c5a0 T _ZN4Foam15functionObjects11timeControl7executeEv
000000000060c000 T _ZN4Foam18functionObjectList7executeEl
000000000060c060 T _ZN4Foam18functionObjectList7executeERKNS_5UListINS_6wordReEEEl
000000000060e820 T _ZN4Foam18functionObjectList7executeEv

```

And `_ZN4Foam14functionObject7executeEl` demangles into long:

```auto
c++filt _ZN4Foam14functionObject7executeEl                 
Foam::functionObject::execute(long)

```

This narrows the problem down significantly and it points to my build of the catalyst adaptor. I am trying to figure out now what went wrong there and why my compiled so contains the “short int” name.

---

<div class="post-metadata">

**Author:** ![olesenm](https://discourse.paraview.org/user_avatar/discourse.paraview.org/olesenm/32/17416_2.png) [@olesenm](https://discourse.paraview.org/u/olesenm)\
**Post date:** [June 23, 2022, 2:14pm UTC](https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861/8 "2022-06-23T14:14:53Z")

</div>

Wild guess that you didn’t have `WM_LABEL_SIZE` or `Foam::label` properly picked up.

We have the following in CMakeLists chain:

```auto
# Convenience name, as per wmake internals
set(LIB_SRC "$ENV{WM_PROJECT_DIR}/src")

# Needed for internal label-size, scalar-size, templates
add_definitions(
    -DWM_$ENV{WM_PRECISION_OPTION}
    -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
    -DNoRepository
)

```

---

<div class="post-metadata">

**Author:** ![robertsawko](https://discourse.paraview.org/user_avatar/discourse.paraview.org/robertsawko/32/6283_2.png) [@robertsawko](https://discourse.paraview.org/u/robertsawko)\
**Post date:** [June 24, 2022, 10:07am UTC](https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861/9 "2022-06-24T10:07:08Z")

</div>

Thanks, @olesenm. That was precisely it. I didn’t have to dig into CMake even. I have set up OpenFOAM on this cluster myself and generated my own module files for it in order to have both versions:

```auto
ml av
...
   openfoam/v2106/DPInt32 openfoam/v2112/DPInt64 (L) paraview/5.10.0/osmesa (D)
   openfoam/v2112/DPInt32 (D) paraview/5.10.0/egl paraview/5.9.1/osmesa (L)

```

I am a big Lmod fan as I think it makes it easy to manage shell environments, which can be complex on HPC. There is also now [a full integration](https://lmod.readthedocs.io/en/latest/260_sh_to_modulefile.html#using-source-sh) with sourcing shell files within Lmod, which I should be using, but this cluster has slightly older Lmod so I generated the module files with [this](https://lmod.readthedocs.io/en/latest/260_sh_to_modulefile.html#converting-shell-scripts-to-modulefiles) and _manually_ adjusted for different variants…

I changed `WM_LABEL_OPTION`, but missed `WM_LABEL_SIZE` so CMake properly picked up the wrong integer. The error, as often in my case, was between the seat and the keyboard.

Thanks to everyone for providing ideas.

---

<div class="post-metadata">

**Author:** ![olesenm](https://discourse.paraview.org/user_avatar/discourse.paraview.org/olesenm/32/17416_2.png) [@olesenm](https://discourse.paraview.org/u/olesenm)\
**Post date:** [June 24, 2022, 10:47am UTC](https://discourse.paraview.org/t/openfoam-int64-catalyst-is-not-loading-properly-because-of-a-missing-symbol/9861/10 "2022-06-24T10:47:42Z")

</div>

If you do need to create modules or simplified shell environments for OpenFOAM, can also consider leveraging the [bin/tools/foamCreateModuleInclude](https://develop.openfoam.com/Development/openfoam/-/blob/master/bin/tools/foamCreateModuleInclude) script.
