EdwardLu2018 / wasm-ar

Playing around with Augmented Reality on the Web using OpenCV and WebAssembly
https://edwardlu2018.github.io/wasm-ar/
48 stars 18 forks source link

Questions about building the project #2

Closed kalwalt closed 3 years ago

kalwalt commented 3 years ago

I read in the Readme.md that is necessary to build the openCV lib but which version do you used? Can you specify the version? It will be very useful for testing... :smile:

kalwalt commented 3 years ago

i was able to build the project with the instructions in #3 feel free to acccept it or not if you don't agree :slightly_smiling_face:

EdwardLu2018 commented 3 years ago

Yep! Looks great! I definitely need to have more documentation and possibly more comments in various places. Thanks! Probably already found this out, but just in case, I used OpenCV 3!

kalwalt commented 3 years ago

Thank you it is a pleasure!

kalwalt commented 3 years ago

BTW, i used tha latest openCV with latest from master branch, It compiled and build all the static libs, but failed to build the OpenCV.js, anyway this was sufficient to complete, i will try with the latest release 4.5.0 :smile:

EdwardLu2018 commented 3 years ago

Hmm interesting. Seems to build fine with opencv master on my machine. What version is your emsdk? Mine is an older-ish version (819e95c).

kalwalt commented 3 years ago

I have used a recent emsdk version: 2.0.8 see the log:

./emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.8
clang version 12.0.0 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project 1a7a9efec3cf872dcf3e1a6e6fe39e797c4d9fc6)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/walter/emsdk/upstream/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Selected multilib: .;@m64
shared:INFO: (Emscripten: Running sanity checks)

The default version is based on upstream, it gives smaller size of the build and many other improves. To avoid different builds ( because developers use different version) while developing for jsartoolkit5 we start to use the emscripten Docker image, the trzeci but now is deprecated (very old and fastcomp based). There is now the Docker image by emsdk, but i never tried...

EdwardLu2018 commented 3 years ago

Hmmm... Seems like the version of emscripten recommended by opencv is 1.39.16

./emsdk update
./emsdk install 1.39.16
./emsdk activate 1.39.16

https://docs.opencv.org/master/d4/da1/tutorial_js_setup.html

EdwardLu2018 commented 3 years ago

Yeah, I tried a variety of opencv versions that worked in the past and none compiled. The only thing that worked was rolling emsdk back to 1.39.16

kalwalt commented 3 years ago

Yeah, I tried a variety of opencv versions that worked in the past and none compiled. The only thing that worked was rolling emsdk back to 1.39.16

Thank you i will try tomorrow!

kalwalt commented 3 years ago

Rolled back to emsdk 1.39.16 and opencv 4.5.0(dev) and it was build with success. :smile: Maybe better stick with the 4.5.0 stable release?

EdwardLu2018 commented 3 years ago

Sweet!

4.5.0 release should work. I believe I tested it on using that and it compiled fine.