1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#!/bin/bash
set -ve
set +x
rm -f '/usr/local/bin/gfortran'
# Ignore return code
brew install --force llvm libomp || true
# Workaround for travis-ci/travis-ci#8973
python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)"
xcodebuild -version | head -n 1 | cut -d ' ' -f 2
id
echo '
#include <stdlib.h>
#include <stdio.h>
#include <omp.h>
int main() {
#pragma omp parallel num_threads(4)
{
printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads());
}
return EXIT_SUCCESS;
}
' > omptest.c
LLVMBASE=`brew --prefix llvm`
$LLVMBASE/bin/clang -fopenmp -L$LLVMBASE/lib omptest.c -o omptest
./omptest
mkdir -p ~/.R
cp tools/travis/llvm.conf ~/.R/Makevars
R --no-save -f util/update-dependencies.R --args ./DESCRIPTION.in
|