Recently, I’ve been doing some research on IR. It is inevitable to get long with some useful toolkits for convinience. The Lemur Project's software development philosophy emphasizes state-of-the-art accuracy, flexibility, and efficiency. Since I’ve told that this toolkit is more efficient in Linux OS, I try my best to conduct my experients in Ubuntu.
Writing a “makefile” file needs a lot of skills, and I learned it this morning and tried to find a specific pattern makefile for myself. This is my first makefile trial:
Then, I tried to use the Lemur API to write my own application using my-style makefile as follows:
#include "Index.hpp" #include "IndexManager.hpp" using namespace lemur::api; using namespace std; int main() { cout << "----------Scan Posting-----------" << endl; char *indexPath = "/usr/local/lemur/index/apdata/apdata.index.key"; Index *index = NULL; index = IndexManager::openIndex(indexPath); int termID; for(termID = 1; termID < index->termCountUnique(); termID ++) { cout << index->term(termID) << endl; } delete index; index = NULL; return 0; }
At first, I met a wiered problem that:
error: ‘__atomic_add’ was not declare in /usr/local/lemur/include/indri/atomic.hpp
After referring to Official Forum, I thought it maybe caused by my g++ version, so I modified hpp file by adding comments on line
45 and 47 and it finally worked. But after that, I got another error:
undefined reference to ‘lemur::api::IndexManager:: openIndex()…’
Again I refered to the forum, many Umass students came across the same problem. This is caused by configuration
which is related to makefile, and I copied MakeFile.app from src folder, and just simply filled some blanks then it
worked by using make -f Makefile.app. The MakeFile.app displays below:
![Screenshot_thumb[2] Screenshot_thumb[2]](https://images.cnblogs.com/cnblogs_com/liangfeng/201104/201104141639533373.png)
![makefileonlemur_thumb[5] makefileonlemur_thumb[5]](https://images.cnblogs.com/cnblogs_com/liangfeng/201104/201104141639549917.png)
![app_thumb[6] app_thumb[6]](https://images.cnblogs.com/cnblogs_com/liangfeng/201104/201104141639576344.png)
浙公网安备 33010602011771号