Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build system fixes #130

Merged
merged 12 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ services:
- *usr_share_icons
environment:
<<: *common_environment_variables
# Build for CUDA architecture sm_72
CUDAARCHS: "72-real"
JOBS: 2
# Build SASS and PTX for CUDA architecture sm_72
CUDAARCHS: "${CUDAARCHS:-72-real}"
PARALLEL_LEVEL: "${PARALLEL_LEVEL:-2}"
cap_add:
- SYS_ADMIN
- SYS_PTRACE
14 changes: 9 additions & 5 deletions modules/core/bin/cmake-js/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,27 @@ done
if [[ "$debug" == "false" ]]; then
args="${args:+$args }-O build/Release";
compile_commands_json="build/Release/compile_commands.json";
args="${args:+$args }--CDCMAKE_LIBRARY_OUTPUT_DIRECTORY=$(realpath -m build/Release)";
else
args="${args:+$args }-D -O build/Debug";
compile_commands_json="build/Debug/compile_commands.json";
args="${args:+$args }--CDCMAKE_LIBRARY_OUTPUT_DIRECTORY=$(realpath -m build/Debug)";
fi

RAPIDS_CORE_PATH=$(dirname $(realpath "$0"))
RAPIDS_CORE_PATH=$(realpath "$RAPIDS_CORE_PATH/../../")
RAPIDS_MODULES_PATH=$(realpath "$RAPIDS_CORE_PATH/../")

if [ -z ${JOBS:+x} ]; then
JOBS=$(node -e "console.log(require('os').cpus().length-2)");
fi
echo "\
=====================================================
PARALLEL_LEVEL=${PARALLEL_LEVEL:-1}
====================================================="

PARALLEL_LEVEL=$JOBS CMAKE_BUILD_PARALLEL_LEVEL=$JOBS \
PARALLEL_LEVEL=${PARALLEL_LEVEL:-1} \
CMAKE_BUILD_PARALLEL_LEVEL=${PARALLEL_LEVEL:-1} \
CCACHE_CONFIGPATH="$RAPIDS_MODULES_PATH/.cache/ccache" \
HOME="$RAPIDS_CORE_PATH" \
cmake-js $args
cmake-js ${args}

ln -f -s $compile_commands_json compile_commands.json

Expand Down
53 changes: 23 additions & 30 deletions modules/core/bin/exec.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,34 @@
#!/usr/bin/env node

