Comments (11)
from quanteda.
Would that be PR #2365 ?
I'll see what I can do, first clone HEAD, build, check with tbb-devel installed, then remove tbb-devel to provoke the compile error, then apply the PR and build/check to see whether the absence of tbb-devel is detected. Is that what you mean?
Is there a configure arg to turn off tbb anyway on install?
from quanteda.
And from an email from Kurt Hornik:
Related to this: your configure.ac does
# Default to no Intel TBB
TBBFLAGS=
TBBLIBS=
# If tbb.h is found, define TBB
AC_CHECK_HEADER([tbb/tbb.h],
[TBBFLAG=-DTBB;TBBLIBS=-ltbb],
[AC_MSG_WARN([parallel computing is disabled because tbb/tbb.h (Intel TBB) is not found])])
This is not a good idea: the code should really also run
AC_CHECK_LIB(tbb, FUNC) with a suitable FUNC before using -ltbb.
Which seems to be the problem on fedora-gcc where apparently a header is
found but the library is not available.
from quanteda.
@rsbivand Thanks for noting this. I've been trying to do some testing for this on a VM but can't get the architecture to match (my emulator is on a macOS arm base).
We'd be very grateful if you were to try a PR to fix this on your system!
from quanteda.
Would that be PR #2365 ?
No, that was just for instructions. You would need to fork the package and work with it from there and start a new PR.
I'll see what I can do, first clone HEAD, build, check with tbb-devel installed, then remove tbb-devel to provoke the compile error, then apply the PR and build/check to see whether the absence of tbb-devel is detected. Is that what you mean?
Is there a configure arg to turn off tbb anyway on install?
We don't have one at the moment but if tbb is not detected on other systems, it should just compile without it.
See also #2364 (comment).
from quanteda.
I need you to provide a minimal free-standing C++ program linking to libtbb directly. I have no idea which function can be called with no arguments, see https://github.com/rsbivand/quanteda/blob/572dbaa4a4896255ceda290bb47239104018664a/configure.ac#L36 and https://nerdland.net/2009/07/detecting-c-libraries-with-autotools/ - a function that does not fail if the library is not available is what is needed but major_version
isn't it. You know TBB, so you need to find the function. In https://github.com/r-spatial/sf/blob/main/configure.ac we had to do lots of arcane things, but were working with amenable libraries.
from quanteda.
Using the example from https://link.springer.com/chapter/10.1007/978-1-4842-4398-5_1, #2368 seems to work.
from quanteda.
And the underlying reason why the header file is found even when no platform tbb devel package is installed may be that one is bundled here: RcppParallel/include/tbb/tbb.h
; RcppParallel/include/tbb
is actually pretty complete, but of unknown version.
from quanteda.
The header test is completely unreliable, as it seems to pick up compiler-internal traces of bits of tbb (in parts of pstl, perhaps) - I can't see leakage from RcppParallel. Hence b849a1a to drop the header test. Had tbb been properly written, it would have exposed a defined value, such as the software version, which could be read if present and printed, but which would fail otherwise.
from quanteda.
@koheiw maybe wait a little - #2368 (comment) asks about giving the location of an installed tbb if not installed in the /usr/include/tbb and /usr/lib or /usr/lib64 directories.
If tbb is installed, pkg-config --libs tbb
should return -ltbb
(Fedora, standard installation), and pkg-config --modversion tbb
should return 2020.3
on Fedora, the relevant value on other installations. On Fedora, tbb.pc
is in /usr/lib64/pkgconfig/
.
If a user has a non-standard location, the tbb.pc
file will be elsewhere, but this can be added to the PKG_CONFIG_PATH
environment variable. In that case, it should also report the -I
and -L
flags needed to find the headers and library, as in https://www.intel.com/content/www/us/en/docs/onetbb/get-started-guide/2021-12/integrate-onetbb.html#INTEGRATE, section "Compile a program using pkg-config", specifically: g++ -o test test.cpp $(pkg-config --libs --cflags tbb)
.
If tbb is installed and PKG_CONFIG_PATH
is correct, pkg-config --exists tbb
exits with status 0
, if not installed, with status 1
. This can be used first with a warning to update PKG_CONFIG_PATH
if tbb
is believed to be installed, or to install it before re-installing the R package if TBB is desired.
Would you like me to adapt configure.ac
to use pkg-config
, or is there enough detail here for you to work with? Rtools for Windows can also use pkg-config
.
from quanteda.
#2371 created.
from quanteda.
Related Issues (20)
- Make tokens_substitute() to replace characters in tokens?
- Add more explicit information on enabling parallelization in quanteda >v4.0.0 HOT 1
- Experiencing problem with textmodel_mlp
- Add apply_if to tokens_ngrams()
- Error in parallel computing HOT 1
- Add invert to sampling functions
- parallel computing is disabled in CRAN version HOT 2
- Keep original unigrams in tokens_compound() HOT 1
- Add only_unigram argument
- Only geneate existing sequence
- Function dfm_stem() does not exist but is required to replace dfm(stem) HOT 1
- Add tokens_trim()
- CRAN problems: documentation links
- CRAN problems: UBSAN HOT 31
- Return value of `cpp_dfm` can be invalid, non-deterministic HOT 2
- dfm_weight with the weights= option does not produce a dfm HOT 1
- Trouble creating fcm from very large tokens object HOT 6
- Error in left_join running topic model HOT 1
- Always remove paddings in `dfm()` HOT 1
- Quanteda: Can create tokens on one subset of corpus, but not the other: Error: The type of x must be character HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quanteda.