Mon
21
Aug 2017
AppVeyor and Travis CI are popular, free web services that provide continuous integration style build and testing environments for open source projects - for Windows and Linux, respectively. They are relatively easy to setup if your project is self-contained, but can be a little bit tricky if you need to install some additional dependencies. Today I successfully finished installing Vulkan SDK in these environments, to test Vulkan Memory Allocator project. Here is how to do it:
In AppVeyor I have everything configured on their website, so you can’t really see configuration file. To download Vulkan SDK, I used curl
command which is available by default. It took me some time to find direct link to SDK file because Download page on vulkan.lunarg.com points to addresses like “https://vulkan.lunarg.com/sdk/home#sdk/downloadConfirm/1.0.51.0/windows/VulkanSDK-1.0.51.0-Installer.exe”, which is actually a web page full of JavaScript that eventually redirects to real file when opened in a web browser. Finally I found it. Then I entered following commands as Environment > Install script:
curl -L --silent --show-error --output VulkanSDK.exe https://vulkan.lunarg.com/sdk/download/1.0.51.0/windows/VulkanSDK-1.0.51.0-Installer.exe?Human=true .\VulkanSDK.exe /S
First command downloads and second one installs Vulkan SDK in silent mode. The SDK is installed to C:\VulkanSDK\1.0.51.0 directory.
Next I added an environmental variable in Environment > Environmental variables section:
name: VULKAN_SDK
value: c:\VulkanSDK\1.0.51.0
In my Visual Studio project settings, I added include directory "$(VULKAN_SDK)/Include" and library directory "$(VULKAN_SDK)/Lib". Then I could successfully #include <vulkan/vulkan.h>
and link with vulkan-1.lib.
For Travis CI you can see my current configuration file as: .travis.yml. What I did here is I added few commands to install
section. First there are some apt-get
commands that install some additional libraries, which I took from Getting Started with the Vulkan SDK page:
sudo apt-get -qq update sudo apt-get install -y libassimp-dev libglm-dev graphviz libxcb-dri3-0 libxcb-present0 libpciaccess0 cmake libpng-dev libxcb-dri3-dev libx11-dev libx11-xcb-dev libmirclient-dev libwayland-dev libxrandr-dev
Then I download and install Vulkan SDK. URL to real file is in the same format as for Windows. I used wget
command for downloading. The file is a self-extracting archive that unpacks SDK content to following subdirectory of current directory: VulkanSDK/1.0.51.0/x86_64.
wget -O vulkansdk-linux-x86_64-1.0.51.0.run https://vulkan.lunarg.com/sdk/download/1.0.51.0/linux/vulkansdk-linux-x86_64-1.0.51.0.run?Human=true chmod ugo+x vulkansdk-linux-x86_64-1.0.51.0.run ./vulkansdk-linux-x86_64-1.0.51.0.run
Finally I issue a command that sets environmental variable pointing to the SDK, to have it available in the code just like on Windows:
export VULKAN_SDK=$TRAVIS_BUILD_DIR/VulkanSDK/1.0.51.0/x86_64
Then I needed to configure my project to search for include files in "$(VULKAN_SDK)/include" and library files in "$(VULKAN_SDK)/lib" (directory names are lowercase this time!). Finally I could #include <vulkan/vulkan.h>
and link with libvulkan.so.
(The post was updated 3 June 2019 - thanks Attilio Provenzano!)
Comments | #vulkan #graphics Share