[R] gcc-4.5.2 and install.packages("glmnet")?

Hugo Mildenberger Hugo.Mildenberger at web.de
Fri Jun 24 10:36:24 CEST 2011


That problem is at least two-fold:
1.  A failing heuristic in glmnet/configure.in
2.  glmnet/src/glmnet/src/newGLMnet_f.f90 does not compile.
      Several problems:
                  - gfortran does not recognise lines starting with [c|C] comments
                  - starting at line 517, a line number column was inserted after column 72  
                  - long lines had been wrapped by inserting [*], often inside parameter names
                  -> looks very wrong, much like a listing file

Quick fix procedure:
	ad  1.  unpack the archive
                apply the patch shown below or edit configure.in (replace ${FC} by ${F77} in line 38)
                delete glmnet/configure
                repack the archive
                try to install the newly packed archive via R CMD INSTALL (will fail)

      ad 2.  I could also attach a patch also for glmnet/src/newGLMnet_f.f90
                - but it is rather big (you may contact me)
                - while the package will compile and load without error,
                   running example(glmnet) results in:
                   glmnet> fit1=glmnet(x,y)
                   Error in validObject(.Object) : 
                   invalid class "dgCMatrix" object: length(Dimnames[[2]])' must match Dim[2]
                   In addition: Warning message:
                   from glmnet Fortran code - Convergence for 1th lambda value not reached after 
                           maxit=100000 iterations; solutions for larger lambdas returned 

So there seem to be many problems worth of a bug report to the author(s) of glmnet.

Kind regards

Hugo 

--- cut here ---

diff -ur a/glmnet/configure.in b/glmnet/configure.in
--- a/glmnet/configure.in       2011-06-15 20:05:30.000000000 +0200
+++ b/glmnet/configure.in       2011-06-24 10:08:21.000000000 +0200
@@ -35,7 +35,7 @@
        FC=`basename "${FC}"`
 fi
 
-case "${FC}" in
+case "${F77}" in
     gfortran*)
       echo "  R configured for gfortran; Good!"
       AC_SUBST(OUR_FCFLAGS, "-fdefault-real-8 -ffixed-form")

--- cut here ---


On Thursday 23 June 2011 22:39:33 Juergen Rose wrote:
> Hi,
> 
> is there any chance to install glmnet with gcc-4.5.2? For me it fails on
> all systems with:
> 
> trying URL
> 'http://mirrors.softliste.de/cran/src/contrib/glmnet_1.7.tar.gz'
> Content type 'application/x-gzip' length 522888 bytes (510 Kb)
> opened URL
> ==================================================
> downloaded 510 Kb
> 
> * installing *source* package ‘glmnet’ ...
>  This package has only been tested with gfortran.
>  So some checks are needed.
>  R_HOME is /usr/lib64/R
> Attempting to determine R_ARCH...
> R_ARCH is 
> Attempting to detect how R was configured for Fortran 90....
>     Unsupported Fortran 90 compiler or Fortran 90
>     compilers unavailable! Stop!
> ERROR: configuration failed for package ‘glmnet’
> 
> How can I get more information, what a problem has happened?
> 
> Otherwise I have no problem to compile a small Fortran 90 program:
> root at orca:/home/rose/Txt/src/Test/Fortran(57)# cat hello.f90 
> program Hello
>   print *,'Hello world'
> end program Hello
> root at orca:/home/rose/Txt/src/Test/Fortran(58)# gfortran -cpp -dM
> hello.f90
> root at orca:/home/rose/Txt/src/Test/Fortran(59)# ./a.out
>  Hello world
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list