OS X에서 haskell의 Cabal에 대한 zlib 전제 조건을 설치하려고합니다. 이 오류 얻을 : 라이브러리 -lgmp가/SW/lib에 발견
$ sudo ./Setup build
Preprocessing library zlib-0.5.0.0…
ld: library not found for -lgmp
collect2: ld returned 1 exit status
linking dist/build/Codec/Compression/Zlib/Stream_hsc_make.o failed
command was: /usr/bin/gcc -lz -L/sw/lib/ghc-6.8.3/lib/bytestring-0.9.0.1.1 -L/sw/lib/ghc-6.8.3/lib/array-0.1.0.0 -L/sw/lib/ghc-6.8.3/lib/base-3.0.2.0 -L/sw/lib/ghc-6.8.3 -lm -lgmp -ldl dist/build/Codec/Compression/Zlib/Stream_hsc_make.o -o dist/build/Codec/Compression/Zlib/Stream_hsc_make
를, 그래서 수동으로 추가 할 경우 나는 성공적으로 ("...는/usr/빈/GCC")이 명령을 실행할 수 있습니다 -L/sw/lib. 문제는 sudo가/sw/lib에 대해 알지 못한다는 것입니다. 보라 :
$ gcc -print-search-dirs | grep sw
libraries: =/lib/i686-apple-darwin9/4.0.1/:/lib/:/usr/lib/i686-apple-darwin9/4.0.1/:/usr/lib/:./i686-apple-darwin9/4.0.1/:./:/sw/lib/i686-apple-darwin9/4.0.1/:/sw/lib/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../
$ sudo gcc -print-search-dirs | grep sw
$
은 어떻게 라이브러리/SW/lib 디렉토리에서 볼 GCC의 sudo는 버전을 알 수 있습니까? 루트의 .bash_profile에 환경 변수를 추가합니까? 그렇다면 어느 것입니까?
업데이트 : 아마도이 작업을 수행하는 더 적절한 방법이있을 수 있지만 여기에는 효과가 있습니다.
#!/bin/sh
export LIBRARY_PATH=/sw/lib:$LIBRARY_PATH
./Setup build
을 그리고 난 불평없이
$ sudo ./script.sh
컴파일 ZLIB 그를 실행 - 만세 : 나는이와 bash는 스크립트를 생성! 불행하게도 음모 설치 아직도 나에게 오류주고있다 :
$ ./Setup configure
Configuring cabal-install-0.6.2…
Setup: At least the following dependencies are missing:
zlib >=0.4 && <0.6
그래서 나는 (내가 처음에 할 노력하고있어 임) 도당 설치 디렉토리에 다시 가서 실행을 ...
$ ./bootstrap.sh
... 예상대로 모든 것을 설치했습니다.
구체적으로 설정 하시겠습니까? 이전에 존재하지 않는 ~/.bash_profile 파일에 루트 사용자를 넣으려고 했었습니다. 내 자신의 ~/.bash_profile에 추가했습니다. 어느 쪽도 차이를 만들지 않습니다. –