1 # Platform Specific Build Instructions
5 When the library is built using GCC it is necessary to link with the pthread
6 library due to how GCC implements `std::thread`. Failing to link to pthread will
7 lead to runtime exceptions (unless you're using libc++), not linker errors. See
8 [issue #67](https://github.com/google/benchmark/issues/67) for more details. You
9 can link to pthread by adding `-pthread` to your linker command. Note, you can
10 also use `-lpthread`, but there are potential issues with ordering of command
11 line parameters if you use that.
13 On QNX, the pthread library is part of libc and usually included automatically
15 [`pthread_create()`](https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/p/pthread_create.html)).
16 There's no separate pthread library to link.
18 ## Building with Visual Studio 2015 or 2017
20 The `shlwapi` library (`-lshlwapi`) is required to support a call to `CPUInfo` which reads the registry. Either add `shlwapi.lib` under `[ Configuration Properties > Linker > Input ]`, or use the following:
23 // Alternatively, can add libraries using linker options.
25 #pragma comment ( lib, "Shlwapi.lib" )
27 #pragma comment ( lib, "benchmarkd.lib" )
29 #pragma comment ( lib, "benchmark.lib" )
34 Can also use the graphical version of CMake:
36 * Under `Where to build the binaries`, same path as source plus `build`.
37 * Under `CMAKE_INSTALL_PREFIX`, same path as source plus `install`.
38 * Click `Configure`, `Generate`, `Open Project`.
39 * If build fails, try deleting entire directory and starting again, or unticking options to build less.
41 ## Building with Intel 2015 Update 1 or Intel System Studio Update 4
43 See instructions for building with Visual Studio. Once built, right click on the solution and change the build to Intel.
45 ## Building on Solaris
47 If you're running benchmarks on solaris, you'll want the kstat library linked in