-
Notifications
You must be signed in to change notification settings - Fork 204
Building and installing
Amanieu edited this page Mar 24, 2013
·
10 revisions
You need a C++11 compiler to build Async++. As of this writing, only GCC 4.7 and Clang 3.2 are known to work.
Async++ can be built as a static or shared library using the build-{static,shared}-{gcc,clang}.sh
scripts.
To use it in a program, include <async++.h>
and link with libasync++
:
g++ -std=c++11 -pthread test.cpp -c -o test.o -I${LIBASYNC_PATH}/include
g++ -std=c++11 -pthread test.o -o test -L${LIBASYNC_PATH} -lasync++
You can control the number of threads spawned in the thread pool by setting the LIBASYNC_NUM_THREADS
environment variable. By default std::thread::hardware_concurrency()
is used, which is the number of core/hardware threads on the system.