Skip to content

Commit

Permalink
Build cleanups.
Browse files Browse the repository at this point in the history
* Marks most projects as BACKGROUND_BUILD.
* Changes THEROCK_INTERACTIVE to an env var in order to avoid spurious rebuilds when just wanting to get output.
  • Loading branch information
stellaraccident committed Jan 28, 2025
1 parent 2ffa8c2 commit 4003471
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 4 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ include(therock_job_pools)
################################################################################
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

option(THEROCK_INTERACTIVE "Enable interactive build mode which will cause all sub-project invocations to stream to the console (reducing parallelism)" OFF)
set(THEROCK_BACKGROUND_BUILD_JOBS "0" CACHE STRING "Number of jobs to reserve for projects marked for background building (empty=auto or a number)")

set(THEROCK_PACKAGE_VERSION "git" CACHE STRING "Sets the package version string")
Expand Down
3 changes: 2 additions & 1 deletion cmake/therock_subproject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ function(therock_cmake_subproject_activate target_name)
set(_configure_comment_suffix " (in background)")
set(_terminal_option)
set(_build_terminal_option "USES_TERMINAL")
if(THEROCK_INTERACTIVE)
if("$ENV{THEROCK_INTERACTIVE}")
set(_terminal_option "USES_TERMINAL")
set(_configure_comment_suffix)
elseif(_build_pool)
Expand Down Expand Up @@ -721,6 +721,7 @@ endfunction()
# it ready to use to compile HIP code.
function(_therock_cmake_subproject_setup_toolchain compiler_toolchain toolchain_file)
string(APPEND CMAKE_MESSAGE_INDENT " ")
set(_build_env_pairs "${_build_env_pairs}")
set(_toolchain_contents)

# General settings applicable to all toolchains.
Expand Down
1 change: 1 addition & 0 deletions compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ therock_cmake_subproject_activate(amd-llvm)

therock_cmake_subproject_declare(hipify
EXTERNAL_SOURCE_DIR "hipify"
BACKGROUND_BUILD
INTERFACE_PROGRAM_DIRS
bin
CMAKE_ARGS
Expand Down
3 changes: 3 additions & 0 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

therock_cmake_subproject_declare(ROCR-Runtime
EXTERNAL_SOURCE_DIR "ROCR-Runtime"
BACKGROUND_BUILD
CMAKE_ARGS
"-DBUILD_SHARED_LIBS=ON"
BUILD_DEPS
Expand All @@ -29,6 +30,7 @@ therock_cmake_subproject_activate(ROCR-Runtime)

therock_cmake_subproject_declare(hip-clr
EXTERNAL_SOURCE_DIR "clr"
BACKGROUND_BUILD
CMAKE_ARGS
-DHIP_PLATFORM=amd
"-DHIP_COMMON_DIR=${CMAKE_CURRENT_SOURCE_DIR}/HIP"
Expand Down Expand Up @@ -62,6 +64,7 @@ therock_cmake_subproject_activate(hip-clr)

therock_cmake_subproject_declare(rocminfo
EXTERNAL_SOURCE_DIR "rocminfo"
BACKGROUND_BUILD
RUNTIME_DEPS
ROCR-Runtime
)
Expand Down
5 changes: 5 additions & 0 deletions math-libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cmake_path(APPEND _toolchain_dir lib/llvm)

therock_cmake_subproject_declare(hipBLAS-common
EXTERNAL_SOURCE_DIR "hipBLAS-common"
BACKGROUND_BUILD
CMAKE_ARGS
-DROCM_PATH=
-DROCM_DIR=
Expand Down Expand Up @@ -39,6 +40,7 @@ therock_cmake_subproject_activate(hipBLAS-common)

therock_cmake_subproject_declare(hipBLASLt
EXTERNAL_SOURCE_DIR "hipBLASLt"
BACKGROUND_BUILD
CMAKE_ARGS
-DHIP_PLATFORM=amd
-DROCM_PATH=
Expand Down Expand Up @@ -70,6 +72,7 @@ therock_cmake_subproject_activate(hipBLASLt)

therock_cmake_subproject_declare(rocBLAS
EXTERNAL_SOURCE_DIR "rocBLAS"
BACKGROUND_BUILD
CMAKE_ARGS
-DHIP_PLATFORM=amd
-DROCM_PATH=
Expand Down Expand Up @@ -107,6 +110,7 @@ therock_cmake_subproject_activate(rocBLAS)

therock_cmake_subproject_declare(rocRAND
EXTERNAL_SOURCE_DIR "rocRAND"
BACKGROUND_BUILD
CMAKE_ARGS
-DHIP_PLATFORM=amd
-DROCM_PATH=
Expand All @@ -129,6 +133,7 @@ therock_cmake_subproject_activate(rocRAND)

therock_cmake_subproject_declare(hipBLAS
EXTERNAL_SOURCE_DIR "hipBLAS"
BACKGROUND_BUILD
CMAKE_ARGS
-DHIP_PLATFORM=amd
-DROCM_PATH=
Expand Down
1 change: 1 addition & 0 deletions ml-frameworks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cmake_path(APPEND _toolchain_dir lib/llvm)

therock_cmake_subproject_declare(MIOpen
EXTERNAL_SOURCE_DIR "MIOpen"
BACKGROUND_BUILD
CMAKE_ARGS
-DHIP_PLATFORM=amd
-DROCM_PATH=
Expand Down
1 change: 1 addition & 0 deletions third-party/FunctionalPlus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ therock_subproject_fetch(therock-FunctionalPlus-sources
)

therock_cmake_subproject_declare(therock-FunctionalPlus
BACKGROUND_BUILD
EXCLUDE_FROM_ALL
EXTERNAL_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/source"
)
Expand Down
2 changes: 1 addition & 1 deletion third-party/boost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ therock_subproject_fetch(boost-sources

therock_cmake_subproject_declare(therock-boost
EXTERNAL_SOURCE_DIR "cmake_project"
BACKGROUND_BUILD
CMAKE_ARGS
"-DBOOST_SOURCE_DIR=${_source_dir}"
"-DTHEROCK_INTERACTIVE=${THEROCK_INTERACTIVE}"
"-DTHEROCK_BOOST_LIBRARIES=atomic,filesystem,system"
EXTRA_DEPENDS
"${_download_stamp}"
Expand Down
2 changes: 1 addition & 1 deletion third-party/boost/cmake_project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.18)
project(BOOST_BUILD)

set(_terminal_option)
if(THEROCK_INTERACTIVE)
if("$ENV{THEROCK_INTERACTIVE}")
set(_terminal_option "USES_TERMINAL")
endif()

Expand Down
1 change: 1 addition & 0 deletions third-party/eigen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ therock_subproject_fetch(therock-eigen-sources
)

therock_cmake_subproject_declare(therock-eigen
BACKGROUND_BUILD
EXCLUDE_FROM_ALL
EXTERNAL_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/source"
)
Expand Down
1 change: 1 addition & 0 deletions third-party/frugally-deep/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ therock_subproject_fetch(therock-frugally-deep-sources
)

therock_cmake_subproject_declare(therock-frugally-deep
BACKGROUND_BUILD
EXCLUDE_FROM_ALL
EXTERNAL_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/source"
BUILD_DEPS
Expand Down

0 comments on commit 4003471

Please sign in to comment.