Bug 365897 - Build fails, error about no R.h.
Summary: Build fails, error about no R.h.
Status: RESOLVED FIXED
Alias: None
Product: cantor
Classification: Applications
Component: r-backend (show other bugs)
Version: 16.04
Platform: Compiled Sources Linux
: NOR minor
Target Milestone: ---
Assignee: Filipe Saraiva
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-20 13:35 UTC by jarymut+kde
Modified: 2017-04-29 13:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Change 'echo -n' to 'printf' (638 bytes, patch)
2016-07-20 13:37 UTC, jarymut+kde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jarymut+kde 2016-07-20 13:35:16 UTC
Build fails with errors: cmake was unable to find R.h. Reason is  'echo -n' in FindR.cmake. Simply changing it to printf fixes issue.

Reproducible: Always

Steps to Reproduce:
1. Set /bin/sh to be dash
2. Try to build cantor

Actual Results:  
Build fails. Error about cmake not finding R.h.

Expected Results:  
Cantor builds without problems

I'm using Gentoo, cmake 3.6.0, dash 0.5.8.2, cantor 16.04.3.
Comment 1 jarymut+kde 2016-07-20 13:37:39 UTC
Created attachment 100196 [details]
Change 'echo -n' to 'printf'

It works as portage patch, so maybe paths should be changed.
Comment 2 Filipe Saraiva 2017-04-28 19:47:43 UTC
Is R Backend working for you?
Comment 3 jarymut+kde 2017-04-28 20:06:29 UTC
Hi.
I forgot about it, because someone in my distro (Gentoo) used same kind of patch for version 17: https://bugs.gentoo.org/show_bug.cgi?id=596940

according to POSIX echo does not take any arguments, but cmake/FindR.cmake still contains:
    sh -c "echo -n $R_INCLUDE_DIR"
at https://github.com/KDE/cantor/blob/master/cmake/FindR.cmake#L34

There are two options:
1. go POSIX and change it to:
    sh -c "printf $R_INCLUDE_DIR"
2. Bash is installed on most systems, so change it to:
    bash -c "echo -n $R_INCLUDE_DIR"
Comment 4 Filipe Saraiva 2017-04-28 20:41:10 UTC
Thanks jarymut, I will address it soon. But in a side question, is R backend working to you in Gentoo? Several distros as problem with this backend right now (bug 351871), so I would like to know if it works for Gentoo. Thanks.
Comment 5 jarymut+kde 2017-04-28 22:03:59 UTC
Sorry, I misunderstood. Nope, it is stuck on "initialising session". I don't know if it has worked before.
I'm using LXQt, KDE was for other users. And I simply installed "all KDE stuff" and noticed cantor did not compile.
Comment 6 Filipe Saraiva 2017-04-29 13:38:32 UTC
Git commit 01cb9b95dce72092231594a44b6dcfb913d475e5 by Filipe Saraiva.
Committed on 29/04/2017 at 13:37.
Pushed by filipesaraiva into branch 'master'.

Put the FindR.cmake in a POSIX compatible way

M  +1    -1    cmake/FindR.cmake

https://commits.kde.org/cantor/01cb9b95dce72092231594a44b6dcfb913d475e5