Skip to content

Commit ad5b6bb

Browse files
committed
Update CI to handle stochtree changes expecting OpenMP and autoconf for the R package
1 parent 2b74ba8 commit ad5b6bb

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

.github/workflows/cpp-test.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,17 @@ jobs:
5656
shell: bash
5757
run: |
5858
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
59+
60+
- name: Set up dependencies (linux clang)
61+
# Set up openMP on ubuntu-latest with clang compiler toolset (doesn't ship with the compiler suite like GCC and MSVC)
62+
if: matrix.os == 'ubuntu-latest' && matrix.cpp_compiler == 'clang++'
63+
run: |
64+
sudo apt-get update && sudo apt-get install -y libomp-dev
5965
6066
- name: Configure CMake
6167
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
6268
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
63-
run: >
69+
run: |
6470
cmake -B ${{ steps.strings.outputs.build-output-dir }}
6571
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
6672
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
@@ -69,6 +75,7 @@ jobs:
6975
-DUSE_SANITIZER=OFF
7076
-DBUILD_TEST=ON
7177
-DBUILD_DEBUG_TARGETS=OFF
78+
-DUSE_OPENMP=ON
7279
-S ${{ github.workspace }}
7380
7481
- name: Build

.github/workflows/pypi-wheels.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ jobs:
3434
- uses: actions/checkout@v4
3535
with:
3636
submodules: 'recursive'
37+
38+
- name: Set up openmp (macos)
39+
# Set up openMP on MacOS since it doesn't ship with the apple clang compiler suite
40+
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
41+
run: |
42+
brew install libomp
3743
3844
- name: Build wheels
3945
uses: pypa/[email protected]

.github/workflows/python-test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ jobs:
3030
with:
3131
python-version: "3.10"
3232
cache: "pip"
33+
34+
- name: Set up openmp (macos)
35+
# Set up openMP on MacOS since it doesn't ship with the apple clang compiler suite
36+
if: matrix.os == 'macos-latest'
37+
run: |
38+
brew install libomp
3339
3440
- name: Install Package with Relevant Dependencies
3541
run: |

cran-bootstrap.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ if (!dir.exists(cran_dir)) {
6060
src_files <- list.files("src", pattern = ".[^o]$", recursive = TRUE, full.names = TRUE)
6161
pybind_src_files <- list.files("src", pattern = "^(py_)", recursive = TRUE, full.names = TRUE)
6262
r_src_files <- src_files[!(src_files %in% pybind_src_files)]
63+
r_src_files <- r_src_files[!(r_src_files %in% c("src/Makevars"))]
64+
cat(r_src_files)
6365
pkg_core_files <- c(
6466
".Rbuildignore",
6567
"cran-comments.md",
@@ -136,9 +138,14 @@ if (all(file.exists(pkg_core_files))) {
136138
}
137139

138140
# Overwrite PKG_CPPFLAGS in src/Makevars
139-
cran_makevars <- file.path(cran_dir, "src/Makevars")
141+
cran_makevars <- file.path(cran_dir, "src/Makevars.in")
140142
makevars_lines <- readLines(cran_makevars)
141-
makevars_lines[grep("^(PKG_CPPFLAGS)", makevars_lines)] <- "PKG_CPPFLAGS= -I$(PKGROOT)/src/include $(STOCHTREE_CPPFLAGS)"
143+
makevars_lines[grep(" -I$(PKGROOT)/include \\", makevars_lines, fixed = T)] <- " -I$(PKGROOT)/src/include \\"
144+
makevars_lines <- makevars_lines[-c(
145+
grep(" -I$(PKGROOT)/deps/eigen \\", makevars_lines, fixed = T),
146+
grep(" -I$(PKGROOT)/deps/fmt/include \\", makevars_lines, fixed = T),
147+
grep(" -I$(PKGROOT)/deps/fast_double_parser/include \\", makevars_lines, fixed = T)
148+
)]
142149
writeLines(makevars_lines, cran_makevars)
143150

144151
# Remove vignette deps from DESCRIPTION if no vignettes

0 commit comments

Comments
 (0)