免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: drunkedcat
打印 上一主题 下一主题

ghc 安装(已解决 见 22 楼) [复制链接]

论坛徽章:
95
程序设计版块每日发帖之星
日期:2015-09-05 06:20:00程序设计版块每日发帖之星
日期:2015-09-17 06:20:00程序设计版块每日发帖之星
日期:2015-09-18 06:20:002015亚冠之阿尔艾因
日期:2015-09-18 10:35:08月度论坛发贴之星
日期:2015-09-30 22:25:002015亚冠之阿尔沙巴布
日期:2015-10-03 08:57:39程序设计版块每日发帖之星
日期:2015-10-05 06:20:00每日论坛发贴之星
日期:2015-10-05 06:20:002015年亚冠纪念徽章
日期:2015-10-06 10:06:482015亚冠之塔什干棉农
日期:2015-10-19 19:43:35程序设计版块每日发帖之星
日期:2015-10-21 06:20:00每日论坛发贴之星
日期:2015-09-14 06:20:00
11 [报告]
发表于 2008-09-09 14:38 |只看该作者
原帖由 drunkedcat 于 2008-9-9 13:40 发表
多谢楼上各位。用 6.8.2 的 bin 版,安装成功
可是运行 ghc 或 ghci 都提示
/usr/lib/ghc-6.8.2/ghc-6.8.2: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

这说明你应该安装 ncurses 的运行时库。


这几天正在看 yaht, 看完了写个心得,感谢一下论坛。

期待你的心得。

论坛徽章:
0
12 [报告]
发表于 2008-09-09 16:16 |只看该作者
安 LFS 时,是安了 ncurses 的,
我的 /usr/lib 里有个 libncurses.so
可是我
ln -s libncurses.so libncurses.so.5 之后,就说 file too short 了。
奇怪
先忍两天,现在用着 hugs,这个东西倒是安装起来很方便。

论坛徽章:
95
程序设计版块每日发帖之星
日期:2015-09-05 06:20:00程序设计版块每日发帖之星
日期:2015-09-17 06:20:00程序设计版块每日发帖之星
日期:2015-09-18 06:20:002015亚冠之阿尔艾因
日期:2015-09-18 10:35:08月度论坛发贴之星
日期:2015-09-30 22:25:002015亚冠之阿尔沙巴布
日期:2015-10-03 08:57:39程序设计版块每日发帖之星
日期:2015-10-05 06:20:00每日论坛发贴之星
日期:2015-10-05 06:20:002015年亚冠纪念徽章
日期:2015-10-06 10:06:482015亚冠之塔什干棉农
日期:2015-10-19 19:43:35程序设计版块每日发帖之星
日期:2015-10-21 06:20:00每日论坛发贴之星
日期:2015-09-14 06:20:00
13 [报告]
发表于 2008-09-09 16:28 |只看该作者
原帖由 drunkedcat 于 2008-9-9 16:16 发表
安 LFS 时,是安了 ncurses 的,
我的 /usr/lib 里有个 libncurses.so
可是我
ln -s libncurses.so libncurses.so.5 之后,就说 file too short 了。

ncurses 的版本对么?ghci 需要的是第 5 版的。

论坛徽章:
0
14 [报告]
发表于 2008-09-09 16:39 |只看该作者
我的安装信息
fuqiang@fuqiang-laptop:~$ ghc --help
Usage:

    ghc-6.8.2 [command-line-options-and-input-files]

To compile and link a complete Haskell program, run the compiler like
so:

    ghc-6.8.2 --make Main

where the module Main is in a file named Main.hs (or Main.lhs) in the
current directory.  The other modules in the program will be located
and compiled automatically, and the linked program will be placed in
the file `a.out' (or `Main.exe' on Windows).

Alternatively, ghc-6.8.2 can be used to compile files individually.  Each
input file is guided through (some of the) possible phases of a
compilation:

    - unlit:        extract code from a "literate program"
    - hscpp:        run code through the C pre-processor (if -cpp flag given)
    - hsc:        run the Haskell compiler proper
    - gcc:        run the C compiler (if compiling via C)
    - as:        run the assembler
    - ld:        run the linker

For each input file, the phase to START with is determined by the
file's suffix:

    - .lhs        literate Haskell                 unlit
    - .hs        plain Haskell                         ghc
    - .hc        C from the Haskell compiler         gcc
    - .c        C not from the Haskell compiler  gcc
    - .s        assembly language                 as
    - other        passed directly to the linker         ld

The phase at which to STOP processing is determined by a command-line
option:

    -E                stop after generating preprocessed, de-litted Haskell
                     (used in conjunction with -cpp)
    -C                stop after generating C (.hc output)
    -S                stop after generating assembler (.s output)
    -c                stop after generating object files (.o output)

