Skip to content

Commit

Permalink
disable openmp (GNU openmp not fork safe; causing hangs)
Browse files Browse the repository at this point in the history
  • Loading branch information
msarahan committed Sep 18, 2018
1 parent a6b3811 commit 2bac9af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ if [[ ${target_platform} == osx-64 ]]; then
export LAPACK_FFLAGS="$LAPACK_FFLAGS -Wl,-rpath,$PREFIX/lib"
export FFLAGS="$FFLAGS -Wl,-rpath,$PREFIX/lib"
else
USE_OPENMP="1"
# Gnu OpenMP is not fork-safe. We disable openmp right now, so that downstream packages don't hang as a result of this.
# USE_OPENMP="1"
USE_OPENMP="0"
fi

# Build all CPU targets and allow dynamic configuration
Expand All @@ -29,8 +31,14 @@ fi
# setting OPENBLAS_NUM_THREADS before loading the library.
# Because -Wno-missing-include-dirs does not work with gfortran:
[[ -d "${PREFIX}"/include ]] || mkdir "${PREFIX}"/include

# USE_SIMPLE_THREADED_LEVEL3 is necessary to avoid hangs when more than one process uses blas:
# https://github.com/xianyi/OpenBLAS/issues/1456
# https://github.com/xianyi/OpenBLAS/issues/294
# https://github.com/scikit-learn/scikit-learn/issues/636

make DYNAMIC_ARCH=1 BINARY=${ARCH} NO_LAPACK=0 NO_AFFINITY=1 USE_THREAD=1 NUM_THREADS=128 \
USE_OPENMP="${USE_OPENMP}" CFLAGS="${CF}" FFLAGS="${FFLAGS}"
USE_OPENMP="${USE_OPENMP}" USE_SIMPLE_THREADED_LEVEL3=1 CFLAGS="${CF}" FFLAGS="${FFLAGS}"
OPENBLAS_NUM_THREADS=${CPU_COUNT} CFLAGS="${CF}" FFLAGS="${FFLAGS}" make test
OPENBLAS_NUM_THREADS=${CPU_COUNT} CFLAGS="${CF}" FFLAGS="${FFLAGS}" make lapack-test
CFLAGS="${CF}" FFLAGS="${FFLAGS}" make install PREFIX="${PREFIX}"
Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ source:
- 0003-turn-TLS-off.patch

build:
number: 2
number: 3
skip: true # [win and vc<14]

requirements:
Expand Down

0 comments on commit 2bac9af

Please sign in to comment.