Remove Python 2 mentions

Also fix up indents
This commit is contained in:
Martin Rys
2025-11-28 20:26:44 +01:00
committed by Martin
parent 45517b8a66
commit 8e2620a597
2 changed files with 35 additions and 43 deletions

View File

@ -2,7 +2,7 @@
# Warnings # Warnings
# #
WARNINGS = -W -Wall -Wstrict-prototypes -Wmissing-prototypes \ WARNINGS = -W -Wall -Wstrict-prototypes -Wmissing-prototypes \
-Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast \ -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast \
-Wwrite-strings -Wwrite-strings
@ -26,10 +26,10 @@ CXXFLAGS = -O3 -ffast-math -fomit-frame-pointer -I.. -W -Wall -march=native -mt
# #
ifeq "$(NFFT)" "" ifeq "$(NFFT)" ""
NFFT = 1800 NFFT = 1800
endif endif
ifeq "$(NUMFFTS)" "" ifeq "$(NUMFFTS)" ""
NUMFFTS = 10000 NUMFFTS = 10000
endif endif
# #
@ -39,32 +39,32 @@ endif
SELFTESTSRC = twotonetest.c SELFTESTSRC = twotonetest.c
ifneq ($(KISSFFT_OPENMP),1) ifneq ($(KISSFFT_OPENMP),1)
BENCHKISS = bm-kiss-$(KISSFFT_DATATYPE) BENCHKISS = bm-kiss-$(KISSFFT_DATATYPE)
BENCHFFTW = bm-fftw-$(KISSFFT_DATATYPE) BENCHFFTW = bm-fftw-$(KISSFFT_DATATYPE)
SELFTEST = st-$(KISSFFT_DATATYPE) SELFTEST = st-$(KISSFFT_DATATYPE)
TESTREAL = tr-$(KISSFFT_DATATYPE) TESTREAL = tr-$(KISSFFT_DATATYPE)
TESTKFC = tkfc-$(KISSFFT_DATATYPE) TESTKFC = tkfc-$(KISSFFT_DATATYPE)
TESTFASTFILT = fastfilt-$(KISSFFT_DATATYPE) TESTFASTFILT = fastfilt-$(KISSFFT_DATATYPE)
TESTCPP = testcpp-$(KISSFFT_DATATYPE) TESTCPP = testcpp-$(KISSFFT_DATATYPE)
TESTSIMD = testsimd TESTSIMD = testsimd
else else
BENCHKISS = bm-kiss-$(KISSFFT_DATATYPE)-openmp BENCHKISS = bm-kiss-$(KISSFFT_DATATYPE)-openmp
BENCHFFTW = bm-fftw-$(KISSFFT_DATATYPE)-openmp BENCHFFTW = bm-fftw-$(KISSFFT_DATATYPE)-openmp
SELFTEST = st-$(KISSFFT_DATATYPE)-openmp SELFTEST = st-$(KISSFFT_DATATYPE)-openmp
TESTREAL = tr-$(KISSFFT_DATATYPE)-openmp TESTREAL = tr-$(KISSFFT_DATATYPE)-openmp
TESTKFC = tkfc-$(KISSFFT_DATATYPE)-openmp TESTKFC = tkfc-$(KISSFFT_DATATYPE)-openmp
TESTFASTFILT = fastfilt-$(KISSFFT_DATATYPE)-openmp TESTFASTFILT = fastfilt-$(KISSFFT_DATATYPE)-openmp
TESTCPP = testcpp-$(KISSFFT_DATATYPE)-openmp TESTCPP = testcpp-$(KISSFFT_DATATYPE)-openmp
TESTSIMD = testsimd-openmp TESTSIMD = testsimd-openmp
CFLAGS += -fopenmp CFLAGS += -fopenmp
CXXFLAGS += -fopenmp CXXFLAGS += -fopenmp
endif endif
ifeq "$(KISSFFT_DATATYPE)" "float" ifeq "$(KISSFFT_DATATYPE)" "float"
# fftw needs to be built with --enable-float to build this lib # fftw needs to be built with --enable-float to build this lib
FFTWLIB = -lfftw3f FFTWLIB = -lfftw3f
else else
FFTWLIB = -lfftw3 FFTWLIB = -lfftw3
endif endif
FFTWLIBDIR ?= $(ABS_LIBDIR) FFTWLIBDIR ?= $(ABS_LIBDIR)
@ -86,22 +86,17 @@ endif
# #
ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),clean)
PYTHON_INTERPRETER = $(shell python --version)
ifeq ($(PYTHON_INTERPRETER), )
PYTHON_INTERPRETER = $(shell python2 --version)
ifeq ($(PYTHON_INTERPRETER), )
PYTHON_INTERPRETER = $(shell python3 --version) PYTHON_INTERPRETER = $(shell python3 --version)
ifeq ($(PYTHON_INTERPRETER), ) ifeq ($(PYTHON_INTERPRETER), )
$(error ERROR: Can not find Python interpreter!) PYTHON_INTERPRETER = $(shell python --version)
else ifeq ($(PYTHON_INTERPRETER), )
PYTHON_INTERPRETER = "python3" $(error ERROR: Can not find Python interpreter!)
endif else
else PYTHON_INTERPRETER = "python"
PYTHON_INTERPRETER = "python2" endif
endif else
else PYTHON_INTERPRETER = "python3"
PYTHON_INTERPRETER = "python" endif
endif
endif endif
# #

View File

@ -4,12 +4,9 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# See COPYING file for more information. # See COPYING file for more information.
from __future__ import absolute_import, division, print_function
import math import math
import sys import sys
import os import os
import random
import struct
import getopt import getopt
import numpy as np import numpy as np
@ -125,7 +122,7 @@ def dofft(x, isreal):
p.wait() p.wait()
return np.reshape(res, dims) return np.reshape(res, dims)
def main(): def main() -> None:
opts, args = getopt.getopt(sys.argv[1:], 'r') opts, args = getopt.getopt(sys.argv[1:], 'r')
opts = dict(opts) opts = dict(opts)
global do_real global do_real