Compiling Apache Lucy

153 Views Asked by At

I am trying to compile Apache Lucy. Here are the steps I followed:

  1. Downloaded Lucy and Clownfish
  2. Compiled Clownfish runtime and compiler
  3. Configured Lucy
  4. Started Lucy Make

The compilation of the files in the core directory works fine but when it gets to the modules it throws an error:

$ make gcc -pedantic -Wall -Wextra -Wno-variadic-macros -std=gnu99 -D_GNU_SOURCE -D CFP_LUCY -D CFP_TESTLUCY -fvisibility=hidden -O2 -g -fno-strict-aliasing -fPIC -I . -I ../core -I autogen/include -I ../modules/analysis/snowstem/source/include -I ../modules/unicode/ucd -I ../modules/unicode/utf8proc -c ../modules/analysis/snowstem/source/libstemmer/libstemmer_utf8.c -o ../modules/analysis/snowstem/source/libstemmer/libstemmer_utf8.o ../modules/analysis/snowstem/source/libstemmer/libstemmer_utf8.c:4:35: fatal error: ../include/libstemmer.h: No such file or directory #include "../include/libstemmer.h" ^ compilation terminated. make: *** [../modules/analysis/snowstem/source/libstemmer/libstemmer_utf8.o] Error 1

The problem seems to be that the code files in the modules include the include files with a relative path like #include "../include/libstemmer.h". Even though the resulting directory is included in the include files directory i.e. -I ../modules/analysis/snowstem/source/include but it does not work

I started modifying the source files to remove the relative path but more started cropping up. I think there must be a better way. Any help on how I can fix this would be really helpful.

3

There are 3 best solutions below

0
On

It seems to me there is not a C library available yet. Above link is old (2012) but explains why it is not obvious.

http://grokbase.com/t/lucy/user/12bp9rw0g7/lucy-user-using-lucy-directly-from-c

0
On

https://github.com/cancerberoSgx/lucy.js/blob/master/scripts/build-lucy-c.sh

that's a shell script that will clone lucy .git and dependencies, compile lucy c and clownfish C them and then compile and run one of the lucy/samples/c

It does it all locally in a folder, so you don't have to install anything globally as root. you need linux buildtools like gcc, make, configure, etc. Good luck

0
On

If you do only cpan Lucy::Simple it should be enough