@@ -40,6 +40,34 @@ This is a known issue with GHC, tracked as
40
40
41
41
[ trac-10458 ] : https://ghc.haskell.org/trac/ghc/ticket/10458
42
42
43
+ #### Why does stack say that R is missing or bad?
44
+
45
+ Even if R is installed in a standard location, stack might fail
46
+ to link it.
47
+
48
+ ~~~
49
+ $ stack install
50
+ inline-r> configure
51
+ inline-r> Configuring inline-r-1.0.1...
52
+ inline-r> Error: Cabal-simple_DY68M0FN_3.8.1.0_ghc-9.4.7: Missing dependency on a
53
+ inline-r> foreign library:
54
+ inline-r> * Missing (or bad) C library: R
55
+ ...
56
+ ~~~
57
+
58
+ In that case, it is helpful to see the actual output of the linker for diagnosing.
59
+
60
+ ~~~
61
+ $ stack install --cabal-verbosity 3
62
+ ~~~
63
+
64
+ You will have to look for the output corresponding to invocations of ` gcc ` and ` ld ` .
65
+ Linking might fail for reasons specific to the environment in which ` inline-r ` is
66
+ built. See for instance [ #427 ] [ ] or the next question about linker errors. In these
67
+ cases, a workaround is to use Nix to install the system dependencies.
68
+
69
+ [ #427 ] : https://github.com/tweag/HaskellR/issues/427
70
+
43
71
#### How do I fix linker errors?
44
72
45
73
Most systems use the historic ` ld.bfd ` linker by default. However,
@@ -53,8 +81,8 @@ errors like the following:
53
81
collect2: error: ld returned 1 exit status
54
82
~~~
55
83
56
- The fix is to either upgrade your linker, or better yet, switch to the
57
- gold linker. On Ubuntu, you can do this with:
84
+ The fix is to either upgrade your linker, or on some systems it might also work
85
+ to switch to the gold linker. On Ubuntu, you can do this with:
58
86
59
87
~~~
60
88
# update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20
0 commit comments