kou commented on a change in pull request #12023:
URL: https://github.com/apache/arrow/pull/12023#discussion_r774192327



##########
File path: ci/scripts/cpp_build.sh
##########
@@ -144,6 +159,8 @@ cmake \
 
 if [ ! -z "${CPP_MAKE_PARALLELISM}" ]; then
   time cmake --build . --target install -- -j${CPP_MAKE_PARALLELISM}
+elif [ "${CMAKE_GENERATOR}" == "Unix Makefiles" ]; then
+  time cmake --build . --target install -- -j$[${n_jobs} + 1]

Review comment:
       We can use the `CMAKE_BUILD_PARALLEL_LEVEL` environment variable instead 
of `--parallel` or `-- -j`: 
https://cmake.org/cmake/help/latest/envvar/CMAKE_BUILD_PARALLEL_LEVEL.html
   
   It works for all CMake generators. If CMake is old to use 
`CMAKE_BUILD_PARALLEL_LEVEL`, the value is just ignored.
   
   ```diff
   diff --git a/.travis.yml b/.travis.yml
   index d0fd316492..11985571d3 100644
   --- a/.travis.yml
   +++ b/.travis.yml
   @@ -102,7 +102,7 @@ jobs:
              -e ARROW_PARQUET=OFF
              -e ARROW_S3=OFF
              -e CMAKE_UNITY_BUILD=ON
   -          -e CPP_MAKE_PARALLELISM=2
   +          -e CMAKE_BUILD_PARALLEL_LEVEL=2
              -e PARQUET_BUILD_EXAMPLES=OFF
              -e PARQUET_BUILD_EXECUTABLES=OFF
              -e Protobuf_SOURCE=BUNDLED
   @@ -154,7 +154,7 @@ jobs:
              -e ARROW_PYTHON=ON
              -e ARROW_S3=OFF
              -e CMAKE_UNITY_BUILD=ON
   -          -e CPP_MAKE_PARALLELISM=2
   +          -e CMAKE_BUILD_PARALLEL_LEVEL=2
              -e PARQUET_BUILD_EXAMPLES=OFF
              -e PARQUET_BUILD_EXECUTABLES=OFF
              -e Protobuf_SOURCE=BUNDLED
   diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh
   index b50675584e..cbc1397da3 100755
   --- a/ci/scripts/cpp_build.sh
   +++ b/ci/scripts/cpp_build.sh
   @@ -157,13 +157,8 @@ cmake \
      ${CMAKE_ARGS} \
      ${source_dir}
    
   -if [ ! -z "${CPP_MAKE_PARALLELISM}" ]; then
   -  time cmake --build . --target install -- -j${CPP_MAKE_PARALLELISM}
   -elif [ "${CMAKE_GENERATOR}" == "Unix Makefiles" ]; then
   -  time cmake --build . --target install -- -j$[${n_jobs} + 1]
   -else
   -  time cmake --build . --target install
   -fi
   +export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-${n_jobs}}
   +time cmake --build . --target install
    
    popd
    
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to