apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
13.9k stars 3.38k forks source link

[Java] Parallel to build JNI C++ code #41867

Open jinchengchenghh opened 1 month ago

jinchengchenghh commented 1 month ago

Describe the enhancement requested

Now we use

<executable>cmake</executable>
<commandlineArgs>--build cpp-jni --target install --config Release</commandlineArgs>

The CI use export CMAKE_BUILD_PARALLEL_LEVEL=NUM_THREAD to accelerate build process. But user may not set this environment. I would prefer to dd -j to commandlineArgs

-j [<jobs>], --parallel [<jobs>]
New in version 3.12.

The maximum number of concurrent processes to use when building. If <jobs> is omitted the native build tool's default number is used.

The [CMAKE_BUILD_PARALLEL_LEVEL](https://cmake.org/cmake/help/latest/envvar/CMAKE_BUILD_PARALLEL_LEVEL.html#envvar:CMAKE_BUILD_PARALLEL_LEVEL) environment variable, if set, specifies a default parallel level when this option is not given.

Some native build tools always build in parallel. The use of <jobs> value of 1 can be used to limit to a single job.

https://cmake.org/cmake/help/latest/manual/cmake.1.html#build-tool-mode

If you think it is possible, I can help to implement it.

Component(s)

Java

vibhatha commented 1 month ago

@jinchengchenghh nice suggestion, happy to see a contribution.