dtm
dtm copied to clipboard
compiling dtm parallel version on HPC cluster
Hi, I successfully compiled and ran the serial version of the code on our HPC cluster but the parallel version of the code does not compile. I am running CentOS 7.9, gcc 4.8.5 and gsl 2.7.
make main
g++ -I ../lib -I ../lib/math -I ../gslwrap/include -I ../gslwrap/include/gslwrap -I ../local/include -I ../lib/util/gflags-1.1/src/gflags -c -o lda-seq.o lda-seq.c
In file included from /usr/include/c++/4.8.2/backward/hash_set:60:0,
from c2_lib.h:6,
from lda-seq.c:1:
/usr/include/c++/4.8.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
#warning \
^
In file included from lda-seq.c:1:0:
c2_lib.h:39:24: error: invalid use of incomplete type ‘FILE {aka struct _IO_FILE}’
class Resource: public FILE {
^
In file included from /usr/include/wchar.h:36:0,
from /usr/include/c++/4.8.2/cwchar:44,
from /usr/include/c++/4.8.2/bits/postypes.h:40,
from /usr/include/c++/4.8.2/bits/char_traits.h:40,
from /usr/include/c++/4.8.2/string:40,
from strutil.h:11,
from c2_lib.h:1,
from lda-seq.c:1:
/usr/include/stdio.h:44:8: error: forward declaration of ‘FILE {aka struct _IO_FILE}’
struct _IO_FILE;
^
In file included from lda-seq.c:1:0:
c2_lib.h:62:3: error: ‘hash_set’ in namespace ‘std’ does not name a type
std::hash_set<int> references_;
^
c2_lib.h: In member function ‘void c2_lib::Resource::AddReference(int)’:
c2_lib.h:52:5: error: ‘references_’ was not declared in this scope
references_.insert(id);
^
c2_lib.h: At global scope:
c2_lib.h:206:14: error: ‘hash_map’ does not name a type
const hash_map<std::string, std::string>& flags,
^
c2_lib.h:206:14: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
c2_lib.h:206:22: error: expected ‘,’ or ‘...’ before ‘<’ token
const hash_map<std::string, std::string>& flags,
^
c2_lib.h:222:14: error: ‘hash_map’ does not name a type
const hash_map<std::string, std::string>& flags,
^
c2_lib.h:222:14: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
c2_lib.h:222:22: error: expected ‘,’ or ‘...’ before ‘<’ token
const hash_map<std::string, std::string>& flags,
^
c2_lib.h:238:11: error: ‘hash_map’ does not name a type
const hash_map<std::string, std::string>& flags,
^
c2_lib.h:238:11: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
c2_lib.h:238:19: error: expected ‘,’ or ‘...’ before ‘<’ token
const hash_map<std::string, std::string>& flags,
^
c2_lib.h:254:16: error: ‘hash_map’ does not name a type
const hash_map<std::string, std::string>& flags,
^
c2_lib.h:254:16: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
c2_lib.h:254:24: error: expected ‘,’ or ‘...’ before ‘<’ token
const hash_map<std::string, std::string>& flags,
^
c2_lib.h:271:13: error: ‘hash_map’ does not name a type
const hash_map<std::string, std::string>& flags,
^
c2_lib.h:271:13: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
c2_lib.h:271:21: error: expected ‘,’ or ‘...’ before ‘<’ token
const hash_map<std::string, std::string>& flags,
^
c2_lib.h: In static member function ‘static c2_lib::Task* dtm::TaskFactory::NewEStepTask(int, const char*, int)’:
c2_lib.h:211:6: error: ‘flags’ was not declared in this scope
flags,
^
c2_lib.h:212:6: error: ‘resources’ was not declared in this scope
resources,
^
c2_lib.h:213:6: error: ‘done_sentinel’ was not declared in this scope
done_sentinel,
^
c2_lib.h: In static member function ‘static c2_lib::Task* dtm::TaskFactory::NewMStepTask(int, const char*, int)’:
c2_lib.h:227:9: error: ‘flags’ was not declared in this scope
flags,
^
c2_lib.h:228:9: error: ‘resources’ was not declared in this scope
resources,
^
c2_lib.h:229:9: error: ‘done_sentinel’ was not declared in this scope
done_sentinel,
^
c2_lib.h: In static member function ‘static c2_lib::Task* dtm::TaskFactory::NewTopicsFitTask(int, const char*, int)’:
c2_lib.h:243:9: error: ‘flags’ was not declared in this scope
flags,
^
c2_lib.h:244:9: error: ‘resources’ was not declared in this scope
resources,
^
c2_lib.h:245:9: error: ‘done_sentinel’ was not declared in this scope
done_sentinel,
^
c2_lib.h: In static member function ‘static c2_lib::Task* dtm::TaskFactory::NewDocsFitTask(int, const char*, int)’:
c2_lib.h:259:9: error: ‘flags’ was not declared in this scope
flags,
^
c2_lib.h:260:9: error: ‘resources’ was not declared in this scope
resources,
^
c2_lib.h:261:9: error: ‘done_sentinel’ was not declared in this scope
done_sentinel,
^
lda-seq.c: In function ‘double dtm::ParallelFitTopics(int, const string&, std::string*, double*)’:
lda-seq.c:1140:3: error: ‘hash_map’ was not declared in this scope
hash_map<string, string> flags;
^
lda-seq.c:1140:3: note: suggested alternative:
In file included from c2_lib.h:7:0,
from lda-seq.c:1:
/usr/include/c++/4.8.2/backward/hash_map:83:11: note: ‘__gnu_cxx::hash_map’
class hash_map
^
lda-seq.c:1140:18: error: expected primary-expression before ‘,’ token
hash_map<string, string> flags;
^
lda-seq.c:1140:26: error: expected primary-expression before ‘>’ token
hash_map<string, string> flags;
^
lda-seq.c:1140:28: error: ‘flags’ was not declared in this scope
hash_map<string, string> flags;
^
lda-seq.c: In function ‘void dtm::ParallelFitDocs(dtm::corpus_seq_t*, int, int, const std::vector<int>&, const string&, double*)’:
lda-seq.c:1256:3: error: ‘hash_map’ was not declared in this scope
hash_map<string, string> flags;
^
lda-seq.c:1256:3: note: suggested alternative:
In file included from c2_lib.h:7:0,
from lda-seq.c:1:
/usr/include/c++/4.8.2/backward/hash_map:83:11: note: ‘__gnu_cxx::hash_map’
class hash_map
^
lda-seq.c:1256:18: error: expected primary-expression before ‘,’ token
hash_map<string, string> flags;
^
lda-seq.c:1256:26: error: expected primary-expression before ‘>’ token
hash_map<string, string> flags;
^
lda-seq.c:1256:28: error: ‘flags’ was not declared in this scope
hash_map<string, string> flags;
^
make: *** [lda-seq.o] Error 1
Any insight is appreciated! Thanks
I am also facing similar issue on compiling dtm-parallel on HPC cluster.
g++ -std=c++98 -I ../lib -I ../lib/math -I ../gslwrap/include -I ../gslwrap/include/gslwrap -I ../local/include -I ../lib/util/gflags-1.1/src/gflags -c -o lda-seq.o lda-seq.c In file included from /usr/include/c++/9/backward/hash_set:60, from c2_lib.h:6, from lda-seq.c:1: /usr/include/c++/9/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp] 32 | #warning \ | ^~~~~~~ In file included from lda-seq.c:1: c2_lib.h:39:24: error: invalid use of incomplete type ‘FILE’ {aka ‘struct _IO_FILE’} 39 | class Resource: public FILE { | ^~~~ In file included from /usr/include/wchar.h:43, from /usr/include/c++/9/cwchar:44, from /usr/include/c++/9/bits/postypes.h:40, from /usr/include/c++/9/bits/char_traits.h:40, from /usr/include/c++/9/string:40, from strutil.h:11, from c2_lib.h:1, from lda-seq.c:1: /usr/include/x86_64-linux-gnu/bits/types/__FILE.h:4:8: note: forward declaration of ‘FILE’ {aka ‘struct _IO_FILE’} 4 | struct _IO_FILE; | ^~~~~~~~ In file included from lda-seq.c:1: c2_lib.h:62:8: error: ‘hash_set’ in namespace ‘std’ does not name a template type 62 | std::hash_set<int> references_; | ^~~~~~~~ c2_lib.h: In member function ‘void c2_lib::Resource::AddReference(int)’: c2_lib.h:52:5: error: ‘references_’ was not declared in this scope 52 | references_.insert(id); | ^~~~~~~~~~~ c2_lib.h: At global scope: c2_lib.h:206:14: error: ‘hash_map’ does not name a type 206 | const hash_map<std::string, std::string>& flags, | ^~~~~~~~ c2_lib.h:206:22: error: expected ‘,’ or ‘...’ before ‘<’ token 206 | const hash_map<std::string, std::string>& flags, | ^ c2_lib.h:222:14: error: ‘hash_map’ does not name a type 222 | const hash_map<std::string, std::string>& flags, | ^~~~~~~~ c2_lib.h:222:22: error: expected ‘,’ or ‘...’ before ‘<’ token 222 | const hash_map<std::string, std::string>& flags, | ^ c2_lib.h:238:11: error: ‘hash_map’ does not name a type 238 | const hash_map<std::string, std::string>& flags, | ^~~~~~~~ c2_lib.h:238:19: error: expected ‘,’ or ‘...’ before ‘<’ token 238 | const hash_map<std::string, std::string>& flags, | ^ c2_lib.h:254:16: error: ‘hash_map’ does not name a type 254 | const hash_map<std::string, std::string>& flags, | ^~~~~~~~ c2_lib.h:254:24: error: expected ‘,’ or ‘...’ before ‘<’ token 254 | const hash_map<std::string, std::string>& flags, | ^ c2_lib.h:271:13: error: ‘hash_map’ does not name a type 271 | const hash_map<std::string, std::string>& flags, | ^~~~~~~~ c2_lib.h:271:21: error: expected ‘,’ or ‘...’ before ‘<’ token 271 | const hash_map<std::string, std::string>& flags, | ^ c2_lib.h: In static member function ‘static c2_lib::Task* dtm::TaskFactory::NewEStepTask(int, const char*, int)’: c2_lib.h:211:6: error: ‘flags’ was not declared in this scope 211 | flags, | ^~~~~ c2_lib.h:212:6: error: ‘resources’ was not declared in this scope 212 | resources, | ^~~~~~~~~ c2_lib.h:213:6: error: ‘done_sentinel’ was not declared in this scope 213 | done_sentinel, | ^~~~~~~~~~~~~ c2_lib.h: In static member function ‘static c2_lib::Task* dtm::TaskFactory::NewMStepTask(int, const char*, int)’: c2_lib.h:227:9: error: ‘flags’ was not declared in this scope 227 | flags, | ^~~~~ c2_lib.h:228:9: error: ‘resources’ was not declared in this scope 228 | resources, | ^~~~~~~~~ c2_lib.h:229:9: error: ‘done_sentinel’ was not declared in this scope 229 | done_sentinel, | ^~~~~~~~~~~~~ c2_lib.h: In static member function ‘static c2_lib::Task* dtm::TaskFactory::NewTopicsFitTask(int, const char*, int)’: c2_lib.h:243:9: error: ‘flags’ was not declared in this scope 243 | flags, | ^~~~~ c2_lib.h:244:9: error: ‘resources’ was not declared in this scope 244 | resources, | ^~~~~~~~~ c2_lib.h:245:9: error: ‘done_sentinel’ was not declared in this scope 245 | done_sentinel, | ^~~~~~~~~~~~~ c2_lib.h: In static member function ‘static c2_lib::Task* dtm::TaskFactory::NewDocsFitTask(int, const char*, int)’: c2_lib.h:259:9: error: ‘flags’ was not declared in this scope 259 | flags, | ^~~~~ c2_lib.h:260:9: error: ‘resources’ was not declared in this scope 260 | resources, | ^~~~~~~~~ c2_lib.h:261:9: error: ‘done_sentinel’ was not declared in this scope 261 | done_sentinel, | ^~~~~~~~~~~~~ lda-seq.c: In function ‘double dtm::ParallelFitTopics(int, const string&, std::string*, double*)’: lda-seq.c:1140:3: error: ‘hash_map’ was not declared in this scope; did you mean ‘__gnu_cxx::hash_map’? 1140 | hash_map<string, string> flags; | ^~~~~~~~ | __gnu_cxx::hash_map In file included from c2_lib.h:7, from lda-seq.c:1: /usr/include/c++/9/backward/hash_map:83:11: note: ‘__gnu_cxx::hash_map’ declared here 83 | class hash_map | ^~~~~~~~ lda-seq.c:1140:18: error: expected primary-expression before ‘,’ token 1140 | hash_map<string, string> flags; | ^ lda-seq.c:1140:26: error: expected primary-expression before ‘>’ token 1140 | hash_map<string, string> flags; | ^ lda-seq.c:1140:28: error: ‘flags’ was not declared in this scope 1140 | hash_map<string, string> flags; | ^~~~~ lda-seq.c:1242:1: warning: no return statement in function returning non-void [-Wreturn-type] 1242 | } | ^ lda-seq.c: In function ‘void dtm::ParallelFitDocs(dtm::corpus_seq_t*, int, int, const std::vector<int>&, const string&, double*)’: lda-seq.c:1256:3: error: ‘hash_map’ was not declared in this scope; did you mean ‘__gnu_cxx::hash_map’? 1256 | hash_map<string, string> flags; | ^~~~~~~~ | __gnu_cxx::hash_map In file included from c2_lib.h:7, from lda-seq.c:1: /usr/include/c++/9/backward/hash_map:83:11: note: ‘__gnu_cxx::hash_map’ declared here 83 | class hash_map | ^~~~~~~~ lda-seq.c:1256:18: error: expected primary-expression before ‘,’ token 1256 | hash_map<string, string> flags; | ^ lda-seq.c:1256:26: error: expected primary-expression before ‘>’ token 1256 | hash_map<string, string> flags; | ^ lda-seq.c:1256:28: error: ‘flags’ was not declared in this scope 1256 | hash_map<string, string> flags; | ^~~~~ make: *** [<builtin>: lda-seq.o] Error 1
Can anyone help me with this one if you have a working version of dtm-parallel.
Any help is appreciated thank you!