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

CRAN build is failing - Calloc call in diff2.c #276

Closed
dansmith01 opened this issue Jan 6, 2025 · 3 comments
Closed

CRAN build is failing - Calloc call in diff2.c #276

dansmith01 opened this issue Jan 6, 2025 · 3 comments
Milestone

Comments

@dansmith01
Copy link

CRAN Package Check Results are failing on r-devel-linux-x86_64-debian-gcc.

Install log is partially copied below:

gcc-14 -I"/home/hornik/tmp/R.check/r-devel-gcc/Work/build/include" -DNDEBUG   -I/usr/local/include -D_FORTIFY_SOURCE=3   -fpic  -g -O2 -Wall -Wstrict-prototypes -pedantic -mtune=native  -c diff2.c -o diff2.o
In file included from diff2_lowlevel_template.h:17,
                 from diff2_lowlevel.h:15,
                 from diff2.c:10:
diff2_lowlevel_template.h: In function ‘diff2_int’:
000.types.h:64:31: error: implicit declaration of function ‘Calloc’; did you mean ‘calloc’? [-Wimplicit-function-declaration]
   64 |   #define R_CALLOC(num, size) Calloc(num, size)
      |                               ^~~~~~
diff2_lowlevel_template.h:75:11: note: in expansion of macro ‘R_CALLOC’
   75 |     tmp = R_CALLOC(nidxs - lag, X_C_TYPE);
      |           ^~~~~~~~
000.templates-types.h:40:22: error: expected expression before ‘int’
   40 |     #define X_C_TYPE int
      |                      ^~~
000.types.h:64:43: note: in definition of macro ‘R_CALLOC’
   64 |   #define R_CALLOC(num, size) Calloc(num, size)
      |                                           ^~~~
diff2_lowlevel_template.h:75:33: note: in expansion of macro ‘X_C_TYPE’
   75 |     tmp = R_CALLOC(nidxs - lag, X_C_TYPE);
      |                                 ^~~~~~~~
000.types.h:65:23: error: implicit declaration of function ‘Free’; did you mean ‘free’? [-Wimplicit-function-declaration]
   65 |   #define R_FREE(ptr) Free(ptr)
      |                       ^~~~
diff2_lowlevel_template.h:118:5: note: in expansion of macro ‘R_FREE’
  118 |     R_FREE(tmp);
      |     ^~~~~~
In file included from diff2_lowlevel_template.h:17,
                 from diff2_lowlevel.h:19:
diff2_lowlevel_template.h: In function ‘diff2_dbl’:
000.templates-types.h:50:22: error: expected expression before ‘double’
   50 |     #define X_C_TYPE double
      |                      ^~~~~~
000.types.h:64:43: note: in definition of macro ‘R_CALLOC’
   64 |   #define R_CALLOC(num, size) Calloc(num, size)
      |                                           ^~~~
diff2_lowlevel_template.h:75:33: note: in expansion of macro ‘X_C_TYPE’
   75 |     tmp = R_CALLOC(nidxs - lag, X_C_TYPE);
      |                                 ^~~~~~~~
make[1]: *** [/home/hornik/tmp/R.check/r-devel-gcc/Work/build/etc/Makeconf:195: diff2.o] Error 1
make[1]: Leaving directory '/tmp/RtmpnknwhO/R.INSTALL9fa214f1933e/matrixStats/src'
ERROR: compilation failed for package ‘matrixStats’
* removing ‘/home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/matrixStats’
@HenrikBengtsson
Copy link
Owner

Thanks for reaching out. I'm pretty sure this is related to #271. Today, Kurt H from the CRAN Team reached out to me about them wanting to remove the intermediate STRICT_R_HEADERS that we rely on in the current CRAN version. I responded that we'll submit the fix as soon as CRAN submissions open up again. I guess CRAN went ahead and removed STRICT_R_HEADERS, which is what we now see.

@HenrikBengtsson HenrikBengtsson added this to the Next release milestone Jan 6, 2025
@yaccos
Copy link
Contributor

yaccos commented Jan 7, 2025

Yes, this is surely related to #271. The issue was resolved by PR #272, but the patch has not been submitted to CRAN yet. Have you tried building the devel version of matrixStats?

@HenrikBengtsson
Copy link
Owner

matrixStats 1.5.0 is now on CRAN. It passed all incoming checks, so I think we can safely close this one.

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

No branches or pull requests

3 participants