Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DUE 2021-09-21: Packages including omp.h after Rincludes.h #245

Closed
zkamvar opened this issue Aug 31, 2021 · 0 comments · Fixed by #246
Closed

DUE 2021-09-21: Packages including omp.h after Rincludes.h #245

zkamvar opened this issue Aug 31, 2021 · 0 comments · Fixed by #246

Comments

@zkamvar
Copy link
Member

zkamvar commented Aug 31, 2021

That is

AMORE BNN BRISC OpenMPController RFCCA RFpredInterval RLT
RandomFields RandomFieldsUtils RandomForestsGLS RhpcBLASctl RxODE
STB TMB brnn coop data.table excursions float glinternet glmmTMB
gmGeostats graphscan hashr hutilscpp influenceR iq kit likeLTD
mRMRe magick meanShiftR meanr mnlogit poismf poppr praznik rFerns
randomForestSRC rasterKernelEstimates rehh simputation spBayes
spNNGP stringdist sylcount unfoldr

Compilation logs can be seen at https://www.stats.ox.ac.uk/pub/bdr/clang13/ but beware these may only show the first error.

Compiliation Log for poppr
* installing *source* package ‘poppr’ ...
** package ‘poppr’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
make[1]: Entering directory '/data/gannet/ripley/R/packages/tests-clang13/poppr/src'
/usr/local/clang13/bin/clang -I"/data/gannet/ripley/R/R-clang-trunk/include" -DNDEBUG   -isystem /usr/local/clang13/include  -fopenmp -fpic  -g -O3 -Wall -pedantic  -c adjust_missing.c -o adjust_missing.o
/usr/local/clang13/bin/clang -I"/data/gannet/ripley/R/R-clang-trunk/include" -DNDEBUG   -isystem /usr/local/clang13/include  -fopenmp -fpic  -g -O3 -Wall -pedantic  -c bitwise_distance.c -o bitwise_distance.o
In file included from bitwise_distance.c:50:
/usr/local/clang13/lib/clang/13.0.0/include/omp.h:483:39: error: expected 'match' clause on 'omp declare variant' directive
    #pragma omp begin declare variant match(device={kind(host)})
                                      ^
/data/gannet/ripley/R/R-clang-trunk/include/Rinternals.h:967:17: note: expanded from macro 'match'
#define match                   Rf_match
                                ^
In file included from bitwise_distance.c:50:
/usr/local/clang13/lib/clang/13.0.0/include/omp.h:486:39: error: expected 'match' clause on 'omp declare variant' directive
    #pragma omp begin declare variant match(device={kind(nohost)})
                                      ^
/data/gannet/ripley/R/R-clang-trunk/include/Rinternals.h:967:17: note: expanded from macro 'match'
#define match                   Rf_match
                                ^
bitwise_distance.c:815:7: warning: variable 'chr_length' set but not used [-Wunused-but-set-variable]
  int chr_length;
      ^
bitwise_distance.c:1190:7: warning: variable 'chr_length' set but not used [-Wunused-but-set-variable]
  int chr_length;
      ^
2 warnings and 2 errors generated.
make[1]: *** [/data/gannet/ripley/R/R-clang-trunk/etc/Makeconf:168: bitwise_distance.o] Error 1
make[1]: Leaving directory '/data/gannet/ripley/R/packages/tests-clang13/poppr/src'
ERROR: compilation failed for package ‘poppr’
* removing ‘/data/gannet/ripley/R/packages/tests-clang13/Libs/poppr-lib/poppr’
Command exited with non-zero status 1
Time 0:01.95, 0.75 + 0.17

The imminent clang 13.0.0 has an omp.h including

    /* OpenMP 5.1 */
...

#   if defined(_OPENMP) && _OPENMP >= 201811
    #pragma omp begin declare variant match(device={kind(host)})
    static inline int omp_is_initial_device(void) { return 1; }
    #pragma omp end declare variant
    #pragma omp begin declare variant match(device={kind(nohost)})
    static inline int omp_is_initial_device(void) { return 0; }
    #pragma omp end declare variant
#   endif

whose use of match causes a compilation error if included after Rinternals.h. 'Writing R Extensions' presents various workarounds, the main one being the strong advice to include system headers before R headers.

Please correct before 2021-09-21 to safely retain your package on CRAN.

--
Brian D. Ripley, ripley@stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant