Link Dependencies

77 views
Skip to first unread message

Kavita Krishnaswamy

unread,
Aug 6, 2019, 9:29:59 PM8/6/19
to emscripten-discuss
How can I build any given Python library to JavaScript/WASM with Emscripten?

How can I build DLIB or any other C++ library to JavaScript/WASM with Emscripten?

Specifically, please see http://dlib.net/compile.html.

OpenCV and DLIB should work together and I'd like them to be in JavaScript/WASM so that I can integrate them in the browser. I'd really appreciate your guidance.

I want to import DLIB modules to OpenCV to use within the browser. I have successfully already built the openCV.js.


In particular, can you please help me convert the following code to JS

https://github.com/spmallick/dlib/blob/master/examples/webcam_head_pose.cpp
?

Thank you in advance


Shlomi Fish

unread,
Aug 9, 2019, 10:34:00 AM8/9/19
to Kavita Krishnaswamy, emscripte...@googlegroups.com
Hi Kavita,

On Tue, 6 Aug 2019 18:29:59 -0700 (PDT)
Kavita Krishnaswamy <ka...@umbc.edu> wrote:

> How can I build any given Python library to JavaScript/WASM with Emscripten?
>
> How can I build DLIB or any other C++ library to JavaScript/WASM with
> Emscripten?
>
> Specifically, please see http://dlib.net/compile.html.
>
> OpenCV and DLIB should work together and I'd like them to be in
> JavaScript/WASM so that I can integrate them in the browser. I'd really
> appreciate your guidance.
>

Please see:

* https://github.com/emscripten-core/emscripten/wiki/Porting-Examples-and-Demos

* https://emscripten.org/ - the documentation.

It may require some trial and error. If you still need help you can hire a
consultant. I am available at https://www.shlomifish.org/me/contact-me/ and am
experienced with emscripten, but there are others.
> I want to import DLIB modules to OpenCV to use within the browser. I have
> successfully already built the openCV.js.
>
>
> In particular, can you please help me convert the following code to JS
>
> https://github.com/spmallick/dlib/blob/master/examples/webcam_head_pose.cpp
> ?
>
> Thank you in advance
>
>



--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
List of Portability Libraries - http://shlom.in/port-libs

By the time it takes Windows Update to download a 22 MB update without
installing it, Mageia Linux’s urpmi was already able to download and install a
game whose package is 900 MB (and there was still a lot of time to spare).
http://www.shlomifish.org/humour/bits/facts/Windows-Update/

Please reply to list if it's a mailing list post - http://shlom.in/reply .

Kavita Krishnaswamy

unread,
Aug 18, 2019, 9:51:59 PM8/18/19
to emscripten-discuss
An example would be very helpful please. I don't see any example with library dependencies. I really wish there were better documentation about linking dependencies. Not a single example exists even in a book.

Can anybody help me with the simple example of linking dependencies?

J Decker

unread,
Aug 19, 2019, 2:03:39 PM8/19/19
to emscripten-discuss
There's really no magic, compile library, include library with -llibName...
For example I compiled against libreSSL, which uses cmake.  I made a build directory, used an emsdk environment, and compiled that project, then copied the library products to the other project, and linked them.  I used .a libraries to avoid dynamic linking issues/overhead.

If you can get one thing to build with emcc/emcmake/etc... then the rest are all the same...


--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/e24eef66-4fd1-4e0a-9684-429e4707d82f%40googlegroups.com.

Shlomi Fish

unread,
Aug 20, 2019, 11:13:59 AM8/20/19
to Kavita Krishnaswamy, emscripte...@googlegroups.com
Hi Kavita,

On Sun, 18 Aug 2019 18:51:59 -0700 (PDT)
Kavita Krishnaswamy <ka...@umbc.edu> wrote:

> An example would be very helpful please. I don't see any example with
> library dependencies. I really wish there were better documentation about
> linking dependencies. Not a single example exists even in a book.
>
> Can anybody help me with the simple example of linking dependencies?
>

What I do is specify all the compiled .bc files on one command line. E.g:

* https://github.com/wothke/libxmp-4.4.1

*
https://github.com/shlomif/fc-solve/blob/master/fc-solve/scripts/Makefile.to-javascript.mak

(These are both listed here:
https://github.com/emscripten-core/emscripten/wiki/Porting-Examples-and-Demos )

Perhaps there is a better way.
Buffy Factoids - http://www.shlomifish.org/humour/bits/facts/Buffy/

Xena the Warrior Princess has not met Chuck Norris yet, or otherwise he
would have been badly and permanently injured.
http://www.shlomifish.org/humour/bits/facts/Xena/
Reply all
Reply to author
Forward
0 new messages