hi everyone, 

I am new to emscripten, but with some reading and testing, I was able to 
compile my Monte Carlo photon transport code (http://mcx.space) to wasm. 

here is my project 

https://github.com/fangq/mmc

to try the compilation, you can use the simple commands below:

git clone https://github.com/fangq/mmc.git
cd mmc/src
make web


this compiles my software and generate the output in src/webmmc folder. 
However, this only works for single-threaded computation. When I changed 
this line (#108 in mmc/common/Makefile_common.mk)

https://github.com/fangq/mmc/blob/master/commons/Makefile_common.mk#L108

from "web: release" to "web: omp" to enable multithreading via openmp, and 
recompile, emcc gave me the following warning at the linking stage

emcc  -fopenmp  -o bin/mmc built/posix_randr.o built/simpmesh.o 
built/tettracing.o built/mcx_utils.o built/tictoc.o built/mmc.o 
built/mmc_host.o built/cjson/cJSON.o  -s WASM=1 -s 
EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' -s FORCE_FILESYSTEM=1 -o 
webmmc/webmmc.html
warning: unresolved symbol: __atomic_compare_exchange
warning: unresolved symbol: __atomic_load
warning: unresolved symbol: __kmpc_barrier
warning: unresolved symbol: __kmpc_critical
warning: unresolved symbol: __kmpc_end_critical
warning: unresolved symbol: __kmpc_end_reduce
warning: unresolved symbol: __kmpc_for_static_fini
warning: unresolved symbol: __kmpc_for_static_init_4u
warning: unresolved symbol: __kmpc_fork_call
warning: unresolved symbol: __kmpc_global_thread_num
warning: unresolved symbol: __kmpc_reduce
warning: unresolved symbol: omp_get_thread_num
warning: unresolved symbol: omp_set_num_threads


and generated binary gave me an error in the browser. 

Also, if I tried to enable SSE in my code by replacing the above mentioned 
line#108 in the Makefile_common.mk to "web: ssemath", I got the following 
error

.../emsdk/emscripten/1.38.11/system/include/SSE/emmintrin.h:49:2: error: 
"SSE2 instruction set not enabled"
#error "SSE2 instruction set not enabled"


I am wondering if someone has experience enabling OpenMP or SSE support 
with emscripten? 

In an even more ambitious attempt, I would be thrilled if I can port my 
OpenCL version of the code (https://github.com/fangq/mcxcl) to the web. I 
am wondering if there is any experimental support for OpenCL? or if there 
is a roadmap for that?

thank you very much

Qianqian

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to