-
Notifications
You must be signed in to change notification settings - Fork 61
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
Refactor EVE's exported CMake target and installation #1336
Changes from 16 commits
0af8685
3f96d24
cde83de
dc84b4a
9c815d2
8ee57e2
ff42066
d9e8f4c
cedfde2
ba70c21
8cb4355
58b7ba0
180c8e7
6163af9
72eeee9
03085a6
fa3e645
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,14 @@ Installation & Quick Start {#install} | |
|
||
In term of SIMD extension sets, we actively supports (ie code is optimized and regularly tested) the following: | ||
|
||
- **Intel** | ||
- SSE2, SSSE3, SSE3, SSE4.1, SSE4.2 | ||
- AVX, AVX2, FMA3 | ||
- AVX512 in SKylake-AVX512 mode (F, CD, VL, DQ, BW) | ||
- **ARM** | ||
- NEON A32 (64 & 128 bits) | ||
- NEON A64 (64 & 128 bits) | ||
- ASIMD | ||
- **Intel** | ||
- SSE2, SSSE3, SSE3, SSE4.1, SSE4.2 | ||
- AVX, AVX2, FMA3 | ||
- AVX512 in SKylake-AVX512 mode (F, CD, VL, DQ, BW) | ||
- **ARM** | ||
- NEON A32 (64 & 128 bits) | ||
- NEON A64 (64 & 128 bits) | ||
- ASIMD | ||
|
||
The following instructions are tentatively supported (ie code is incomplete and not tested in depth): | ||
|
||
|
@@ -32,17 +32,19 @@ The following instructions are tentatively supported (ie code is incomplete and | |
# Retrieving the source | ||
|
||
## Github | ||
|
||
**EVE** is available on GitHub and can be retrieved via the following command: | ||
<br/> | ||
|
||
@verbatim | ||
$ git clone https://github.com/jfalcou/eve.git | ||
$ git clone https://github.com/jfalcou/eve.git | ||
@endverbatim | ||
|
||
This retrieves the `main` branch which contains the latest stable version. Development happens | ||
live on `main` so if you need stability, use a tagged versions. | ||
|
||
## CPM | ||
|
||
You can install **EVE** directly via [CPM](https://github.com/cpm-cmake/CPM.cmake). After | ||
[adding CPM to your CMake setup](https://github.com/cpm-cmake/CPM.cmake#adding-cpm), just | ||
add the following commands: | ||
|
@@ -61,24 +63,27 @@ CPMAddPackage( | |
``` | ||
|
||
## SPACK | ||
|
||
**EVE** is [**available**](https://spack.readthedocs.io/en/latest/package_list.html#eve | ||
) via [**SPACK**](https://spack.readthedocs.io/en/latest/getting_started.html): | ||
|
||
```bash | ||
$ spack install eve | ||
spack install eve | ||
``` | ||
|
||
Once installed, you can use **EVE** headers directly from your | ||
[**SPACK**](https://spack.readthedocs.io/en/latest/getting_started.html) installation. | ||
|
||
## AUR | ||
|
||
**EVE** is available on Arch-Linux via an [**AUR package**](https://aur.archlinux.org/packages/eve-git/). | ||
|
||
```bash | ||
$ yay -S eve-git | ||
yay -S eve-git | ||
``` | ||
|
||
## Conan | ||
|
||
[**Conan Center**](https://conan.io/center/) hosts **EVE** as the | ||
[`jfalcou-eve` package](https://conan.io/center/jfalcou-eve). | ||
|
||
|
@@ -94,55 +99,56 @@ cmake | |
``` | ||
|
||
## VCPKG | ||
|
||
**EVE** can be fetched from [VCPKG](https://vcpkgx.com/details.html?package=eve). Note that, as of | ||
now, we still don't support MSVC. | ||
|
||
```bash | ||
$ vcpkg install eve | ||
vcpkg install eve | ||
``` | ||
|
||
# Installation from Source | ||
|
||
If you didn't fetched **EVE** from a package manager, you'll need to install it via our CMake | ||
system. | ||
|
||
## Setting up the Library | ||
Create a `build` directory here and enter it. Once in the `build` directory, you can use **CMake** | ||
to generate the build system for **EVE**. | ||
|
||
We recommend using [Ninja](https://ninja-build.org/) but any build system is fine. | ||
With **CMake**, generate the build system for **EVE**. We recommend using | ||
[Ninja](https://ninja-build.org/) but any build system is fine. | ||
|
||
@verbatim | ||
$ mkdir build | ||
$ cd build | ||
$ cmake .. -G Ninja | ||
cmake -B build -G Ninja | ||
@endverbatim | ||
|
||
Once **CMake** completes, you can use the `install` target to build and install **EVE**. By default, | ||
the library will be installed in the `/usr/local`directory, thus requiring root privileges on Linux. | ||
Since **EVE** is header only, once **CMake** completes, you can install **EVE** without building. By | ||
default, the library will be installed globally to your system, in `/usr/local` for Linux, thus | ||
requiring root privileges. | ||
|
||
@verbatim | ||
$ ninja install | ||
@endverbatim | ||
```bash | ||
cmake --install build | ||
``` | ||
|
||
You can select an alternative installation path by specifying the `CMAKE_INSTALL_PREFIX` option at configuration time. | ||
An alternative installation prefix can be specified with the '--prefix' flag. | ||
|
||
@verbatim | ||
$ cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=path/to/install | ||
$ ninja install | ||
@endverbatim | ||
```bash | ||
cmake --install build --prefix path/to/install | ||
``` | ||
|
||
## Building the Documentation | ||
|
||
You can rebuild **EVE** documentation if you have the latest version of Doxygen installed | ||
using the `doxygen` target: | ||
<br/> | ||
|
||
@code | ||
ninja doxygen | ||
cmake --build build --target doxygen | ||
@endcode | ||
|
||
The resulting HTML files will be available in the `doc` folder. | ||
|
||
# Using the library | ||
|
||
## Compilation | ||
|
||
Once installed, you can compile the following code to check if everything is alright. | ||
|
@@ -152,7 +158,7 @@ Once installed, you can compile the following code to check if everything is alr | |
To do so, use your C++20 aware favorite compiler, for example g++. | ||
|
||
@verbatim | ||
$ g++ test.cpp -std=c++20 -march=native -O3 -DNDEBUG -I/path/to/install/include -o output | ||
$ g++ test.cpp -std=c++20 -march=native -O3 -DNDEBUG -I/path/to/install/include/eve-<version> -o output | ||
@endverbatim | ||
|
||
Don't forget the `--std=c++20` option to be sure to activate C++20 support. If you use a different compiler, check your compiler user's manual to use the proper option. | ||
|
@@ -168,7 +174,7 @@ The SIMD instruction sets that **EVE** uses is decided at compile time. You can | |
You can also select a specific instructions set by using the proper option(s) from your compiler. For example, let's compile for exactly SSE4.1. | ||
|
||
@verbatim | ||
$ g++ test.cpp -std=c++20 -msse4.1 -O3 -DNDEBUG -I/path/to/install/include -o output | ||
$ g++ test.cpp -std=c++20 -msse4.1 -O3 -DNDEBUG -I/path/to/install/include/eve-<version> -o output | ||
@endverbatim | ||
|
||
## Execution | ||
|
@@ -185,19 +191,37 @@ $ ./output | |
|
||
That's it, **EVE** is properly installed and ready to use. | ||
|
||
## Use in CMake | ||
|
||
Once installed, **EVE** may be consumed though its config-file **CMake** package. Simply find and | ||
link against **EVE's** **CMake** target, as you would any other **CMake** library, and then | ||
configure and build your **CMake** project. | ||
|
||
```cmake | ||
add_executable(use-eve main.cpp) | ||
find_package(eve CONFIG REQUIRED) | ||
target_link_libraries(use-eve PRIVATE eve::eve) | ||
``` | ||
|
||
> If a custom installation prefix was used, ensure your **EVE** installation is within **CMake's** | ||
search path with the use of the **CMake** variables **eve_ROOT** (CMake 3.12), **eve_DIR**, or | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we remove the 3.12 remark ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are now saying 3.19 is the minimum, yes. Thanks! |
||
**CMAKE_PREFIX_PATH**. | ||
|
||
# Advanced options | ||
|
||
If you want to dig a bit further, you can pass additional options to `cmake` to | ||
activate additional features. | ||
|
||
| Option | Effect | Target | | ||
|--------|:-------------|:---------------------| | ||
| `EVE_BUILD_TEST` | Enable unit tests for **EVE** (`ON` by default). | `ninja unit` | | ||
| `EVE_BUILD_BENCHMARKS`| Enable benchmark tests for **EVE** (`OFF` by default). | `ninja benchmarks` | | ||
| `EVE_BUILD_RANDOM` | Enable random tests for **EVE** (`OFF` by default). | `ninja random` | | ||
|
||
There is currently over 2000 tests, so compiling all unit tests may require a large machine or | ||
some time. We recommend compiling in parallel using `-j`. | ||
| `EVE_BUILD_TEST` | Enable unit tests for **EVE** (`ON` by default). | `unit` | | ||
| `EVE_BUILD_BENCHMARKS`| Enable benchmark tests for **EVE** (`OFF` by default). | `benchmarks` | | ||
| `EVE_BUILD_RANDOM` | Enable random tests for **EVE** (`OFF` by default). | `random` | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't we had a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that option was added as part of #1336 to enable the integration tests that are now registered with CTest. Thanks for catching my not updating this documentation section to match! I'll do that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added these docs and made an aggregated |
||
|
||
There is currently over 2000 tests, so compiling all unit tests may require a large machine or some | ||
time. We recommend compiling in parallel using `-j`. | ||
All available **CMake** targets may be listed via `cmake --build build --target help`, each of which | ||
may be built individually. | ||
|
||
Some options are also available to control some other aspects | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's be pedantic for 0.5ns.
Can we remove that noisy commit? I guess this new line is accidental.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being pedantic is good.
I actually placed that line there purposefully to change a Dockerfile, causing rebuilding of the docker image. I did this in an attempt to fix those mysterious CI errors. It didn't work.
I will clean up!