[prev in list] [next in list] [prev in thread] [next in thread] 

List:       crux
Subject:    [PATCH] document parallelism configuration for cmake and ctest
From:       Liu Yubao <yubao.liu () gmail ! com>
Date:       2023-03-21 11:36:06
Message-ID: CAO--oKhpgWrkZ4exWc6xZ5pwREvF_ew6Xnp=02m+iWq=yH+SqA () mail ! gmail ! com
[Download RAW message or body]

Building llvm and clang often get OOM killed because they use ninja which
doesn't respect MAKEFLAGS.

The two new environment variables benefit all CMake/Ninja based packages,
I also committed a patch[1] to Venom Linux to automatically adjust parallel jobs
for llvm and clang packages, it's very easy to port to ports/opt.git.

[1] https://github.com/venomlinux/ports/pull/4287

---
 pkgmk.conf      |  2 ++
 pkgmk.conf.5.in | 10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/pkgmk.conf b/pkgmk.conf
index e6a8abc8..5063e77e 100644
--- a/pkgmk.conf
+++ b/pkgmk.conf
@@ -7,6 +7,8 @@ export CXXFLAGS="${CFLAGS}"

 # export JOBS=$(nproc)
 # export MAKEFLAGS="-j $JOBS"
+# export CMAKE_BUILD_PARALLEL_LEVEL=$JOBS
+# export CTEST_PARALLEL_LEVEL=$JOBS

 case ${PKGMK_ARCH} in
        "64"|"")
diff --git a/pkgmk.conf.5.in b/pkgmk.conf.5.in
index 3e054362..bd9c099f 100644
--- a/pkgmk.conf.5.in
+++ b/pkgmk.conf.5.in
@@ -29,6 +29,16 @@ Set make options.
 .br
 Default: none
 .TP
+\fBexport CMAKE_BUILD_PARALLEL_LEVEL='NUMBER'\fP
+Set Specifies the maximum number of concurrent processes to use when
building using the cmake --build command line Build Tool Mode.
+.br
+Default: none
+.TP
+\fBexport CTEST_PARALLEL_LEVEL='NUMBER'\fP
+Set Specify the number of tests for CTest to run in parallel.
+.br
+Default: none
+.TP
 \fBPKGMK_SOURCE_MIRRORS=('STRING')\fP
 Set mirrors to check and download source archives from.
 .br
-- 
2.39.2
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
https://lists.crux.nu/mailman/listinfo/crux
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic