Skip to content
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

occur some error when complie #4

Open
deloverzeus opened this issue Mar 21, 2024 · 1 comment
Open

occur some error when complie #4

deloverzeus opened this issue Mar 21, 2024 · 1 comment

Comments

@deloverzeus
Copy link

I input command "emcmake cmake ..;make;"

em++: warning: object file output extension (.bc) used for non-object output. If you meant to build an object file please use -c, -r, or -shared` [-Wemcc]
[ 55%] Built target nanogui
[ 57%] Running bin2c
[ 59%] Building CXX object CMakeFiles/Tekari.dir/src/main.cpp.o
[ 61%] Building CXX object CMakeFiles/Tekari.dir/src/bsdf_application.cpp.o
[ 62%] Building CXX object CMakeFiles/Tekari.dir/src/bsdf_canvas.cpp.o
[ 64%] Building CXX object CMakeFiles/Tekari.dir/src/dataset.cpp.o
[ 66%] Building CXX object CMakeFiles/Tekari.dir/src/radial_grid.cpp.o
[ 67%] Building CXX object CMakeFiles/Tekari.dir/src/dataset_button.cpp.o
[ 69%] Building CXX object CMakeFiles/Tekari.dir/src/metadata.cpp.o
[ 71%] Building CXX object CMakeFiles/Tekari.dir/src/color_map.cpp.o
[ 72%] Building CXX object CMakeFiles/Tekari.dir/src/color_map_selection_window.cpp.o
[ 74%] Building CXX object CMakeFiles/Tekari.dir/src/color_map_button.cpp.o
[ 76%] Building CXX object CMakeFiles/Tekari.dir/src/metadata_window.cpp.o
[ 77%] Building CXX object CMakeFiles/Tekari.dir/src/help_window.cpp.o
[ 79%] Building CXX object CMakeFiles/Tekari.dir/src/axis.cpp.o
[ 81%] Building CXX object CMakeFiles/Tekari.dir/src/selections.cpp.o
[ 83%] Building CXX object CMakeFiles/Tekari.dir/src/raw_data_processing.cpp.o
[ 84%] Building CXX object CMakeFiles/Tekari.dir/src/points_stats.cpp.o
[ 86%] Building CXX object CMakeFiles/Tekari.dir/src/data_io.cpp.o
[ 88%] Building CXX object CMakeFiles/Tekari.dir/src/arrow.cpp.o
[ 89%] Building CXX object CMakeFiles/Tekari.dir/src/slider_2d.cpp.o
[ 91%] Building CXX object CMakeFiles/Tekari.dir/src/bsdf_dataset.cpp.o
[ 93%] Building CXX object CMakeFiles/Tekari.dir/src/wavelength_slider.cpp.o
[ 94%] Building CXX object CMakeFiles/Tekari.dir/tekari_resources.cpp.o
[ 96%] Linking CXX executable tekari.bc
ext_build/nanogui/libnanogui.bc:1:1: error: expected top-level entity
1 | // include: shell.js
| ^
1 error generated.
em++: error: '/home/overzeus/gitdir/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=/home/overzeus/gitdir/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -std=c++17 -O3 -DNDEBUG ext_build/nanogui/libnanogui.bc -c -o /tmp/emscripten_temp_6qvo21c8/libnanogui_0.o' failed (returned 1)
make[2]: *** [CMakeFiles/Tekari.dir/build.make:524:tekari.bc] error 1
make[1]: *** [CMakeFiles/Makefile2:158:CMakeFiles/Tekari.dir/all] error 2
make: *** [Makefile:136:all] error 2
emmake: error: 'make' failed (returned 2)

@DXXS
Copy link

DXXS commented Aug 3, 2024

Yes, I got this "error: expected top-level entity " too when compiling nanogui; I think it helps to see what it's doing if you turn on -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON in the emcmake cmake call...
...
/Users/ds/Development/miniforge3/bin/cmake -E cmake_link_script CMakeFiles/nanogui.dir/link.txt --verbose=1
/Users/ds/Development/emsdk/upstream/emscripten/em++ -o libnanogui.bc @CMakeFiles/nanogui.dir/objects1.rsp
em++: warning: object file output extension (.bc) used for non-object output. If you meant to build an object file please use -c, -r, or -shared` [-Wemcc]
[ 78%] Built target nanogui
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/example1.dir/build.make CMakeFiles/example1.dir/depend
cd /Users/ds/Development/nanogui && /Users/ds/Development/miniforge3/bin/cmake -E cmake_depends "Unix Makefiles" /Users/ds/Development/nanogui /Users/ds/Development/nanogui /Users/ds/Development/nanogui /Users/ds/Development/nanogui /Users/ds/Development/nanogui/CMakeFiles/example1.dir/DependInfo.cmake --color=
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/example1.dir/build.make CMakeFiles/example1.dir/build
[ 80%] Building CXX object CMakeFiles/example1.dir/src/example1.cpp.o
/Users/ds/Development/emsdk/upstream/emscripten/em++ -DNANOGUI_GLES_VERSION=2 -DNANOGUI_USE_GLES @CMakeFiles/example1.dir/includes_CXX.rsp -O3 -DNDEBUG -fvisibility=hidden -O3 -DNDEBUG -std=gnu++17 -MD -MT CMakeFiles/example1.dir/src/example1.cpp.o -MF CMakeFiles/example1.dir/src/example1.cpp.o.d -o CMakeFiles/example1.dir/src/example1.cpp.o -c /Users/ds/Development/nanogui/src/example1.cpp
[ 82%] Linking CXX executable example1.bc
/Users/ds/Development/miniforge3/bin/cmake -E cmake_link_script CMakeFiles/example1.dir/link.txt --verbose=1
/Users/ds/Development/emsdk/upstream/emscripten/em++ -O3 -DNDEBUG @CMakeFiles/example1.dir/objects1.rsp -o example1.bc @CMakeFiles/example1.dir/linklibs.rsp
libnanogui.bc:1:1: error: expected top-level entity
1 | // include: shell.js
| ^
1 error generated.
em++: error: '/Users/ds/Development/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=/Users/ds/Development/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -O3 -DNDEBUG libnanogui.bc -c -o /var/folders/jg/109wtcf50lz0fh0z6fx1kdd40000gn/T/emscripten_temp_icie40zj/libnanogui_0.o' failed (returned 1)
...

Apparently the 'warning' should be an error instead... Not sure where to 'fix' things, but emscripten appears to jump directly from the object file in 'objects1.rsp' to javascript instead of generating the requested bytecode (?).

In my case, using "emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.63 (217010a223375e6e9251669187d406ef2ddf266e)".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants