4
votes

I recently switched my PC at work from Ubuntu to Arch Linux. And I am now getting the following error (I am using stack to build my project):

setup-Simple-Cabal-1.22.4.0-ghc-7.10.2: Missing dependency on a foreign library:
* Missing C library: HSrts-ghc7.10.2
This problem can usually be solved by installing the system package that provides this library (you may need the "-dev" version). If the library is already installed but in a non-standard location then you can use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where it is.

As far as I understand it, the difference in Linux Distribution should not cause any issue.

Things I have tried:
-add the path where the library is with --extra-lib-dirs
-make sure that the version of stack/ghc are the same acrose both systems
-tried unsucesfully to find a relevant difference between the 2 systems
(gcc version was different but didn't change anything)

I have a docker container based on ubutu where it builds without an issue.

The only thing I can think of is that this library gets handled differently from some random C-library since it contains the Haskell-Runtime. But I have no idea what this difference would be. Or how a differnent handling would cause an issue on my Arch System.

Here my .cabal file (the folder also contains the whole project): https://github.com/opencog/atomspace/blob/master/tests/haskell/libExecutionOutputTest/opencoglib.cabal

1
Do you get the same error if you try to build with cabal instead of stack?ghorn
@ghorn i haven't tried but switching to cabal is not really a solution for me.LordMord

1 Answers

1
votes

Okay i figured out a workaround, instead of specifiyc the library in the .cabal file:

...  
extra-libraries: HSrts-ghc7.10.2   
...

you add it to your stack.yaml file:

...
ghc-options:
    package-name: -lHSrts-ghc7.10.2
...

If you also have a exectuable defined in your .cabal file this will break the executable, since the library is not only included in the library. And including the runtime library in an executable results in an instant segementation fault.