It\'s not often two things I love so much come together to cause me so much annoyance (besides my kids). I\'ve written a Haskell program at work that uses libraries like tex
This simple example "works for me":
$ cat A.hs
main = print "yes"
$ ghc -O2 --make -static -optc-static -optl-static A.hs -fvia-C -optl-pthread
$ ldd A
not a dynamic executable
$ ./A
"yes"
(and I've used this process, via .cabal, to ship executables for clients in the past couple of years).
I think the best bet is to file bugs, and get this working. The IHG can also fund work like this, but I'm fairly sure the GHC team would consider this a high priority, if you're trying to ship products.
It is related to the old glibc library in CentOS. You have to compile with the same version of glibc as installed on CentOS.
I had exactly the same problem. Haskell executable compiled on arch (or ubuntu) won't run on CentOS. In my case though i was lucky, because our admin just removed CentOS and installed Arch for application server.
I found out the problem. It seems that the link to the Biohaskell page is accurate: this is a problem loading iconv. This occurs when calling openFile
, but not when calling openBinaryFile
. Since xml-enumerator
uses the latter, it worked just fine. Switching over the rest of the code to use openBinaryFile
instead (via Data.Enumerator.Binary.enumFile
) got everything to work.
This is a good workaround for my use case, but the bug still exists.