Bug 314253

Summary: recent libgfortran-related commits breaks cantor-R support on fedora
Product: [Applications] cantor Reporter: Rex Dieter <rdieter>
Component: generalAssignee: Alexander Rieder <alexanderrieder>
Status: RESOLVED FIXED    
Severity: normal CC: aacid, kevin.kofler
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.1

Description Rex Dieter 2013-02-01 14:43:58 UTC
$SUMMARY says it all, recent cmake-related commits wrt libgfortran breaks R support on fedora.  In short, libgfortran is not found, and disables R support.

The commits are:
https://projects.kde.org/projects/kde/kdeedu/cantor/repository/revisions/6e95493628e6ec6bef4d9ec9122b67ca0351b2a0
https://projects.kde.org/projects/kde/kdeedu/cantor/repository/revisions/41f812a7698fb965e7ec2d5499fb66a6b87f48b7
https://projects.kde.org/projects/kde/kdeedu/cantor/repository/revisions/cc26da79e51f4826a9b34ae034fc40704b2748e9

On fedora, libgfortran.so is treated as a gcc-private lib (similar to libstdc++.so) in /usr/lib/gcc/x86_64-redhat-linux/4.7.2/libgfortran.so (on x86_64 anyway), and the 
FIND_LIBRARY(GFORTRAN_LIBRARY gfortran)
call introduced in these commits doesn't seem to find it.

I'm looking into whether this is expected or some cmake bug/issue.

Reproducible: Always
Comment 1 Rex Dieter 2013-02-01 14:58:41 UTC
Fwiw, I question the legitimacy of the comment in FindR.cmake:
  # for at least some versions of R, we seem to have to link against -lRlapack. Else loading some
  # R packages will fail due to unresolved symbols, or we can't link against -lR.

I'd argue the problem more likely lies in some broken R installs, where their modules/libraries themselves are underlinked and/or missing symbols, and this here is just a workaround/bandaid.

(I suppose that may discount static linking though... ugh.  Not sure if that's a case worrying to much about though honestly)
Comment 2 Albert Astals Cid 2013-02-04 19:18:26 UTC
Rex, does https://git.reviewboard.kde.org/r/108701/ help?
Comment 3 Rex Dieter 2013-02-04 19:28:20 UTC
Looks like it will, I'll test and report back.
Comment 4 Albert Astals Cid 2013-02-06 22:39:53 UTC
Any luck?
Comment 5 Rex Dieter 2013-02-07 14:10:14 UTC
reviewboard patch confirmed good fixing this bug, thanks.
Comment 6 Christophe Marin 2013-02-07 22:08:00 UTC
Git commit aee382880f4f7a3b8d02bf0b697e6b334eacf65a by Christophe Giboudeaux.
Committed on 07/02/2013 at 23:06.
Pushed by cgiboudeaux into branch 'KDE/4.10'.

Try harder to find gfortran
Some distributions (Fedora, OpenSUSE...) don't install the libgfortran library in a standard dir thus making the detection fail.
Instead of looking for libgfortran.so, we know run gfortran to get the full path.

REVIEW: 108701
FIXED-IN: 4.10.1

M  +16   -3    cmake/FindR.cmake

http://commits.kde.org/cantor/aee382880f4f7a3b8d02bf0b697e6b334eacf65a