• Home
  • Raw
  • Download

Lines Matching +full:build +full:- +full:linux

1 # Build Instructions
3 Instructions for building this repository on Linux, Windows, and MacOS.
7 - [Build Instructions](#build-instructions)
8 - [Table Of Contents](#table-of-contents)
9 - [Contributing to the Repository](#contributing-to-the-repository)
10 - [Repository Content](#repository-content)
11 - [Installed Files](#installed-files)
12 - [Build Requirements](#build-requirements)
13 - [Test Requirements](#test-requirements)
14 - [Repository Set-Up](#repository-set-up)
15 - [Display Drivers](#display-drivers)
16 - [Repository Dependencies](#repository-dependencies)
17 - [Vulkan-Headers](#vulkan-headers)
18 - [Test Dependencies](#test-dependencies)
19 - [Warnings as errors off by default!](#warnings-as-errors-off-by-default)
20 - [Build and Install Directory Locations](#build-and-install-directory-locations)
21- [Building Dependent Repositories with Known-Good Revisions](#building-dependent-repositories-wit…
22 - [Automatically](#automatically)
23 - [Manually](#manually)
24 - [Notes About the Manual Option](#notes-about-the-manual-option)
25 - [Generated source code](#generated-source-code)
26 - [Build Options](#build-options)
27 - [Building On Windows](#building-on-windows)
28 - [Windows Development Environment Requirements](#windows-development-environment-requirements)
29 - [Windows Build - Microsoft Visual Studio](#windows-build---microsoft-visual-studio)
30 - [Windows Quick Start](#windows-quick-start)
31- [Use `CMake` to Create the Visual Studio Project Files](#use-cmake-to-create-the-visual-studio-p…
32 - [Build the Solution From the Command Line](#build-the-solution-from-the-command-line)
33 - [Build the Solution With Visual Studio](#build-the-solution-with-visual-studio)
34 - [Windows Install Target](#windows-install-target)
35 - [Building On Linux](#building-on-linux)
36 - [Linux Development Environment Requirements](#linux-development-environment-requirements)
37 - [Required Package List](#required-package-list)
38 - [Linux Build](#linux-build)
39 - [Linux Quick Start](#linux-quick-start)
40 - [Use CMake to Create the Make Files](#use-cmake-to-create-the-make-files)
41 - [Build the Project](#build-the-project)
42 - [Linux Notes](#linux-notes)
43 - [WSI Support Build Options](#wsi-support-build-options)
44 - [Linux Install to System Directories](#linux-install-to-system-directories)
45 - [Linux 32-bit support](#linux-32-bit-support)
46 - [Building on MacOS](#building-on-macos)
47 - [MacOS Development Environment Requirements](#macos-development-environment-requirements)
48 - [Clone the Repository](#clone-the-repository)
49 - [MacOS build](#macos-build)
50 - [Building with the Unix Makefiles Generator](#building-with-the-unix-makefiles-generator)
51 - [Building with the Xcode Generator](#building-with-the-xcode-generator)
52 - [Building on Fuchsia](#building-on-fuchsia)
53 - [SDK Symbols](#sdk-symbols)
54 - [Building on QNX](#building-on-qnx)
55 - [Cross Compilation](#cross-compilation)
56- [Unknown function handling which requires explicit assembly implementations](#unknown-function-h…
57- [Platforms which fully support unknown function handling](#platforms-which-fully-support-unknown
58 - [Tests](#tests)
70 This repository contains the source code necessary to build the desktop Vulkan
78 - *install_dir*`/lib` : The Vulkan loader library
79 - *install_dir*`/bin` : The Vulkan loader library DLL (Windows)
81 ## Build Requirements
91 ## Repository Set-Up
95 This repository does not contain a Vulkan-capable driver. You will need to
105 1. CMake or Environment variable overrides (e.g., -D VULKAN_HEADERS_INSTALL_DIR)
106 2. System-installed packages, mostly applicable on Linux
113 #### Vulkan-Headers
115 …ired dependency on the [Vulkan Headers repository](https://github.com/KhronosGroup/Vulkan-Headers).
116 The Vulkan-Headers repository contains the Vulkan API definition files that are
117 required to build the loader.
124 To build the tests, pass both `-D UPDATE_DEPS=ON` and `-D BUILD_TESTS=ON` options when generating t…
126 cmake ... -D UPDATE_DEPS=ON -D BUILD_TESTS=ON ...
134 System/language package managers have to build on multiple different platforms and compilers.
138 Add `-D BUILD_WERROR=ON` to your workflow
140 ### Build and Install Directory Locations
142 A common convention is to place the `build` directory in the top directory of
143 the repository and place the `install` directory as a child of the `build`
147 ### Building Dependent Repositories with Known-Good Revisions
150 to gather and build the dependent repositories mentioned above.
151 This program uses information stored in the `scripts/known-good.json` file
156 The first step to either is cloning the Vulkan-Loader repo and stepping into
160 git clone git@github.com:KhronosGroup/Vulkan-Loader.git
161 cd Vulkan-Loader
167 heavy-lifting, you may just trigger the following CMake commands:
170 cmake -S . -B build -D UPDATE_DEPS=On
171 cmake --build build
176 To manually update the dependencies you now must create the build folder, and
177 run the update deps script followed by the necessary CMake build commands:
180 mkdir build
181 cd build
183 cmake -C helper.cmake ..
184 cmake --build .
189 - You may need to adjust some of the CMake options based on your platform. See
190 the platform-specific sections later in this document.
191 - The `update_deps.py` script fetches and builds the dependent repositories in
193 - The `--dir` option for `update_deps.py` can be used to relocate the
196 - The `update_deps.py` script generates a file named `helper.cmake` and places
200 The `-C helper.cmake` option is used to set these variables when you generate
201 the build files.
202 - If using "MINGW" (Git For Windows), you may wish to run
206 - Please use `update_deps.py --help` to list additional options and read the
216 Run `python scripts/generate_source.py --help` to see how to invoke it.
220 Note: By default this helper target is disabled. To enable it, add `-D LOADER_CODEGEN=ON`
224 cmake -S . -B build -D LOADER_CODEGEN=ON
225 cmake --build . --target loader_codegen
228 ### Build Options
230 When generating build files through CMake, several options can be specified to
231 customize the build.
235------------------------------- | ------------- | ------- | --------------------------------------…
237 | BUILD_WSI_XCB_SUPPORT | Linux | `ON` | Build the loader with the XCB entry p…
238 | BUILD_WSI_XLIB_SUPPORT | Linux | `ON` | Build the loader with the Xlib entry …
239 | BUILD_WSI_WAYLAND_SUPPORT | Linux | `ON` | Build the loader with the Wayland ent…
240 | BUILD_WSI_DIRECTFB_SUPPORT | Linux | `OFF` | Build the loader with the DirectFB en…
241 | BUILD_WSI_SCREEN_QNX_SUPPORT | QNX | `OFF` | Build the loader with the QNX Screen …
242 … | `OFF` | Link the loader to the [OneCore](https://msdn.microsoft.com/en-us/library/windows/de…
243 | USE_GAS | Linux | `ON` | Controls whether to build assembly fi…
244 | USE_MASM | Windows | `ON` | Controls whether to build assembly fi…
245 | LOADER_ENABLE_ADDRESS_SANITIZER | Linux & macOS | `OFF` | Enables Address Sanitizer in the load…
246 | LOADER_ENABLE_THREAD_SANITIZER | Linux & macOS | `OFF` | Enables Thread Sanitizer in the loade…
255--------------------- | ----------- | ----------------------------- | ----------------------------…
256 | FALLBACK_CONFIG_DIRS | Linux/MacOS | `/etc/xdg` | Configuration path(s) to us…
257 | FALLBACK_DATA_DIRS | Linux/MacOS | `/usr/local/share:/usr/share` | Configuration path(s) to us…
258 …ific version information for the Loader DLL. Format is "major.minor.patch.build". …
260 These variables should be set using the `-D` option when invoking CMake to generate the native plat…
266 - Windows
267 - Any Personal Computer version supported by Microsoft
268 - Microsoft [Visual Studio](https://www.visualstudio.com/)
269 - Versions
270 - [2022](https://www.visualstudio.com/vs/downloads/)
271 - [2019](https://www.visualstudio.com/vs/older-downloads/)
272 - The Community Edition of each of the above versions is sufficient, as
274 - [CMake 3.22.1](https://cmake.org/files/v3.22.1/cmake-3.22.1-win64-x64.zip) is recommended.
275 - Use the installer option to add CMake to the system PATH
276 - Git Client Support
277 - [Git for Windows](http://git-scm.com/download/win) is a popular solution
279 - Some IDEs (e.g., [Visual Studio](https://www.visualstudio.com/),
283 ### Windows Build - Microsoft Visual Studio
286 files. Then either run CMake with the `--build` option to build from the
294 cd Vulkan-Loader
295 mkdir build
296 cd build
297 cmake -A x64 -D UPDATE_DEPS=ON ..
298 cmake --build .
308 create a build directory and generate the Visual Studio project files:
310 cd Vulkan-Loader
311 mkdir build
312 cd build
313 cmake -D UPDATE_DEPS=ON -G "Visual Studio 16 2019" -A x64 ..
316 > repository. If you place your build directory someplace else, you'll need to
319 The `-G` option is used to select the generator
325 The `-A` option is used to select either the "Win32", "x64", or "ARM64 architecture.
327 When generating the project files, the absolute path to a Vulkan-Headers
329 `-D UPDATE_DEPS=ON` option, by directly setting the
331 `VULKAN_HEADERS_INSTALL_DIR` CMake variable with the `-D` CMake option. In
333 Vulkan-Headers repository built with the install target.
335 The above steps create a Windows solution file named `Vulkan-Loader.sln` in
336 the build directory.
338 At this point, you can build the solution from the command line or open the
341 #### Build the Solution From the Command Line
343 While still in the build directory:
345 cmake --build .
347 to build the Debug configuration (the default), or:
349 cmake --build . --config Release
351 to make a Release build.
353 #### Build the Solution With Visual Studio
355 Launch Visual Studio and open the "Vulkan-Loader.sln" solution file in the
356 build folder. You may select "Debug" or "Release" from the Solution
357 Configurations drop-down list. Start a build by selecting the Build->Build
363 the primary build artifacts to a specific location using a "bin, include, lib"
368 with the `CMAKE_INSTALL_PREFIX` variable when first generating the project build
371 You can build the install target from the command line with:
373 cmake --build . --config Release --target install
375 or build the `INSTALL` target from the Visual Studio solution explorer.
377 ## Building On Linux
379 ### Linux Development Environment Requirements argument
383 It is be straightforward to adapt this repository to other Linux distributions.
385 [CMake 3.22.1](https://cmake.org/files/v3.22.1/cmake-3.22.1-Linux-x86_64.tar.gz) is recommended.
389 sudo apt-get install git build-essential libx11-xcb-dev \
390 libxkbcommon-dev libwayland-dev libxrandr-dev
392 ### Linux Build argument
395 CMake with the `--build` option or `make` to build from the command line.
397 #### Linux Quick Start
399 cd Vulkan-Loader
400 mkdir build
401 cd build
402 cmake -D UPDATE_DEPS=ON ..
410 create a build directory and generate the make files.
412 cd Vulkan-Loader
413 mkdir build
414 cd build
415 cmake -D CMAKE_BUILD_TYPE=Debug \
416 -D VULKAN_HEADERS_INSTALL_DIR=absolute_path_to_install_dir \
417 -D CMAKE_INSTALL_PREFIX=install ..
420 > repository. If you place your `build` directory someplace else, you'll need
423 Use `-D CMAKE_BUILD_TYPE` to specify a Debug or Release build.
425 When generating the project files, the absolute path to a Vulkan-Headers
427 `-D UPDATE_DEPS=ON` option, by directly setting the `VULKAN_HEADERS_INSTALL_DIR`
429 variable with the `-D` CMake option.
431 Vulkan-Headers repository built with the install target.
433 > Note: For Linux, the default value for `CMAKE_INSTALL_PREFIX` is
438 #### Build the Project argument
440 You can just run `make` to begin the build.
442 To speed up the build on a multi-core machine, use the `-j` option for `make`
443 to specify the number of cores to use for the build. For example:
445 make -j4
449 cmake --build .
451 ### Linux Notes argument
453 #### WSI Support Build Options
455 By default, the Vulkan Loader is built with support for the Vulkan-defined WSI
456 display servers: Xcb, Xlib, and Wayland. It is recommended to build the
458 usability across Linux platforms. If it is necessary to build these modules
462 #### Linux Install to System Directories
464 Installing the files resulting from your build to the systems directories is
471 directory is still `build`, you can execute:
476 specified when creating the build files with CMake:
478 - `/usr/local/lib`: Vulkan loader library and package config files
481 cache on some Linux systems.
485 install to `/tmp/build` instead of `/usr/local`, on your CMake command line
488 -D CMAKE_INSTALL_PREFIX=/tmp/build
491 `/tmp/build`. This may be useful for collecting the artifacts and providing
497 `/tmp/build` causes the loader to search
498 `/tmp/build/etc/vulkan/explicit_layer.d` and
499 `/tmp/build/share/vulkan/explicit_layer.d` for the layer JSON files. The
502 searching the two locations under `/tmp/build`.
514 #### Linux 32-bit support
516 The loader supports building in 32-bit Linux environments.
518 Here are some notes for building this repo as 32-bit on a 64-bit Ubuntu
521 If not already installed, install the following 32-bit development libraries:
523 `gcc-multilib gcc-multilib g++-multilib libc6:i386 libc6-dev-i386 libgcc-s1:i386 libwayland-dev:i38…
528 Set up your environment for building 32-bit targets:
530 export CFLAGS=-m32
531 export CXXFLAGS=-m32
532 export LDFLAGS=-m32
533 export ASFLAGS=--32
537 Finally, build the repository normally as explained above.
539 These notes are taken from the Github Actions workflow `linux-32` which is run
548 - Ensure Homebrew is at the beginning of your PATH:
552 - Add packages with the following (may need refinement)
558 Clone the Vulkan-Loader repository:
560 git clone https://github.com/KhronosGroup/Vulkan-Loader.git
562 ### MacOS build
564 [CMake 3.22.1](https://cmake.org/files/v3.22.1/cmake-3.22.1-Darwin-x86_64.tar.gz) is recommended.
570 When generating the project files, the absolute path to a Vulkan-Headers
572 `-D UPDATE_DEPS=ON` option, by directly setting the
574 `VULKAN_HEADERS_INSTALL_DIR` CMake variable with the `-D` CMake option. In
576 Vulkan-Headers repository built with the install target.
578 mkdir build
579 cd build
580 …cmake -D UPDATE_DEPS=ON -D VULKAN_HEADERS_INSTALL_DIR=absolute_path_to_install_dir -D CMAKE_BUILD_…
583 To speed up the build on a multi-core machine, use the `-j` option for `make`
584 to specify the number of cores to use for the build. For example:
586 make -j4
592 mkdir build-xcode
593 cd build-xcode
594 cmake -GXcode ..
595 open Vulkan-Loader.xcodeproj
597 Within Xcode, you can select Debug or Release builds in the project's Build
602 Fuchsia uses the project's GN build system to integrate with the Fuchsia platform build.
607 the file vulkan.symbols.api; see [SDK](https://fuchsia.dev/fuchsia-src/development/sdk).
611 QNX is using its own build system. The proper build environment must be set
612 under the QNX host development system (Linux, Win64, MacOS) by invoking
616 It will build the ICD loader for all CPU targets supported by QNX.
633 * 64 bit Linux (x64)
634 * 32 bit Linux (x86)
639 Platforms not listed will use a fallback C Code path that relies on tail-call optimization to work.
644 To build tests, make sure that the `BUILD_TESTS` option is set to true. Using
645 the command line, this looks like `-D BUILD_TESTS=ON`.
648 tests. To run the tests, change the directory to that of the build direction, and