Added CPPFLAGS and LDFLAGS to the testing for OpenMP during R installation from source. (#7759)

This commit is contained in:
Christian Marquardt 2022-03-28 13:14:07 +02:00 committed by GitHub
parent b37ff3d492
commit 39c5616af2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1187 additions and 631 deletions

1812
R-package/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
### configure.ac -*- Autoconf -*- ### configure.ac -*- Autoconf -*-
AC_PREREQ(2.69) AC_PREREQ(2.71)
AC_INIT([xgboost],[0.6-3],[],[xgboost],[]) AC_INIT([xgboost],[1.6-0],[],[xgboost],[])
# Use this line to set CC variable to a C compiler # Use this line to set CC variable to a C compiler
AC_PROG_CC AC_PROG_CC
@ -33,7 +33,7 @@ then
ac_pkg_openmp=no ac_pkg_openmp=no
AC_MSG_CHECKING([whether OpenMP will work in a package]) AC_MSG_CHECKING([whether OpenMP will work in a package])
AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <omp.h>]], [[ return (omp_get_max_threads() <= 1); ]])]) AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <omp.h>]], [[ return (omp_get_max_threads() <= 1); ]])])
${CC} -o conftest conftest.c ${OPENMP_LIB} ${OPENMP_CXXFLAGS} 2>/dev/null && ./conftest && ac_pkg_openmp=yes ${CC} -o conftest conftest.c ${CPPFLAGS} ${LDFLAGS} ${OPENMP_LIB} ${OPENMP_CXXFLAGS} 2>/dev/null && ./conftest && ac_pkg_openmp=yes
AC_MSG_RESULT([${ac_pkg_openmp}]) AC_MSG_RESULT([${ac_pkg_openmp}])
if test "${ac_pkg_openmp}" = no; then if test "${ac_pkg_openmp}" = no; then
OPENMP_CXXFLAGS='' OPENMP_CXXFLAGS=''