fix: Fix build errors with GCC 15 and optimize third-party library build time #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: close #xxx
This PR fixes build errors encountered with GCC 15 compiler and optimizes build time by disabling unnecessary components (tests, examples, tools) in third-party libraries.
Build Fixes:
LZ4_BUILD_CLI=OFF,LZ4_BUILD_LEGACY_LZ4C=OFF) to avoidpthread_sigmasklinking errorsFMT_TEST=OFF,FMT_DOC=OFF) to avoidpthread_sigmasklinking errors-include cstdintcompiler flag to fixint64_tundefined errors with GCC 15's stricter C++ standard implementationBuild Optimizations:
4. zstd: Disable command-line programs (
ZSTD_BUILD_PROGRAMS=OFF) to reduce build time5. arrow: Disable tests, benchmarks, and examples (
ARROW_BUILD_TESTS=OFF,ARROW_BUILD_BENCHMARKS=OFF,ARROW_BUILD_EXAMPLES=OFF) to reduce build timeTests
API and Format
No API changes. This PR only affects the build configuration of third-party dependencies.
Documentation
No new features. This is a build system fix and optimization.
Detailed Changes
1. lz4 Build Configuration (
build_lz4macro)Problem: Building lz4 CLI tools failed with
pthread_sigmaskundefined symbol error.Solution: Added
-DLZ4_BUILD_CLI=OFF -DLZ4_BUILD_LEGACY_LZ4C=OFFto disable both CLI tools since only the static library is needed.Impact: Eliminates linking errors and reduces build time.
2. fmt Build Configuration (
build_fmtmacro)Problem: Building fmt tests failed with
pthread_sigmaskundefined symbol error.Solution: Added
-DFMT_TEST=OFF -DFMT_DOC=OFFto disable tests and documentation generation.Impact: Eliminates linking errors and reduces build time.
3. thrift Build Fix (via arrow configuration)
Problem: thrift's
Mutex.hmissing#include <cstdint>causedint64_tundefined errors with GCC 15's stricter C++ standard implementation (known issue THRIFT-5842).Solution: Added
-include cstdintcompiler flag toARROW_CMAKE_CXX_FLAGSto automatically include<cstdint>for all C++ files during arrow/thrift build.Impact: Fixes compilation errors without modifying third-party source code. This is a cleaner solution than patching source files.
4. zstd Build Optimization (
build_zstdmacro)Purpose: Reduce build time by disabling unnecessary command-line programs.
Change: Added
-DZSTD_BUILD_PROGRAMS=OFFto disable zstd CLI tools.Impact: Faster builds since only the static library is needed.
5. arrow Build Optimization (
build_arrowmacro)Purpose: Reduce build time by disabling tests, benchmarks, and examples.
Change: Added
-DARROW_BUILD_TESTS=OFF -DARROW_BUILD_BENCHMARKS=OFF -DARROW_BUILD_EXAMPLES=OFF.Impact: Significantly faster arrow builds, especially important since arrow is one of the largest dependencies.