Closed kalwalt closed 10 months ago
As a side note i have also run the script:
python3 deploy_content.py
python3 deploy_deps.py
and all dependencies were installed and ktx-software
too...
i added this line inside IGLU CMakeLists.txt:
target_include_directories(IGLUtexture_loader PUBLIC "${IGL_ROOT_DIR}/third-party/deps/src/ktx-software/include")
and that error went away, but i got another one:
[21/21] Linking CXX executable samples\wasm\Tiny_Mesh.html
FAILED: samples/wasm/Tiny_Mesh.html
cmd.exe /C "cd . && C:\Users\perda\emsdk\upstream\emscripten\em++.bat -s USE_WEBGL2=1 -s USE_GLFW=3 -s GL_SUPPORT_AUTOMATIC_ENABLE_EXTENSIONS=1 -s GL_EMULATE_GLES_VERSION_STRING_FORMAT=1 -s ALLOW_MEMORY_GROWTH=1 -s SINGLE_FILE=1 -s LLD_REPORT_UNDEFINED --shell-file C:/Users/perda/kalwalt-github/igl/samples/wasm/igl.html samples/wasm/CMakeFiles/Tiny_Mesh.dir/Tiny_Mesh.cpp.o samples/wasm/CMakeFiles/Tiny_Mesh.dir/Common.cpp.o -o samples\wasm\Tiny_Mesh.html src/igl/libIGLLibrary.a src/igl/opengl/libIGLOpenGL.a src/igl/libIGLLibrary.a src/igl/opengl/libIGLOpenGL.a -lfmt && cd ."
wasm-ld: error: unable to find library -lfmt
em++: error: 'C:/Users/perda/emsdk/upstream/bin\wasm-ld.exe -o samples\wasm\Tiny_Mesh.wasm samples/wasm/CMakeFiles/Tiny_Mesh.dir/Tiny_Mesh.cpp.o samples/wasm/CMakeFiles/Tiny_Mesh.dir/Common.cpp.o src/igl/libIGLLibrary.a src/igl/opengl/libIGLOpenGL.a src/igl/libIGLLibrary.a src/igl/opengl/libIGLOpenGL.a -lfmt -LC:\Users\perda\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten -lGL-webgl2 -lal -lhtml5 -lstubs-debug -lnoexit -lc-debug -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-debug-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --allow-undefined-file=C:\Users\perda\AppData\Local\Temp\tmpar9lib4d.undefined --strip-debug --export-if-defined=main --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=__main_argc_argv --export-if-defined=fflush --export=emscripten_stack_get_end --export=emscripten_stack_get_free --export=emscripten_stack_get_base --export=emscripten_stack_get_current --export=emscripten_stack_init --export=stackSave --export=stackRestore --export=stackAlloc --export=__wasm_call_ctors --export=__errno_location --export=__get_temp_ret --export=__set_temp_ret --export=malloc --export=__cxa_is_pointer_type --export-table -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=2147483648 --stack-first' failed (returned 1)
ninja: build stopped: subcommand failed.
if you delete the -lfmt
from build.ninja
it will finally build and link the Triangle.html and Tiny_Mesh.html files, i can see a colored triangle in the Triangle.html and a set of rotating textured cubes in the second. Of course it is a hack but maybe can be useful to someone.
To solve these issues i made these modifications to src/igl/CMakeLists.txt
:
//at line 25
if(NOT EMSCRIPTEN)
target_link_libraries(IGLLibrary PUBLIC fmt)
endif()
and to src/igl/opengl/CMakeLists.txt
:
-add_subdirectory("${IGL_ROOT_DIR}/third-party/deps/src/glew/build/cmake" glew)
+add_subdirectory("${IGL_ROOT_DIR}/third-party/deps/src/glew-2.2.0/build/cmake" glew)
-target_include_directories(IGLOpenGL PUBLIC "${IGL_ROOT_DIR}/third-party/deps/src/glew/include")
+target_include_directories(IGLOpenGL PUBLIC "${IGL_ROOT_DIR}/third-party/deps/src/glew-2.2.0/include")
but maybe this last depends on the python script deploy_deps.py
You can find my changes in this branch https://github.com/kalwalt/igl/tree/testing-wasm if you want i can send a PR.
Please send a PR
@rudybear I just send PR #64 to fix this.
As described in the readme i run this command to build the wasm lib:
configurations goes well:
but during the build process i got this error:
Maybe i missing some steps? Thank you, Walter.
I'm trying to build the WASM version with an Ubuntu 22-04 machine without Vulkan ( i have only an integrated GPU intel card)