Skip to content

Commit 4b54027

Browse files
committed
circleci: Attempt to fix "Cannot allocate memory" when building CMake
This commit attempts to fix the following error by limiting the number of parallel build and link jobs. [...] cmcompress -I/work/src/Source/CTest -I/work/src/Source/CPack -O3 -DNDEBUG -std=gnu++17 -MD -MT Source/CMakeFiles/CMakeLib.dir/cmLocalGenerator.cxx.o -MF Source/CMakeFiles/CMakeLib.dir/cmLocalGenerator.cxx.o.d -o Source/CMakeFiles/CMakeLib.dir/cmLocalGenerator.cxx.o -c /work/src/Source/cmLocalGenerator.cxx /work/src/Source/cmLocalGenerator.cxx:2901:1: fatal error: error writing to /tmp/ccLGyPoR.s: Cannot allocate memory } ^ compilation terminated.
1 parent 588f4e9 commit 4b54027

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CMakeLists.txt

+13
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,19 @@ if(CMakePythonDistributions_SUPERBUILD)
169169
)
170170
message(STATUS "SuperBuild - CMakeProject-build - OPENSSL_ROOT_DIR: ${OPENSSL_ROOT_DIR}")
171171
endif()
172+
foreach(var_name IN ITEMS
173+
CMAKE_BUILD_PARALLEL_LEVEL
174+
CMAKE_JOB_POOLS
175+
CMAKE_JOB_POOL_COMPILE
176+
CMAKE_JOB_POOL_LINK
177+
)
178+
if(DEFINED ${var_name})
179+
list(APPEND _cmake_cache_args
180+
-D${var_name}:STRING=${${var_name}}
181+
)
182+
message(STATUS "SuperBuild - CMakeProject-build - ${var_name}: ${${var_name}}")
183+
endif()
184+
endforeach()
172185

173186
ExternalProject_add(CMakeProject-build
174187
SOURCE_DIR ${CMakeProject_SOURCE_DIR}

scikit-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ before_install:
1111
circle:
1212
environment:
1313
PATH: /opt/python/$<MANYLINUX_PYTHON>/bin:$<PATH>
14-
SETUP_CMAKE_ARGS: -DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl
14+
SETUP_CMAKE_ARGS: -DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl '-DCMAKE_JOB_POOLS:STRING=compile=4;link=3' -DCMAKE_JOB_POOL_COMPILE:STRING=compile -DCMAKE_JOB_POOL_LINK:STRING=link
1515

1616
travis:
1717
osx:

0 commit comments

Comments
 (0)