0
0
Fork 0

compile libcld2 statically

This commit is contained in:
deoxxa 2014-08-23 18:51:57 +02:00
parent 27f001bc14
commit 22b7b3bc24
3 changed files with 15 additions and 7 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@
.settings
.DS_Store
/analysis/token_filters/cld2/cld2-read-only
/analysis/token_filters/cld2/libcld2_full.a
/examples/bleve_index_json/bleve_index_json
/examples/bleve_index_json/index.bleve/
/examples/bleve_query/bleve_query

View File

@ -8,21 +8,18 @@ In normal usage, you use this with the "single" tokenizer, so there is only one
1. Acquire the source to cld2 in this directory.
$ svn checkout http://cld2.googlecode.com/svn/trunk/ cld2-read-only
$ svn checkout -r 167 http://cld2.googlecode.com/svn/trunk/ cld2-read-only
2. Build cld2
$ cd cld2-read-only/internal/
$ ./compile_libs.sh
$ ./compile_cld2.sh
3. Put the resulting libraries somewhere your linker can find.
3. Put the resulting libraries somewhere your dynamic linker can find.
$ cp *.so /usr/local/lib
$ cp *.a /usr/local/lib
4. Run the unit tests
$ cd ../..
$ go test -v
=== RUN TestCld2Filter
--- PASS: TestCld2Filter (0.00 seconds)

View File

@ -0,0 +1,10 @@
#!/bin/bash
SRC="cldutil cldutil_shared compact_lang_det compact_lang_det_hint_code compact_lang_det_impl debug fixunicodevalue generated_entities generated_language generated_ulscript getonescriptspan lang_script offsetmap scoreonescriptspan tote utf8statetable cld_generated_cjk_uni_prop_80 cld2_generated_cjk_compatible cld_generated_cjk_delta_bi_32 generated_distinct_bi_0 cld2_generated_quad0122 cld2_generated_deltaocta0122 cld2_generated_distinctocta0122 cld_generated_score_quad_octa_0122";
OBJ="";
for f in ${SRC}; do
g++ -c -fPIC -O2 -m64 -o "cld2-read-only/internal/${f}.o" "cld2-read-only/internal/${f}.cc";
OBJ="${OBJ} cld2-read-only/internal/${f}.o";
done;
ar rcs libcld2_full.a ${OBJ};