Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update C readme with vcpkg and CMake usage instructions #316

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 22 additions & 9 deletions c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,27 @@ smell](https://en.wikipedia.org/wiki/Design_smell) in any case.

# Building

This implementation is just C and assembly files. It doesn't include a
public-facing build system. (The `Makefile` in this directory is only
for testing.) Instead, the intention is that you can include these files
in whatever build system you're already using. This section describes
the commands your build system should execute, or which you can execute
by hand. Note that these steps may change in future versions.
This implementation is just C and assembly files. It comes with a CMake
buildsystem even though you can simply include the source files in
whatever build system you're already using. (The `Makefile` in this
directory is only for testing.) This section is split in two parts; the
first describes how to use the CMake buildsystem while the second
specifies the commands necessary to build the library by hand with gcc
for various platforms (you may use these as a guideline for integrating
the source files into your own buildsystem). Note that these steps may
change in future versions.

## x86
If you use the [vcpkg](https://vcpkg.io/) as your package manager, you
can simply reference the `blake3` port from your manifest or install it
via `./vcpkg install blake3`

## CMake

### CMake Options

## Manual Build Instructions

### x86

Dynamic dispatch is enabled by default on x86. The implementation will
query the CPU at runtime to detect SIMD support, and it will use the
Expand Down Expand Up @@ -268,7 +281,7 @@ gcc -shared -O3 -o libblake3.so -DBLAKE3_NO_SSE2 -DBLAKE3_NO_SSE41 -DBLAKE3_NO_A
-DBLAKE3_NO_AVX512 blake3.c blake3_dispatch.c blake3_portable.c
```

## ARM NEON
### ARM NEON

The NEON implementation is enabled by default on AArch64, but not on
other ARM targets, since not all of them support it. To enable it, set
Expand Down Expand Up @@ -300,7 +313,7 @@ in call to always_inline ‘vaddq_u32’: target specific option mismatch
...then you may need to add something like `-mfpu=neon-vfpv4
-mfloat-abi=hard`.

## Other Platforms
### Other Platforms

The portable implementation should work on most other architectures. For
example:
Expand Down