0

Any idea what might cause a DOUBLE_EPS not declared error when installing R package fixest?

Ultimately I want to install the package didimputation. It fails because doing that requires fixest to be installed, the latest version of which requires R version 3.5. I only have access to R version 3.4.4 (no chance of upgrading).

To make progress, therefore, I am trying to install an archive version of fixest, namely version 0.8.4, which should work with R version 3.4.4. Here's the command I am using:

packageurl <- "https://XXX/src/contrib/Archive/fixest/fixest_0.8.4.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

where XXX is the location of my organisation's private CRAN mirror.

But this fails with a different error message:

g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG  -I"/home/jshaw/R/x86_64-redhat-linux-gnu-library/3.4/Rcpp/include" -I/usr/local/include  -fopenmp -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -c parallel_funs.cpp -o parallel_funs.o
parallel_funs.cpp: In function ‘double poisson_linkinv(double)’:
parallel_funs.cpp:185:22: error: ‘DOUBLE_EPS’ was not declared in this scope
     return x < -36 ? DOUBLE_EPS : exp(x);
                      ^
parallel_funs.cpp: In function ‘double logit_linkinv(double)’:
parallel_funs.cpp:239:22: error: ‘DOUBLE_EPS’ was not declared in this scope
     return x < -30 ? DOUBLE_EPS : (x > 30) ? 1-DOUBLE_EPS : 1 / (1 + 1 / exp(x));
                      ^
parallel_funs.cpp: In function ‘double logit_mueta(double)’:
parallel_funs.cpp:260:16: error: ‘DOUBLE_EPS’ was not declared in this scope
         return DOUBLE_EPS;
                ^
make: *** [parallel_funs.o] Error 1
ERROR: compilation failed for package ‘fixest’
* removing ‘/home/jshaw/R/x86_64-redhat-linux-gnu-library/3.4/fixest’
Warning in install.packages :
  installation of package ‘/tmp/Rtmpi4jCku/downloaded_packages/fixest_0.8.4.tar.gz’ had non-zero exit status

Any idea how I solve this?

I am working on a Red Hat Linux environment.

r2evans
  • 141,215
  • 6
  • 77
  • 149
jms202
  • 51
  • 1
  • 3
  • You will need to patch the source (to `#define DOUBLE_EPS`) to match your ancient and outdated system. CRAN works with current versions of opetating systems and tools. Going backwards to versions before fixest 0.8.4. – Dirk Eddelbuettel Feb 28 '23 at 12:47
  • Thanks @Dirk. Basic question, but can you explain how I would go about doing this? – jms202 Feb 28 '23 at 13:16
  • 1
    You download the .tar.gz that gives you trouble. open it (`tar xaf file_*tar.gz`) and edit the file(s) in question. You need to add the the definiton of `DOUBLE_EPS` that is now standard. Years ago it may have been `DBL_MAX`. You should then be able to install from the modified sources you have now "patched" (or "adapted") for your (these days) somewhat unique (and 'antique') build environment. – Dirk Eddelbuettel Feb 28 '23 at 14:51

0 Answers0