How to build vtk-wasm64

Hi,

I am experimenting with >4GB limitation using vtk-wasm. However, I am getting error wasm32 object file can’t be linked in wasm64 mode. How do I compile vtk-wasm in wasm64 to test this?

Thanks,

Pass these extra args to cmake when configuring VTK.
-DCMAKE_C_FLAGS=MEMORY64 -DCMAKE_CXX_FLAGS=MEMORY64

That is sufficient to give you wasm64. Although, don’t be too excited. You will run into some issues with the SDL2 render window ¹. It was fixed in SDL3 but emscripten still uses SDL2.

Thanks! I was just curious about the build process. Passing the flags make it compiled, but the correct value is -sMEMORY64.

However, after compiling VTK WASM, I tried to build my app against the newly installed library, and got,

Could not find a configuration file for package "VTK" that is compatible
  with requested version "".

  The following configuration files were considered but not accepted:

    /scratch/tools/VTK/install-wasm-64/lib/cmake/vtk-9.3/vtk-config.cmake, version: 9.3.20240311 (64bit)

The same app and build script works with wasm 32-bit. I know wasm64 bit is still WIP. So, if you have any ideas how to proceed, it would be great. Otherwise, I just put off my experiment to wait for official release.

Thanks,

That happens because your project is trying to find 32-bit VTK wasm.

Pass those flags even when configuring your project.