Other commonly-used options are:

    -v[n]            Control verbosity (n is 0--5, normal verbosity level is 1,
                      -v alone is equivalent to -v3)

    -fglasgow-exts  Allow Glasgow extensions (unboxed types, etc.)

    -O                    An `optimising' package of compiler flags, for faster code

    -prof            Compile for cost-centre profiling
                     (add -auto-all for automagic cost-centres on all
                      top-level functions)

    -H14m            Increase compiler's heap size (might make compilation
                    faster, especially on large source files).

    -M              Output Makefile rules recording the
                    dependencies of a list of Haskell files.

Given the above, here are some TYPICAL invocations of ghc-6.8.2:

    # compile a Haskell module to a .o file, optimising:
    % ghc-6.8.2 -c -O Foo.hs
    # link three .o files into an executable called "test":
    % ghc-6.8.2 -o test Foo.o Bar.o Baz.o
    # compile a Haskell module to C (a .hc file), using a bigger heap:
    % ghc-6.8.2 -C -H16m Foo.hs
    # compile Haskell-produced C (.hc) to assembly language:
    % ghc-6.8.2 -S Foo.hc

The User's Guide has more information about GHC's *many* options.  An
online copy can be found here:

   http://www.haskell.org/ghc/documentation.html


[ 本帖最后由 fuqiang_huang 于 2008-9-9 16:48 编辑 ]

论坛徽章:
0
15 [报告]
发表于 2008-09-09 21:35 |只看该作者
strings libncurses.a
.............
ncurses 5.5.20051010
GCC: (GNU) 4.0.3
..............

论坛徽章:
0
16 [报告]
发表于 2008-09-09 23:04 |只看该作者
这么难啊?
还是用debian方便, 只需要一个命令
aptitude install ghc6
就搞定了.

论坛徽章:
95
程序设计版块每日发帖之星
日期:2015-09-05 06:20:00程序设计版块每日发帖之星
日期:2015-09-17 06:20:00程序设计版块每日发帖之星
日期:2015-09-18 06:20:002015亚冠之阿尔艾因
日期:2015-09-18 10:35:08月度论坛发贴之星
日期:2015-09-30 22:25:002015亚冠之阿尔沙巴布
日期:2015-10-03 08:57:39程序设计版块每日发帖之星
日期:2015-10-05 06:20:00每日论坛发贴之星
日期:2015-10-05 06:20:002015年亚冠纪念徽章
日期:2015-10-06 10:06:482015亚冠之塔什干棉农
日期:2015-10-19 19:43:35程序设计版块每日发帖之星
日期:2015-10-21 06:20:00每日论坛发贴之星
日期:2015-09-14 06:20:00
17 [报告]
发表于 2008-09-09 23:06 |只看该作者
原帖由 drunkedcat 于 2008-9-9 21:35 发表
strings libncurses.a
.............
ncurses 5.5.20051010
GCC: (GNU) 4.0.3
..............

ghci 需要的是动态库。

找到 ghci 实际执行的文件用 ldd 看看库的位置是否正确。另外,把 ghci 的出错信息原封不动的拷贝上来,不要转述。

论坛徽章:
95
程序设计版块每日发帖之星
日期:2015-09-05 06:20:00程序设计版块每日发帖之星
日期:2015-09-17 06:20:00程序设计版块每日发帖之星
日期:2015-09-18 06:20:002015亚冠之阿尔艾因
日期:2015-09-18 10:35:08月度论坛发贴之星
日期:2015-09-30 22:25:002015亚冠之阿尔沙巴布
日期:2015-10-03 08:57:39程序设计版块每日发帖之星
日期:2015-10-05 06:20:00每日论坛发贴之星
日期:2015-10-05 06:20:002015年亚冠纪念徽章
日期:2015-10-06 10:06:482015亚冠之塔什干棉农
日期:2015-10-19 19:43:35程序设计版块每日发帖之星
日期:2015-10-21 06:20:00每日论坛发贴之星
日期:2015-09-14 06:20:00
18 [报告]
发表于 2008-09-09 23:08 |只看该作者
原帖由 blue_stone 于 2008-9-9 23:04 发表
这么难啊?
还是用debian方便, 只需要一个命令
aptitude install ghc6
就搞定了.

但前提是你所使用的源中有这个包,而且版本也和你的心意。

论坛徽章:
0
19 [报告]
发表于 2008-09-09 23:46 |只看该作者
原帖由 MMMIX 于 2008-9-9 23:08 发表

但前提是你所使用的源中有这个包,而且版本也和你的心意。



hgc和hugs都包含在Debian的官方源中.

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
20 [报告]
发表于 2008-09-10 00:05 |只看该作者
支持 aptitude,支持 debian。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP