Skip to content

Commit 1b20a0b

Browse files
committed
add llvm path to runner
1 parent 92299dc commit 1b20a0b

1 file changed

Lines changed: 15 additions & 25 deletions

File tree

.github/workflows/R-CMD-check.yaml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,21 @@ jobs:
4646
4747
- name: Configure clang 16
4848
run: |
49-
brew_prefix=$(brew --prefix llvm@16)
50-
echo "$brew_prefix/bin" >> $GITHUB_PATH
51-
export PATH="$brew_prefix/bin:$PATH"
52-
# Test compiler
53-
echo "Testing clang installation..."
54-
clang --version
55-
# Configure without flags first
56-
echo "CC=$brew_prefix/bin/clang" >> $GITHUB_ENV
57-
echo "CXX=$brew_prefix/bin/clang++" >> $GITHUB_ENV
58-
echo "LDFLAGS=-L$brew_prefix/lib" >> $GITHUB_ENV
59-
echo "CPPFLAGS=-I$brew_prefix/include" >> $GITHUB_ENV
60-
# Create test program
61-
echo "#include <stdio.h>" > test.c
62-
echo "int main() { printf(\"Hello\\n\"); return 0; }" >> test.c
63-
# Try to compile
64-
$brew_prefix/bin/clang test.c -o test
65-
./test
49+
echo "/usr/local/opt/llvm@16/bin" >> $GITHUB_PATH
50+
export PATH="/usr/local/opt/llvm@16/bin:$PATH"
51+
echo "CC=/usr/local/opt/llvm@16/bin/clang -mmacos-version-min=13" >> $GITHUB_ENV
52+
echo "CXX=/usr/local/opt/llvm@16/bin/clang++ -mmacos-version-min=13" >> $GITHUB_ENV
53+
echo "LDFLAGS=-L/usr/local/opt/llvm@16/lib" >> $GITHUB_ENV
54+
echo "CPPFLAGS=-I/usr/local/opt/llvm@16/include" >> $GITHUB_ENV
55+
echo 'export PATH="/opt/homebrew/opt/llvm@16/bin:$PATH"' >> /Users/runner/.bash_profile
6656
6757
- name: Download and compile R-devel
6858
run: |
6959
curl -O https://stat.ethz.ch/R/daily/R-devel.tar.gz
7060
tar -xzf R-devel.tar.gz
7161
mkdir r-devel-build
7262
cd r-devel-build
73-
# Print current environment
74-
echo "Current environment:"
75-
env | sort
76-
echo "Configuring R..."
63+
sudo chown -R $(whoami) .
7764
../R-devel/configure \
7865
--with-C23 \
7966
--enable-R-shlib \
@@ -83,10 +70,13 @@ jobs:
8370
--with-readline \
8471
--with-tcltk \
8572
--with-recommended-packages \
86-
--enable-RGBA || (cat config.log && false)
87-
echo "Building R..."
88-
make || (cat config.log && false)
89-
echo "Installing R..."
73+
--enable-RGBA
74+
make
75+
if [ $? -ne 0 ]; then
76+
echo "R compilation failed. Showing config.log:"
77+
cat config.log
78+
exit 1
79+
fi
9080
sudo make install
9181
9282
- uses: r-lib/actions/setup-pandoc@v2

0 commit comments

Comments
 (0)