Merge branch 'emscripten' into 'master'

Emscripten

See merge request ngsolve/netgen!603
This commit is contained in:
Hochsteger, Matthias 2023-09-05 17:34:16 +02:00
commit ef93b7c145
6 changed files with 11 additions and 3 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(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})
endif()

View File

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

View File

@ -24,8 +24,8 @@ if(status AND NOT status EQUAL 0)
string(REGEX REPLACE "^netgen(.*)" "\\1" git_version_string "${git_version_string}")
endif()
else()
MESSAGE(WARNING "Could not determine git-version from source code - assuming 6.2.0.0")
set(git_version_string "v6.2.0.0")
MESSAGE(WARNING "Could not determine git-version from source code - assuming 6.2.0-0")
set(git_version_string "v6.2.0-0")
endif()
endif()
string(STRIP ${git_version_string} git_version_string)

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})
if(EMSCRIPTEN)
set(PYTHON_MODULE_EXTENSION ".so")
target_link_options(ngcore PUBLIC -sALLOW_MEMORY_GROWTH -sENVIRONMENT=web)
target_compile_options(ngcore PUBLIC -sNO_DISABLE_EXCEPTION_CATCHING)
endif()

View File

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

View File

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