Skip to content

Commit

Permalink
Honor CXX / CC flags when testing R
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Nov 28, 2024
1 parent 5c01d76 commit 28f51be
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
14 changes: 10 additions & 4 deletions R-package/configure
Original file line number Diff line number Diff line change
Expand Up @@ -2239,12 +2239,18 @@ if test -z "${R_HOME}"; then
exit 1
fi

CXX17=`"${R_HOME}/bin/R" CMD config CXX17`
CXX17STD=`"${R_HOME}/bin/R" CMD config CXX17STD`
CXX="${CXX17} ${CXX17STD}"
if [ -z "${CXX:-}" ]
then
CXX17=`"${R_HOME}/bin/R" CMD config CXX17`
CXX17STD=`"${R_HOME}/bin/R" CMD config CXX17STD`
CXX="${CXX17} ${CXX17STD}"
fi
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`

CC=`"${R_HOME}/bin/R" CMD config CC`
if [ -z "${CC:-}" ]
then
CC=`"${R_HOME}/bin/R" CMD config CC`
fi
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`

Expand Down
14 changes: 10 additions & 4 deletions R-package/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ if test -z "${R_HOME}"; then
exit 1
fi

CXX17=`"${R_HOME}/bin/R" CMD config CXX17`
CXX17STD=`"${R_HOME}/bin/R" CMD config CXX17STD`
CXX="${CXX17} ${CXX17STD}"
if [[ -z "${CXX:-}" ]]
then
CXX17=`"${R_HOME}/bin/R" CMD config CXX17`
CXX17STD=`"${R_HOME}/bin/R" CMD config CXX17STD`
CXX="${CXX17} ${CXX17STD}"
fi
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`

CC=`"${R_HOME}/bin/R" CMD config CC`
if [[ -z "${CC:-}" ]]
then
CC=`"${R_HOME}/bin/R" CMD config CC`
fi
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`

Expand Down
6 changes: 6 additions & 0 deletions ops/pipeline/test-rpkg-impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ shift 1
source /opt/miniforge/bin/activate

set -x

mkdir -p ~/.R/
touch ~/.R/Makevars
echo "CXX=$CXX" >> ~/.R/Makevars
echo "CC=$CC" >> ~/.R/Makevars

R -e 'dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)'
python3 ops/script/test_r_package.py --build-tool="${build_tool}"

0 comments on commit 28f51be

Please sign in to comment.