File: install-osx

package info (click to toggle)
r-cran-openmx 2.21.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 14,412 kB
  • sloc: cpp: 36,577; ansic: 13,811; fortran: 2,001; sh: 1,440; python: 350; perl: 21; makefile: 5
file content (40 lines) | stat: -rwxr-xr-x 770 bytes parent folder | download | duplicates (2)
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