Emscripten cmake and other libs

794 views
Skip to first unread message

Gurjot Singh Bhatti

unread,
Mar 17, 2016, 2:30:42 AM3/17/16
to emscripten-discuss
Hi,

I am trying to port a C++ project using emscripten which is using 'cmake' as its build system. This project uses several libs such as boost and liblog4cxx.
I ran the following cmake command:

~/Documents/emsdk_portable/emscripten/master/./emcmake cmake -DCMAKE_TOOLCHAIN_FILE= ~/Documents/emsdk_portable/emscripten/master/cmake/Modules/Platform/Emscripten.cmake -G "Unix Makefiles" -DBOOST_ROOT=/home/scott/boost_1_60_0/ ..

It is able to identify the BOOST version but gives the following error:
Unable to find the requested Boost libraries.
Boost version: 1.60.0
Boost include path: /home/scott/boost_1_60_0
Could not find the following Boost libraries:
          boost_thread
          boost_date_time
          boost_program_options
          boost_filesystem
          boost_system
No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.


Also this:
-- checking for module 'liblog4cxx'
--   package 'liblog4cxx' not found


ERROR:root:Configure step failed with non-zero return code 1!

I tried setting the boost library dir as well, but still getting the same error.

If I run the cmake command with ./emcmake then it compiles.

I am at loss how to configure these libs to compile with emscripten.

Kindly help me solve these issues.

Floh

unread,
Mar 17, 2016, 4:52:47 AM3/17/16
to emscripten-discuss
Does it all work natively without the emscripten toolchain? 

Also, boost_thread and boost_filesystem are warning signs that getting this stuff to run on emscripten might not be trivial :)

-Floh.

Gurjot Singh Bhatti

unread,
Mar 17, 2016, 5:06:47 AM3/17/16
to emscripte...@googlegroups.com
On 17 March 2016 at 14:22, Floh <flo...@gmail.com> wrote:
> Does it all work natively without the emscripten toolchain?

Yes it works.
If I run,

cmake -DCMAKE_TOOLCHAIN_FILE=
~/Documents/emsdk_portable/emscripten/master/cmake/Modules/Platform/Emscripten.cmake
-G "Unix Makefiles" -DBOOST_ROOT=/home/scott/boost_1_60_0/ ..

or

cmake -DBOOST_ROOT=/home/scott/boost_1_60_0/ ..

and then do 'make', then it works as expected without any warnings..

> Also, boost_thread and boost_filesystem are warning signs that getting this
> stuff to run on emscripten might not be trivial :)

But what is the correct way to link these libs?
Why boost is not being detected, its headers and lib files are not found?
What about the liblog4cxx?

--
Gurjot Singh Bhatti
Website: http://bhattigurjot.com

Gurjot Singh Bhatti

unread,
Mar 18, 2016, 2:14:13 PM3/18/16
to emscripte...@googlegroups.com
On 17 March 2016 at 14:36, Gurjot Singh Bhatti <bhatti...@gmail.com> wrote:
>> Also, boost_thread and boost_filesystem are warning signs that getting this
>> stuff to run on emscripten might not be trivial :)
>
> But what is the correct way to link these libs?
> Why boost is not being detected, its headers and lib files are not found?
> What about the liblog4cxx?

I'm still stuck on this step. If anyone has any idea about this, kindly share.

Floh

unread,
Mar 19, 2016, 5:19:40 AM3/19/16
to emscripten-discuss
Just a wild guess since I didn't try to use boost with emscripten, but:

The boost cmake files might have some sort of platform detection for boost_thread etc, and may be if it is an unknown platform doesn't include those libs in the build process. I'd start with googling around whether others had similar problems with boost and emscripten (or PNaCl, since it's a fairly similar platform) and if that doesn't help start looking into the boost build system files.

Cheers,
-Floh

raytrace

unread,
Mar 29, 2016, 11:43:30 PM3/29/16
to emscripten-discuss
Tried boost filesystem before with Emscripten, it works on my test app.  Emscriptened boost filesystem using https://github.com/tee3/boost-build-emscripten

Thanks,
Reply all
Reply to author
Forward
0 new messages