@@ -610,6 +610,8 @@ PACKAGE_URL=''
610610
611611ac_subst_vars=' LTLIBOBJS
612612LIBOBJS
613+ PKG_LIBS
614+ PKG_CXXFLAGS
613615OPENMP_FLAG
614616ARMA_HAVE_OPENMP
615617CXXCPP
@@ -3269,19 +3271,18 @@ EOF
32693271
32703272if test x" ${SYSKERNEL} " = x" Linux" ; then
32713273
3272- # # Check if R is configured to compile programs using OpenMP out-of-the-box.
3274+ # # Check if R is configured to compile OpenMP programs out-of-the-box.
32733275 if test x" ${can_use_openmp} " = x" no" ; then
32743276 { printf " %s\n" " $as_me :${as_lineno-$LINENO } : checking whether R CMD SHLIB can already compile OpenMP programs" >&5
32753277printf %s " checking whether R CMD SHLIB can already compile OpenMP programs... " >&6 ; }
32763278
3277- # # Execute R CMD SHLIB.
32783279 " ${R_HOME} /bin/R" CMD SHLIB test-omp.cpp > /dev/null 2>&1
32793280 if test x" $? " = x" 0" ; then
32803281 { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: yes" >&5
32813282printf " %s\n" " yes" >&6 ; }
32823283 openmp_already_works=" yes"
32833284 arma_have_openmp=" #define ARMA_USE_OPENMP 1"
3284- # #FIXME can_use_openmp="yes"
3285+ can_use_openmp=" yes"
32853286 else
32863287 { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: no" >&5
32873288printf " %s\n" " no" >&6 ; }
@@ -3291,19 +3292,21 @@ printf "%s\n" "no" >&6; }
32913292 fi
32923293 fi
32933294
3294- # # If needed, check if R is configured to compile programs using OpenMP with -fopenmp
3295+ # # If needed, check if R is configured to compile OpenMP programs using -fopenmp
32953296 if test x" ${can_use_openmp} " = x" no" ; then
32963297 { printf " %s\n" " $as_me :${as_lineno-$LINENO } : checking whether R CMD SHLIB can compile OpenMP via -fopenmp" >&5
32973298printf %s " checking whether R CMD SHLIB can compile OpenMP via -fopenmp... " >&6 ; }
32983299
3299- # # Execute R CMD SHLIB.
3300- PKG_CXXFLAGS=-fopenmp PKG_LIBS=-fopen " ${R_HOME} /bin/R" CMD SHLIB -fopenmp test-omp.cpp > /dev/null 2>&1
3300+ PKG_CXXFLAGS=" ${PKG_CXXFLAGS} -fopenmp" PKG_LIBS=" ${PKG_LIBS} -fopen" " ${R_HOME} /bin/R" CMD SHLIB -fopenmp test-omp.cpp > /dev/null 2>&1
33013301 if test x" $? " = x" 0" ; then
33023302 { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: yes" >&5
33033303printf " %s\n" " yes" >&6 ; }
33043304 openmp_already_works=" yes"
33053305 arma_have_openmp=" #define ARMA_USE_OPENMP 1"
33063306 can_use_openmp=" yes"
3307+ # keep any entries user may have set
3308+ PKG_CXXFLAGS=" ${PKG_CXXFLAGS} -fopenmp"
3309+ PKG_LIBS=" ${PKG_LIBS} -fopenmp"
33073310 else
33083311 { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: no" >&5
33093312printf " %s\n" " no" >&6 ; }
@@ -3314,33 +3317,37 @@ printf "%s\n" "no" >&6; }
33143317 fi
33153318fi
33163319
3320+ if test x" ${SYSKERNEL} " = x" Darwin" ; then
33173321
3322+ # # Check if R is configured to compile OpenMP programs using -Xclang -fopenmp
3323+ if test x" ${can_use_openmp} " = x" no" ; then
3324+ { printf " %s\n" " $as_me :${as_lineno-$LINENO } : checking whether R CMD SHLIB can compile OpenMP programs using '-Xclang -fopenmp'" >&5
3325+ printf %s " checking whether R CMD SHLIB can compile OpenMP programs using '-Xclang -fopenmp'... " >&6 ; }
3326+
3327+ PKG_CXXFLAGS=-Xclang -fopenmp PKG_LIBS=" ${PKG_LIBS} -lomp" " ${R_HOME} /bin/R" CMD SHLIB -fopenmp test-omp.cpp > /dev/null 2>&1
3328+ if test x" $? " = x" 0" ; then
3329+ { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: yes" >&5
3330+ printf " %s\n" " yes" >&6 ; }
3331+ openmp_already_works=" yes"
3332+ arma_have_openmp=" #define ARMA_USE_OPENMP 1"
3333+ can_use_openmp=" yes"
3334+ # keep any entries user may have set
3335+ PKG_CXXFLAGS=" ${PKG_CXXFLAGS} -Xclang -fopenmp"
3336+ PKG_LIBS=" ${PKG_LIBS} -lomp"
3337+ else
3338+ { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: no" >&5
3339+ printf " %s\n" " no" >&6 ; }
3340+ openmp_already_works=" no"
3341+ arma_have_openmp=" #define ARMA_DONT_USE_OPENMP 1"
3342+ can_use_openmp=" no"
3343+ fi
3344+ fi
3345+ fi
33183346
33193347# # Go back home.
33203348cd " ${owd} "
33213349rm -rf " ${BUILDDIR} "
33223350
3323- # # Additional Apple check
3324- { printf " %s\n" " $as_me :${as_lineno-$LINENO } : checking for macOS" >&5
3325- printf %s " checking for macOS... " >&6 ; }
3326- RSysinfoName=$( " ${R_HOME} /bin/Rscript" --vanilla -e ' cat(Sys.info()["sysname"])' )
3327- if test x" ${RSysinfoName} " = x" Darwin" ; then
3328- { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: found" >&5
3329- printf " %s\n" " found" >&6 ; }
3330- { printf " %s\n" " $as_me :${as_lineno-$LINENO } : checking for macOS Apple compiler" >&5
3331- printf %s " checking for macOS Apple compiler... " >&6 ; }
3332- apple_compiler=$( $CXX --version 2>&1 | grep -i -c -e ' apple llvm' )
3333- if test x" ${apple_compiler} " = x" 1" ; then
3334- { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: found" >&5
3335- printf " %s\n" " found" >&6 ; }
3336- { printf " %s\n" " $as_me :${as_lineno-$LINENO } : WARNING: OpenMP unavailable and turned off." >&5
3337- printf " %s\n" " $as_me : WARNING: OpenMP unavailable and turned off." >&2 ; }
3338- can_use_openmp=" no"
3339- fi
3340- else
3341- { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: not found" >&5
3342- printf " %s\n" " not found" >&6 ; }
3343- fi
33443351
33453352if test x" ${can_use_openmp} " = x" yes" ; then
33463353 { printf " %s\n" " $as_me :${as_lineno-$LINENO } : checking for OpenMP" >&5
@@ -3366,6 +3373,10 @@ ARMA_HAVE_OPENMP="${arma_have_openmp}"
33663373
33673374OPENMP_FLAG=" ${openmp_flag} "
33683375
3376+ PKG_CXXFLAGS=" ${PKG_CXXFLAGS} "
3377+
3378+ PKG_LIBS=" ${PKG_LIBS} "
3379+
33693380ac_config_files=" $ac_config_files inst/include/RcppArmadillo/config/RcppArmadilloConfigGenerated.h src/Makevars"
33703381
33713382cat > confcache << \_ACEOF
0 commit comments