Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
448 changes: 0 additions & 448 deletions CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions FFTW3Config.cmake.in

This file was deleted.

12 changes: 0 additions & 12 deletions FFTW3ConfigVersion.cmake.in

This file was deleted.

16 changes: 1 addition & 15 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ endif
SUBDIRS=support $(GENFFT) kernel simd-support dft rdft reodft api \
libbench2 $(CHICKEN_EGG) tests mpi $(DOCDIR) tools m4
EXTRA_DIST=COPYRIGHT bootstrap.sh CONVENTIONS fftw.pc.in \
CMakeLists.txt cmake.config.h.in FFTW3Config.cmake.in \
FFTW3ConfigVersion.cmake.in README-perfcnt.md
README-perfcnt.md

SIMD_LIBS = simd-support/libsimd_support.la

Expand Down Expand Up @@ -168,19 +167,6 @@ fftw3@PREC_SUFFIX@.pc: fftw.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = fftw3@PREC_SUFFIX@.pc

FFTW3@PREC_SUFFIX@Config.cmake: $(top_srcdir)/FFTW3Config.cmake.in
$(SED) \
-e 's|[@]PREC_SUFFIX@|@PREC_SUFFIX@|g' \
-e 's|[@]CMAKE_INSTALL_FULL_LIBDIR@|$(libdir)|g' \
-e 's|[@]CMAKE_INSTALL_FULL_INCLUDEDIR@|$(includedir)|g' \
$(top_srcdir)/FFTW3Config.cmake.in > $@
FFTW3@PREC_SUFFIX@ConfigVersion.cmake: $(top_srcdir)/FFTW3ConfigVersion.cmake.in
$(SED) \
-e 's|[@]FFTW_VERSION@|@PACKAGE_VERSION@|g' \
$(top_srcdir)/FFTW3ConfigVersion.cmake.in > $@
cmakedir = $(libdir)/cmake/fftw3
cmake_DATA = FFTW3@PREC_SUFFIX@Config.cmake FFTW3@PREC_SUFFIX@ConfigVersion.cmake

WISDOM_DIR = /etc/fftw
WISDOM = wisdom@PREC_SUFFIX@

Expand Down
108 changes: 108 additions & 0 deletions README-meson.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Meson Build System

A Meson-based build system is included in order to provide a modern alternative
to Autotools for those who need it (such as for better integration with IDEs
and easier inclusion as subproject/dependency of other software).

Note that it is **EXPERIMENTAL**. It should mostly just work, but if you run
into any problems, please report them on our issue tracker and consider using
the Autotools system in the meantime.

It might one day replace Autotools for maintainer tasks, but for the sake of
compatibility, there are currently no plans to remove Autotools: FFTW’s build
tasks are relatively complex, it runs on a wide variety of platforms, and some
(paying) users are not at liberty to drastically alter their build environment.

For that reason, changes to the Meson system should only touch files directly
belonging to it until a decision has been made to promote it to the primary
build system. This means some parts of it will not be as clean and efficient
as they could be.

## Completeness

The Meson build system should have feature parity with Autotools, except for
the following:

* Fortran wrappers (needs replacements for Autoconf-provided macros)
* ARM v7a/v8 performance counters
* Commercialized tarballs

## Requirements

### General

