ChaoranHu / coga

R package for Convolution of Gamma Distributions
GNU General Public License v3.0
4 stars 1 forks source link

Installation problems #6

Closed stemangiola closed 1 year ago

stemangiola commented 4 years ago

Hello,

when trying to install coga I get the following errors under R3xx and R4xx

cc -g -O2  -fpic -USOLARIS -DRCPP_USE_UNWIND_PROTECT -I. -I../inst/include -DHAVE_CONFIG_H -DREALSIZE=8  -I./src/common -I. -I.  -I./src/divonne -DNOUNDERSCORE -c -o Divonne.o ./src/divonne/Divonne.c
In file included from ./src/divonne/common.c:14:0,
                 from ./src/common/CSample.c:77,
                 from ./src/divonne/Divonne.c:14:
./src/divonne/Split.c: In function ‘SolveEqs’:
./src/divonne/Split.c:119:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for(int first_time = 1 ; c >= cut; --c) {
   ^
./src/divonne/Split.c:119:3: note: use option -std=c99 or -std=gnu99 to compile your code
make[1]: Leaving directory `/tmp/RtmpaENKVE/R.INSTALL2f954222bc19/cubature/src/Cuba-4.2'
make[1]: *** [libcuba.a(Divonne.o)] Error 1
make: *** [cuba.ts] Error 2
ERROR: compilation failed for package ‘cubature’
* removing ‘/stornext/Home/data/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.6/cubature’
* restoring previous ‘/stornext/Home/data/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.6/cubature’
Error: Failed to install 'coga' from GitHub:
  (converted from warning) installation of package ‘cubature’ had non-zero exit status

If I use the -std=c99 I get the following warning

cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++

It is possible to avoid this all together?

stemangiola commented 4 years ago

Have you tried to install coga in R4.x.x I think you might have some problems with many compilers for your choice of using

 for(int first_time = 1 ; c >= cut; --c) {
ChaoranHu commented 1 year ago

Sorry for the extremely late reply, @stemangiola!

I think the issue you met is not in coga but dependent R package cubature. So, maybe you want to contact the maintenance of that package.

--C.Hu