[Bioc-devel] groHMM Bioconductor

Pariksheet Nanda p@n79 @end|ng |rom p|tt@edu
Sat Jan 25 05:38:35 CET 2025


Hi Tulip,

The R NEWS file says "Strict R headers are now the default.  This 
removes the legacy definitions of PI, Calloc, Realloc and Free: use 
M_PI, R_Calloc, R_Realloc or R_Free instead" here: 
https://cran.r-project.org/doc/manuals/r-devel/NEWS.html so the patch 
below fixes the source compilation of groHMM.

NB: Resending in plain text because the mailing list list rejected my 
previous message with "The message's content type was not explicitly 
allowed" for some reason.

Pariksheet
---


diff --git a/src/hmmMiscFunctions.c b/src/hmmMiscFunctions.c
index 68d2359..85e1a29 100755
--- a/src/hmmMiscFunctions.c
+++ b/src/hmmMiscFunctions.c
@@ -271,8 +271,8 @@ extern void SStatsGamma_p1(int state, int emis_indx, 
void* ss, fwbk_t fwbk) {
  }
  extern void UpdateGamma(int state, void* ss, hmm_t *hmm) {
    ssGamma *SS = (ssGamma*)ss;
-  double *shape= (double*)Calloc(1, double);
-  double *scale= (double*)Calloc(1, double);
+  double *shape= (double*)R_Calloc(1, double);
+  double *scale= (double*)R_Calloc(1, double);
    int updateRetVal= MLEGamma(SS[0].N, SS[0].sumPiXi, SS[0].sumLogPiXi,
                          shape, scale);
    if(updateRetVal == 0) {
@@ -284,8 +284,8 @@ extern void UpdateGamma(int state, void* ss, hmm_t 
*hmm) {
          due to instibility!  Using Shape: %f; Scale: %f\n",
          state, hmm[0].em_args[state][0], hmm[0].em_args[state][1]);
    }
-  Free(shape);
-  Free(scale);
+  R_Free(shape);
+  R_Free(scale);
  }
  // Used to fit a constrained gamma, where E[x] = 1, and shape=1/scale.
  extern void UpdateGamma_SHAPEeq1overSCALE(int state, void* ss, hmm_t 
*hmm) {







On 1/24/25 11:58 AM, Tulip Nandu wrote:
> Hi,
> 
> Can anyone please help with this error. I solved one error of dgeTests now this one cropped up. THis wan all working fine before. Has anything changed.
> 
> Please let me know. Any help is appreciated.
> 
> Regards,
> 
> Tulip.
> 
> 
> 
> "
> 
> hmmMiscFunctions.c: In function ‘SStatsGamma’:
> hmmMiscFunctions.c:235:37: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘double’ [-Wformat=]
>    235 |     if(!(logPP <= epsilon)) Rprintf("[SSallocGamma] -- \
>        |                                     ^~~~~~~~~~~~~~~~~~~~
>    236 |         Assertion about to fail!  logPP= %d\n", logPP);
>        |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~
>        |                                                 |
>        |                                                 double
> hmmMiscFunctions.c: In function ‘UpdateGamma’:
> hmmMiscFunctions.c:274:27: warning: implicit declaration of function ‘Calloc’; did you mean ‘calloc’? [-Wimplicit-function-declaration]
>    274 |   double *shape= (double*)Calloc(1, double);
>        |                           ^~~~~~
>        |                           calloc
> hmmMiscFunctions.c:274:37: error: expected expression before ‘double’
>    274 |   double *shape= (double*)Calloc(1, double);
>        |                                     ^~~~~~
> hmmMiscFunctions.c:275:37: error: expected expression before ‘double’
>    275 |   double *scale= (double*)Calloc(1, double);
>        |                                     ^~~~~~
> hmmMiscFunctions.c:287:3: warning: implicit declaration of function ‘Free’; did you mean ‘free’? [-Wimplicit-function-declaration]
>    287 |   Free(shape);
>        |   ^~~~
>        |   free
> make: *** [/home/biocbuild/bbs-3.21-bioc/R/etc/Makeconf:195: hmmMiscFunctions.o] Error 1
> ERROR: compilation failed for package ‘groHMM’
> * removing ‘/home/biocbuild/bbs-3.21-bioc/R/site-library/groHMM’
> 
> "



More information about the Bioc-devel mailing list