Skip to content
Merged
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
1 change: 1 addition & 0 deletions deps/checksums/pffft_1_1_0_tar_gz/sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ea0701a6bc256405b03975908a6a92d0ffecdd18579e8484b8d789c8bd561787
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated this checksum using:

curl -sL "https://github.com/marton78/pffft/archive/refs/tags/v1.1.0.tar.gz" | shasum -a 256

36 changes: 36 additions & 0 deletions deps/test/fftpack/test_install.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <stdio.h>
#include <stdlib.h>

extern void rffti( int n, double *wsave );

int main( void ) {
double wsave[ 2*8 + 15 ]; // 2*n + 15
int n = 8;
int i;

rffti( n, wsave );

printf( "rffti( %d, wsave )\n", n );
for ( i = n; i < 2*n; i++ ) {
printf( "wsave[%2d] = %f\n", i, wsave[i] );
}
printf( "\n" );
}
11 changes: 11 additions & 0 deletions tools/make/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -688,3 +688,14 @@ DEPS_CPPCHECK_BUILD_OUT ?= $(DEPS_BUILD_DIR)/cppcheck_$(deps_cppcheck_version_sl

# Host platform:
DEPS_CPPCHECK_PLATFORM := $(shell command -v $(NODE) >/dev/null 2>&1 && $(NODE_HOST_PLATFORM))

# FFTPACK...

# Define the PFFFT version:
DEPS_FFTPACK_VERSION ?= 1.1.0

# Generate a version slug:
deps_fftpack_version_slug := $(subst .,_,$(DEPS_FFTPACK_VERSION))

# Define the output path when building FFTPACK:
DEPS_FFTPACK_BUILD_OUT ?= $(DEPS_BUILD_DIR)/pffft-$(DEPS_FFTPACK_VERSION)
7 changes: 4 additions & 3 deletions tools/make/lib/install/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ include $(TOOLS_MAKE_LIB_DIR)/install/cephes.mk
include $(TOOLS_MAKE_LIB_DIR)/install/cppcheck.mk
include $(TOOLS_MAKE_LIB_DIR)/install/electron.mk
include $(TOOLS_MAKE_LIB_DIR)/install/emsdk.mk
include $(TOOLS_MAKE_LIB_DIR)/install/fftpack.mk
include $(TOOLS_MAKE_LIB_DIR)/install/llvm.mk
include $(TOOLS_MAKE_LIB_DIR)/install/node.mk
include $(TOOLS_MAKE_LIB_DIR)/install/openblas.mk
Expand Down Expand Up @@ -157,7 +158,7 @@ clean-deps-tests: clean-deps-openblas-tests
# @example
# make install-deps-dev
#/
install-deps-dev: install-deps-boost install-deps-cephes install-deps-cppcheck install-deps-python install-deps-r install-deps-shellcheck
install-deps-dev: install-deps-boost install-deps-cephes install-deps-cppcheck install-deps-fftpack install-deps-python install-deps-r install-deps-shellcheck

.PHONY: install-deps-dev

Expand All @@ -167,7 +168,7 @@ install-deps-dev: install-deps-boost install-deps-cephes install-deps-cppcheck i
# @example
# make clean-deps-dev
#/
clean-deps-dev: clean-deps-boost clean-deps-cephes clean-deps-cppcheck clean-deps-python clean-deps-r clean-deps-shellcheck
clean-deps-dev: clean-deps-boost clean-deps-cephes clean-deps-cppcheck clean-deps-fftpack clean-deps-python clean-deps-r clean-deps-shellcheck

.PHONY: clean-deps-dev

Expand All @@ -177,7 +178,7 @@ clean-deps-dev: clean-deps-boost clean-deps-cephes clean-deps-cppcheck clean-dep
# @example
# make clean-deps-dev-tests
#/
clean-deps-dev-tests: clean-deps-boost-tests clean-deps-cephes-tests clean-deps-cppcheck-tests clean-deps-shellcheck-tests
clean-deps-dev-tests: clean-deps-boost-tests clean-deps-cephes-tests clean-deps-cppcheck-tests clean-deps-fftpack-tests clean-deps-shellcheck-tests

.PHONY: clean-deps-dev-tests

Expand Down
177 changes: 177 additions & 0 deletions tools/make/lib/install/fftpack.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
#/
# @license Apache-2.0
#
# Copyright (c) 2026 The Stdlib Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#/

# VARIABLES #

# Define the download URL:
DEPS_FFTPACK_URL ?= https://github.com/marton78/pffft/archive/refs/tags/v$(DEPS_FFTPACK_VERSION).tar.gz

# Determine the basename for the download:
deps_fftpack_basename := pffft-$(DEPS_FFTPACK_VERSION).tar.gz

# Define the path to the file containing a checksum to verify a download:
DEPS_FFTPACK_CHECKSUM ?= $(shell $(CAT) $(DEPS_CHECKSUMS_DIR)/$(subst .,_,$(subst -,_,$(deps_fftpack_basename)))/sha256)

# Define the output path when downloading:
DEPS_FFTPACK_DOWNLOAD_OUT ?= $(DEPS_TMP_DIR)/$(deps_fftpack_basename)

# Define a list of source files:
deps_fftpack_src := \
src/fftpack.c

# Resolve a list of source files to absolute filepaths:
DEPS_FFTPACK_SRC ?= $(addprefix $(DEPS_FFTPACK_BUILD_OUT)/,$(deps_fftpack_src))

# Define the path to the directory containing tests:
DEPS_FFTPACK_TEST_DIR ?= $(DEPS_DIR)/test/fftpack

# Define the output directory path for compiled tests:
DEPS_FFTPACK_TEST_OUT ?= $(DEPS_FFTPACK_TEST_DIR)/build

# Define the path to a test file for checking an installation:
DEPS_FFTPACK_TEST_INSTALL ?= $(DEPS_FFTPACK_TEST_DIR)/test_install.c

# Define the output path for a test file:
DEPS_FFTPACK_TEST_INSTALL_OUT ?= $(DEPS_FFTPACK_TEST_OUT)/test_install


# RULES #

#/
# Downloads an FFTPACK distribution.
#
# @private
#/
$(DEPS_FFTPACK_DOWNLOAD_OUT): | $(DEPS_TMP_DIR)
$(QUIET) echo 'Downloading FFTPACK...' >&2
$(QUIET) $(DEPS_DOWNLOAD_BIN) $(DEPS_FFTPACK_URL) $(DEPS_FFTPACK_DOWNLOAD_OUT)

#/
# Extracts an FFTPACK gzipped tar archive.
#
# @private
#/
$(DEPS_FFTPACK_BUILD_OUT): $(DEPS_FFTPACK_DOWNLOAD_OUT) | $(DEPS_BUILD_DIR)
$(QUIET) echo 'Extracting FFTPACK...' >&2
$(QUIET) $(TAR) -zxf $(DEPS_FFTPACK_DOWNLOAD_OUT) -C $(DEPS_BUILD_DIR)

#/
# Creates a directory for storing compiled tests.
#
# @private
#/
$(DEPS_FFTPACK_TEST_OUT):
$(QUIET) $(MKDIR_RECURSIVE) $(DEPS_FFTPACK_TEST_OUT)

#/
# Compiles a test file for testing an FFTPACK installation.
#
# @private
#/
$(DEPS_FFTPACK_TEST_INSTALL_OUT): $(DEPS_FFTPACK_BUILD_OUT) $(DEPS_FFTPACK_TEST_OUT)
$(QUIET) $(CC) -I $(DEPS_FFTPACK_BUILD_OUT) $(DEPS_FFTPACK_TEST_INSTALL) $(DEPS_FFTPACK_SRC) -o $(DEPS_FFTPACK_TEST_INSTALL_OUT)

#/
# Downloads an FFTPACK distribution.
#
# @private
#
# @example
# make deps-download-fftpack
#/
deps-download-fftpack: $(DEPS_FFTPACK_DOWNLOAD_OUT)

.PHONY: deps-download-fftpack

#/
# Verifies a downloaded FFTPACK distribution.
#
# @private
#
# @example
# make deps-verify-fftpack
#/
deps-verify-fftpack: deps-download-fftpack
$(QUIET) echo 'Verifying download...' >&2
$(QUIET) $(DEPS_CHECKSUM_BIN) $(DEPS_FFTPACK_DOWNLOAD_OUT) $(DEPS_FFTPACK_CHECKSUM) >&2

.PHONY: deps-verify-fftpack

#/
# Extracts a downloaded FFTPACK distribution.
#
# @private
#
# @example
# make deps-extract-fftpack
#/
deps-extract-fftpack: $(DEPS_FFTPACK_BUILD_OUT)

.PHONY: deps-extract-fftpack

#/
# Tests an installed FFTPACK distribution.
#
# @private
#
# @example
# make deps-test-fftpack
#/
deps-test-fftpack: $(DEPS_FFTPACK_TEST_INSTALL_OUT)
$(QUIET) echo 'Running tests...' >&2
$(QUIET) $(DEPS_FFTPACK_TEST_INSTALL_OUT)
$(QUIET) echo '' >&2
$(QUIET) echo 'Success.' >&2

.PHONY: deps-test-fftpack

#/
# Installs FFTPACK.
#
# @example
# make install-deps-fftpack
#/
install-deps-fftpack: deps-download-fftpack deps-verify-fftpack deps-extract-fftpack deps-test-fftpack

.PHONY: install-deps-fftpack

#/
# Removes an installed FFTPACK distribution.
#
# ## Notes
#
# - The rule does **not** remove an FFTPACK download (if one exists).
#
# @example
# make clean-deps-fftpack
#/
clean-deps-fftpack: clean-deps-fftpack-tests
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(DEPS_FFTPACK_BUILD_OUT)

.PHONY: clean-deps-fftpack

#/
# Removes compiled FFTPACK installation tests.
#
# @example
# make clean-deps-fftpack-tests
#/
clean-deps-fftpack-tests:
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(DEPS_FFTPACK_TEST_OUT)

.PHONY: clean-deps-fftpack-tests
4 changes: 2 additions & 2 deletions tools/make/lib/test-fixtures/c.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test-fixtures-c:
echo "Generating test fixtures: $$file"; \
cd `dirname $$file` && \
$(MAKE) clean && \
CEPHES="$(DEPS_CEPHES_BUILD_OUT)" CEPHES_SRC="$(DEPS_CEPHES_SRC)" $(MAKE) && \
CEPHES="$(DEPS_CEPHES_BUILD_OUT)" CEPHES_SRC="$(DEPS_CEPHES_SRC)" FFTPACK_SRC="$(DEPS_FFTPACK_SRC)" $(MAKE) && \
$(MAKE) run || exit 1; \
done

Expand All @@ -45,7 +45,7 @@ test-fixtures-c-files:
echo "Generating test fixtures: $$file"; \
cd `dirname $$file` && \
$(MAKE) clean && \
CEPHES="$(DEPS_CEPHES_BUILD_OUT)" CEPHES_SRC="$(DEPS_CEPHES_SRC)" $(MAKE) && \
CEPHES="$(DEPS_CEPHES_BUILD_OUT)" CEPHES_SRC="$(DEPS_CEPHES_SRC)" FFTPACK_SRC="$(DEPS_FFTPACK_SRC)" $(MAKE) && \
$(MAKE) run || exit 1; \
done

Expand Down