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
This automatically installs dependencies as well (see [list of dependencies](#dependencies) below).
55
+
56
+
Installing from source into `$PREFIX` (for instance `$CONDA_PREFIX` when in a conda environment, or `$HOME/.local`) after manually installing the [dependencies](#dependencies):
57
+
58
+
```bash
59
+
git clone https://github.com/egpbos/xtensor-fftw
60
+
cd xtensor-fftw
61
+
mkdir build
62
+
cd build
63
+
cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX
64
+
make install
65
+
```
66
+
67
+
## Dependencies
68
+
69
+
*[xtensor](https://github.com/QuantStack/xtensor)
70
+
*[xtl](https://github.com/QuantStack/xtl)
71
+
*[FFTW](http://www.fftw.org/) version 3
72
+
* A compiler supporting C++14
73
+
46
74
## Usage
47
75
48
76
_xtensor-fftw_ is a header-only library.
49
-
To use, include one of the header files in the `include` directory, e.g. `xtensor-fftw/fft.hpp`, in your c++ code.
77
+
To use, include one of the header files in the `include` directory, e.g. `xtensor-fftw/basic.hpp`, in your c++ code.
50
78
To compile, one should also include the paths to the FFTW header and libraries and link to the appropriate FFTW library.
51
79
52
80
Note that _xtensor-fftw_ on Windows does not support `long double` precision.
53
81
The `long double` precision version of the FFTW library requires that `sizeof(long double) == 12`.
54
82
In recent versions of Visual Studio, `long double` is an alias of `double` and has size 8.
55
83
56
-
What follows are instructions for compiling the _xtensor-fftw_ tests.
84
+
85
+
## Building and running tests
86
+
87
+
What follows are instructions for compiling and running the _xtensor-fftw_ tests.
57
88
These also serve as an example of how to do build your own code using _xtensor-fftw_ (excluding the GoogleTest specific parts).
58
89
59
-
### Dependencies
90
+
### Dependencies for building tests
60
91
The main dependency is a version of FFTW 3.
61
92
For the tests, we need the floating point version which is enabled in the FFTW configuration step using:
62
93
```bash
@@ -65,12 +96,13 @@ For the tests, we need the floating point version which is enabled in the FFTW c
65
96
66
97
CMake and _xtensor_ must also be installed in order to compile the _xtensor-fftw_ tests.
67
98
Both can either be installed through Conda or built/installed manually.
68
-
When using a non-Conda _xtensor_-install, make sure that the CMake `find_package` command can find _xtensor_, e.g. by passing something like `-DCMAKE_MODULE_PATH="path_to_xtensorConfig.cmake"` to CMake (not tested).
99
+
When using a non-Conda _xtensor_-install, make sure that the CMake `find_package` command can find _xtensor_, e.g. by passing something like `-DCMAKE_MODULE_PATH="path_to_xtensorConfig.cmake"` to CMake.
100
+
If _xtensor_ was installed in a default location, CMake should be able to find it without any command line options.
69
101
70
102
Optionally, a GoogleTest installation can be used.
71
103
However, it is recommended to use the built-in option to download GoogleTest automatically (see below).
72
104
73
-
### Configure
105
+
### Configure tests
74
106
75
107
Inside the _xtensor-fftw_ source directory, create a build directory and `cd` into it:
76
108
```bash
@@ -93,13 +125,22 @@ or pass the path to CMake directly as such:
0 commit comments