Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I tell which ghc version a program was built with?

Tags:

haskell

ghc

I'm wondering if there's a way to tell which ghc version a binary was built with. Major version is enough, specifically ghc 7 vs ghc 8.

like image 406
Filip Haglund Avatar asked Jan 13 '18 23:01

Filip Haglund


1 Answers

According to the documentation, you can use the --info RTS flag:

$ ./a.out +RTS --info
[("GHC RTS", "YES")
,("GHC version", "6.7")
,("RTS way", "rts_p")
,("Host platform", "x86_64-unknown-linux")
,("Host architecture", "x86_64")
,("Host OS", "linux")
,("Host vendor", "unknown")
,("Build platform", "x86_64-unknown-linux")
,("Build architecture", "x86_64")
,("Build OS", "linux")
,("Build vendor", "unknown")
,("Target platform", "x86_64-unknown-linux")
,("Target architecture", "x86_64")
,("Target OS", "linux")
,("Target vendor", "unknown")
,("Word size", "64")
,("Compiler unregisterised", "NO")
,("Tables next to code", "YES")
]

Among other things, this lists the GHC version.

like image 171
melpomene Avatar answered Oct 03 '22 07:10

melpomene