I like VCVRack and because of beeing also a software developer, I once looked into the sources to see what is going on under the hood.
But somehow I didn’t like the provided build setup/instructions and therefore I never built VCVRack this way.
I was aware of the Conan C/C++ Package Manager and intended for some time to adopt Conan for C++ development.
So I was thinking to give it a try with VCVRack.
Now I want to present/discuss here the current state I have so far.
As a short overview I have done so far the following steps:
- determining the VCVRack build dependencies
- searched for existing Conan packages and in case packages were missing I created and published these packages by myself
- created conanfile.py recipe to manage dependencies for VCVRack
- Translated build instructions from Makefiles into CMakeLists.txt to build VCVRack with CMake for
- Linux (Gcc and Clang)
- MacOS (Clang)
- Windows (MinGW Gcc)
- added Azure CI pipeline setup for automated building of VCVRack on Azure for Linux, MacOS and Windows with Conan and CMake
- added Conan and CMake build + Azure CI setup for public available plugins
The work is based on the current v1 branch development.
I created a Pull Request in my own repository https://github.com/qno/Rack/pull/5 so you can take a look at the current state.
For now I don’t want to go into too much details, but it will have the following advantages:
- No more messing up with dependencies handled via git submodules (they could just be removed)
- No more Makefiles nedded anymore
- No complicated setup of build environment anymore
- CMake based build (so you can also generate a project for your favourite IDE)
- No need to build VCVRack anymore before beeing able to build a Plugin
- Faster builds, as prebuilt binary artifacts of dependencies will be downloaded (and cached) by Conan
- Native Windows build with MSVC compiler should be possible (will requires some changes VCVRack code through use of platform abstraction), all dependencies can already be build with MSVC
So here is what you basically need to do:
- Install Build Environment (Git, Cmake, Compiler) (for Windows no MinGW installation is required anymore ).
- Under Linux you also don’t need to install any required dependecies with the package manager anymore.
- Install the Conan Package Manager for your development Platform.
- Setup Conan repositories for retrieving artifacts:
conan remote add conan-community https://api.bintray.com/conan/conan-community/conan
conan remote add qno https://api.bintray.com/conan/qno/conan-public
conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
- For Windows create a Conan MinGW profile under your USER directory in
.conan\profiles, called e.g.
mingwwith the following content:
[settings] os=Windows os_build=Windows arch=x86_64 arch_build=x86_64 compiler=gcc compiler.version=8 compiler.exception=seh compiler.libcxx=libstdc++11 compiler.threads=posix build_type=Release [options] [build_requires] mingw_installer/1.0@conan/stable msys2_installer/latest@bincrafters/stable [env]
- If you are under Windows also add the following change under your USER directory to the
.conan/conan.conffile to avoid trouble with spaces in path names:
[storage] # This is the default path, but you can write your own. It must be an absolute path or a # path beginning with "~" (if the environment var CONAN_USER_HOME is specified, this directory, even # with "~/", will be relative to the conan user home, not to the system user home) path = C:\.conan/data
- Clone repository
git clone https://github.com/qno/Rack.gitand switch to feature branch
git checkout feature/add_conan
- Create a build directory and cd into it
conan install ../Rack- under Windows please use
conan install ..\Rack --profile mingw
cmake -DCMAKE_BUILD_TYPE=Release ../Rack- under Windows please call
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..\Rack
- Build VCVRack with
cmake --build . -j
In case the Conan build fails - just add
--build=missing to the conan command, as it is possible that prebuilt binary artifacts are missing.
These steps are also reflected in the CI pipeline setup, so you can take a look there.
To test and run the VCVRack executable run the Rack executable in the bin directory.
Still open points are:
add missing deploy steps for VCVRack inside Conan (package VCVRack, create installer packages etc.) automated upload of Azure build artifacts (to github pages for nightly builds for example, etc.) create some kind of Conan VCVRack SDK package to ease Plugin development (I have it already but yet not published) improve Plugin building with Conan and CMake
- native Windows build with MS Visual Studio Compiler
If someone is interested in the work, feel free to check out the branch to test it and give some feedback here.
But please keep in mind - it is still work in progress and I would really like to get some feedback about the current state.
Build the VCVRack Fundamental Plugin
As without Plugins you basically can’t do anything useful with VCVRack, here is what you need to do for now to build it.
Build the VCVRackSDK and publish it to your local Conan cache:
- cd into the Rack source directory
conan create . qno/testing- under Windows please use
conan create . qno/testing --profile mingw
Build the Plugin:
Note - The CMAKE_INSTALL_PREFIX points here to the default Rack Plugin folder, so the Plugin is published during the build process.
- Clone the Fundamental Plugin
git clone https://github.com/VCVRack/Fundamental.gitand switch to the feature/add_conan_cmake branch
git checkout feature/add_conan_cmake
- Create a build directory and cd into it
conan install ../Fundamental- under Windows please use
conan install ..\Fundamental --profile mingw
- Execute CMake
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/.Rack/plugins-v1 ../Fundamental- under Windows please call
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%HOMEPATH%\Documents\Rack\plugins-v1" ..\Fundamental
- Build Fundamental Plugin
cmake --build . -j --target install
- run the Rack executable and select Plugins from the Plugin Manager
The following Plugins were also adapted, so you can build them exactly as the Fundamental Plugin (just replace in the above steps the name of the Plugin):
- Befaco Plugin -
- ESeries Plugin -
- AudibleInstruments Plugin -
- HetrickCV Plugin -
- JW-Modules Plugin -
- Bacon Music Plugin -
They work under Windows and Linux, for MacOS I couldn’t build and test, as I don’t have a Mac.
Download Build artifacts from Github
For demonstration purpose I created a special Github repository which contains all uploaded Azure CI build artifacts (Rack and Plugins)
Rack and Plugin binaries can be downloaded from VCVRack-Release-Demo/releases and tested. The artifacts are updated automatically after CI builds.