quanteda / quanteda.textstats

Textual statistics for quanteda
GNU General Public License v3.0
14 stars 2 forks source link

Fix old tbb #74

Closed koheiw closed 5 months ago

koheiw commented 5 months ago

73

kbenoit commented 5 months ago

@koheiw On my local mac, where it's not finding TBB installed (even though it is, but not seeing it as per https://github.com/quanteda/quanteda/issues/2367, with the new compiler directive to fix this, I get:

   clang++ -arch arm64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/RcppArmadillo/include' -I'/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/quanteda/include' -I/opt/R/arm64/include   -DARMA_64BIT_WORD=1 `/Library/Frameworks/R.framework/Resources/bin/Rscript ../inst/deftbb.R` -fPIC  -falign-functions=64 -Wall -g -O2  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c collocations.cpp -o collocations.o
   collocations.cpp:20:45: error: use of undeclared identifier 'UintAtomic'
   typedef std::unordered_map<Ngram, std::pair<UintAtomic, UintAtomic>, hash_ngram, equal_ngram> MapNgramsPair;
                                               ^
   collocations.cpp:147:39: error: type 'MapNgramsPair' (aka 'int') does not provide a subscript operator
                   auto &count = map_seqs[text_sub];
                                 ~~~~~~~~^~~~~~~~~
   collocations.cpp:239:13: error: member reference base type 'MapNgramsPair' (aka 'int') is not a structure or union
       map_seqs.max_load_factor(GLOBAL_PATTERN_MAX_LOAD_FACTOR);
       ~~~~~~~~^~~~~~~~~~~~~~~~
   collocations.cpp:257:29: error: member reference base type 'MapNgramsPair' (aka 'int') is not a structure or union
       std::size_t N = map_seqs.size();
                       ~~~~~~~~^~~~~
   collocations.cpp:271:28: error: member reference base type 'MapNgramsPair' (aka 'int') is not a structure or union
       for (auto it = map_seqs.begin(); it != map_seqs.end(); ++it) {
                      ~~~~~~~~^~~~~~
   collocations.cpp:271:52: error: member reference base type 'MapNgramsPair' (aka 'int') is not a structure or union
       for (auto it = map_seqs.begin(); it != map_seqs.end(); ++it) {
                                              ~~~~~~~~^~~~
   6 errors generated.
   make: *** [collocations.o] Error 1
   ERROR: compilation failed for package ‘quanteda.textstats’

How can the compiler #if statements be nested so that this doesn't happen if not QUANTEDA_USE_TBB ?

koheiw commented 5 months ago

Please try https://github.com/quanteda/quanteda.textstats/pull/75.