var Path = require('path');
var binp = Path.join(__dirname, '../', 'node_modules', '.bin');
var opts = {
module.exports = function (cmd, args, env = {}) {

require('dotenv').config();

var Path = require('path');
var env_ = Object.assign({}, process.env, env);
var binp = Path.join(__dirname, '../', 'node_modules', '.bin');
var opts = {
shell: true,
stdio: 'inherit',
cwd: process.cwd(),
env: Object.assign({}, process.env, {
PATH: `${process.env.PATH}:${binp}` })
};

module.exports = function(cmd, args) {

var name = (() => {
switch (require('os').platform()) {
case 'win32':
return 'windows.sh'
default:
return 'linux.sh'
}
})();

var proc = require('child_process').spawn(
Path.join(__dirname, cmd, name), args, opts);
env: Object.assign({}, env_, {
PATH: `${env_.PATH}:${binp}`
})
};

['SIGTERM', 'SIGINT', 'SIGBREAK', 'SIGHUP'].forEach((signal) => {
process.on(signal, () => proc.kill(signal))
});
var name = (() => {
switch (require('os').platform()) {
case 'win32':
return 'windows.sh'
default:
return 'linux.sh'
}
})();

proc.on('exit', (code, signal) => {
// exit code could be null when OS kills the process(out of memory, etc) or
// due to node handling it but if the signal is SIGINT the user exited the
// process so we want exit code 0
process.exit(code === null ? signal === 'SIGINT' ? 0 : 1 : code);
});
return require('child_process').spawnSync(
Path.join(__dirname, cmd, name), args, opts);
}

if (require.main === module) {
module.exports(process.argv[2], process.argv.slice(3));
module.exports(process.argv[2], process.argv.slice(3));
}
16 changes: 12 additions & 4 deletions modules/core/cmake/Modules/ConfigureCUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ if(DEFINED ENV{CUDAARCHS})
if("$ENV{CUDAARCHS}" STREQUAL "")
# If CUDAARCHS is <empty_string>, auto-detect current GPU arch
set(NODE_RAPIDS_CMAKE_BUILD_FOR_DETECTED_ARCHS TRUE)
message(STATUS "Auto-detecting GPU architecture because the CUDAARCH environment variable = '")
message(STATUS "Auto-detecting GPU architecture because the CUDAARCHS environment variable = '")
elseif("$ENV{CUDAARCHS}" STREQUAL "ALL")
# If CUDAARCHS is "ALL," build for all supported archs
set(NODE_RAPIDS_CMAKE_BUILD_FOR_ALL_CUDA_ARCHS TRUE)
message(STATUS "Building all supported GPU architectures because the CUDAARCH environment variable = 'ALL'")
message(STATUS "Building all supported GPU architectures because the CUDAARCHS environment variable = 'ALL'")
else()
# Use the current value of the CUDAARCHS env var
set(CMAKE_CUDA_ARCHITECTURES "$ENV{CUDAARCHS}")
message(STATUS "Using GPU architectures from CUDAARCH env var: $ENV{CUDAARCHS}")
message(STATUS "Using GPU architectures from CUDAARCHS env var: $ENV{CUDAARCHS}")
endif()
elseif(DEFINED CMAKE_CUDA_ARCHITECTURES)
if(CMAKE_CUDA_ARCHITECTURES STREQUAL "")
Expand All @@ -54,7 +54,7 @@ elseif(DEFINED CMAKE_CUDA_ARCHITECTURES)
else()
# Fall-back to auto-detecting the current GPU architecture
set(NODE_RAPIDS_CMAKE_BUILD_FOR_DETECTED_ARCHS TRUE)
message(STATUS "Auto-detecting GPU architectures because CUDAARCH env var is not defined, and CMAKE_CUDA_ARCHITECTURES was not specified.")
message(STATUS "Auto-detecting GPU architectures because CUDAARCHS env var is not defined, and CMAKE_CUDA_ARCHITECTURES was not specified.")
endif()

# Build the list of supported architectures
Expand Down Expand Up @@ -118,6 +118,14 @@ message(STATUS "BUILD_FOR_DETECTED_ARCHS: ${NODE_RAPIDS_CMAKE_BUILD_FOR_DETECTED
message(STATUS "BUILD_FOR_ALL_CUDA_ARCHS: ${NODE_RAPIDS_CMAKE_BUILD_FOR_ALL_CUDA_ARCHS}")
message(STATUS "CMAKE_CUDA_ARCHITECTURES: ${CMAKE_CUDA_ARCHITECTURES}")

if (NOT "${CMAKE_CUDA_ARCHITECTURES}" STREQUAL "75-real")
message(FATAL_ERROR "Expected CMAKE_CUDA_ARCHITECTURES to equal 75-real. Got ${CMAKE_CUDA_ARCHITECTURES}")
endif()

# Unset this first
# unset(CMAKE_CUDA_ARCHITECTURES CACHE)
set(CMAKE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}" CACHE STRING "" FORCE)

# Enable the CUDA language
enable_language(CUDA)

Expand Down
13 changes: 11 additions & 2 deletions modules/core/cmake/Modules/ConfigureCUDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,21 @@ function(find_and_configure_cudf VERSION)
OUTPUT_VARIABLE NODE_RAPIDS_CPM_SOURCE_CACHE
OUTPUT_STRIP_TRAILING_WHITESPACE)

# Have to set these in case configure and build steps are run separately
# TODO: figure out why
set(BUILD_TESTS OFF)
set(BUILD_BENCHMARKS OFF)
set(JITIFY_USE_CACHE ON)
set(CUDA_STATIC_RUNTIME ON)
set(CUDF_USE_ARROW_STATIC ON)
set(PER_THREAD_DEFAULT_STREAM ON)
set(DISABLE_DEPRECATION_WARNING ${DISABLE_DEPRECATION_WARNINGS})
set(CUDF_GENERATED_INCLUDE_DIR ${NODE_RAPIDS_CPM_SOURCE_CACHE}/cudf-build)

CPMAddPackage(NAME cudf
CPMFindPackage(NAME cudf
VERSION ${VERSION}
GIT_REPOSITORY https://github.com/trxcllnt/cudf.git
GIT_TAG fix/async-set-value-literal
GIT_TAG nr/03232021
GIT_SHALLOW TRUE
SOURCE_SUBDIR cpp
OPTIONS "BUILD_TESTS OFF"
Expand Down
13 changes: 11 additions & 2 deletions modules/core/cmake/Modules/ConfigureCUSPATIAL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,25 @@ function(find_and_configure_cuspatial VERSION)
OUTPUT_VARIABLE NODE_RAPIDS_CPM_SOURCE_CACHE
OUTPUT_STRIP_TRAILING_WHITESPACE)

# Have to set these in case configure and build steps are run separately
# TODO: figure out why
set(BUILD_TESTS OFF)
set(BUILD_BENCHMARKS OFF)
set(JITIFY_USE_CACHE ON)
set(CUDA_STATIC_RUNTIME ON)
set(CUDF_USE_ARROW_STATIC ON)
set(PER_THREAD_DEFAULT_STREAM ON)
set(DISABLE_DEPRECATION_WARNING ${DISABLE_DEPRECATION_WARNINGS})
set(CUDF_GENERATED_INCLUDE_DIR ${NODE_RAPIDS_CPM_SOURCE_CACHE}/cudf-build)

CPMAddPackage(NAME cuspatial
CPMFindPackage(NAME cuspatial
VERSION ${VERSION}
# GIT_REPOSITORY https://github.com/rapidsai/cuspatial.git
# GIT_TAG branch-${VERSION}
GIT_REPOSITORY https://github.com/trxcllnt/cuspatial.git
# Can also use a local path to your repo clone for testing
# GIT_REPOSITORY /home/ptaylor/dev/rapids/cuspatial
GIT_TAG fix/async-set-value-literal
GIT_TAG nr/03232021
GIT_SHALLOW TRUE
SOURCE_SUBDIR cpp
OPTIONS "BUILD_TESTS OFF"
Expand Down
22 changes: 20 additions & 2 deletions modules/core/cmake/Modules/ConfigureCXX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ if(NODE_RAPIDS_USE_CCACHE)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM_PATH}")
else()
execute_process(COMMAND node -p
"require('@rapidsai/core').modules_path"
"require('@rapidsai/core').project_root_dir_path"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE NODE_RAPIDS_MODULES_BASE_DIR
OUTPUT_VARIABLE NODE_RAPIDS_BASE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND node -p
"require('@rapidsai/core').cmake_modules_path"
Expand Down Expand Up @@ -67,6 +67,24 @@ execute_process(COMMAND node -p
set(ENV{CPM_SOURCE_CACHE} ${NODE_RAPIDS_CPM_SOURCE_CACHE})
message(STATUS "Using CPM source cache: $ENV{CPM_SOURCE_CACHE}")

if (NOT DEFINED ENV{NODE_RAPIDS_USE_LOCAL_DEPS_BUILD_DIRS})
execute_process(COMMAND node -p
"require('@rapidsai/core').cmake_fetchcontent_base"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE NODE_RAPIDS_FETCHCONTENT_BASE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)

set(FETCHCONTENT_BASE_DIR "${NODE_RAPIDS_FETCHCONTENT_BASE_DIR}")
message(STATUS "Using CMake FetchContent base dir: ${FETCHCONTENT_BASE_DIR}")

# Can't set these yet because the order of include paths is different
# when using libcudf from a build dir vs. CPM running the CMakeLists.txt.
# set(rmm_ROOT "${FETCHCONTENT_BASE_DIR}/rmm-build")
# set(cudf_ROOT "${FETCHCONTENT_BASE_DIR}/cudf-build")
# # set(cugraph_ROOT "${FETCHCONTENT_BASE_DIR}/cugraph-build")
# set(cuspatial_ROOT "${FETCHCONTENT_BASE_DIR}/cuspatial-build")
endif()

execute_process(COMMAND node -p
"require('@rapidsai/core').cpp_include_path"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion modules/core/cmake/Modules/ConfigureCuGraph.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function(find_and_configure_cugraph VERSION)
include(get_cpm)
include(ConfigureRAFT)

CPMAddPackage(NAME cugraph
CPMFindPackage(NAME cugraph
VERSION ${CUGRAPH_VERSION}
GIT_REPOSITORY https://github.com/rapidsai/cugraph.git
GIT_TAG branch-${CUGRAPH_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion modules/core/cmake/Modules/ConfigureOpenGLEW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include(get_cpm)

add_compile_definitions(GLEW_EGL)

CPMAddPackage(NAME glew
CPMFindPackage(NAME glew
VERSION ${GLEW_VERSION}
GIT_REPOSITORY https://github.com/Perlmint/glew-cmake.git
GIT_TAG glew-cmake-${GLEW_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion modules/core/cmake/Modules/ConfigureOpenGLFW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ else()
set(GLFW_GIT_BRANCH_NAME "${GLFW_VERSION}")
endif()

CPMAddPackage(NAME glfw
CPMFindPackage(NAME glfw
VERSION ${GLFW_VERSION}
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG ${GLFW_GIT_BRANCH_NAME}
Expand Down
2 changes: 1 addition & 1 deletion modules/core/cmake/Modules/ConfigureRAFT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function(find_and_configure_raft VERSION)

include(get_cpm)

CPMAddPackage(NAME raft
CPMFindPackage(NAME raft
VERSION ${RAFT_VERSION}
GIT_REPOSITORY https://github.com/rapidsai/raft.git
GIT_TAG ${RAFT_BRANCH}
Expand Down
2 changes: 1 addition & 1 deletion modules/core/cmake/Modules/ConfigureRMM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function(find_and_configure_rmm VERSION)

include(get_cpm)

CPMAddPackage(NAME rmm
CPMFindPackage(NAME rmm
VERSION ${RMM_VERSION}
GIT_REPOSITORY https://github.com/rapidsai/rmm.git
GIT_TAG branch-${RMM_VERSION}
Expand Down
14 changes: 7 additions & 7 deletions modules/core/cmake/Modules/ccache.conf.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
max_size = 0
hash_dir = false
max_size=0
hash_dir=false
# let ccache preserve C++ comments, because some of them may be meaningful to the compiler
keep_comments_cpp = true
base_dir = @NODE_RAPIDS_MODULES_BASE_DIR@
cache_dir = @NODE_RAPIDS_CMAKE_CCACHE_DIR@
compiler_check = %compiler% --version
keep_comments_cpp=true
base_dir=@NODE_RAPIDS_BASE_DIR@
cache_dir=@NODE_RAPIDS_CMAKE_CCACHE_DIR@
compiler_check=%compiler% --version
# Uncomment to debug ccache preprocessor errors/cache misses
# log_file = @NODE_RAPIDS_CMAKE_CCACHE_DIR@/ccache.log
# log_file=@NODE_RAPIDS_CMAKE_CCACHE_DIR@/ccache.log
1 change: 1 addition & 0 deletions modules/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
"devDependencies": {
"@types/jest": "25.2.2",
"dotenv": "8.2.0",
"jest": "26.6.3",
"jest-silent-reporter": "0.1.2",
"esm": "3.2.25",
Expand Down
4 changes: 4 additions & 0 deletions modules/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ export * from './loadnativemodule';

export const modules_path = Path.resolve(__dirname, '..', '..', '..');

export const project_root_dir_path = Path.resolve(modules_path, '..');

export const ccache_path = Path.resolve(modules_path, '.cache', 'ccache');

export const cpm_source_cache_path = Path.resolve(modules_path, '.cache', 'cpm');

export const cpp_include_path = Path.resolve(modules_path, 'core', 'include');

export const cmake_modules_path = Path.resolve(modules_path, 'core', 'cmake', 'Modules');

export const cmake_fetchcontent_base = Path.resolve(modules_path, '.cache', 'build');
2 changes: 1 addition & 1 deletion modules/demo/deck/3d-heatmap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"deck.gl": "^8.1.0",
"react": "^16.3.0",
"react-dom": "^16.3.0",
"react-map-gl": "^5.0.0"
"react-map-gl": "6.1.10"
},
"devDependencies": {
"@babel/core": "^7.4.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/demo/deck/3d-tiles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@loaders.gl/3d-tiles": "^2.1.1",
"react": "^16.8.0",
"react-dom": "^16.8.0",
"react-map-gl": "^5.0.0"
"react-map-gl": "6.1.10"
},
"devDependencies": {
"@babel/core": "^7.4.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/demo/deck/ShanghaiData/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"deck.gl": "^8.1.0",
"react": "^16.3.0",
"react-dom": "^16.3.0",
"react-map-gl": "^5.0.0"
"react-map-gl": "6.1.10"
},
"devDependencies": {
"@babel/core": "^7.4.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/demo/deck/arc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"deck.gl": "^8.1.0",
"react": "^16.3.0",
"react-dom": "^16.3.0",
"react-map-gl": "^5.0.0"
"react-map-gl": "6.1.10"
},
"devDependencies": {
"@babel/core": "^7.4.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/demo/deck/brushing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"deck.gl": "^8.1.0",
"react": "^16.3.0",
"react-dom": "^16.3.0",
"react-map-gl": "^5.0.0"
"react-map-gl": "6.1.10"
},
"devDependencies": {
"@babel/core": "^7.4.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/demo/deck/data-filter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"deck.gl": "^8.1.0",
"react": "^16.3.0",
"react-dom": "^16.3.0",
"react-map-gl": "^5.0.0",
"react-map-gl": "6.1.10",
"styletron-engine-atomic": "^1.4.0",
"styletron-react": "^5.2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion modules/demo/deck/geojson/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"deck.gl": "^8.1.0",
"react": "^16.3.0",
"react-dom": "^16.3.0",
"react-map-gl": "^5.0.0"
"react-map-gl": "6.1.10"
},
"devDependencies": {
"@babel/core": "^7.4.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/demo/deck/heatmap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"deck.gl": "^8.1.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-map-gl": "^5.0.0"
"react-map-gl": "6.1.10"
},
"devDependencies": {
"@babel/core": "^7.4.0",
Expand Down
Loading