(a) dev-lang/R with USE=tk is not using prefix path for tcl/tkConfig.sh (Upstream report: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=15647) If I run: ./configure --libdir=/some/prefix --with-tcltk I would expect that that "checking for *.sh" in library (sub)directories searches in ${libdir} before any other guessed locations. However, it does not: checking for tclConfig.sh... no checking for tclConfig.sh in library (sub)directories... /usr/lib64/tclConfig.sh checking for tkConfig.sh... no checking for tkConfig.sh in library (sub)directories... /usr/lib64/tkConfig.sh (here, ${libdir} was /some/prefix and the files found were some outside) I'd consider this (i.e., that Gentoo provides --libdir and R does not search it for the config files) an R bug and reported it there, but this may take a while to be fixed, if at all. Workaround patch: --- configure.ac.orig 2014-01-24 23:14:46.151754852 +0000 +++ configure.ac 2014-01-24 23:14:31.946442971 +0000 @@ -380,11 +380,11 @@ fi], AC_ARG_WITH([tcl-config], [AS_HELP_STRING([--with-tcl-config=TCL_CONFIG],[specify location of tclConfig.sh @<:@@:>@])], [TCL_CONFIG="${withval}"], -[TCL_CONFIG=""]) +[TCL_CONFIG="${libdir}/tclConfig.sh"]) AC_ARG_WITH([tk-config], [AS_HELP_STRING([--with-tk-config=TK_CONFIG],[specify location of tkConfig.sh @<:@@:>@])], [TK_CONFIG="${withval}"], -[TK_CONFIG=""]) +[TK_CONFIG="${libdir}/tkConfig.sh"]) (b) --with-blas= requires directory, but pkg-config from ebuild provides the linker flags If I run: ./configure --libdir=/some/prefix --with-blas the configure call is: configure --with-blas=-L/path/to/usr/lib/blas/reference -lblas when it should be: configure --with-blas=/path/to/usr/lib/blas/reference Patch: --- R-3.0.2.ebuild.orig 2014-01-26 14:38:09.707069380 +0000 +++ R-3.0.2.ebuild 2014-01-26 14:21:27.221276947 +0000 @@ -82,6 +82,8 @@ src_prepare() { # https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14953 epatch "${FILESDIR}"/${PN}-3.0.0-rmath-shared.patch + epatch "${FILESDIR}"/${PN}-3.0.2-tcltk.patch + # fix packages.html for doc (gentoo bug #205103) sed -i \ -e "s:../../../library:../../../../$(get_libdir)/R/library:g" \ @@ -139,7 +141,7 @@ src_configure() { --with-system-bzlib \ --with-system-pcre \ --with-system-xz \ - --with-blas="$($(tc-getPKG_CONFIG) --libs blas)" \ + --with-blas="$($(tc-getPKG_CONFIG) --libs-only-L blas | sed 's:^-L::')" \ --docdir="${EPREFIX}/usr/share/doc/${PF}" \ rdocdir="${EPREFIX}/usr/share/doc/${PF}" \ $(use_enable nls) \
Thanks, mschu. I can confirm the bug. I think libdir is used for R to install to, not for the configure to search for libraries. Will --with-tcltk=/path/to/tclck do? Not sure if there is a cleaner solution for blas.
For Tcl/Tk, --with-tk-config=/path/to/tkConfig.sh --with-tcl-config=/path/to/tclConfig.sh will work. For BLAS, --with-blas="$($(tc-getPKG_CONFIG) --variable=libdir blas)" would also work.
Sorry, I realized I did not answer your question. --with-tcltk=$EPREFIX/usr/lib does not work.
(In reply to Michael Schubert from comment #2) > For Tcl/Tk, > > --with-tk-config=/path/to/tkConfig.sh --with-tcl-config=/path/to/tclConfig.sh > > will work. > > For BLAS, > > --with-blas="$($(tc-getPKG_CONFIG) --variable=libdir blas)" > > would also work. Let's patch it like this then.
Created attachment 370102 [details, diff] R-3.0.2.ebuild patch Fixes for blas cflags instead of libdir and using prefix tcl/tk-config. Tested on RHEL host. configure with blas and USE +/- tk are clean.
Created attachment 370104 [details, diff] R-3.0.2.ebuild patch CORRECTION: applied in the right direction
Thanks Michael, commited. Please find my updated patch below, leveraging use_with. Enjoy! ./ChangeLog + 17 Feb 2014; Benda Xu <heroxbd@gentoo.org> R-3.0.2.ebuild: + Pass correct blas path to configure, pass {tk,tcl}-config scripts to configure + explicitly for Prefix. Credits to Michael Schubert, bug 499356. + @@ -157,6 +157,8 @@ $(use_with readline) \ $(use_with tiff libtiff) \ $(use_with tk tcltk) \ + $(use_with tk tk-config "${EPREFIX}"/usr/lib/tkConfig.sh) \ + $(use_with tk tcl-config "${EPREFIX}"/usr/lib/tclConfig.sh) \ $(use_with X x) }
The --with-blas change is not seriously reflected upon. I am going to revert it as pointed out by Robert McGehee on bug 505904.
The fix was needed and did work when I submitted it. If I'm not mistaken, gentoo BLAS changed in the meantime to no longer link libblas.so to the BLAS currently eselected, but have pkg-config take care linking the right one. I played around with this a while ago and could not get R to link the right BLAS without explicitly re-introducing the symlink. I'll have another look later today, but I suspect the fix will be more complicated than just reverting.
Michael, if you have trouble configuring the correct blas library, please file a bug on the corresponding blas implementation. We (science herd) are in a transition into a new framework of blas, there might be such glitches. My Prefix outputs: $ pkg-config --libs blas -lrefblas after all.
(In reply to Michael Schubert from comment #9) > The fix was needed and did work when I submitted it. > > If I'm not mistaken, gentoo BLAS changed in the meantime to no longer link > libblas.so to the BLAS currently eselected, but have pkg-config take care > linking the right one. > > I played around with this a while ago and could not get R to link the right > BLAS without explicitly re-introducing the symlink. I'll have another look > later today, but I suspect the fix will be more complicated than just > reverting. Yes, it might be more complicated than my first thought. What blas are you using?
I am using openblas from ::science. I can confirm linking of openblas works with R 3.0.3 and the original pkg-config --libs, so I second reverting for the current version of R (I did not re-test with 3.0.2 but I can recall it not working - however, that was with the old blas structure).