NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.51k stars 13.69k forks source link

R package dependencies incorrectly specified #42927

Open idontgetoutmuch opened 6 years ago

idontgetoutmuch commented 6 years ago

Issue description

In my nix shell I get

Error: ./configure failed with return code 1. required CBLAS library not found. See .Lorenz_modelcf026bd3d5ff/build_assert_openmp_sm_30/configure.log and .Lorenz_modelcf026bd3d5ff/build_assert_openmp_sm_30/config.log for details
Warning message:
In run.libbi(x, client = "sample", ...) : LibBi terminated with an error.
*** Exception: R Runtime Error: Error in assert_output.libbi(x) : 
  The libbi object must be run first (using sample, filter or optimise).

which suggests the nix package of this R package hasn't been explicit about the dependence on (C?)BLAS. Of course, it may be that on macOS we need to be explicit about where to find BLAS.

Using homebrew and R's install.packages(), I don't see this problem.

Steps to reproduce

NB pkgs.rPackages.rbi

{ pkgs ? import <nixpkgs> {}, compiler ? "ghc822", doBenchmark ? false }:

let

f = { mkDerivation, haskell, base, foldl, Frames, fuzzyset
    , inline-r, integration, lens
    , pandoc-types, plots
    , diagrams-rasterific
    , diagrams
    , diagrams-svg
    , diagrams-contrib
    , R, random, stdenv
    , template-haskell, temporary }:
mkDerivation {
  pname = "mrp";
  version = "1.0.0";
  src = ./.;
  isLibrary = false;
  isExecutable = true;
  executableHaskellDepends = [
    base
    diagrams
    diagrams-rasterific
    diagrams-svg
    diagrams-contrib
    (haskell.lib.dontCheck inline-r)
    foldl
    Frames
    fuzzyset
    integration
    lens
    pandoc-types
    plots
    random
    template-haskell
    temporary
  ];
  executableSystemDepends = [
    R
    pkgs.rPackages.rbi
    pkgs.rPackages.dplyr
    pkgs.rPackages.ggmap
    pkgs.rPackages.ggplot2
    pkgs.rPackages.knitr
    pkgs.rPackages.maptools
    pkgs.rPackages.reshape2
    pkgs.rPackages.rgeos
    # pkgs.rPackages.rgdal
    pkgs.rPackages.rstan
    pkgs.rPackages.zoo];
  license = stdenv.lib.licenses.bsd3;
};

haskellPackages = if compiler == "default"
  then pkgs.haskellPackages
  else pkgs.haskell.packages.${compiler};

# Fixup a few things
myHaskellPackages = haskellPackages.override {
  overrides = self: super: with pkgs.haskell.lib; {
    diagrams-rasterific = doJailbreak super.diagrams-rasterific;
    diagrams-svg = doJailbreak super.diagrams-svg;
    diagrams-contrib = doJailbreak super.diagrams-contrib;
    diagrams = doJailbreak super.diagrams;
    inline-r = dontCheck super.inline-r;
    pipes-group = doJailbreak super.pipes-group;
  };
};

variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;

drv = variant (myHaskellPackages.callPackage f {});

in

  if pkgs.lib.inNixShell then drv.env else drv

and

nix-shell shell.nix -I nixpkgs=https://github.com/nixos/nixpkgs-channels/archive/nixos-unstable-small.tar.gz

Technical details

bash-3.2$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 17.3.0, macOS 10.13.2`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 1.11.15`
 - channels(root): `"nixpkgs-18.03pre122117.14df60d0db9"`
 - channels(dom): `"nixpkgs-18.09pre142380.23f2dfd9f5a"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.