-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the heFFTe library, a Highly Efficient FFT for Exascale.
- Loading branch information
Showing
7 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From e85d3df03ca8c226364df61e3dbeee6ccddd5fe1 Mon Sep 17 00:00:00 2001 | ||
From: Axel Huebl <[email protected]> | ||
Date: Tue, 11 Jun 2024 17:15:37 -0700 | ||
Subject: [PATCH] Fix AppleClang: Stock `aligned_alloc` | ||
|
||
Compiling heFFTe 2.4.0 with AppleClang 16.0.6 on macOS 13.4 raises: | ||
``` | ||
include/stock_fft/heffte_stock_allocator.h:43:46: error: use of undeclared identifier 'aligned_alloc' | ||
return reinterpret_cast<pointer>(aligned_alloc(alignof(F), n*sizeof(F))); | ||
^ | ||
``` | ||
|
||
This adds the missing include and uses the C++ variant of the | ||
function. | ||
--- | ||
include/stock_fft/heffte_stock_allocator.h | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/include/stock_fft/heffte_stock_allocator.h b/include/stock_fft/heffte_stock_allocator.h | ||
index d8d69df..6123513 100644 | ||
--- a/include/stock_fft/heffte_stock_allocator.h | ||
+++ b/include/stock_fft/heffte_stock_allocator.h | ||
@@ -2,6 +2,7 @@ | ||
#define HEFFTE_STOCK_ALLOCATOR_H | ||
|
||
#include <memory> | ||
+#include <stdlib.h> | ||
#include <vector> | ||
|
||
#include "heffte_stock_complex.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
@echo on | ||
|
||
:: configure | ||
cmake ^ | ||
-S %SRC_DIR% -B build ^ | ||
%CMAKE_ARGS% ^ | ||
-G "Ninja" ^ | ||
-DBUILD_SHARED_LIBS=ON ^ | ||
-DCMAKE_BUILD_TYPE=Release ^ | ||
-DCMAKE_C_COMPILER=clang-cl ^ | ||
-DCMAKE_CXX_COMPILER=clang-cl ^ | ||
-DCMAKE_INSTALL_LIBDIR=lib ^ | ||
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ | ||
-DCMAKE_LINKER=lld-link ^ | ||
-DCMAKE_NM=llvm-nm ^ | ||
-DCMAKE_VERBOSE_MAKEFILE=ON ^ | ||
-DHeffte_DISABLE_GPU_AWARE_MPI=ON ^ | ||
-DHeffte_ENABLE_AVX=ON ^ | ||
-DHeffte_ENABLE_AVX512=OFF ^ | ||
-DHeffte_ENABLE_FFTW=ON ^ | ||
-DHeffte_ENABLE_CUDA=OFF ^ | ||
-DHeffte_ENABLE_ROCM=OFF ^ | ||
-DHeffte_ENABLE_ONEAPI=OFF ^ | ||
-DHeffte_ENABLE_MKL=OFF ^ | ||
-DHeffte_ENABLE_DOXYGEN=OFF ^ | ||
-DHeffte_SEQUENTIAL_TESTING=ON ^ | ||
-DHeffte_ENABLE_TESTING=ON ^ | ||
-DHeffte_ENABLE_TRACING=OFF ^ | ||
-DHeffte_ENABLE_PYTHON=OFF ^ | ||
-DHeffte_ENABLE_FORTRAN=OFF ^ | ||
-DHeffte_ENABLE_SWIG=OFF ^ | ||
-DHeffte_ENABLE_MAGMA=OFF | ||
if errorlevel 1 exit 1 | ||
|
||
:: build, pack & install | ||
cmake --build build --config Release --parallel %CPU_COUNT% --target install | ||
if errorlevel 1 exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
# avoid side-injection of -std=c++14 flag in some toolchains | ||
if [[ ${CXXFLAGS} == *"-std=c++14"* ]]; then | ||
echo "14 -> 17" | ||
export CXXFLAGS="${CXXFLAGS} -std=c++17" | ||
fi | ||
# Darwin modern C++ | ||
# https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk | ||
if [[ ${target_platform} =~ osx.* ]]; then | ||
export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" | ||
fi | ||
|
||
# configure | ||
cmake \ | ||
-S ${SRC_DIR} -B build \ | ||
${CMAKE_ARGS} \ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_VERBOSE_MAKEFILE=ON \ | ||
-DCMAKE_INSTALL_LIBDIR=lib \ | ||
-DCMAKE_INSTALL_PREFIX=${PREFIX} \ | ||
-DHeffte_DISABLE_GPU_AWARE_MPI=ON \ | ||
-DHeffte_ENABLE_AVX=ON \ | ||
-DHeffte_ENABLE_AVX512=OFF \ | ||
-DHeffte_ENABLE_FFTW=ON \ | ||
-DHeffte_ENABLE_CUDA=OFF \ | ||
-DHeffte_ENABLE_ROCM=OFF \ | ||
-DHeffte_ENABLE_ONEAPI=OFF \ | ||
-DHeffte_ENABLE_MKL=OFF \ | ||
-DHeffte_ENABLE_DOXYGEN=OFF \ | ||
-DHeffte_SEQUENTIAL_TESTING=ON \ | ||
-DHeffte_ENABLE_TESTING=ON \ | ||
-DHeffte_ENABLE_TRACING=OFF \ | ||
-DHeffte_ENABLE_PYTHON=OFF \ | ||
-DHeffte_ENABLE_FORTRAN=OFF \ | ||
-DHeffte_ENABLE_SWIG=OFF \ | ||
-DHeffte_ENABLE_MAGMA=OFF | ||
|
||
# build, pack & install | ||
cmake --build build --parallel ${CPU_COUNT} --target install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
mpi: | ||
- mpich # [unix] | ||
- openmpi # [unix] | ||
# macOS aligned_alloc support | ||
# https://github.com/icl-utk-edu/heffte/pull/49 | ||
# https://stackoverflow.com/questions/44841574/aligned-alloc-not-found-for-clang/76984907#76984907 | ||
MACOSX_SDK_VERSION: # [osx and x86_64] | ||
- "10.15" # [osx and x86_64] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{% set name = "heFFTe" %} | ||
{% set version = "2.4.0" %} | ||
{% set build = 0 %} | ||
|
||
package: | ||
name: {{ name|lower }} | ||
version: {{ version }} | ||
|
||
source: | ||
url: https://github.com/icl-utk-edu/heffte/archive/refs/tags/v{{ version }}.tar.gz | ||
sha256: 02310fb4f9688df02f7181667e61c3adb7e38baf79611d80919d47452ff7881d | ||
patches: | ||
# macOS build error in aligned_alloc | ||
# https://github.com/icl-utk-edu/heffte/pull/49 | ||
- 49.patch | ||
|
||
build: | ||
number: {{ build }} | ||
|
||
# heFFTe depends on MPI, but we do not yet build a Windows-MPI that we trust | ||
skip: true # [win] | ||
|
||
# add build string so packages can depend on specific mpi variants | ||
# dependencies: | ||
# `pkg * mpi_mpich_*` for MPICH | ||
# `pkg * mpi_openmpi_*` for OpenMPI | ||
# `pkg * mpi_*` for any mpi | ||
{% set mpi_prefix = "mpi_" + mpi %} | ||
string: {{ mpi_prefix }}_h{{ PKG_HASH }}_{{ build }} | ||
|
||
requirements: | ||
build: | ||
- {{ compiler("c") }} | ||
- {{ compiler("cxx") }} | ||
- {{ stdlib("c") }} | ||
- cmake | ||
- make # [unix] | ||
- pkgconfig | ||
host: | ||
- fftw * mpi_{{ mpi }}_* | ||
- {{ mpi }} | ||
run: | ||
- fftw * mpi_{{ mpi }}_* | ||
- {{ mpi }} | ||
|
||
test: | ||
requires: | ||
- {{ compiler("c") }} | ||
- {{ compiler("cxx") }} | ||
- {{ stdlib("c") }} | ||
- cmake | ||
- make # [unix] | ||
- pkgconfig | ||
|
||
about: | ||
home: https://icl.utk.edu/publications/fft-ecp-fast-fourier-transform | ||
license: BSD-3-Clause | ||
license_family: BSD | ||
license_file: LICENSE | ||
summary: Distributed fast-Fourier transforms in on a heterogeneous systems. | ||
|
||
description: | | ||
The Highly Efficient FFT for Exascale (heFFTe) library is being developed | ||
as part of the Exascale Computing Project (ECP), which is a joint project | ||
of the U.S. Department of Energy's Office of Science and National Nuclear | ||
Security Administration (NNSA). HeFFTe delivers algorithms for distributed | ||
fast-Fourier transforms in on a heterogeneous systems, targeting the | ||
upcoming exascale machines. | ||
doc_url: https://icl-utk-edu.github.io/heffte/ | ||
dev_url: https://github.com/icl-utk-edu/heffte | ||
|
||
extra: | ||
recipe-maintainers: | ||
- ax3l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@echo on | ||
|
||
set "OMP_NUM_THREADS=2" | ||
|
||
cmake -S %PREFIX%\share\heffte\testing -B build_test | ||
if errorlevel 1 exit 1 | ||
|
||
cmake --build build_test | ||
if errorlevel 1 exit 1 | ||
|
||
cmake --build build_test --target test | ||
if errorlevel 1 exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu -x -o pipefail | ||
|
||
export OMP_NUM_THREADS=2 | ||
|
||
cmake -S ${PREFIX}/share/heffte/testing -B build_test | ||
cmake --build build_test | ||
cmake --build build_test --target test |