kogalur / randomForestSRC

DOCUMENTATION:
https://www.randomforestsrc.org/
GNU General Public License v3.0
115 stars 18 forks source link

Install Error: identifier "M_E" is undefined; compilation aborted #6

Closed RachelPeung closed 6 years ago

RachelPeung commented 6 years ago

Dear Professor,

I've tried to install the randomForestSRC package for a Centos system but I failed. But with a windows7 system at last I succeed with running install.packages("randomForestSRC", dependencies = T, repos = 'http://cran.rstudio.com/') (I also failed directly installing the downloaded package on windows7). I'm sorry that I know little about compilation. I hope that you would give me some help to solve the problem.

Try1:

At first I try to install the package with install.packages('randomForestSRC_2.5.1.tar.gz') in the centos system as I've download the package file under the working directory. But it incurrs an error below:

Installing package into ‘/public/home/pengruijiao/R/x86_64-pc-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
inferring 'repos = NULL' from 'pkgs'
* installing *source* package ‘randomForestSRC’ ...
** package ‘randomForestSRC’ successfully unpacked and MD5 sums checked
checking for gcc... icc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether icc -std=gnu99 accepts -g... yes
checking for icc -std=gnu99 option to accept ISO C89... none needed
checking for icc -std=gnu99 option to support OpenMP... -fopenmp
configure: creating ./config.status
config.status: creating src/Makevars
** libs
icc -std=gnu99 -I/public/software/R-3.3.3/lib64/R/include -DNDEBUG  -I/usr/local/include   -fopenmp  -fpic  -g -O2 -std=c99  -c R_init_randomForestSRC.c -o R_init_randomForestSRC.o
icc: command line warning #10121: overriding '-std=gnu99' with '-std=c99'
icc -std=gnu99 -I/public/software/R-3.3.3/lib64/R/include -DNDEBUG  -I/usr/local/include   -fopenmp  -fpic  -g -O2 -std=c99  -c randomForestSRC.c -o randomForestSRC.o
icc: command line warning #10121: overriding '-std=gnu99' with '-std=c99'
randomForestSRC.c(2336): error: identifier "M_E" is undefined
                    RF_vimpCLSptr[p][j][k] = M_E * result / (double) cumDenomCount;
                                             ^

compilation aborted for randomForestSRC.c (code 2)
make: *** [randomForestSRC.o] Error 2
ERROR: compilation failed for package ‘randomForestSRC’
* removing ‘/public/home/pengruijiao/R/x86_64-pc-linux-gnu-library/3.3/randomForestSRC’
Warning message:
In install.packages("randomForestSRC_2.5.1.tar.gz") :
  installation of package ‘randomForestSRC_2.5.1.tar.gz’ had non-zero exit status

Try2:

Then I found an introduction about the package installation although it's mainly about to utilize OpenMP: http://ccs.miami.edu/~hishwaran/rfsrc.html, and I followed the method 1:

1. Download the package source code randomForestSRC_X.x.x.tar.gz. The X's indicate the version posted. Do not download the binary.

2. Open a console, navigate to the directory containing the tarball, and untar it using the command

tar -xvf randomForestSRC_X.x.x.tar.gz

3. This will create a directory structure with the root directory of the package named randomForestSRC. Change into the root directory of the package using the command

cd randomForestSRC

4. Run autoconf using the command

autoconf

5. Change back to your working directory using the command

cd ..

From your working directory, execute the command

R CMD INSTALL --preclean --clean randomForestSRC

on the modified package. Ensure that you do not target the unmodified tarball, but instead act on the directory structure you just modified.

But the same error occurs just like the error above.

Try3:

And I try install the package on window7. At first I failed but I succeded later with install.packages("randomForestSRC", dependencies = T, repos = 'http://cran.rstudio.com/'). I try the same command on centos but it just did't work. The error is still no change as above, except it downloads something before the installation

Content type 'application/x-gzip' length 903705 bytes (882 KB)
==================================================
downloaded 882 KB
kogalur commented 6 years ago

M_E is in math.h and represents the constant e. Those headers are provided by the GNU C library. I would recommend that you install and/or update the GCC compiler on your system.

RachelPeung commented 6 years ago

Thank you for answering me! I have no privilege to update the compiler since I run the code on a server and I'm not Administrator. I may talk to my mentor to see if we can have the compiler updated. Thank you!