Drkcore

07 02 2013 Haskell Tweet

Haskellでbrewのcurlを使おうとしたが

Haskellでscpを使いたいなぁと思い、色々と調べてみたがヨサゲなのが見つからなかった。

そこで、あーそういえばcurl使えんじゃんと思い出して、職場のlinuxではcabal install curlでokだった。この勢いでMBAにも入れようとしてハマった。

osxに最初から入っているcurlはscpに対応していない

$ /usr/bin/curl -V
curl 7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL libz

というわけでbrewで入れた(libssh2が必要)。ちなみにこんなのが出るのでln -sした。

$ /usr/local/bin/curl -V
curl 7.28.1 (x86_64-apple-darwin12.2.1) libcurl/7.28.1 OpenSSL/0.9.8r zlib/1.2.5 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp 
Features: IPv6 Largefile NTLM NTLM_WB SSL libz

curlのほうはコレでOK。

続いてcabal installでcurlを入れるわけだが、brewのlibとかincludeを指定できないみたいなので、ソースを読んでみる。

curlc.cのincludeが

#include <curl/curl.h>

と決め打ちなので、ちょいと書きなおしてやる

#include "/usr/local/Cellar/curl/7.28.1/include/curl/curl.h"

これでコンパイル通るかなーと

通らない。

/usr/local/Cellar/curl/7.28.1/include/curl/curlrules.h:143:0:
     error: size of array ‘__curl_rule_01__’ is negative

/usr/local/Cellar/curl/7.28.1/include/curl/curlrules.h:153:0:
     error: size of array ‘__curl_rule_02__’ is negative
cabal: Error: some packages failed to install:
curl-1.3.8 failed during the building phase. The exception was:
ExitFailure 1

negativeってなんだよ?とググってみたらヒットした。要するに64bitのlibcurlを32bitのghcで使おうとしてエラーになっているらしい。

が、32bitじゃないと現状Yesodがうまく動かないのでこれ以上はどうしようもない感じ。

5月にHaskell Platform 2013.2.0.0が出たら再チャレンジするかな。またはlibssh2とかsshでなんとかするか。

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021