Build instructions for SSE + Emscripten.
MathGeoLib at http://clb.demon.fi/MathGeoLib/nightly/ is now worked to build with Emscripten juj/sse1 branch from https://github.com/juj/emscripten/tree/sse1 . It can be used to unit test and benchmark SSE support in Emscripten. A quick setup guide:
Setting up MathGeoLib:
- Set up Emscripten e.g. via emsdk and use the branch https://github.com/juj/emscripten/tree/sse1
git clone https://github.com/juj/MathGeoLib.git
Build structure follows traditional CMake out-of-source builds, so to configure different build types, do the following in MathGeoLib root directory:
mkdir new_directory_for_my_buildcd new_directory_for_my_buildcmake <options> ..
Where the cmake configure line with <options> is:
-
Build for native benchmark runs with SSE1 support (no SSE2 or newer, replace with
-DMATH_SSE2=1or e.g.-DMATH_AVX=1for that):cmake -DMATH_TESTS_EXECUTABLE=1 -DMATH_SSE=1 -DCMAKE_BUILD_TYPE=Release .. -
Build for native debug runs with SSE1 support:
cmake -DMATH_TESTS_EXECUTABLE=1 -DMATH_SSE=1 -DCMAKE_BUILD_TYPE=Debug -DFAIL_USING_EXCEPTIONS=1 ..
To build with Emscripten, set up Emscripten first, e.g. via the Emscripten SDK, and have your Emscripten tools set up in PATH (source emsdk_env.sh/.bat in your shell if using emsdk), and then
-
Build for Emscripten benchmark runs with SSE1 support:
emcmake cmake -DMATH_TESTS_EXECUTABLE=1 -DMATH_SSE=1 -DCMAKE_BUILD_TYPE=Release .. -
Build for Emscripten debug runs with SSE1 support:
emcmake cmake -DMATH_TESTS_EXECUTABLE=1 -DMATH_SSE=1 -DCMAKE_BUILD_TYPE=Debug -DFAIL_USING_EXCEPTIONS=1 ..
To build and run the output, do in native:
make/mingw32-make/msbuild/xcodebuilddepending on your OS and target IDE- Run
./MathGeoLib
and in Emscripten:
make/mingw32-makedepending on your OS- run generated
MathGeoLib.htmlor if you want to run in shell, then the fileMathGeoLib.js
(TODO: incorporate these into the main docs)