From ripley at stats.ox.ac.uk  Fri Oct 12 23:58:45 2012
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri, 12 Oct 2012 22:58:45 +0100
Subject: [Rd] R CMD SHLIB error bad value (core2) for -mtune= switch
In-Reply-To: <1349996161811-4645928.post@n4.nabble.com>
References: <1349996161811-4645928.post@n4.nabble.com>
Message-ID: <50789295.5020905@stats.ox.ac.uk>

1) Cygwin is not a supported platform. See the 'R Installation and 
Administration Manual'.

2) C:\Program Files\R\R-2.15.1\etc\i386\Makeconf is for the Windows port 
of R, not Cygwin.

Are you perchance trying to use Windows R with Cygwin compilers? It will 
not work ....  Binary installations of R have to be used with exactly 
the compilers used to build R.

On 11/10/2012 23:56, smzyij wrote:
> Hi there,
>
> I'm having trouble to compile the R + C/C++ codes for this project from
> Yahoo folks on latent factor models:
> https://github.com/yahoo/Latent-Factor-Models#readme
>
> After downloading the package from the site, I could not successfully *make*
> the files.
>
> Here is the message:
> ======================================================================================
> sh-4.1$ make
> R CMD SHLIB src/C/util.c src/C/factor_model_util.c src/C/pagerank.c
> src/C/hierarchical.c src/C/factor_model_multicontext.c
> src/C/factor_model_util2.cpp -o lib/c_funcs.so
> make[1]: Entering directory `/cygdrive/c/Users/yi/Desktop/Yi/Latent Factor
> models'
> g++  -I"C:/PROGRA~1/R/R-215~1.1/include" -DNDEBUG          -O2 -Wall
> -mtune=core2 -c src/C/factor_model_util2.cpp -o src/C/factor_model_util2.o
> src/C/factor_model_util2.cpp:1: error: bad value (core2) for -mtune= switch
> C:/PROGRA~1/R/R-215~1.1/etc/i386/Makeconf:179: recipe for target
> `src/C/factor_model_util2.o' failed
> make[1]: *** [src/C/factor_model_util2.o] Error 1
> make[1]: Leaving directory `/cygdrive/c/Users/yi/Desktop/Yi/Latent Factor
> models'
> Makefile:8: recipe for target `c_funcs' failed
> make: *** [c_funcs] Error 1
> ======================================================================================
>
> I am running cygwin (virtual linux environment on windows) on Windows 7
> 64bit Professional with Intel core i5 650 @3.20GHz 3.33GHz with 4GB memory
> to take advantage of its c/c++ compile capabilities. My R version is R
> 2.15.1. It looks to me from the files in my src/C folder that  "src/C/util.c
> src/C/factor_model_util.c src/C/pagerank.c src/C/hierarchical.c
> src/C/factor_model_multicontext.c " have all been complied to their
> corresponding *.o files, but not "src/C/factor_model_util2.cpp ".
>
> Here is the makefile contents (You can download them from the link I posted
> above):
> ======================================================================================
> all: lib c_funcs
>
> pagerank: src/C/pagerank.c src/C/util.h
> 	R CMD SHLIB src/C/pagerank.c -o lib/pagerank.so
>
> c_funcs: src/C/util.h src/C/factor_model_util.h src/C/pagerank.c
> src/C/util.c src/C/factor_model_util.c src/C/factor_model_util2.cpp
> src/C/hierarchical.c src/C/hierarchical.h src/C/factor_model_multicontext.c
> 	R CMD SHLIB src/C/util.c src/C/factor_model_util.c src/C/pagerank.c
> src/C/hierarchical.c src/C/factor_model_multicontext.c
> src/C/factor_model_util2.cpp -o lib/c_funcs.so
>
> clean:
> 	rm -f src/C/*.o src/C/*.so lib/*.so
>
> lib:
> 	mkdir lib
> ======================================================================================
>
> Here is the contents of the makevars:
> ======================================================================================
> PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) -Wall
> ======================================================================================
>
> I did check my C:\Program Files\R\R-2.15.1\etc\i386\Makeconf file, but could
> not figure out why this matters:
> bad value (core2) for -mtune= switch
>
>
> Can someone help or what else do you need to help diagnose the issue here?
>
> Many Thanks!
>
> YI
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/R-CMD-SHLIB-error-bad-value-core2-for-mtune-switch-tp4645928.html
> Sent from the R devel mailing list archive at Nabble.com.
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] R CMD SHLIB error bad value (core2) for -mtune= switch
Prof Brian Ripley