In install Openmc in Docker container with webassembly. my Dockerfile:
FROM emscripten/emsdk:3.1.48
RUN git clone --recurse-submodules GitHub - openmc-dev/openmc: OpenMC Monte Carlo Code
RUN mkdir openmc/build
RUN apt-get update -y && apt install g++ cmake libhdf5-dev libpng-dev mpich libmpich-dev libhdf5-serial-dev libhdf5-mpich-dev -y
WORKDIR openmc
ENV CMAKE_TOOLCHAIN_FILE=/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
WORKDIR build
RUN emcmake cmake …
RUN make -j
when i run make -j command i get this error:
137.0 cache:INFO: generating system asset: symbol_lists/7125293634da23c080eed4b1d5f0b4afeaf4f0f3.json… (this will be cached in “/emsdk/upstream/emscripten/cache/symbol_lists/7125293634da23c080eed4b1d5f0b4afeaf4f0f3.json” for subsequent builds)
137.4 cache:INFO: - ok
137.6 wasm-ld: error: unable to find library -lhdf5
137.6 wasm-ld: error: unable to find library -lcrypto
137.6 wasm-ld: error: unable to find library -lcurl
137.6 wasm-ld: error: unable to find library -lsz
137.6 wasm-ld: error: unable to find library -lz
137.6 wasm-ld: error: unable to find library -lhdf5_hl
137.6 wasm-ld: error: unable to find library -lhdf5
137.6 wasm-ld: error: unable to find library -lhdf5
137.6 wasm-ld: error: unable to find library -lcrypto
137.6 wasm-ld: error: unable to find library -lcurl
137.6 wasm-ld: error: unable to find library -lsz
137.6 wasm-ld: error: unable to find library -lz
137.6 wasm-ld: error: unable to find library -lhdf5_hl
137.6 wasm-ld: error: unable to find library -lcrypto
137.6 wasm-ld: error: unable to find library -lcurl
137.6 wasm-ld: error: unable to find library -lsz
137.6 wasm-ld: error: unable to find library -lz
137.6 wasm-ld: error: unable to find library -lhdf5_hl
137.6 em++: error: ‘/emsdk/upstream/bin/wasm-ld -o …/…/bin/test_distribution.wasm CMakeFiles/test_distribution.dir/test_distribution.cpp.o …/…/lib/libCatch2Main.a …/…/lib/libopenmc.a …/…/lib/libCatch2.a -lhdf5 -lcrypto -lcurl -lsz -lz -lhdf5_hl …/…/lib/libfmt.a …/…/lib/libpugixml.a -L/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten -lGL -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc+±noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr /tmp/tmpn4bqiyb3libemscripten_js_symbols.so --export-if-defined=main --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=__main_argc_argv --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=__get_temp_ret --export=__set_temp_ret --export=__wasm_call_ctors --export-table -z stack-size=65536 --initial-memory=16777216 --max-memory=16777216 --no-entry --table-base=1 --global-base=1024’ failed (returned 1)
137.6 em++: error: ‘/emsdk/upstream/bin/wasm-ld -o bin/openmc.wasm CMakeFiles/openmc.dir/src/main.cpp.o lib/libopenmc.a -lhdf5 -lcrypto -lcurl -lsz -lz -lhdf5_hl lib/libfmt.a lib/libpugixml.a -L/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten -lGL -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc+±noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr /tmp/tmpjljf66r3libemscripten_js_symbols.so --export-if-defined=main --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=__main_argc_argv --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=__get_temp_ret --export=__set_temp_ret --export=__wasm_call_ctors --export-table -z stack-size=65536 --initial-memory=16777216 --max-memory=16777216 --no-entry --table-base=1 --global-base=1024’ failed (returned 1)
137.6 em++: error: ‘/emsdk/upstream/bin/wasm-ld -o …/…/bin/test_file_utils.wasm CMakeFiles/test_file_utils.dir/test_file_utils.cpp.o …/…/lib/libCatch2Main.a …/…/lib/libopenmc.a …/…/lib/libCatch2.a -lhdf5 -lcrypto -lcurl -lsz -lz -lhdf5_hl …/…/lib/libfmt.a …/…/lib/libpugixml.a -L/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten -lGL -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc+±noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr /tmp/tmpwjn8_udulibemscripten_js_symbols.so --export-if-defined=main --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=__main_argc_argv --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=__get_temp_ret --export=__set_temp_ret --export=__wasm_call_ctors --export-table -z stack-size=65536 --initial-memory=16777216 --max-memory=16777216 --no-entry --table-base=1 --global-base=1024’ failed (returned 1)
137.6 make[2]: *** [tests/cpp_unit_tests/CMakeFiles/test_distribution.dir/build.make:105: bin/test_distribution.js] Error 1
137.6 make[1]: *** [CMakeFiles/Makefile2:1206: tests/cpp_unit_tests/CMakeFiles/test_distribution.dir/all] Error 2
137.6 make[2]: *** [CMakeFiles/openmc.dir/build.make:103: bin/openmc.js] Error 1
137.6 make[2]: *** [tests/cpp_unit_tests/CMakeFiles/test_file_utils.dir/build.make:105: bin/test_file_utils.js] Error 1
137.6 make[1]: *** Waiting for unfinished jobs…
137.6 make[1]: *** [CMakeFiles/Makefile2:292: CMakeFiles/openmc.dir/all] Error 2
137.6 make[1]: *** [CMakeFiles/Makefile2:1236: tests/cpp_unit_tests/CMakeFiles/test_file_utils.dir/all] Error 2
137.8 [100%] Linking CXX executable …/…/bin/test_tally.js
137.9 wasm-ld: error: unable to find library -lhdf5
137.9 wasm-ld: error: unable to find library -lcrypto
137.9 wasm-ld: error: unable to find library -lcurl
137.9 wasm-ld: error: unable to find library -lsz
137.9 wasm-ld: error: unable to find library -lz
137.9 wasm-ld: error: unable to find library -lhdf5_hl
137.9 em++: error: ‘/emsdk/upstream/bin/wasm-ld -o …/…/bin/test_tally.wasm CMakeFiles/test_tally.dir/test_tally.cpp.o …/…/lib/libCatch2Main.a …/…/lib/libopenmc.a …/…/lib/libCatch2.a -lhdf5 -lcrypto -lcurl -lsz -lz -lhdf5_hl …/…/lib/libfmt.a …/…/lib/libpugixml.a -L/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten -lGL -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc+±noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr /tmp/tmpfpq_sh2clibemscripten_js_symbols.so --export-if-defined=main --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=__main_argc_argv --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=__get_temp_ret --export=__set_temp_ret --export=__wasm_call_ctors --export-table -z stack-size=65536 --initial-memory=16777216 --max-memory=16777216 --no-entry --table-base=1 --global-base=1024’ failed (returned 1)
137.9 make[2]: *** [tests/cpp_unit_tests/CMakeFiles/test_tally.dir/build.make:105: bin/test_tally.js] Error 1
137.9 make[1]: *** [CMakeFiles/Makefile2:1266: tests/cpp_unit_tests/CMakeFiles/test_tally.dir/all] Error 2
137.9 make: *** [Makefile:146: all] Error 2
Dockerfile:13
11 | WORKDIR build
12 | RUN emcmake cmake …
13 | >>> RUN make -j
ERROR: failed to solve: process “/bin/sh -c make -j” did not complete successfully: exit code: 2