A recent enough version of [Meson](https://mesonbuild.com/) or a compatible
implementation of it (such as [muon](https://sr.ht/~lattis/muon/)) is required.
The exact minimum version is specified at the start of the `meson.build` file.

FFTW itself needs a C compiler. GCC and Clang are well-tested.

ICL and MSVC should also work, but currently only static libraries can be built
successfully with Microsoft’s toolchains. For now, we strongly recommend using
a MinGW-w64-based toolchain to build FFTW for Windows. [MXE](https://mxe.cc/)
can be used to build one if necessary.

Running the test suite currently requires Perl.

### Git only

Additionally, if you have obtained this copy of FFTW from the Git repository,
you will need the [Dune](https://dune.build/) build system for OCaml. Much of
FFTW’s source code is *generated*, and this is required in order to build the
generators. This has only been tested on x86 Linux with glibc.
GNU indent is required as well, since the generated sources in FFTW releases
should be formatted.
Release tarballs already contain the generated sources.

To build the full documentation (already included in release tarballs),
you need:

* Perl
* `makeinfo`
* `fig2dev` (part of transfig)
* `texi2pdf` (part of texinfo).

To generate the Fortran wrappers (included in release tarballs), you need Perl.

## Usage

See the [Meson documentation](https://mesonbuild.com/Manual.html) for
instructions, including usage with IDEs and
[cross compilers](https://mesonbuild.com/Cross-compilation.html).

The short version:

```sh
meson setup builddir
cd builddir
meson compile
meson test --suite small
meson install
```

Some IDEs, like KDevelop, already support Meson. VSCode has an extension
you can install from the marketplace. Once that is set up, you can simply
open the FFTW source directory and everything will be configured automatically.

### Generating Release Tarballs

Assuming you have all of the above and the current Git commit is tagged, you
can simply run `meson dist` in a configured build directory. This will do the
following by default:

* Collect the sources in the current Git `HEAD` commit
NOTE: NOT whatever is currently checked out, and thus NOT including untracked
or modified files! Meson will warn about this and require a command line flag
to proceed if it detects uncommitted changes.
* Cement the tarball’s version (so it won’t depend on Git)
* Generate `ChangeLog` from Git
* Generate all codelets and copy them to the tarball tree
* Patch `configure.ac` to match Meson’s version info
* Configure the resulting sources and run the full test suite
* Upon success, generate a compressed tarball and accompanying checksum file

If the commit is not tagged, the build system still packages a tarball, but it
will print a warning and refuse to include the Autotools build system.

Most of the above happens in a shell script generated from
`support/meson_dist.sh.in`.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ generated automatically. This repository contains the *generator* and
it does not contain the *generated code*. *YOU WILL BE UNABLE TO
COMPILE CODE FROM THIS REPOSITORY* unless you have special tools and
know what you are doing. In particular, do not expect things to
work by simply executing `configure; make` or `cmake`.
work by simply executing `configure; make` or `meson setup <dir>`.

Most users should ignore this repository, and should instead download
official tarballs from http://fftw.org/, which contain the generated
Expand Down
76 changes: 76 additions & 0 deletions api/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# TODO: Generate Fortran wrappers
summary('Fortran wrappers', '(not supported with Meson yet)', section: 'Build')

fftw_api_inc = include_directories('.')
fftw_srcset.add(
files(
'apiplan.c',
'configure.c',
'execute-dft-c2r.c',
'execute-dft-r2c.c',
'execute-dft.c',
'execute-r2r.c',
'execute-split-dft-c2r.c',
'execute-split-dft-r2c.c',
'execute-split-dft.c',
'execute.c',
'export-wisdom-to-file.c',
'export-wisdom-to-string.c',
'export-wisdom.c',
'f77api.c',
'flops.c',
'forget-wisdom.c',
'import-system-wisdom.c',
'import-wisdom-from-file.c',
'import-wisdom-from-string.c',
'import-wisdom.c',
'malloc.c',
'map-r2r-kind.c',
'mapflags.c',
'mkprinter-file.c',
'mkprinter-str.c',
'mktensor-iodims.c',
'mktensor-iodims64.c',
'mktensor-rowmajor.c',
'plan-dft-1d.c',
'plan-dft-2d.c',
'plan-dft-3d.c',
'plan-dft-c2r-1d.c',
'plan-dft-c2r-2d.c',
'plan-dft-c2r-3d.c',
'plan-dft-c2r.c',
'plan-dft-r2c-1d.c',
'plan-dft-r2c-2d.c',
'plan-dft-r2c-3d.c',
'plan-dft-r2c.c',
'plan-dft.c',
'plan-guru-dft-c2r.c',
'plan-guru-dft-r2c.c',
'plan-guru-dft.c',
'plan-guru-r2r.c',
'plan-guru-split-dft-c2r.c',
'plan-guru-split-dft-r2c.c',
'plan-guru-split-dft.c',
'plan-guru64-dft-c2r.c',
'plan-guru64-dft-r2c.c',
'plan-guru64-dft.c',
'plan-guru64-r2r.c',
'plan-guru64-split-dft-c2r.c',
'plan-guru64-split-dft-r2c.c',
'plan-guru64-split-dft.c',
'plan-many-dft-c2r.c',
'plan-many-dft-r2c.c',
'plan-many-dft.c',
'plan-many-r2r.c',
'plan-r2r-1d.c',
'plan-r2r-2d.c',
'plan-r2r-3d.c',
'plan-r2r.c',
'print-plan.c',
'rdft2-pad.c',
'the-planner.c',
'version.c',
),
)

install_headers(files('fftw3.h'))
Loading