Building
The build method for CHMPX Node.js addon library is explained below.
1. Install prerequisites before compiling
- For recent Debian-based Linux distributions users, follow the steps below:
$ sudo aptitude update $ sudo aptitude git gcc g++ make gdb dh-make fakeroot dpkg-dev $ sudo aptitude install nodejs npm
- For users who use supported Fedora other than latest version, follow the steps below:
$ sudo dnf install git autoconf automake gcc libstdc++-devel gcc-c++ make libtool $ sudo dnf install nodejs npm
- For other recent RPM-based Linux distributions users, follow the steps below:
$ sudo yum install git autoconf automake gcc libstdc++-devel gcc-c++ make libtool $ sudo yum install nodejs npm
2. K2HASH library
In advance, you need to install the developer package of CHMPX library(See here for installation).
Without installing this package, you can also build the CHMPX library(See here for the build).
3. Clone source codes from Github
$ git clone git@github.com:yahoojapan/chmpx_nodejs.gif
$ cd chmpx_nodejs
4. Building and Testing
Run the build and test using the npm command.
$ sudo npm cache clean
$ npm update
$ npm run build
$ npm run test
If the building and testing succeed, you can find three chmpx.node files in the following path. (And a symbolic link build under the top directory.)
$ ls -la build
lrwxrwxrwx 1 guest users 43 Nov 30 14:00 build -> /home/guest/chmpx_nodejs/src/build
$ ls -l src/build/Release/*.node
total 252
-rwxr-xr-x 1 guest users 240637 Nov 30 14:00 chmpx.node