File tree Expand file tree Collapse file tree 5 files changed +2
-13
lines changed Expand file tree Collapse file tree 5 files changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -608,7 +608,6 @@ PACKAGE_URL=''
608608ac_subst_vars=' LTLIBOBJS
609609LIBOBJS
610610STOCHTREE_CPPFLAGS
611- OPENMP_AVAILABILITY_FLAGS
612611OPENMP_LIB
613612OPENMP_CXXFLAGS
614613target_alias
@@ -1762,14 +1761,12 @@ OPENMP_CXXFLAGS=""
17621761if test ` uname -s` = " Linux"
17631762then
17641763 OPENMP_CXXFLAGS=" \$ (SHLIB_OPENMP_CXXFLAGS)"
1765- OPENMP_AVAILABILITY_FLAGS=' -DSTOCHTREE_OPENMP_AVAILABLE'
17661764fi
17671765
17681766if test ` uname -s` = " Darwin"
17691767then
17701768 OPENMP_CXXFLAGS=' -Xclang -fopenmp'
17711769 OPENMP_LIB=' -lomp'
1772- OPENMP_AVAILABILITY_FLAGS=' -DSTOCHTREE_OPENMP_AVAILABLE'
17731770
17741771 # libomp 15.0+ from brew is keg-only (i.e. not symlinked into the standard paths search by the linker),
17751772 # so need to search in other locations.
@@ -1830,7 +1827,6 @@ printf "%s\n" "${ac_pkg_openmp}" >&6; }
18301827 if test " ${ac_pkg_openmp} " = no; then
18311828 OPENMP_CXXFLAGS=' '
18321829 OPENMP_LIB=' '
1833- OPENMP_AVAILABILITY_FLAGS=' '
18341830 echo ' ***********************************************************************************************'
18351831 echo ' OpenMP is unavailable on this macOS system. stochtree code will run single-threaded as a result.'
18361832 echo ' To use all CPU cores for training jobs, you should install OpenMP by running'
18441840
18451841
18461842
1847-
18481843ac_config_files=" $ac_config_files src/Makevars"
18491844
18501845
Original file line number Diff line number Diff line change @@ -47,14 +47,12 @@ OPENMP_CXXFLAGS=""
4747if test `uname -s` = "Linux"
4848then
4949 OPENMP_CXXFLAGS="\$(SHLIB_OPENMP_CXXFLAGS)"
50- OPENMP_AVAILABILITY_FLAGS='-DSTOCHTREE_OPENMP_AVAILABLE'
5150fi
5251
5352if test `uname -s` = "Darwin"
5453then
5554 OPENMP_CXXFLAGS='-Xclang -fopenmp'
5655 OPENMP_LIB='-lomp'
57- OPENMP_AVAILABILITY_FLAGS='-DSTOCHTREE_OPENMP_AVAILABLE'
5856
5957 # libomp 15.0+ from brew is keg-only (i.e. not symlinked into the standard paths search by the linker),
6058 # so need to search in other locations.
104102 if test "${ac_pkg_openmp}" = no; then
105103 OPENMP_CXXFLAGS=''
106104 OPENMP_LIB=''
107- OPENMP_AVAILABILITY_FLAGS=''
108105 echo '***********************************************************************************************'
109106 echo ' OpenMP is unavailable on this macOS system. stochtree code will run single-threaded as a result.'
110107 echo ' To use all CPU cores for training jobs, you should install OpenMP by running'
117114# substitute variables from this script into Makevars.in
118115AC_SUBST ( OPENMP_CXXFLAGS )
119116AC_SUBST ( OPENMP_LIB )
120- AC_SUBST ( OPENMP_AVAILABILITY_FLAGS )
121117AC_SUBST ( STOCHTREE_CPPFLAGS )
122118AC_CONFIG_FILES ( [ src/Makevars] )
123119
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ STOCHTREE_CPPFLAGS="${STOCHTREE_CPPFLAGS} -DEIGEN_MPL2_ONLY -DEIGEN_DONT_PARALLE
2626# OpenMP #
2727##########
2828
29- STOCHTREE_CPPFLAGS="${STOCHTREE_CPPFLAGS} -DSTOCHTREE_OPENMP_AVAILABLE "
29+ STOCHTREE_CPPFLAGS="${STOCHTREE_CPPFLAGS}"
3030
3131#########################
3232# Generate Makevars.win #
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ PKGROOT=..
44
55STOCHTREE_CPPFLAGS = \
66 @STOCHTREE_CPPFLAGS@ \
7- @OPENMP_AVAILABILITY_FLAGS@ \
87 -DSTOCHTREE_R_BUILD
98
109PKG_CPPFLAGS = \
Original file line number Diff line number Diff line change 66
77namespace StochTree {
88
9- #ifdef STOCHTREE_OPENMP_AVAILABLE
9+ #ifdef _OPENMP
1010
1111#include < omp.h>
1212#define STOCHTREE_HAS_OPENMP 1
@@ -40,7 +40,6 @@ inline void set_num_threads(int num_threads) {
4040#else
4141#define STOCHTREE_HAS_OPENMP 0
4242
43- // Fallback implementations when OpenMP is not available
4443inline int get_max_threads () {return 1 ;}
4544
4645inline int get_thread_num () {return 0 ;}
You can’t perform that action at this time.
0 commit comments