金子邦彦研究室インストールWindows の種々のソフトウェア(インストール)FFTW3 のインストール(ソースコードを使用)(Build Tools for Visual Studio を利用)(Windows 上)

FFTW3 のインストール(ソースコードを使用)(Build Tools for Visual Studio を利用)(Windows 上)

FFTW は, 離散フーリエ変換 (DFT) を行う C のプログラム集.1次元に限らず,より高次元でも動く.

このページでは,Windows での FFTW バージョン 3 (FFTW3)インストール法を説明する.

Linux での FFTW3 のビルドとインストールについては, 別のWebページで説明する.

前準備

Build Tools for Visual Studio 2022 (ビルドツール for Visual Studio 2022),Visual Studio 2022 のインストール(Windows 上)

関連する外部ページ

Git のインストール(Windows 上)

サイト内の関連ページ

Windows での Git のインストール: 別ページ »で説明

関連する外部ページ

Git の公式ページ: https://git-scm.com/

cmake のインストール(Windows 上)

サイト内の関連ページ

Windows での cmake のインストール: 別ページ »で説明

関連する外部ページ

cmake の公式ダウンロードページ: https://cmake.org/download/

7-Zip のインストール(Windows 上)

7-Zip 22.01 のインストール

Windows では, コマンドプロンプトを管理者として開き, 次のコマンドを実行することにより, 7-Zip 22.01 のインストールを行うことができる.

mkdir %HOMEPATH%\7zip
cd %HOMEPATH%\7zip
curl -O https://www.7-zip.org/a/7z2201-x64.exe
.\7z2201-x64.exe
call powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";c:\Program Files\7-Zip\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")"

サイト内の関連ページ

Windows での 7-Zip のインストール: 別ページ »で説明

関連する外部ページ

7-Zip の公式ページ: https://sevenzip.osdn.jp/

FFTW3 のインストール(Build Tools for Visual Studio を利用)(Windows 上)

  1. FFTW のバージョンを確認する.

    https://www.fftw.org

  2. Windows で,コマンドプロンプト管理者として実行.

    コマンドプロンプトを管理者として実行: 別ページ »で説明

  3. fftw3 のソースコードをダウンロード

    このとき,使用するバージョンを指定している.

    C:
    cd %HOMEPATH%
    rmdir /s /q fftw-3.3.10
    del fftw-3.3.10.tar.gz
    del fftw-3.3.10.tar
    curl -O https://www.fftw.org/fftw-3.3.10.tar.gz
    "c:\Program Files\7-Zip\7z.exe" x fftw-3.3.10.tar.gz
    "c:\Program Files\7-Zip\7z.exe" x fftw-3.3.10.tar
    

    [image]
  4. cmake の実行

    cmake でのオプションについて

    cmake のオプションの 「Visual Studio 17 2022」のところは, 使用する Visual Studio のバージョンにあわせること. Visual Studio 2022 のときは,「Visual Studio 17 2022」. Visual Studio 2019 のときは,「Visual Studio 16 2019

    cmake の実行手順例は次の通り

    cd %HOMEPATH%
    cd fftw-3.3.10
    rmdir /s /q build
    mkdir build
    cd build
    del CMakeCache.txt
    cmake .. -G "Visual Studio 17 2022" -A x64 -T host=x64 ^
        -DCMAKE_INSTALL_PREFIX="c:\fftw3" 
    

    [image]
  5. cmake の実行結果の確認

    ※ 下の通りになるとは限らない.エラーメッセージが出るなど場合は,前で cmake を実行したときの設定を変えてやり直す

    [image]
  6. ソースコードからビルドし、インストールする
    cmake --build . --config RELEASE
    cmake --build . --config RELEASE --target INSTALL
    
  7. 実行結果の確認

    [image]
  8. Windowsシステム環境変数 FFTW3_ROOT に,C:\fftw3 を設定

    Windows で,コマンドプロンプト管理者として実行

    コマンドプロンプトを管理者として実行: 別ページ »で説明

  9. 次のコマンドを実行
    call powershell -command "[System.Environment]::SetEnvironmentVariable(\"FFTW3_ROOT\", \"C:\fftw3\", \"Machine\")"
    

    [image]
  10. Windowsシステム環境変数 Pathに,C:\fftw3\bin追加することにより,パスを通す

    Windows で,コマンドプロンプト管理者として実行

    コマンドプロンプトを管理者として実行: 別ページ »で説明

  11. 次のコマンドを実行
    call powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";C:\fftw3\bin\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")"
    

    [image]