是否可以生成独立的haskell可执行文件? [英] Is it possible to produce stand alone haskell executable

查看:175
本文介绍了是否可以生成独立的haskell可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法可以让独立的haskell可执行文件在不同的linux机器上运行,假设架构相似?

Is there any way to produce stand alone haskell executable to run on different linux machines assuming the architecture is similar?

对不起,我应该已经更清楚了。其他机器可能没有安装ghc - 有点像Python的pyinstaller就是我一直在寻找的东西?

Sorry I should have been clearer. The other machines might not have ghc installed on them - a bit like pyinstaller for python is what I was looking for?

推荐答案

您可以使用标志 -static -optl-pthread -optl-static 以避免在编译Haskell项目时动态链接的依赖关系。这应该可以帮助你在没有完全相同库版本的两台linux机器上运行编译好的可执行文件。

You can use the flags -static -optl-pthread -optl-static to avoid dynamically linked dependencies when compiling a Haskell project. This should help you run the compiled executable on two linux machines that do not have the exact same library versions.

这篇关于是否可以生成独立的haskell可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