Skip to content

Commit

Permalink
Merge #77 into my current working tree and push the bits which are sa…
Browse files Browse the repository at this point in the history
…fe to push for now.
  • Loading branch information
ned14 committed Apr 15, 2021
1 parent 2040dcb commit db383d6
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 78 deletions.
80 changes: 42 additions & 38 deletions Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,9 @@ These compilers and OSs are regularly tested:

Other compilers, architectures and OSs may work, but are not tested regularly.
You will need a working [Filesystem TS](https://en.cppreference.com/w/cpp/experimental/fs)
implementation in your STL, and at least C++ 14.

## Get a copy of the source

Download [this archive](https://dedi5.nedprod.com/static/files/llfio-v2-source-latest.tar.xz)
or clone from the GitHub repository:

~~~
git config --system core.longpaths true
git clone --recursive https://github.com/ned14/llfio.git
cd llfio
~~~

The first command is relevant so deeply nested paths on Windows will work when
cloning the repository and submodules. It may require elevated privileges, but
you can also use `git config --global core.longpaths true` instead.

### If you already cloned before reading this

If you had already cloned _this_ repository, but didn't use the `--recursive`
switch, you can simply run the following command from inside the work tree:

~~~
git submodule update --init --recursive
~~~

## Header only usage

LLFIO defaults to header only library configuration, so you don't actually need
any of the prebuilt binaries below, or to build anything. Simply:

~~~cpp
#include "llfio/include/llfio.hpp"
~~~
implementation in your STL, and at least C++ 14.

LLFIO has your choice of header-only, static library, and shared library build modes.
Note that on Microsoft Windows, the default header only configuration is unsafe
to use outside of toy projects. You will get warnings of the form:

Expand All @@ -67,14 +35,50 @@ which doesn't have this problem (define `LLFIO_EXPERIMENTAL_STATUS_CODE=1`)
documentation](https://github.com/ned14/ntkernel-error-category)) (iii)
Don't use header only LLFIO on Windows (see below).


## Install from the vcpkg package manager

This is particularly easy, and works on Mac OS, Linux and Microsoft Windows:

```
vcpkg install llfio
```

LLFIO appears at `<llfio/llfio.hpp>`.

## Prebuilt binaries

It is faster to build programs using LLFIO if you don't use a header only build.
In this situation, define `LLFIO_HEADERS_ONLY=0`, and choose one of `LLFIO_DYN_LINK` or `LLFIO_STATIC_LINK` depending on whether you are using the prebuilt shared or static libraries respectively.
In this situation, define `LLFIO_HEADERS_ONLY=0`, and choose one of `LLFIO_DYN_LINK`
or `LLFIO_STATIC_LINK` depending on whether you are using the prebuilt shared or
static libraries respectively.

You can find prebuilt binaries for Mac OS, Ubuntu and Microsoft Windows at
https://github.com/ned14/llfio/releases. Choose a release, and under the Assets
you will find the prebuilt binaries packages which include headers.

## Get a copy of the source

Clone from the GitHub repository:

~~~
git config --system core.longpaths true
git clone --recursive https://github.com/ned14/llfio.git
cd llfio
~~~

The first command is relevant so deeply nested paths on Windows will work when
cloning the repository and submodules. It may require elevated privileges, but
you can also use `git config --global core.longpaths true` instead.

### If you already cloned before reading this

- https://dedi5.nedprod.com/static/files/llfio-v2-binaries-darwin-latest.zip
- https://dedi5.nedprod.com/static/files/llfio-v2-binaries-linux64-latest.tgz
- https://dedi5.nedprod.com/static/files/llfio-v2-binaries-win64-latest.zip
If you had already cloned _this_ repository, but didn't use the `--recursive`
switch, you can simply run the following command from inside the work tree:

~~~
git submodule update --init --recursive
~~~

## Build static libraries from source

Expand Down
2 changes: 1 addition & 1 deletion include/llfio/llfio.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! \file llfio/llfio.hpp The master *latest version* LLFIO include file. All LLFIO consuming libraries should include this header only.
#include "version.hpp"

#if defined(_MSC_VER) && !defined(__clang__)
#if defined(_MSC_VER) && !defined(__clang__) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
#define LLFIO_HEADERS_PATH2 LLFIO_VERSION_GLUE(v, LLFIO_HEADERS_VERSION, /llfio.hpp)
#elif !__PCPP_ALWAYS_FALSE__
#define LLFIO_HEADERS_PATH2 LLFIO_VERSION_GLUE(v, LLFIO_HEADERS_VERSION,)/llfio.hpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,6 @@ class dynamic_thread_pool_group_impl final : public dynamic_thread_pool_group
#else
void *_grouph{nullptr};
size_t _newly_added_active_work_items{0};
size_t _timer_work_items_remaining{0};
size_t _active_work_items_remaining{0};
#endif

Expand Down
2 changes: 1 addition & 1 deletion include/llfio/v2.0/llfio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define LLFIO_NAMESPACE_VERSION LLFIO_VERSION_GLUE(LLFIO_VERSION_MAJOR, _, LLFIO_VERSION_MINOR)

#if defined(__cpp_modules) || defined(DOXYGEN_SHOULD_SKIP_THIS)
#if defined(_MSC_VER) && !defined(__clang__)
#if defined(_MSC_VER) && !defined(__clang__) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
//! \brief The LLFIO C++ module name
#define LLFIO_MODULE_NAME LLFIO_VERSION_GLUE(llfio_v, LLFIO_NAMESPACE_VERSION, )
#else
Expand Down
2 changes: 1 addition & 1 deletion include/llfio/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define LLFIO_VERSION_GLUE(a, b, c) LLFIO_VERSION_GLUE2(a, b, c)
#define LLFIO_NAMESPACE_VERSION LLFIO_VERSION_GLUE(LLFIO_VERSION_MAJOR, _, LLFIO_VERSION_MINOR)

#if defined(_MSC_VER) && !defined(__clang__)
#if defined(_MSC_VER) && !defined(__clang__) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
#define LLFIO_HEADERS_VERSION LLFIO_VERSION_GLUE(LLFIO_VERSION_MAJOR, ., LLFIO_VERSION_MINOR)
#else
#define LLFIO_HEADERS_VERSION LLFIO_VERSION_MAJOR.LLFIO_VERSION_MINOR
Expand Down
Loading

0 comments on commit db383d6

Please sign in to comment.