我能说出一个程序是用哪个ghc版本构建的吗?

时间:2018-01-13 23:50:22

标签: haskell ghc

我想知道是否有办法告诉哪个ghc版本是二进制文件。主要版本就足够了,特别是ghc 7 vs ghc 8。

1 个答案:

答案 0 :(得分:23)

根据the documentation,您可以使用--info RTS标志:

$ ./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")
]

除此之外,还列出了GHC版本。