This repository has been archived by the owner on Feb 14, 2020. It is now read-only.
forked from mzsanford/cld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.txt
77 lines (42 loc) · 1.87 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
NOTE: I have only tested this under Linux (Fedora 13)!
TO BUILD C++ LIBRARY (libcld.a):
It would be nice to have a Makefile (patches welcome!), and to also
build a dynamic library, but for now I made a simple shell script to
build everything:
source ./build.sh
On Windows, open a command prompt and run this instead:
./build.win.cmd
If it succeeds it should print something like this:
Compile...
Make libcld.a
Compile example.cc
Done!
Then, run the trivial example program:
./example
And you should see this output:
LANG=ENGLISH
LANG=HINDI
TO BUILD PYTHON BINDINGS:
After building libcld.a (above), just run this:
python -u setup.py build
NOTE: on OS X Snow Leopard, I had to do this first:
export ARCHFLAGS="-arch x86_64"
otherwise distutils tries to build for PPC arch as well, and then
base/build_config.h is unhappy.
You should see output something like this (varies by platform):
running build
running build_ext
building 'cld' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I. -I/usr/include/python2.6 -c pycldmodule.cc -o build/temp.linux-x86_64-2.6/pycldmodule.o
pycldmodule.cc: In function ‘void initcld()’:
pycldmodule.cc:41: warning: deprecated conversion from string constant to ‘char*’
g++ -pthread -shared build/temp.linux-x86_64-2.6/pycldmodule.o -L. -L/usr/lib64 -lcld -lpython2.6 -o build/lib.linux-x86_64-2.6/cld.so
Then, install the libary:
sudo python -u setup.py install
Finally, run the unit test to make sure all is good:
python -u test.py
It should produce output like this:
................................................................
----------------------------------------------------------------------
Ran 65 tests in 0.002s
OK