[R] How Can I Build a Standalone Binary

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Fri Aug 7 23:23:48 CEST 2020


I don't think it's feasible to do what you want.  At a very basic level, 
R assumes it has files distributed across a file system (mostly below 
the R.home() directory).  Faking that in a single standalone executable 
may be possible but wouldn't be easy.

If running a server isn't possible, then I'd suggest you work on 
automating a regular R installation, and put the things you want to run 
into scripts that make use of it.  Two steps instead of one.

Duncan Murdoch



On 07/08/2020 5:10 p.m., Knecht, Logan wrote:
> Unfortunately, that is not a solution due to the constraints of file sizes associated with the run time operations as well as specific execution workflows.
> 
> I need to make this a packaged distributable and the only blocker for it at the moment is not being able to successfully bundle R as a standalone binary.
> 
> Warm Regards,
> 
> Logan Knecht
> 
> 2020/08/07 午前4:50 に、"Duncan Murdoch" <murdoch.duncan using gmail.com> を書き込みました:
> 
>      Wouldn't it be easier to set up a Shiny host system, and just give your
>      collaborators a URL to the Shiny app running there?
> 
>      Duncan Murdoch
> 
> 
>      On 06/08/2020 5:32 p.m., Knecht, Logan wrote:
>      > Hello all,
>      >
>      > ===== The short version =====
>      >
>      > I am trying to build a standalone version for R so that I can bundle and package a self-hosted environment for a shiny app. There are reasons for this decision, but it will only distract from the discussion.
>      >
>      > The inspiration for this comes from here:
>      > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.youtube.com_watch-3Fv-3DARrbbviGvjc&d=DwIDaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=yLJd2IoXkBkWMIBcuv1k7wCSdpKnUqiEZDh_EJHHU08&m=6GL5xCevUT873KGyFsJhVe44s-QATomA_BHxDVctiOA&s=yHknXdnol-gw1NqdlK0Md_dn9jW_NU6DlTZJ0aoKnxc&e=
>      > and here
>      > https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dirkschumacher_r-2Dshiny-2Delectron&d=DwIDaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=yLJd2IoXkBkWMIBcuv1k7wCSdpKnUqiEZDh_EJHHU08&m=6GL5xCevUT873KGyFsJhVe44s-QATomA_BHxDVctiOA&s=iCgG_D3ngLrfXykUszOieQIRiwj5prEN3c0gFb8V_1g&e=
>      >
>      > I have tried these solutions, to no avail as I repeatedly encounter issues with the process. Some issues have been difficulties importing libraries after repeating their steps, others have been issues with missing dynamic libraries that aren't available when I build from source.
>      >
>      > ===== Questions =====
>      >
>      > -   How is the R binary at this link created?
>      >      -   Link: https://urldefense.proofpoint.com/v2/url?u=https-3A__cloud.r-2Dproject.org_bin_macosx_R-2D4.0.2.pkg&d=DwIDaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=yLJd2IoXkBkWMIBcuv1k7wCSdpKnUqiEZDh_EJHHU08&m=6GL5xCevUT873KGyFsJhVe44s-QATomA_BHxDVctiOA&s=pUj6yAcIF2zy9KcB7dXJD4ezIwluDIhuc3UN05ZcIs4&e=
>      > -   How do I include `libgfortran.5.dylib`
>      >      -   This distributable, when configured shows a file called `libgfortran.5.dylib`
>      >      -   As of this writing, my solution fails because this is missing when I run the self-hosted R
>      > -   Is there any guidance on how to build a self-hosted R executable for each operating system?
>      >      -   OSX
>      >      -   Linux
>      >      -   Windows
>      >
>      > ===== The long version =====
>      >
>      > ----- The Goal -----
>      >
>      > Create a self hosted version of R that runs independent of each system so that I can package and build shiny apps to be distributed to collaborators in order to evangelize our new statistical method.
>      >
>      > ----- The Impetus -----
>      >
>      > It is too distracting and too much work to get our collaborators to configure their environments just to try our statiscal methods we have been creating.
>      >
>      > We have a shiny app built around the statistical methods to simplify the interface for interaction. Now we want to package it for easy consumption.
>      >
>      > It should be as simple as downloading an application and running it.
>      >
>      > ----- The Current Progress -----
>      >
>      > I have a repo here that is an electron application
>      >
>      > https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_FredHutch_FAUST-5FNextflow-5FDesktop_tree_research_create-5Fr-5F4-5F0-5F2-5Fbuild-2Ddev&d=DwIDaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=yLJd2IoXkBkWMIBcuv1k7wCSdpKnUqiEZDh_EJHHU08&m=6GL5xCevUT873KGyFsJhVe44s-QATomA_BHxDVctiOA&s=c_SfZuM1kBF7onYsTkktR5K6DyeLHO_iJU_8tn7XJE4&e=
>      >
>      > I can bundle these resources without issues
>      >
>      > -   Java
>      > -   Nextflow
>      > -   Our Shiny App
>      >
>      > ----- Process -----
>      > The only missing piece is `R`
>      >
>      > I have a set of environment variables here:
>      > https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_FredHutch_FAUST-5FNextflow-5FDesktop_blob_research_create-5Fr-5F4-5F0-5F2-5Fbuild-2Ddev_electron-5Ffaust-5Fnextflow-5Fdesktop_app_binaries_r_build-5Fenvironment-5Fvariables.env&d=DwIDaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=yLJd2IoXkBkWMIBcuv1k7wCSdpKnUqiEZDh_EJHHU08&m=6GL5xCevUT873KGyFsJhVe44s-QATomA_BHxDVctiOA&s=asCEqMQrRxIP9twZSG53oZmV8uK2PnP9iv2nqxw18xc&e=
>      >
>      > I `source` the env variables and then I run this script here:
>      > `https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_FredHutch_FAUST-5FNextflow-5FDesktop_blob_research_create-5Fr-5F4-5F0-5F2-5Fbuild-2Ddev_electron-5Ffaust-5Fnextflow-5Fdesktop_app_binaries_r_download-5Fr-5Fosx.sh&d=DwIDaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=yLJd2IoXkBkWMIBcuv1k7wCSdpKnUqiEZDh_EJHHU08&m=6GL5xCevUT873KGyFsJhVe44s-QATomA_BHxDVctiOA&s=6J4zNQoHoBCICudLqtBbiLk1xpStNSpsrtsnb6-O0Ak&e= `
>      >
>      > I then use the downloaded `R` to install dependencies with these scripts:
>      >
>      > -   https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_FredHutch_FAUST-5FNextflow-5FDesktop_blob_research_create-5Fr-5F4-5F0-5F2-5Fbuild-2Ddev_electron-5Ffaust-5Fnextflow-5Fdesktop_app_binaries_r_install-5Fr-5Fdependencies.r&d=DwIDaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=yLJd2IoXkBkWMIBcuv1k7wCSdpKnUqiEZDh_EJHHU08&m=6GL5xCevUT873KGyFsJhVe44s-QATomA_BHxDVctiOA&s=irTsih9Pq4R_rzV_6-eF0cAEAGTYbERYDRjnpy-hrgk&e=
>      > -   https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_FredHutch_FAUST-5FNextflow-5FDesktop_blob_research_create-5Fr-5F4-5F0-5F2-5Fbuild-2Ddev_electron-5Ffaust-5Fnextflow-5Fdesktop_app_binaries_r_install-5Fr-5Fcran-5Fdependencies.r&d=DwIDaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=yLJd2IoXkBkWMIBcuv1k7wCSdpKnUqiEZDh_EJHHU08&m=6GL5xCevUT873KGyFsJhVe44s-QATomA_BHxDVctiOA&s=T9dVoi8UTeY8nd4o5ykO4Mzx4jFBpRy5YNUTFaZVbJs&e=
>      > -   https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_FredHutch_FAUST-5FNextflow-5FDesktop_blob_research_create-5Fr-5F4-5F0-5F2-5Fbuild-2Ddev_electron-5Ffaust-5Fnextflow-5Fdesktop_app_binaries_r_install-5Fr-5Fbiocmanager-5Fdependencies.r&d=DwIDaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=yLJd2IoXkBkWMIBcuv1k7wCSdpKnUqiEZDh_EJHHU08&m=6GL5xCevUT873KGyFsJhVe44s-QATomA_BHxDVctiOA&s=AA7yI29L7ET5-HAfUlzguKp28j8N7755H6pCNA4m6uU&e=
>      >
>      > And then voilà! It works. Well. It works on my local machine. I can run the development build, I can package the build, I can run the release after installing it. Everything works.
>      >
>      > Except when I bring it over to a separate computer it doesn't work because it states that it can't find `libgfortran.5.dylib`. See the attached screen shot.
>      >
>      > ===== The Plea For Guidance =====
>      >
>      > I would love any help to figure out how to achieve this. We are very close to somethng tangibly interesting and it's very deflating to be blocked because `R` does not have a distributable that can be bundled.
>      >
>      > Any guidance or suggestions are greatly appreciated!
>      >
>      > Warm Regards,
>      >
>      > Logan Knecht
>      >
>      > 	[[alternative HTML version deleted]]
>      >
>      > ______________________________________________
>      > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>      > https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwIDaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=yLJd2IoXkBkWMIBcuv1k7wCSdpKnUqiEZDh_EJHHU08&m=6GL5xCevUT873KGyFsJhVe44s-QATomA_BHxDVctiOA&s=rXWnxYtLId2lxALBHyFwuyXWU-yTHljjCyH-AZ4alpc&e=
>      > PLEASE do read the posting guide https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwIDaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=yLJd2IoXkBkWMIBcuv1k7wCSdpKnUqiEZDh_EJHHU08&m=6GL5xCevUT873KGyFsJhVe44s-QATomA_BHxDVctiOA&s=RlRm34djv4feVOhSjRGeswgJsw13nHd02YTERiDBxng&e=
>      > and provide commented, minimal, self-contained, reproducible code.
>      >
> 
>



More information about the R-help mailing list