Emscripten fixes

This commit is contained in:
Matthias Hochsteger 2023-09-05 17:13:29 +02:00
parent c7e2a2ea7c
commit fe37f7d0b2
5 changed files with 9 additions and 1 deletions

View File

@ -319,7 +319,7 @@ if (USE_PYTHON)
target_include_directories(netgen_python INTERFACE ${pybind11_INCLUDE_DIR} ${Python3_INCLUDE_DIRS}) target_include_directories(netgen_python INTERFACE ${pybind11_INCLUDE_DIR} ${Python3_INCLUDE_DIRS})
target_include_directories(nglib PRIVATE ${pybind11_INCLUDE_DIR} ${Python3_INCLUDE_DIRS}) target_include_directories(nglib PRIVATE ${pybind11_INCLUDE_DIR} ${Python3_INCLUDE_DIRS})
if(Python3_LIBRARIES) if(Python3_LIBRARIES AND NOT BUILD_FOR_CONDA)
target_link_libraries(netgen_python INTERFACE ${Python3_LIBRARIES}) target_link_libraries(netgen_python INTERFACE ${Python3_LIBRARIES})
endif() endif()

View File

@ -230,10 +230,13 @@ endif(USE_MPI)
####################################################################### #######################################################################
# propagate cmake variables to Netgen subproject # propagate cmake variables to Netgen subproject
set_vars( NETGEN_CMAKE_ARGS set_vars( NETGEN_CMAKE_ARGS
CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS_RELEASE CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE
CMAKE_STRIP
USE_GUI USE_GUI
USE_PYTHON USE_PYTHON

View File

@ -18,6 +18,7 @@ string(REPLACE "|" ";" ng_compile_flags_replace_sep "${NG_COMPILE_FLAGS}")
target_compile_options(ngcore PUBLIC ${ng_compile_flags_replace_sep}) target_compile_options(ngcore PUBLIC ${ng_compile_flags_replace_sep})
if(EMSCRIPTEN) if(EMSCRIPTEN)
set(PYTHON_MODULE_EXTENSION ".so")
target_link_options(ngcore PUBLIC -sALLOW_MEMORY_GROWTH -sENVIRONMENT=web) target_link_options(ngcore PUBLIC -sALLOW_MEMORY_GROWTH -sENVIRONMENT=web)
target_compile_options(ngcore PUBLIC -sNO_DISABLE_EXCEPTION_CATCHING) target_compile_options(ngcore PUBLIC -sNO_DISABLE_EXCEPTION_CATCHING)
endif() endif()

View File

@ -1628,7 +1628,9 @@ namespace netgen
MeshOptimize3d meshopt(mp); MeshOptimize3d meshopt(mp);
tempmesh.Compress(); tempmesh.Compress();
tempmesh.FindOpenElements (); tempmesh.FindOpenElements ();
#ifndef EMSCRIPTEN
RegionTaskManager rtm(mp.parallel_meshing ? mp.nthreads : 0); RegionTaskManager rtm(mp.parallel_meshing ? mp.nthreads : 0);
#endif // EMSCRIPTEN
for (auto i : Range(10)) for (auto i : Range(10))
{ {
PrintMessage (5, "Num open: ", tempmesh.GetNOpenElements()); PrintMessage (5, "Num open: ", tempmesh.GetNOpenElements());

View File

@ -631,7 +631,9 @@ namespace netgen
// const CSGeometry * geometry) // const CSGeometry * geometry)
{ {
static Timer t("OptimizeVolume"); RegionTimer reg(t); static Timer t("OptimizeVolume"); RegionTimer reg(t);
#ifndef EMSCRIPTEN
RegionTaskManager rtm(mp.parallel_meshing ? mp.nthreads : 0); RegionTaskManager rtm(mp.parallel_meshing ? mp.nthreads : 0);
#endif // EMSCRIPTEN
const char* savetask = multithread.task; const char* savetask = multithread.task;
multithread.task = "Optimize Volume"; multithread.task = "Optimize Volume";