%global pypi_name fmm3dpy %global repo_name FMM3D %global forgeurl https://github.com/flatironinstitute/%{repo_name} %global tag v%{version} Name: python-%{pypi_name} Version: 1.0.3 Release: 1%{?dist} Summary: Fast Multipole Method in Python (FMM3D wrapper) License: Apache-2.0 URL: https://fmm3d.readthedocs.io/ Source0: %{forgeurl}/archive/%{tag}/%{repo_name}-%{version}.tar.gz BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gcc-gfortran BuildRequires: make BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-wheel BuildRequires: python3-pip BuildRequires: python3-numpy BuildRequires: sed %description fmm3dpy provides Python bindings for the Flatiron Institute's FMM3D library. It offers Fast Multipole Method (FMM) implementations for the Laplace, Helmholtz, and Maxwell equations. %package -n python3-%{pypi_name} Summary: %{summary} Requires: python3-numpy %description -n python3-%{pypi_name} This package provides the Python 3 library for fmm3dpy. %prep %autosetup -n %{repo_name}-%{version} # FIX THE MAKEFILE # The static lib must be compiled with -fPIC so it can be linked into the python shared object. sed -i 's/FFLAGS =/FFLAGS = -fPIC -fallow-argument-mismatch/g' makefile sed -i 's/CFLAGS =/CFLAGS = -fPIC/g' makefile %build # STEP 1: Build the static library (lib-static/libfmm3d.a) export OMP_NUM_THREADS=1 %make_build lib # STEP 2: Manually compile Python extensions using f2py cd python cat > manual_builder.py < setup.py < - 1.0.3-1 - Update to 1.0.3 and use improved build process