2010-07-19

Node.js を試してみる

御贔屓の RedisDB のページで気になってた Node.js  を試してみる。
(結論としては、Redis 使うところまで届かず、コンパイルで時間切れという残念な結果。次回期待)


やったこと(残念な流れ):
  1. cygwin ダウンロードする。
  2. cygwin インストールする。
    1. python gcc/c gcc/c++ make を追加で選択
  3. 本家参考にソースをダウンロード/展開する。
  4. cygwin/bash で ./configure 

      => いろいろ not found と出る。

5. libssl-dev 入れると幸せ(via:tricknotes)という情報を入手。
6. cygwin のパッケージ眺めてもそれっぽいのが無いので Devel\openssl-devel を入れてみる。
7. 何個かは not found が消えたがまだコンパイル通らない。(情報と not found の数も合わない)
8. cygwin 用フルパッケージを配っているヒト(via: DTrejo)がいたので拝借。
9. cygwin/bin 配下から現環境とくらべて新しそうなの(や無いの)を持ってくる。(何者なのかは調べてない)

  • cygintl-1
  • cygintl-2
  • cygpcre
  • cygrensvr
  • cygssp
  • cygwap
  • ln.exe
  • nano.exe
10. 3.で展開した最新ソースで ./configure。
11. not found がまだ出るが気にせず、make と make install。

=> 通った!

12. make test

=> module オブジェクトに GuessArchitecture アトリビュートが無いと怒られる。
同じヒトがいた。python のバージョンかもらしい。 (via: vwxyz)

13.  サンプルのチャットアプリ(via: ry)を試す。

=> node server.js
http://127.0.0.1:8001/ にブラウザでアクセス。 => 動いた。

RedisDBまでいかなかった orz。


以下 ./configure と make test のメモ
----
$ ./configure
Checking for program g++ or c++          : /usr/bin/g
Checking for program cpp                 : /usr/bin/c
Checking for program ar                  : /usr/bin/a
Checking for program ranlib              : /usr/bin/r
Checking for g++                         : ok
Checking for program gcc or cc           : /usr/bin/g
Checking for gcc                         : ok
Checking for library dl                  : yes
Checking for library execinfo            : not found
Checking for openssl                     : not found
Checking for function SSL_library_init   : yes
Checking for header openssl/crypto.h     : yes
Checking for library rt                  : yes
--- libeio ---
Checking for library pthread             : yes
Checking for function pthread_create     : yes
Checking for function pthread_atfork     : yes
Checking for futimes(2)                  : yes
Checking for readahead(2)                : no
Checking for fdatasync(2)                : yes
Checking for pread(2) and pwrite(2)      : yes
Checking for sendfile(2)                 : no
Checking for sync_file_range(2)          : no
--- libev ---
Checking for header sys/inotify.h        : not found
Checking for header sys/epoll.h          : not found
Checking for header port.h               : not found
Checking for header poll.h               : yes
Checking for function poll               : yes
Checking for header sys/event.h          : not found
Checking for header sys/queue.h          : yes
Checking for function kqueue             : not found
Checking for header sys/select.h         : yes
Checking for function select             : yes
Checking for header sys/eventfd.h        : not found
Checking for SYS_clock_gettime           : no
Checking for library rt                  : yes
Checking for function clock_gettime      : yes
Checking for function nanosleep          : yes
Checking for function ceil               : yes
Checking for fdatasync(2) with c++       : yes
'configure' finished successfully (53.469s)

----

$ make test
Waf: Entering directory `/cygdrive/d/user/bin/node/build'
DEST_OS: cygwin
DEST_CPU: x86
Parallel Jobs: 2
Waf: Leaving directory `/cygdrive/d/user/bin/node/build'
'build' finished successfully (0.516s)
python tools/test.py --mode=release simple message
Traceback (most recent call last):
  File "tools/test.py", line 1066, in
    ARCH_GUESS = utils.GuessArchitecture()
AttributeError: 'module' object has no attribute 'GuessArchitecture'
make: *** [test] Error 1
----

0 件のコメント:

コメントを投稿