Skip to content

Commit 893bf6f

Browse files
committed
updated docs
1 parent 854e590 commit 893bf6f

File tree

5 files changed

+31
-24
lines changed

5 files changed

+31
-24
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ option(FINUFFT_ENABLE_SANITIZERS "Whether to enable sanitizers, only effective f
1818
option(FINUFFT_USE_OPENMP "Whether to use OpenMP for parallelization. If disabled, the finufft library will be single threaded. This does not affect the choice of FFTW library." ON)
1919
option(FINUFFT_USE_CPU "Whether to build the ordinary FINUFFT library (libfinufft)." ON)
2020
option(FINUFFT_USE_CUDA "Whether to build CUDA accelerated FINUFFT library (libcufinufft). This is completely independent of the main FINUFFT library" OFF)
21-
option(FINUFFT_STATIC_LINKING "Whether to build the static FINUFFT library." ON)
21+
option(FINUFFT_STATIC_LINKING "If ON builds the static finufft library, if OFF build a shared finufft library." ON)
2222
option(FINUFFT_BUILD_DEVEL "Whether to build development executables" OFF)
2323
option(FINUFFT_BUILD_EXAMPLES "Whether to build the FINUFFT examples" OFF)
2424
option(FINUFFT_BUILD_TESTS "Whether to build the FINUFFT tests" OFF)
@@ -141,6 +141,9 @@ include(cmake/setupCPM.cmake)
141141

142142
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
143143
include(CTest)
144+
if(FINUFFT_BUILD_TESTS)
145+
enable_testing()
146+
endif()
144147
include(cmake/setupSphinx.cmake)
145148
endif()
146149

docs/README

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ to install:
6060
https://github.com/matthew-brett/texext
6161
* python3 - since sphinx autodoc actually runs py to gen docstrings.
6262

63-
Then (from this docs directory), run ``make latexpdf``
63+
Then it is possible to build docs locally in two ways. The cmake way or the make way
64+
65+
The cmake way requires to run ``cmake --build [path to the build dir] --target finufft_sphinx``
66+
It creates a subfolder inside the build directory called ``finufft_sphinx`` containing the ``index.html``
67+
68+
Alternatively (from this docs directory), run ``make latexpdf``
6469
and look in _build/latex/finufft.pdf for the PDF.
6570

6671
Or, run ``make html`` then point your browser to
@@ -71,3 +76,4 @@ do not remove them.
7176

7277

7378
Alex Barnett, 2022/6/13.
79+
Marco Barbone, 2024/08/01

docs/devnotes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Developer notes
44
===============
55

66
* Developers needing to update/regenerate documentation in general, including our readthedocs website, see ``docs/README``. Developers changing MATLAB/octave interfaces or docs, also see ``matlab/README``. Please also see ``contributing.md`` for code style and git hook guidelines.
7-
* cmake supports sphinx generation one can do by ``cmake --build . --target finufft_sphinx``. This will crete a folder called finufft_sphinx in your build directory, opening ``index.html`` will preview the updated documentation.
8-
* cmake sphinx requires shpinx and texext to be installed in python
7+
98
* To update the version number, this needs to be done by hand in the following places:
109

1110
- ``CMakeLists.txt`` for cmake
1211
- ``docs/conf.py`` for sphinx
13-
- ``python/finufft/setup.py`` for the python pkg version
14-
- ``python/cufinufft/setup.py`` for the GPU python pkg version
12+
- ``docs/install.rst`` cmake git tags
13+
- ``python/finufft/finufft/__init__.py`` for the python pkg version
14+
- ``python/cufinufft/cufinufft/__init__.py`` for the GPU python pkg version
1515
- ``include/finufft/defs.h`` for the debug>0 output
1616
- ``matlab/Contents.m`` for the MATLAB/Octave help
1717
- ``CHANGELOG``: don't forget to describe the new features and changes, folding lines at 80 chars.

docs/install.rst

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@ a precompiled binary for your platform under Assets for various
1212
`releases <https://github.com/flatironinstitute/finufft/releases>`_.
1313
Please post an `Issue <https://github.com/flatironinstitute/finufft/issues>`_
1414
to document your installation problem.
15-
When using CMake, finufft requires no external dependencies except (c/c++ compilers supporting OpenMP).
15+
When using CMake, finufft requires no external dependencies except (c/c++ compilers supporting OpenMP and c++17).
1616
However GNU ``makefile`` assumes that FFTW (single/double) are installed.
17+
Python-only users can simply install via ``pip install finufft`` which downloads a generic binary from PyPI. Only if you prefer a custom compilation, see :ref:`below<install-python>`.
1718

1819
.. note::
1920
finufft builds with no issues on Linux and MacOS using any compiler, in our experience GCC-13 gives best performance.
2021
On Windows MSVC works fine. The llvm toolchain included in Visual Studio does not seem to have OpenMP, it is possible to build single-threaded FINUFFT.
2122
The official windows LLVM distribution builds finufft with no issues but debug builds using sanitizers break.
22-
23-
.. note::
24-
2523
On windows finufft built with MSVC requires ``VCOMP140D.DLL`` which is part of the `Microsoft Visual C++ Redistributable <https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170>`_.
2624
It is likely to be already installed in your system.
2725
If the library is built with LLVM it requires ``libomp140.x86.64.dll``, more information `here <https://devblogs.microsoft.com/cppblog/improved-openmp-support-for-cpp-in-visual-studio/>`_.
28-
Python-only users can simply install via ``pip install finufft`` which downloads a generic binary from PyPI. Only if you prefer a custom compilation, see :ref:`below<install-python>`.
26+
2927

3028
CMake CPM Based Installation
3129
----------------------------
@@ -40,13 +38,13 @@ Then add the following to your ``CMakeLists.txt``:
4038
.. code-block:: cmake
4139
4240
# short version
43-
CPMAddPackage("gh:flatironinstitute/finufft@2.3")
41+
CPMAddPackage("gh:flatironinstitute/finufft@2.2")
4442
4543
# alternative in case custom options are needed
4644
CPMAddPackage(
4745
NAME Finufft
4846
GIT_REPOSITORY https://github.com/flatironinstitute/finufft.git
49-
GIT_TAG 2.3
47+
GIT_TAG 2.2
5048
GIT_SHALLOW Yes
5149
GIT_PROGRESS Yes
5250
EXCLUDE_FROM_ALL Yes
@@ -72,7 +70,7 @@ To do so add the following to your ``CMakeLists.txt``:
7270
FetchContent_Declare(
7371
finufft
7472
GIT_REPOSITORY https://github.com/flatironinstitute/finufft.git
75-
GIT_TAG 2.3
73+
GIT_TAG 2.2
7674
)
7775
7876
# Make the content available
@@ -96,8 +94,8 @@ The basic quick download, building, and test is then:
9694
cd finufft
9795
cmake -S . -B build -DFINUFFT_BUILD_TESTS=ON --install-prefix /path/to/install
9896
cmake --build build
99-
ctest
100-
cmake --install .
97+
ctest --test-dir build/
98+
cmake --install build
10199
102100
.. note::
103101

@@ -127,11 +125,12 @@ Here are all our build options, showing name, explanatory text, and default valu
127125
:end-before: @cmake_opts_end
128126

129127
.. note::
130-
It is possible to choose between ``FFTW`` and `DUCC fft <https://gitlab.mpcdf.mpg.de/mtr/ducc>`_, Ducc fft is from the same author as `pocket fft <https://gitlab.mpcdf.mpg.de/mtr/pocketfft>`_.
128+
It is possible to choose between ``FFTW`` and `ducc fft <https://gitlab.mpcdf.mpg.de/mtr/ducc>`_, ducc fft is from the same author as `pocket fft <https://gitlab.mpcdf.mpg.de/mtr/pocketfft>`_.
131129
Pocket fft is the fft used by `scipy <https://scipy.org/>`_.
132-
An idea about ducc performance can be found in `this discussion <https://github.com/flatironinstitute/finufft/pull/463#issuecomment-2223988300>`_. We encourage the power user can try switching to ducc0 to see if it improves performance.
130+
An idea about ducc performance can be found in `this discussion <https://github.com/flatironinstitute/finufft/pull/463#issuecomment-2223988300>`_. We encourage the power user to try switching to ducc to see if it improves performance.
133131

134132
.. warning::
133+
Note to the user, using --fast-math or /fp:fast can break finufft and its tests.
135134
On windows with msvc cl, ``ducc fft`` has to compile with ``/fp:fast``, otherwise some tests (run_finufft3d_test_float, run_finufft3dmany_test_float) may fail because of the resulting error is larger than the tolerance.
136135
On the other hand, finufft on windows with msvc cl should not compile with flag ``/fp:fast``, with ``/fp:fast`` the test run_dumbinputs_double will result in segfault, because /fp:fast makes values (NaN, +infinity, -infinity, -0.0) may not be propagated or behave strictly according to the IEEE-754 standard.
137136

@@ -143,7 +142,7 @@ For example, to configure, build and test the development preset (which builds t
143142
144143
cmake -S . -B build --preset dev # dev is the preset name
145144
cmake --build build
146-
ctest
145+
ctest --test-dir build/
147146
148147
.. warning::
149148

@@ -179,7 +178,7 @@ If there is an error in testing on what you consider a standard set-up,
179178
please file a detailed bug report as a New Issue at https://github.com/flatironinstitute/finufft/issues
180179

181180

182-
Quick linux GNU MAKE install instructions
181+
Quick linux GNU make install instructions
183182
--------------------------------
184183

185184
Make sure you have packages ``fftw3`` and ``fftw3-dev`` (or their
@@ -460,7 +459,7 @@ section of ``mexopts.sh``.
460459

461460

462461

463-
3) Windows GNU MAKE: tips for compiling
462+
3) Windows GNU make: tips for compiling
464463
-------------------------------
465464

466465
We have users who have adjusted the makefile to work - at least to some extent - on Windows 10. If you are only interested in calling from Octave (which already comes with MinGW-w64 and FFTW), then we have been told this can be done very simply: from within Octave, go to the ``finufft`` directory and do ``system('make octave')``. You may have to tweak ``OCTAVE`` in your ``make.inc`` in a similar fashion to below.

docs/overview.src

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:width: 45%
88
.. image:: spreadpic.png
99
:width: 54%
10-
10+
1111
`FINUFFT <https://github.com/flatironinstitute/finufft>`_ is a library to compute efficiently the three most common types of nonuniform fast Fourier transform
1212
(NUFFT) to a specified precision, in one, two, or three dimensions,
1313
either on a multi-core shared-memory machine, or on a GPU.
@@ -18,7 +18,7 @@ has very simple interfaces to most major numerical languages
1818
but also has more advanced (vectorized and "guru") interfaces that
1919
allow multiple strength vectors and the reuse of FFT plans.
2020
The CPU library
21-
is written in C++ (with limited use of ++ features), OpenMP, and calls
21+
is written in C++, OpenMP, and calls
2222
`FFTW <http://www.fftw.org>`_.
2323
It has been developed since 2017 at the `Center for Computational Mathematics
2424
<https://www.simonsfoundation.org/flatiron/center-for-computational-mathematics/>`_ at the `Flatiron Institute <https://www.simonsfoundation.org/flatiron>`_,
@@ -158,4 +158,3 @@ $a_{kj} = e^{ik x_j}$, then use BLAS3 (eg ``ZGEMM``) to compute $F = AC$,
158158
where each column of $F$ and $C$ is a new instance of :eq:`1d1`.
159159
If you have very many columns this can be competitive with a NUFFT
160160
even for $M$ and $N$ up to $10^4$, because BLAS3 is so fast.
161-

0 commit comments

Comments
 (0)