Skip to content

Conversation

@kalwalt
Copy link
Collaborator

@kalwalt kalwalt commented Feb 20, 2020

  • WASM in a single file
  • deleting libjpeg refs. because included by emscripten with USE_LIBJPEG
  • stb image for emscripten (linux?)

These changes to upgrade the project, and to test with WebWorker.

@kalwalt
Copy link
Collaborator Author

kalwalt commented Feb 20, 2020

i can not compile the project it fails with this error, related to jpeg lib:

[100%] Linking CXX executable artoolkitx.js
cd /home/walter/kalwalt-github/artoolkitX_em_2d/Source/build-em/artoolkitx.js && /usr/bin/cmake -E cmake_link_script CMakeFiles/artoolkitx.dir/link.txt --verbose=1
/home/walter/emsdk/fastcomp/emscripten/em++   -s USE_LIBJPEG=1 -O3 -s ASSERTIONS=0 --llvm-lto 1 --memory-init-file 0 -s INVOKE_RUN=0 -s NO_EXIT_RUNTIME=1 -msse -msse2 -msse3 -mssse3 -I/home/walter/kalwalt-github/artoolkitX_em_2d/Source/depends/emscripten/opencv-3.4.1 -I/home/walter/kalwalt-github/artoolkitX_em_2d/Source/depends/emscripten/opencv-3.4.1/modules/core/include -I/home/walter/kalwalt-github/artoolkitX_em_2d/Source/depends/emscripten/opencv-3.4.1/modules/highgui/include -I/home/walter/kalwalt-github/artoolkitX_em_2d/Source/depends/emscripten/opencv-3.4.1/modules/imgcodecs/include -I/home/walter/kalwalt-github/artoolkitX_em_2d/Source/depends/emscripten/opencv-3.4.1/modules/videoio/include -I/home/walter/kalwalt-github/artoolkitX_em_2d/Source/depends/emscripten/opencv-3.4.1/modules/imgproc/include -I/home/walter/kalwalt-github/artoolkitX_em_2d/Source/depends/emscripten/opencv-3.4.1/modules/calib3d/include -I/home/walter/kalwalt-github/artoolkitX_em_2d/Source/depends/emscripten/opencv-3.4.1/modules/features2d/include -I/home/walter/kalwalt-github/artoolkitX_em_2d/Source/depends/emscripten/opencv-3.4.1/modules/flann/include -I/home/walter/kalwalt-github/artoolkitX_em_2d/Source/depends/emscripten/opencv-3.4.1/modules/video/include -I/home/walter/kalwalt-github/artoolkitX_em_2d/Source/ARX/OCVT/include -DNDEBUG -O3  -O3  -s MODULARIZE_INSTANCE=1 -s USE_ES6_IMPORT_META=0 -s EXPORT_NAME='artoolkitXjs' -s EXPORT_ES6=1  -s BINARYEN_TRAP_MODE=clamp -s SINGLE_FILE=1   --pre-js /home/walter/kalwalt-github/artoolkitX_em_2d/Source/artoolkitx.js/ARX_wasmLoader.js -s TOTAL_MEMORY=16777216 -s ALLOW_MEMORY_GROWTH=1   --bind --post-js /home/walter/kalwalt-github/artoolkitX_em_2d/Source/artoolkitx.js/ARX_additions.js -s EXPORTED_FUNCTIONS='['_arwUpdateAR', '_arwCapture', '_arwGetProjectionMatrix', '_arwQueryTrackableVisibilityAndTransformation', '_arwGetTrackablePatternConfig', '_arwGetTrackablePatternImage', '_arwLoadOpticalParams']' -s EXTRA_EXPORTED_RUNTIME_METHODS='['ccall', 'cwrap', 'FS', 'setValue']' @CMakeFiles/artoolkitx.dir/objects1.rsp  -o artoolkitx.js @CMakeFiles/artoolkitx.dir/linklibs.rsp
error: Linking globals named 'jpeg_natural_order': symbol multiply defined!
shared:ERROR: Failed to run llvm optimizations: 
artoolkitx.js/CMakeFiles/artoolkitx.dir/build.make:124: recipe for target 'artoolkitx.js/artoolkitx.js' failed
make[2]: *** [artoolkitx.js/artoolkitx.js] Error 1
make[2]: uscita dalla directory "/home/walter/kalwalt-github/artoolkitX_em_2d/Source/build-em"
CMakeFiles/Makefile2:556: recipe for target 'artoolkitx.js/CMakeFiles/artoolkitx.dir/all' failed
make[1]: *** [artoolkitx.js/CMakeFiles/artoolkitx.dir/all] Error 2
make[1]: uscita dalla directory "/home/walter/kalwalt-github/artoolkitX_em_2d/Source/build-em"
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

note in detail: error: Linking globals named 'jpeg_natural_order': symbol multiply defined!

@kalwalt kalwalt added C/C++ about C and C++ code enhancement New feature or request labels Feb 20, 2020
@kalwalt
Copy link
Collaborator Author

kalwalt commented Feb 20, 2020

i found the cause of the error!

@kalwalt
Copy link
Collaborator Author

kalwalt commented Feb 20, 2020

i think that i can also remove the Opencv libjpeg compilation, need to be verified.

@kalwalt
Copy link
Collaborator Author

kalwalt commented Feb 20, 2020

There is also a STB_IMAGE option in Emscripten since by 2013 maybe we can add also this? If yes we could add also to the 'official' version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C/C++ about C and C++ code enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant