Closed motorlearner closed 1 year ago
See below: cmdstanr is built from github and depends on data.table, which should be specified as data_table in the propagatedBuildInputs.
cmdstanr
data.table
data_table
remotes::install_github("b-rodrigues/rix") library(rix) rix( r_ver = "latest", r_pkgs = c("data.table"), system_pkgs = c("cmdstan"), git_pkgs = list( list( # build cmdstanr package from github package_name = "cmdstanr", repo_url = "https://github.com/stan-dev/cmdstanr", branch_name = "master", commit = "5e2551c7a5f40434e858f18d9dbfb50444583696" ) ), ide = "code", overwrite = TRUE, shell_hook = 'export CMDSTAN=$(dirname $(dirname "$(which stan)"))/opt/cmdstan' )
let pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/b200e0df08f80c32974a6108ce431d8a8a5e6547.tar.gz") {}; rpkgs = builtins.attrValues { inherit (pkgs.rPackages) data_table languageserver; }; git_archive_pkgs = [(pkgs.rPackages.buildRPackage { name = "cmdstanr"; src = pkgs.fetchgit { url = "https://github.com/stan-dev/cmdstanr"; branchName = "master"; rev = "5e2551c7a5f40434e858f18d9dbfb50444583696"; sha256 = "sha256-afoITk2TGOwIoHcAZhNS2hgDmMAj1OkTPZHTif+U0Xo="; }; propagatedBuildInputs = builtins.attrValues { inherit (pkgs.rPackages) checkmate data.table jsonlite posterior processx R6 withr; # should be data_table }; }) ]; system_packages = builtins.attrValues { inherit (pkgs) R cmdstan; }; in pkgs.mkShell { buildInputs = [ git_archive_pkgs rpkgs system_packages ]; shellHook = '' export CMDSTAN=$(dirname $(dirname "$(which stan)"))/opt/cmdstan ''; }
thanks! I thought this was dealt with but seem I forgot to make it work for deps of Github packages! I'll solve asap
thanks, solved with https://github.com/b-rodrigues/git2nixsha/commit/f9ef556929ec7f00cc4a02d103a71d836c6e6129
See below:
cmdstanr
is built from github and depends ondata.table
, which should be specified asdata_table
in the propagatedBuildInputs.