Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build instructions for SSE + Emscripten. #36

Open
juj opened this issue Nov 21, 2014 · 0 comments
Open

Build instructions for SSE + Emscripten. #36

juj opened this issue Nov 21, 2014 · 0 comments

Comments

@juj
Copy link
Owner

juj commented Nov 21, 2014

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:

  1. Set up Emscripten e.g. via emsdk and use the branch https://github.com/juj/emscripten/tree/sse1
  2. 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:

  1. mkdir new_directory_for_my_build
  2. cd new_directory_for_my_build
  3. cmake <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=1 or e.g. -DMATH_AVX=1 for 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:

  1. make/mingw32-make/msbuild/xcodebuild depending on your OS and target IDE
  2. Run ./MathGeoLib

and in Emscripten:

  1. make/mingw32-make depending on your OS
  2. run generated MathGeoLib.html or if you want to run in shell, then the file MathGeoLib.js

(TODO: incorporate these into the main docs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant