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

Compiling fails #5

Closed
jhagberg opened this issue May 9, 2019 · 6 comments
Closed

Compiling fails #5

jhagberg opened this issue May 9, 2019 · 6 comments

Comments

@jhagberg
Copy link

jhagberg commented May 9, 2019

Using
install.packages("ECOSolveR")
gives

In file included from include/ecos.h:28:0,
                 from src/ecos.c:24:
include/glblopts.h:20:10: fatal error: R.h: No such file or directory
 #include <R.h>

creating
ln -s /usr/share/R/include .
in /usr/lib/R fixes this.

@bnaras
Copy link
Owner

bnaras commented May 9, 2019

What platform? Can I have more details? This sounds to me like a peculiarity of your installation as R.h is sought for in $(R_HOME)/include, the standard place.

@mattdowle
Copy link

mattdowle commented May 9, 2019

I'm seeing the same problem. With the 0.5-1 update. I see it's passing OK on CRAN though.
I was surprised too since R.h is indeed in standard place and thousands of other packages are finding R.h fine.
Here's a screenshot showing the red colors.
I wonder if the highlight of R.h is spurious. It could be the line above (glblopts.h) that it can't find.
image

ECOSolveR :
 Version 0.5 installed in /home/mdowle/build/revdeplib built under R 3.6.0 
 Version 0.5.1 available at http://cloud.r-project.org
Update? (Yes/no/cancel) 
trying URL 'http://cloud.r-project.org/src/contrib/ECOSolveR_0.5.1.tar.gz'
Content type 'application/x-gzip' length 2214214 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

* installing *source* package ‘ECOSolveR’ ...
** package ‘ECOSolveR’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
(cp -f ecos-2954b2a-changes/include/* ecos/include && \
cp -f ecos-2954b2a-changes/ecos_bb/* ecos/ecos_bb && \
cp -f ecos-2954b2a-changes/Makefile ecos && \
cp -f ecos-2954b2a-changes/ecos-unix.mk ecos/ecos.mk && \
(cd ecos && \
make libecos.a CC="gcc -std=gnu99" CFLAGS="-O3 -fpic -DCTRLC=1 -DLDL_LONG -DDLONG -I/usr/lib/R/include -Iinclude -Iexternal/ldl/include -Iexternal/amd/include -Iexternal/SuiteSparse_config -I../SuiteSparse_config -Iecos/include -Iecos/external/SuiteSparse_config" AR="ar" RANLIB="ranlib" && \
make libecos_bb.a CC="gcc -std=gnu99" CFLAGS="-O3 -fpic -DCTRLC=1 -DLDL_LONG -DDLONG -I/usr/lib/R/include -Iinclude -Iexternal/ldl/include -Iexternal/amd/include -Iexternal/SuiteSparse_config -I../SuiteSparse_config -Iecos/include -Iecos/external/SuiteSparse_config" AR="ar" RANLIB="ranlib") && \
touch ecos.ts)
make[1]: Entering directory '/tmp/RtmpGWO9Dk/R.INSTALL6aae256ac2db/ECOSolveR/src/ecos'
gcc -std=gnu99 -O3 -fpic -DCTRLC=1 -DLDL_LONG -DDLONG -I/usr/lib/R/include -Iinclude -Iexternal/ldl/include -Iexternal/amd/include -Iexternal/SuiteSparse_config -I../SuiteSparse_config -Iecos/include -Iecos/external/SuiteSparse_config -DCTRLC=1 -DLDL_LONG -DDLONG -Iinclude -Iexternal/ldl/include -Iexternal/amd/include -Iexternal/SuiteSparse_config  -c src/ecos.c -o ecos.o
In file included from include/ecos.h:28:0,
                 from src/ecos.c:24:
include/glblopts.h:20:10: fatal error: R.h: No such file or directory
 #include <R.h>
          ^~~~~
compilation terminated.
Makefile:48: recipe for target 'ecos.o' failed
make[1]: *** [ecos.o] Error 1
make[1]: Leaving directory '/tmp/RtmpGWO9Dk/R.INSTALL6aae256ac2db/ECOSolveR/src/ecos'
Makevars:15: recipe for target 'ecos.ts' failed
make: *** [ecos.ts] Error 2
ERROR: compilation failed for package ‘ECOSolveR’
* removing ‘/home/mdowle/build/revdeplib/ECOSolveR’
* restoring previous ‘/home/mdowle/build/revdeplib/ECOSolveR’

The downloaded source packages are in
        ‘/tmp/Rtmp68y5cY/downloaded_packages’
Warning message:
In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘ECOSolveR’ had non-zero exit status
> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
[1] BiocManager_1.30.4

loaded via a namespace (and not attached):
[1] compiler_3.6.0 tools_3.6.0   
>

@bnaras
Copy link
Owner

bnaras commented May 9, 2019

Actually, my fault. ${R_HOME}/include is nowhere guaranteed to provide the include path. Safer to use Rscript. Will push a fix shortly.

@bnaras
Copy link
Owner

bnaras commented May 10, 2019

@jhagberg I pushed a commit that should fix this problem. Thanks.

@bnaras
Copy link
Owner

bnaras commented May 15, 2019

Fixed and code released

@bnaras bnaras closed this as completed May 15, 2019
@mattdowle
Copy link

Thanks @bnaras. Yes the update works now for me.

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