blei-lab / hdp

Hierarchical Dirichlet processes. Topic models where the data determine the number of topics. This implements Gibbs sampling.
GNU General Public License v2.0
150 stars 47 forks source link

Problem Installing hdp #4

Closed imk1 closed 7 years ago

imk1 commented 7 years ago

I am trying to install hdp, and I get this error:

In file included from state.h:4:0, from state.cpp:1: corpus.h: In constructor ‘document::document()’: corpus.h:18:17: error: ‘NULL’ was not declared in this scope words = NULL; ^ corpus.h: In destructor ‘document::~document()’: corpus.h:34:22: error: ‘NULL’ was not declared in this scope if (words != NULL) ^ In file included from state.cpp:1:0: state.h: At global scope: state.h:146:63: error: ‘NULL’ was not declared in this scope hdp_state target_state=NULL); ^ In file included from state.h:4:0, from hdp.h:4, from hdp.cpp:1: corpus.h: In constructor ‘document::document()’: corpus.h:18:17: error: ‘NULL’ was not declared in this scope words = NULL; ^ corpus.h: In destructor ‘document::~document()’: corpus.h:34:22: error: ‘NULL’ was not declared in this scope if (words != NULL) ^ In file included from hdp.h:4:0, from hdp.cpp:1: state.h: At global scope: state.h:146:63: error: ‘NULL’ was not declared in this scope hdp_state target_state=NULL); ^ hdp.cpp: In member function ‘void hdp::run(const char)’: hdp.cpp:147:97: error: call to ‘double hdp_state::split_sampling(int, int, int, int, int, hdp_state)’ uses the default argument for parameter 6, which is not yet defined double prob_split = proposed_state->split_sampling(num_scans, d0, d1, t0, t1); ^ Makefile:13: recipe for target 'hdp' failed make[1]: [hdp] Error 1 make[1]: Leaving directory '/srv/scratch/shared/surya/imk1/TFBindingPredictionProject/src/hdp/hdp' Makefile:4: recipe for target 'make_all' failed make: [make_all] Error 2

I installed the latest version of gsl, and I think that I updated the Makefiles in hdp and hdp-faster correctly. Do you know what might be causing this problem?

Thanks so much!

imk1 commented 7 years ago

It looks like adding #include \<cstddef> to corpus.h solved the problem.

jaanli commented 7 years ago

Cool! Can you submit a pull request for this please?

imk1 commented 7 years ago

Done! https://github.com/blei-lab/hdp/pull/5