Skip to content
Snippets Groups Projects
Commit 3fe85836 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

adjust memory for gcc on all 32 bit systems

parent 2dadd9c2
No related branches found
No related tags found
No related merge requests found
...@@ -139,10 +139,7 @@ set(GMSH_API api/gmsh.h api/gmshc.h api/gmsh.h_cwrap) ...@@ -139,10 +139,7 @@ set(GMSH_API api/gmsh.h api/gmshc.h api/gmsh.h_cwrap)
if(ENABLE_PRIVATE_API) if(ENABLE_PRIVATE_API)
message(WARNING "The private API is unsupported and undocumented. It is meant " message(WARNING "The private API is unsupported and undocumented. It is meant "
"for expert Gmsh developers, not for regular Gmsh users, who should rely " "for expert Gmsh developers, not for regular Gmsh users, who should rely "
"on the stable public API (gmsh/api) instead. If you are repackaging Gmsh, " "on the stable public API (gmsh/api) instead.")
"e.g. for a Linux distribution, please DO NOT distribute the private API "
"(i.e. all the internal headers) and ship the stable public API instead "
"(i.e. only the headers and modules in gmsh/api).")
file(GLOB_RECURSE HEADERS Common/*.h Numeric/*.h Geo/*.h Mesh/*.h Solver/*.h file(GLOB_RECURSE HEADERS Common/*.h Numeric/*.h Geo/*.h Mesh/*.h Solver/*.h
Post/*.h Plugin/*.h Graphics/*.h contrib/kbipack/*.h Post/*.h Plugin/*.h Graphics/*.h contrib/kbipack/*.h
contrib/DiscreteIntegration/*.h contrib/HighOrderMeshOptimizer/*.h contrib/DiscreteIntegration/*.h contrib/HighOrderMeshOptimizer/*.h
...@@ -308,6 +305,12 @@ if(MSVC) ...@@ -308,6 +305,12 @@ if(MSVC)
endif() endif()
endif() endif()
# reduce memory usage of GCC on 32 bit systems
if(NOT HAVE_64BIT_SIZE_T AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} --param ggc-min-expand=1 --param ggc-min-heapsize=1000000")
endif()
if(ENABLE_OPENMP) if(ENABLE_OPENMP)
find_package(OpenMP) find_package(OpenMP)
if(OpenMP_FOUND OR OPENMP_FOUND) if(OpenMP_FOUND OR OPENMP_FOUND)
...@@ -1209,13 +1212,16 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt AND ENABLE_HXT) ...@@ -1209,13 +1212,16 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt AND ENABLE_HXT)
set_config_option(HAVE_HXT "Hxt") set_config_option(HAVE_HXT "Hxt")
# do not use arithmetic contraction in predicates.c # do not use arithmetic contraction in predicates.c
if(MSVC OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND WIN32)) if(MSVC OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND WIN32))
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c" set_source_files_properties(
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c"
PROPERTIES COMPILE_FLAGS "/fp:strict") PROPERTIES COMPILE_FLAGS "/fp:strict")
elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel") elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel")
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c" set_source_files_properties(
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c"
PROPERTIES COMPILE_FLAGS "-fp-model strict") PROPERTIES COMPILE_FLAGS "-fp-model strict")
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") elseif(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c" set_source_files_properties(
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/hxt/predicates/src/predicates.c"
PROPERTIES COMPILE_FLAGS "-fno-unsafe-math-optimizations -ffp-contract=off") PROPERTIES COMPILE_FLAGS "-fno-unsafe-math-optimizations -ffp-contract=off")
else() else()
message(WARNING message(WARNING
...@@ -1614,7 +1620,7 @@ if(NOT ENABLE_BUILD_DYNAMIC AND NOT ENABLE_BUILD_SHARED) ...@@ -1614,7 +1620,7 @@ if(NOT ENABLE_BUILD_DYNAMIC AND NOT ENABLE_BUILD_SHARED)
endif() endif()
endif() endif()
# Linux-specific options # Linux-specific linker options
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(HAVE_OCC) if(HAVE_OCC)
find_library(RT_LIB rt) find_library(RT_LIB rt)
...@@ -1625,11 +1631,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ...@@ -1625,11 +1631,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Intel") if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Intel")
add_definitions(-fPIC) add_definitions(-fPIC)
endif() endif()
if(NOT HAVE_64BIT_SIZE_T)
# reduce gcc memory usage on 32 bit machines
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} --param ggc-min-expand=1 --param ggc-min-heapsize=32768")
endif()
endif() endif()
# we could specify include dirs more selectively, but this is simpler # we could specify include dirs more selectively, but this is simpler
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment