From 738c0d01f4bef63ec9db4f04c6ef71599a1989f9 Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Sat, 29 Apr 2023 16:42:12 +0900 Subject: [PATCH 1/3] Use static link for windows --- fftw-src/build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fftw-src/build.rs b/fftw-src/build.rs index e01b12fc..9e784ea5 100644 --- a/fftw-src/build.rs +++ b/fftw-src/build.rs @@ -102,8 +102,8 @@ fn main() { if cfg!(target_os = "windows") { download_archive_windows(&out_dir).unwrap(); println!("cargo:rustc-link-search={}", out_dir.display()); - println!("cargo:rustc-link-lib=libfftw3-3"); - println!("cargo:rustc-link-lib=libfftw3f-3"); + println!("cargo:rustc-link-lib=static=libfftw3-3"); + println!("cargo:rustc-link-lib=static=libfftw3f-3"); } else { build_unix(&out_dir); println!("cargo:rustc-link-search={}", out_dir.join("lib").display()); From 080e3c7f932c997922dab4f1725cfbe939c56db1 Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Sat, 29 Apr 2023 16:56:57 +0900 Subject: [PATCH 2/3] Add CI matrix for windows without nuget --- .github/workflows/rust.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d135d219..c8713fdd 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -7,16 +7,16 @@ on: pull_request: {} jobs: - windows: + windows-mkl: runs-on: windows-latest strategy: fail-fast: false matrix: - feature: ["intel-mkl", "source"] + download: ["nuget", "ocipkg"] steps: - uses: actions/checkout@v1 - name: Get MKL using NuGet - if: ${{ matrix.feature == 'intel-mkl' }} + if: ${{ matrix.download == 'nuget' }} run: | nuget install intelmkl.devel.cluster.win-x64 -Version 2022.0.3.171 nuget install intelmkl.static.cluster.win-x64 -Version 2022.0.3.171 @@ -28,7 +28,20 @@ jobs: args: > --all-targets --manifest-path=fftw/Cargo.toml - --features=${{ matrix.feature }} + --features=intel-mkl + --no-default-features + + windows-source: + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/cargo@v1 + with: + command: test + args: > + --all-targets + --manifest-path=fftw/Cargo.toml + --features=source --no-default-features macos: From 2b3644218e5a527b6ebf5bc0004cf75f2a753748 Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Sat, 29 Apr 2023 17:12:34 +0900 Subject: [PATCH 3/3] Use static linking in fftw-sys --- fftw-sys/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fftw-sys/src/lib.rs b/fftw-sys/src/lib.rs index c8b875b9..9b519eea 100644 --- a/fftw-sys/src/lib.rs +++ b/fftw-sys/src/lib.rs @@ -10,9 +10,9 @@ use libc::FILE; pub use num_complex::Complex32 as fftwf_complex; pub use num_complex::Complex64 as fftw_complex; -#[cfg_attr(feature = "system", link(name = "fftw3"))] +#[cfg_attr(feature = "system", link(name = "fftw3", kind = "static"))] extern "C" {} -#[cfg_attr(feature = "system", link(name = "fftw3f"))] +#[cfg_attr(feature = "system", link(name = "fftw3f", kind = "static"))] extern "C" {} include!("fftw.rs");