I want to compile/install assimp with phtreads enabled over vcpkg on Windows. But i dont know how?

49 Views Asked by At

So i am trying to write a simulation of clothing-behaviour in an web environment for my master-thesis with QtCreator. Therefore i am developing a c++ cmake project and want to compile it with emscripten to WebAssembly which worked fine so far. Before knowing about using an external thread i used the WebAssembly Qt 6.6.2 (single-threaded) and now switched to the WebAssembly QT 6.6.2 (multi-threaded) Kit.

For the Simulation i want to use a Thread to calculate the physical behaviour indepented of my rendering context. I am on Windows and installed emscripten and vcpkg. With the emscripten cmd i installed assimp with the according triplet.

SET VCPKG_DEFAULT_TRIPLET=wasm32-emscripten

and then

vcpkg install assimp

Now in my code i import assets over assimp and that causes the following problem.

As soon as i use assimp Assimp::Importer m_importer; I get this ninja build error :-1: Error: ninja: build stopped: subcommand failed.

And the compilation log states this: wasm-ld: error: --shared-memory is disallowed by 3DSLoader.cpp.o because it was not compiled with 'atomics' or 'bulk-memory' features.

This brought me to the conclusion that i need to install assimp over vcpkg with pthreads enabled. But i don't know how?

I already use these in my CMAkeLists.txt target_compile_options(Clothing-Simulator PRIVATE "-pthread") target_link_options(Clothing-Simulator PRIVATE "-pthread")

Can anyone provide some knowledge on this topic as i am unfamiliar with advanced CMake and vcpkg? If i should provide any more ressources i will do.

I already know the option of Web-Workers/WASM-Workers but wanted to try pthreads first.

I already tried to compile it with pthreads on Flag, but i am using it wrong.

vcpkg install assimp -DASSIMP_ENABLE_PTHREADS=ON

gives me

<unknown>:1:9: error: invalid character in package name (must be lowercase, digits, '-') on expression: -dassimp_enable_pthreads=on

vcpkg install <port name> <port name>... vcpkg install zlib zlib:x64-windows curl boost

so i guess i have to do otherwise. But as mentioned above i have little to zero expertise on this.

Thanks for any help

0

There are 0 best solutions below