You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# macOS linker doesn't support -soname, and use different extension
73
75
# see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html
For convenience, we provide a build target to generate multi and single threaded libraries:
29
29
- Force enable multithreading on both dynamic and static libraries by appending `-mt` to the target, e.g. `make lib-mt`.
30
+
Note that the `.pc` generated on calling `make lib-mt` will already include the require Libs and Cflags.
30
31
- Force disable multithreading on both dynamic and static libraries by appending `-nomt` to the target, e.g. `make lib-nomt`.
31
32
- By default, as mentioned before, dynamic library is multithreaded, and static library is single-threaded, e.g. `make lib`.
32
33
33
34
When linking a POSIX program with a multithreaded version of `libzstd`,
34
35
note that it's necessary to invoke the `-pthread` flag during link stage.
35
36
37
+
The `.pc` generated from `make install` or `make install-pc` always assume a single-threaded static library
38
+
is compiled. To correctly generate a `.pc` for the multi-threaded static library, set `MT=1` as ENV variable.
39
+
36
40
Multithreading capabilities are exposed
37
41
via the [advanced API defined in `lib/zstd.h`](https://github.com/facebook/zstd/blob/v1.4.3/lib/zstd.h#L351).
38
42
@@ -145,6 +149,13 @@ The file structure is designed to make this selection manually achievable for an
145
149
will expose the deprecated `ZSTDMT` API exposed by `zstdmt_compress.h` in
146
150
the shared library, which is now hidden by default.
147
151
152
+
- The build macro `STATIC_BMI2` can be set to 1 to force usage of `bmi2` instructions.
153
+
It is generally not necessary to set this build macro,
154
+
because `STATIC_BMI2` will be automatically set to 1
155
+
on detecting the presence of the corresponding instruction set in the compilation target.
156
+
It's nonetheless available as an optional manual toggle for better control,
157
+
and can also be used to forcefully disable `bmi2` instructions by setting it to 0.
158
+
148
159
- The build macro `DYNAMIC_BMI2` can be set to 1 or 0 in order to generate binaries
149
160
which can detect at runtime the presence of BMI2 instructions, and use them only if present.
150
161
These instructions contribute to better performance, notably on the decoder side.
0 commit comments