tweag / HaskellR

The full power of R in Haskell.
https://tweag.github.io/HaskellR
Other
583 stars 47 forks source link

libR >= 3 not found ++ adding R libraries to the shell.nix #328

Closed teuffy closed 6 years ago

teuffy commented 6 years ago

machine: Linux scw-debJessie 4.14.12-mainline-rev1 #1 SMP Fri Jan 5 16:30:27 UTC 2018 x86_64 GNU/Linux

stack --nix build result failed log

Configuring inline-r-0.9.1...
Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2: The pkg-config package 'libR' version
>=3.0 is required but it could not be found.

shell.nix


{pkgs ? import <nixpkgs> { }, ghc ? pkgs.haskell.compiler.ghc822}:

with pkgs;

let
  # Uncomment the line below to build HaskellR against a version of R with
  # the --enable-strict-barrier configure flag enabled for better memory
  # diagnostics.

  # R = pkgs.R.override { enableStrictBarrier = true; };

  R-with-pkgs = rWrapper.override {
    packages = with rPackages;
     [
      ggplot2
      dplyr
      xts
     ];
    }; 

  # XXX Workaround https://ghc.haskell.org/trac/ghc/ticket/11042.
  libHack = if stdenv.isDarwin then {
      DYLD_LIBRARY_PATH = ["${R}/lib/R/lib"];
    } else {
      LD_LIBRARY_PATH = ["${R}/lib/R"];
    };
in

haskell.lib.buildStackProject ({
  name = "HaskellR";
  inherit ghc;
  buildInputs =
    [ python36Packages.ipython
      python36Packages.jupyter_client
      python36Packages.notebook
      R-with-pkgs
      zeromq
      zlib
    ];
  LANG = "en_US.UTF-8";
  LD_LIBRARY_PATH = ["${R}/lib/R/"];
} // libHack)
teuffy commented 6 years ago

I am using #287 to solve my problem (package installation)

shmish111 commented 3 years ago

@teuffy I'm having the same problem but I don't get what you did when you say you used #287 ? Were you able to use stack build within a nix shell?