0

I am trying to build CLucene in Max OS X 10.10. I followed the instructions here. The cmake .. command ran correctly, but after that, when I try to run make with the makefile generated, I get the following error:

enter image description here

I Googled it and found reports of similar errors in some forums, and even found a similar question in Stackoverflow as well: Error when Make CLucene, but nowhere did I find a canonical solution.

What should I do to fix this?

Community
  • 1
  • 1
SexyBeast
  • 7,913
  • 28
  • 108
  • 196
  • Assuming you have the `pthread` headers installed in a location where they can be found then I believe the commentor on the linked ticket is correct and this is an include header problem with the `CLucene` sources and you should take it up with them. But simply adding the include to either that file (or some common include file) will likely fix it if that is the case. – Etan Reisner Jan 26 '15 at 13:12
  • Suppose if the required header is not there in the correct location, how do I add it there? I mean, simply acquiring the header file and putting it in the appropriate location (where should this be? Somewhere in the list of locations specified by `$PATH`?) will do, or do I have to modify the source code to include that? – SexyBeast Jan 26 '15 at 13:36
  • If you don't have the `pthread` headers on your system at all you would need to find out how to appropriately install them on OS X. Though I would imagine they might already be there. Unfortunately I don't know how to check or how to install them (I don't use OS X). And no, `$PATH` is unrelated. – Etan Reisner Jan 26 '15 at 13:39

1 Answers1

3

There is a bug for the Mac OS X version. You need to patch 2 files (assuming that the current directory is the CLucene one):

If you click the links you will get directly the patches. Let me know if you have problems applying the patches.

meto
  • 3,425
  • 10
  • 37
  • 49
  • Hi. Patched it, and the `libclucene-core.dylib` library has been generated. Will this be sufficient, or do I need to include the other `dylib`s that has been generated in the `bin` folder? – SexyBeast Jan 27 '15 at 18:14
  • You should also add `libclucene-shared.dylib`, according to `src/shared/README` – meto Jan 27 '15 at 22:50
  • **This package creates a library that is used in all the CLucene projects. It provides cross-platform macros and functions that used to be inside CLucene. Since we need to be able to link against the shared clucene-core library, we need these functions to be seperate. They provide things like cl_* string macros, file handling functions, replacement functions, etc.**. Where is it mentioned? – SexyBeast Jan 27 '15 at 22:52
  • in the src there are lots of cl_* macros. If you don't include this, the code in the other library will not compile – meto Jan 27 '15 at 22:55
  • Remember to include specific files, if you need them. For example, if you need the analyzer, you need also `#include "CLucene/analysis/Analyzers.h"` – meto Jan 27 '15 at 23:16
  • Yes, yes, definitely. What I meant is, do I need to add the other `dylib`s as well? – SexyBeast Jan 27 '15 at 23:17
  • So, these two will suffice :-) – meto Jan 27 '15 at 23:19
  • 1
    Thanks a lot! Appreciate your help.. :) – SexyBeast Jan 27 '15 at 23:20