07022013 Haskell
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でなんとかするか。
空洞化のウソ――日本企業の「現地化」戦略 (講談社現代新書)
Bandit Algorithms for Website Optimization
ビッグデータの衝撃――巨大なデータが戦略を決める
2011年新聞・テレビ消滅 (文春新書)
@DOMMUNE---FINAL MEDIAが伝授するライブストリーミングの超魔術!!!!!!!! (DOMMUNE BOOKS 0002)
財務3表実践活用法 会計でビジネスの全体像をつかむ (朝日新書)
財務諸表を読む技術 わかる技術 (朝日新書)