2011-11-28 2 views
7

c readline library에 대한 haskell readline library wrapper을 언급하고 있습니다. 아래Mac OSX에서 haskell readline 라이브러리를 어떻게 설치합니까?

cabal install readline 출력 :

$ cabal install readline 
Resolving dependencies... 
Configuring readline-1.0.1.0... 
checking for gcc... gcc 
checking for C compiler default output file name... a.out 
checking whether the C compiler works... yes 
checking whether we are cross compiling... no 
checking for suffix of executables... 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether gcc accepts -g... yes 
checking for gcc option to accept ISO C89... none needed 
checking for GNUreadline.framework... checking for readline... no 
checking for tputs in -lncurses... yes 
checking for readline in -lreadline... yes 
checking for rl_readline_version... yes 
checking for rl_begin_undo_group... no 
configure: error: readline not found, so this package cannot be built 
See `config.log' for more details. 
cabal: Error: some packages failed to install: 
readline-1.0.1.0 failed during the configure step. The exception was: 
ExitFailure 1 

나는 (sudo port install readline 사용) MacPorts를 통해 설치는 C의 readline 라이브러리를 가지고 있지만 하스켈의 readline 라이브러리를 설치하는 동안 나는 여전히 같은 오류가 발생합니다.

+0

http://www.haskell.org/cabal/FAQ.html – tekknolagi

+0

'port'로'readline'을 설치했다면 왜'cabal'을 써서 설치해야합니까? – tekknolagi

+1

'readline' c 라이브러리가 포트와 함께 설치되었지만'readline' haskell 라이브러리를 설치할 수 없습니다. 내가 그 질문을 분명히하기 위해 명확히했습니다. –

답변

20

당신의 MacPorts를 설치 설치된 파일의 기본 경로를 사용하는 경우, 여기서 C 헤더 및 라이브러리를 찾을하는 지정하려고 :

cabal install readline --extra-include-dirs=/opt/local/include \ 
--extra-lib-dirs=/opt/local/lib 

업데이트 2 배 : GNU Readline와 내 컴퓨터가 아니라 브루 통해 설치에 MacPorts보다, Haskell readline 라이브러리에 대한 configure 스크립트가 베어링을 제대로 찾으려면 약간의 비표준 플래그가 필요합니다. 위의 문제가 해결되지 않는 경우,이 시도 :

cabal install readline --extra-include-dirs=/opt/local/include \ 
--extra-lib-dirs=/opt/local/lib \ 
--configure-option=--with-readline-includes=/opt/local/include \ 
--configure-option=--with-readline-libraries=/opt/local/lib 
+3

고마워, 잘 했어. readline을 설치하기 위해'sudo port install readline + universal' 명령을 사용했고,'cabal install readline --extra-include-dirs =/opt/local/include 명령을 사용했다 --extra-lib-dirs =/opt/local/lib --configure-option = - with-readline-includes =/opt/local/include - configure-option = - with-readline-libraries =/opt/local/lib' 명령을 사용하여 haskell readline 라이브러리를 설치하십시오. –

+0

물론; 'configure'가 실행되면 실제로 링크 할 때 둘 다 가질 필요가 있습니다. 명령의 마지막 입맛을 반영하여 업데이트되었습니다. – acfoltzer

+9

readline 공식은 keg 전용이므로, 다음과 같이 술통에 전체 경로를 추가해야했습니다 :'cabal install readline --extra-include-dirs =/usr/local/Cellar/readline /6.2.4/include/ --extra-lib-dirs =/usr/local/Cellar/readline/6.2.4/lib/--configure-option = - with-readline-includes =/usr/local/Cellar readline-libraries =/usr/local/Cellar/readline/6.2.4/lib /' – liborw

1

내가이 작성한 Readline 내 사제 설치 작업을 얻기 위해 여기 http://fp.okeefecreations.com/2010/08/installing-haskell-bindings-to-readline.html의 지침에 따라 끝났다. 유일한 수정은 경로에 나열된 readline의 버전을 조정하는 것이 었습니다.

나는 이것이 acfoltzer 's와 비슷한 해결책이라는 것을 알고 있지만 거기에 코멘트를 추가 할 담당자가 없거나 코멘트하는 방법을 알 수 없다. :)

+1

$ cabal install readline --configure-option = - with-readline-libraries = "/ usr/local/Cellar/readline/6.2.4/lib"--configure-option = - with-readline-includes = " /usr/local/Cellar/readline/6.2.4/include "최신 내용 –

+0

답변의 링크가 끊어졌습니다. –

관련 문제