-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web Assembly problems #107
Comments
I made a PR to fix all and all is working nice now. You can use this example to download nanogui with CPM (cmake package manager):
And at least:
|
DEAD ... Found a better way... See next comment. After much pain I was able to get this to build on OSX also...
|
Follow the instructions from this page... (summarized)
Checkout nanogui
|
occur some errors, |
Do you have the correct version 3.1.34? The error sounds like you are trying to build on a mac and the "-march" is causing problems which the emsdk does not care about. My cmake building foo is not strong enough to know how to remove the "-march". |
I build on windows(MingW64) |
My emsdk version 3.1.54. I remove "-march" .I use your instructions "set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_CXX_COMPILER> -r -o <LINK_FLAGS> ")" but the new error is : |
Once emsdk is installed I think you and do a "emsdk install 3.1.34" and then "emsdk activate 3.1.34", or something like that. I would give that a try first then if it does not work move forward. |
Hello,
So I continued with 3.1.56. So I git the nanogui :
I think since the post the nanogui has changed as I did not find any "march" for example in the CMakeLists.txt then followed as proposed above with :
and here follows what I get :
So it does not work. I tried to install X11 related dev libraries as it is the problem expressed : " sudo apt-get install cmake xorg-dev libglu1-mesa-dev", no more success. Can someone help ? regards, |
Last time I touched the code was on 2023/03/15... Can you try the commit hash from before that date? |
Here it is :
|
I think I did not clone the good "nanogui" project. I try now with "mitsuba-render". Sorry. I will give news after try. |
It is better this time but does not still work. I think the library builds ok, but not the examples.
also removed the "march" lines (79-91) Then
and here is what I get :
|
As soon as I can scratch my head I will check the git hash I have and re-try with my instructions. |
emsdk list The recommended precompiled SDK download is 3.1.48 (694434b6d47c5f6eff2c8fbd9eeb016c977ae9dc). To install/activate it use: This is equivalent to installing/activating: All recent (non-legacy) installable versions are: CXXFLAGS='-s USE_WEBGL2=1 -s USE_GLFW=3 -s WASM=1' emcmake cmake ..; emmake make Update the VERSION argument value or use a ... suffix to tell [ 4%] Building C object CMakeFiles/nanogui.dir/ext/nanovg/src/nanovg.c.o |
git hash... |
If you are getting failures in the 3 files below I can do a diff and see what I changed but I think the only change was in CMakeLists.txt git status Changes not staged for commit: |
Hello, git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 3.1.48
./emsdk activate 3.1.48
source ./emsdk_env.sh
cd ..
git clone https://github.com/mitsuba-renderer/nanogui.git --recursive
cd nanogui For other users : please notice that at this time the last commit is 8 March 2023 (2ee903c). Then had to change the CMakeLists.txt including points a,b and c, as discussed before in this thread. I enclose a CMakeLists.txt file ready to work with this message, so that other users only have to copy it : Then : mkdir web
cd web
CXXFLAGS='-s USE_WEBGL2=1 -s USE_GLFW=3 -s WASM=1' emcmake cmake ..; emmake make Then start a python webserver to test :
Then everything is ok. Thanks a lot ! I will be able now to start my project. Just a remark, don't know if it's normal, but, in webassembly context :
Best Regards, |
Hi,
I found this problems when compile to WASM:
1 - This line throw error that
GLFW_SCALE_TO_MONITOR
don't exists (screen.cpp):2 - This method
glfwSetWindowContentScaleCallback
throw error that don't exists (screen.cpp):3 - Adding a fixed suffix
.bc
don't work on emsdk:The text was updated successfully, but these errors were encountered: