Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ endif()

# OpenMP
if(USE_OPENMP)
add_definitions(-DSTOCHTREE_OPENMP_AVAILABLE)
if(APPLE)
find_package(OpenMP)
if(NOT OpenMP_FOUND)
Expand Down
5 changes: 0 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,6 @@ PACKAGE_URL=''
ac_subst_vars='LTLIBOBJS
LIBOBJS
STOCHTREE_CPPFLAGS
OPENMP_AVAILABILITY_FLAGS
OPENMP_LIB
OPENMP_CXXFLAGS
target_alias
Expand Down Expand Up @@ -1762,14 +1761,12 @@ OPENMP_CXXFLAGS=""
if test `uname -s` = "Linux"
then
OPENMP_CXXFLAGS="\$(SHLIB_OPENMP_CXXFLAGS)"
OPENMP_AVAILABILITY_FLAGS='-DSTOCHTREE_OPENMP_AVAILABLE'
fi

if test `uname -s` = "Darwin"
then
OPENMP_CXXFLAGS='-Xclang -fopenmp'
OPENMP_LIB='-lomp'
OPENMP_AVAILABILITY_FLAGS='-DSTOCHTREE_OPENMP_AVAILABLE'

# libomp 15.0+ from brew is keg-only (i.e. not symlinked into the standard paths search by the linker),
# so need to search in other locations.
Expand Down Expand Up @@ -1830,7 +1827,6 @@ printf "%s\n" "${ac_pkg_openmp}" >&6; }
if test "${ac_pkg_openmp}" = no; then
OPENMP_CXXFLAGS=''
OPENMP_LIB=''
OPENMP_AVAILABILITY_FLAGS=''
echo '***********************************************************************************************'
echo ' OpenMP is unavailable on this macOS system. stochtree code will run single-threaded as a result.'
echo ' To use all CPU cores for training jobs, you should install OpenMP by running'
Expand All @@ -1844,7 +1840,6 @@ fi




ac_config_files="$ac_config_files src/Makevars"


Expand Down
4 changes: 0 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ OPENMP_CXXFLAGS=""
if test `uname -s` = "Linux"
then
OPENMP_CXXFLAGS="\$(SHLIB_OPENMP_CXXFLAGS)"
OPENMP_AVAILABILITY_FLAGS='-DSTOCHTREE_OPENMP_AVAILABLE'
fi

if test `uname -s` = "Darwin"
then
OPENMP_CXXFLAGS='-Xclang -fopenmp'
OPENMP_LIB='-lomp'
OPENMP_AVAILABILITY_FLAGS='-DSTOCHTREE_OPENMP_AVAILABLE'

# libomp 15.0+ from brew is keg-only (i.e. not symlinked into the standard paths search by the linker),
# so need to search in other locations.
Expand Down Expand Up @@ -104,7 +102,6 @@ then
if test "${ac_pkg_openmp}" = no; then
OPENMP_CXXFLAGS=''
OPENMP_LIB=''
OPENMP_AVAILABILITY_FLAGS=''
echo '***********************************************************************************************'
echo ' OpenMP is unavailable on this macOS system. stochtree code will run single-threaded as a result.'
echo ' To use all CPU cores for training jobs, you should install OpenMP by running'
Expand All @@ -117,7 +114,6 @@ fi
# substitute variables from this script into Makevars.in
AC_SUBST(OPENMP_CXXFLAGS)
AC_SUBST(OPENMP_LIB)
AC_SUBST(OPENMP_AVAILABILITY_FLAGS)
AC_SUBST(STOCHTREE_CPPFLAGS)
AC_CONFIG_FILES([src/Makevars])

Expand Down
2 changes: 1 addition & 1 deletion configure.win
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ STOCHTREE_CPPFLAGS="${STOCHTREE_CPPFLAGS} -DEIGEN_MPL2_ONLY -DEIGEN_DONT_PARALLE
# OpenMP #
##########

STOCHTREE_CPPFLAGS="${STOCHTREE_CPPFLAGS} -DSTOCHTREE_OPENMP_AVAILABLE"
STOCHTREE_CPPFLAGS="${STOCHTREE_CPPFLAGS}"

#########################
# Generate Makevars.win #
Expand Down
3 changes: 1 addition & 2 deletions include/stochtree/openmp_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace StochTree {

#ifdef STOCHTREE_OPENMP_AVAILABLE
#ifdef _OPENMP

#include <omp.h>
#define STOCHTREE_HAS_OPENMP 1
Expand Down Expand Up @@ -40,7 +40,6 @@ inline void set_num_threads(int num_threads) {
#else
#define STOCHTREE_HAS_OPENMP 0

// Fallback implementations when OpenMP is not available
inline int get_max_threads() {return 1;}

inline int get_thread_num() {return 0;}
Expand Down
1 change: 0 additions & 1 deletion src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ PKGROOT=..

STOCHTREE_CPPFLAGS = \
@STOCHTREE_CPPFLAGS@ \
@OPENMP_AVAILABILITY_FLAGS@ \
-DSTOCHTREE_R_BUILD

PKG_CPPFLAGS = \
Expand Down
Loading