Skip to content

Instantly share code, notes, and snippets.

@ryukau
Last active June 15, 2020 08:04
Show Gist options
  • Save ryukau/72a364296fc4c8162ace655a32e588fb to your computer and use it in GitHub Desktop.
Save ryukau/72a364296fc4c8162ace655a32e588fb to your computer and use it in GitHub Desktop.

There are 2 things to build.

  1. FFTW3
  2. VST plugins

Preparation

Following tools are required:

  • CMake
  • Git
  • Xcode

It probably needs to install Make. See following link.

Quick Introduction to Command Line

If you are not familiar with shell, take a look at following tutorial.

Before starting, make a working directory. In this instruction, working directory path is set to ~/code.

Following snippet is commands of bash. On macOS, open terminal and type or copy them into it.

cd ~
mkdir code
cd code

If the required tools are all installed correctly, copy & pasting the bash snippets in this instruction from top to bottom finishes the building. I'd recommend to copy long commands rather than type them in.

Recent version of macOS changed default shell from bash to zsh, and I only know bash. So if the commands are not working, please let me know. I'll fix it.

Building FFTW3

Download FFTW3 source code (fftw-3.3.8.tar.gz) from following link.

Move FFTW3 source code to working directory, then extract it.

mv /path/to/fftw-3.3.8.tar.gz ~/code
tar -xf fftw-3.3.8.tar.gz

Change directory into FFTW3 source code, then build.

cd fftw-3.3.8

./configure --with-pic=yes --enable-single --enable-sse2 --enable-avx2 --enable-avx-128-fma --enable-fma --prefix="$HOME/code/install"

make -j8
make install

After executing all above commands, FFTW3 will be built as ~/code/install/lib/libfftw3f.a. We'll use libfftw3f.a later.

Info: The installation is done locally and doesn't affect system. To uninstall, just delete ~/code/install.

Building VST 3 Plugins

Clone repository.

mkdir -p ~/code/vst
cd ~/code/vst

git clone --recursive https://github.com/steinbergmedia/vst3sdk.git
git clone --recursive https://github.com/ryukau/VSTPlugins.git

Replace FFTW3 to the one built on locally.

cp ~/code/install/lib/libfftw3f.a ~/code/vst/VSTPlugins/lib/fftw3/macOS/libfftw3f.a

Start building.

cd ~/code/vst

mkdir vst3sdk/build
cd vst3sdk/build

cmake -GXcode -DSMTG_MYPLUGINS_SRC_PATH="../../VSTPlugins" -DSMTG_ADD_VST3_HOSTING_SAMPLES=FALSE -DSMTG_ADD_VST3_PLUGINS_SAMPLES=FALSE ..
cmake --build . -j --config Release

Plugins are built into ~/code/vst3sdk/build/VST3/Release. To install plugins, copy them to /Users/$USERNAME/Library/Audio/Plug-ins/VST3/.

Concatenated Commands

If all the required tools are installed, copy & pasting the following commands will likely finish building.

# Prepare working directory.
cd ~
mkdir code
cd code

# Build FFTW3
wget http://fftw.org/fftw-3.3.8.tar.gz
mv /path/to/fftw-3.3.8.tar.gz ~/code
tar -xf fftw-3.3.8.tar.gz
cd fftw-3.3.8

./configure --with-pic=yes --enable-single --enable-sse2 --enable-avx2 --enable-avx-128-fma --enable-fma --prefix="$HOME/code/install"

make -j8
make install

# Build plugins.
mkdir -p ~/code/vst
cd ~/code/vst

git clone --recursive https://github.com/steinbergmedia/vst3sdk.git
git clone --recursive https://github.com/ryukau/VSTPlugins.git

cp ~/code/install/lib/libfftw3f.a ~/code/vst/VSTPlugins/lib/fftw3/macOS/libfftw3f.a

cd ~/code/vst
mkdir vst3sdk/build
cd vst3sdk/build

cmake -GXcode -DSMTG_MYPLUGINS_SRC_PATH="../../VSTPlugins" -DSMTG_ADD_VST3_HOSTING_SAMPLES=FALSE -DSMTG_ADD_VST3_PLUGINS_SAMPLES=FALSE ..
cmake --build . -j --config Release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment