# CMake flags that are used for vtk-wasm-sdk?

**URL:** https://discourse.vtk.org/t/cmake-flags-that-are-used-for-vtk-wasm-sdk/15259
**Category:** Web
**Created:** [February 10, 2025, 5:32pm UTC](https://discourse.vtk.org/t/cmake-flags-that-are-used-for-vtk-wasm-sdk/15259 "2025-02-10T17:32:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Sophonet](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/ecccb3/32.png) [@Sophonet](https://discourse.vtk.org/u/Sophonet)
#### Post date: [February 10, 2025, 5:32pm UTC](https://discourse.vtk.org/t/cmake-flags-that-are-used-for-vtk-wasm-sdk/15259/1 "2025-02-10T17:32:50Z")

</div>

Hi,

after switching from SDL2-based wasm of VTK 9.3.1 to WebAssembly-based functionality in 9.4.1 (or the current main branch), I have noticed that my own compiled WASM app runs magnitudes slower compared to a build with the vtk-wasm-sdk docker image. One render pass needs about 300 ms - it feels like this is magnitudes more than with the vtk-wasm-sdk docker image (32bit, no threads) and also much more than with (a patched) build using VTK 9.3.1 via SDL2.

I would be interested in the CMake flags that have been used for creating the libraries in the vtk-wasm-vtk in order to reproduce the speed in a home-built app. I guess the ones found in [.gitlab/ci/docker/Dockerfile · main · VTK / vtk-wasm-sdk · GitLab](https://gitlab.kitware.com/vtk/vtk-wasm-sdk/-/blob/main/.gitlab/ci/docker/Dockerfile?ref_type=heads) might be not the currently used ones?

@jaswantp, do you know where I can find them? The ones I have used (for the slow rendering) are the following (see [Building using emscripten for WebAssembly - VTK documentation](https://docs.vtk.org/en/latest/advanced/build_wasm_emscripten.html))

-DBUILD\_SHARED\_LIBS:BOOL=OFF   
-DCMAKE\_BUILD\_TYPE:STRING=Release   
-DVTK\_ENABLE\_LOGGING:BOOL=OFF   
-DVTK\_ENABLE\_WRAPPING:BOOL=OFF   
-DVTK\_WEBASSEMBLY\_64\_BIT=OFF   
-DVTK\_WEBASSEMBLY\_THREADS=OFF   
-DVTK\_MODULE\_ENABLE\_VTK\_RenderingLICOpenGL2:BOOL=DONT\_WANT   
-DCMAKE\_CXX\_FLAGS\_RELEASE=“-O3”   
-DVTK\_ENABLE\_WEBGPU:BOOL=ON

I am using emsdk 3.1.74.

Thanks,

Sophonet.

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [February 10, 2025, 5:51pm UTC](https://discourse.vtk.org/t/cmake-flags-that-are-used-for-vtk-wasm-sdk/15259/2 "2025-02-10T17:51:39Z")

</div>

Hello @Sophonet

> [@Sophonet](#):
>
> I guess the ones found in [.gitlab/ci/docker/Dockerfile · main · VTK / vtk-wasm-sdk · GitLab](https://gitlab.kitware.com/vtk/vtk-wasm-sdk/-/blob/main/.gitlab/ci/docker/Dockerfile?ref_type=heads) might be not the currently used ones?

Those flags are currently used for the `vtk-wasm-sdk` image.

> [@Sophonet](#):
>
> I am using emsdk 3.1.74.

The `vtk-wasm-sdk` image is built using emsdk 3.1.64, whereas you seem to use emsdk 3.1.74. Maybe there is something wrong with the newer emsdk? Can you try emsdk 3.1.64 instead?

---

<div class="post-metadata">

### Author: ![Sophonet](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/ecccb3/32.png) [@Sophonet](https://discourse.vtk.org/u/Sophonet)
#### Post date: [February 11, 2025, 5:51pm UTC](https://discourse.vtk.org/t/cmake-flags-that-are-used-for-vtk-wasm-sdk/15259/3 "2025-02-11T17:51:28Z")

</div>

Thanks @jaswantp. It turned out that somehow the flags I have mentioned were not used - instead, a debug version was built and that was horribly slow.

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [February 11, 2025, 5:56pm UTC](https://discourse.vtk.org/t/cmake-flags-that-are-used-for-vtk-wasm-sdk/15259/4 "2025-02-11T17:56:42Z")

</div>

Thanks for posting an update. I am genuinely relieved that emsdk version is not to blame 🙂
