| JensOwen | 95c6227 | 2014-11-01 13:05:43 -0600 | [diff] [blame] | 1 | # Build Instructions |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame] | 2 | This project fully supports Linux today. |
| 3 | Support for Windows is for the loader and layers (additional info below). Additional Windows support will be coming in Q1'15. |
| JensOwen | 95c6227 | 2014-11-01 13:05:43 -0600 | [diff] [blame] | 4 | Support for Android is TBD. |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 5 | |
| Courtney Goeltzenleuchter | 47469d9 | 2015-02-13 09:30:42 -0700 | [diff] [blame^] | 6 | ##Git the Bits |
| 7 | |
| 8 | Make sure you have access to the Khronos Github repository. If not, send an email to |
| 9 | jens@lunarg.com or courtney@lunarg.com and we can add you if you have a Khronos account. |
| 10 | Also need to be sure that your Github account name is in your Khronos profile or the |
| 11 | system will disable Github access. Once you have access to the Khronos Github repository, |
| 12 | the preferred work flow is to fork that repo, commit work on to your fork and then issue a |
| 13 | pull request to integrate that work into the Khronos repo. If that's too much, it's okay |
| 14 | to clone the Khronos repository directly. |
| 15 | |
| Ian Elliott | a3d5501 | 2015-02-13 10:57:55 -0700 | [diff] [blame] | 16 | Note: If you are doing ICD (driver) development, please make sure to look at documentation in the [*ICD Loader*](loader/README.md) and the [*Sample Driver*](icd). |
| 17 | |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame] | 18 | ##Linux System Requirements |
| Courtney Goeltzenleuchter | fc82da6 | 2015-02-05 17:02:39 -0700 | [diff] [blame] | 19 | Ubuntu 14.10 needed for DRI 3 |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 20 | |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 21 | ``` |
| Norbert Nopper | 86647a9 | 2015-01-22 20:47:49 +0100 | [diff] [blame] | 22 | sudo apt-get install git subversion cmake libgl1-mesa-dev freeglut3-dev libglm-dev libpng12-dev libmagickwand-dev qt5-default |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 23 | sudo apt-get build-dep mesa |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 24 | ``` |
| Courtney Goeltzenleuchter | fc82da6 | 2015-02-05 17:02:39 -0700 | [diff] [blame] | 25 | Warning: Recent versions of 14.10 have **REMOVED** DRI 3. |
| 26 | Version: 2:2.99.914-1~exp1ubuntu4.1 is known to work. |
| 27 | To see status of this package: |
| 28 | ``` |
| 29 | dpkg -s xserver-xorg-video-intel |
| 30 | ``` |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 31 | |
| Norbert Nopper | 455f25d | 2015-02-06 20:57:52 +0100 | [diff] [blame] | 32 | Note: |
| 33 | Version 2:2.99.914-1~exp1ubuntu4.2 does not work anymore. |
| 34 | To install the working driver from launchpadlibrarian.net: |
| Norbert Nopper | 36ccff7 | 2015-02-06 21:06:58 +0100 | [diff] [blame] | 35 | - Remove the current driver: |
| 36 | ``` |
| 37 | sudo apt-get purge xserver-xorg-video-intel |
| 38 | ``` |
| 39 | - Download the old driver: |
| 40 | ``` |
| 41 | wget http://launchpadlibrarian.net/189418339/xserver-xorg-video-intel_2.99.914-1%7Eexp1ubuntu4.1_amd64.deb |
| 42 | ``` |
| 43 | - Install the driver: |
| 44 | ``` |
| 45 | sudo dpkg -i xserver-xorg-video-intel_2.99.914-1~exp1ubuntu4.1_amd64.deb |
| 46 | ``` |
| 47 | - Either restart Ubuntu or just X11. |
| Norbert Nopper | 455f25d | 2015-02-06 20:57:52 +0100 | [diff] [blame] | 48 | |
| Courtney Goeltzenleuchter | 47469d9 | 2015-02-13 09:30:42 -0700 | [diff] [blame^] | 49 | ## Clone the repository |
| 50 | |
| 51 | To create your local git repository: |
| 52 | ``` |
| 53 | mkdir YOUR_DEV_DIRECTORY # it's called GL-Next on Github, but the name doesn't matter |
| 54 | cd YOUR_DEV_DIRECTORY |
| 55 | git clone -o khronos git@github.com:KhronosGroup/GL-Next.git . |
| 56 | # Or substitute the URL from your forked repo for git@github.com:KhronosGroup above. |
| 57 | ``` |
| 58 | |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame] | 59 | ##Linux Build |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 60 | |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 61 | The sample driver uses cmake and should work with the usual cmake options and utilities. |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 62 | The standard build process builds the icd, the icd loader and all the tests. |
| 63 | |
| 64 | Example debug build: |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 65 | ``` |
| Courtney Goeltzenleuchter | 47469d9 | 2015-02-13 09:30:42 -0700 | [diff] [blame^] | 66 | cd YOUR_DEV_DIRECTORY # cd to the root of the xgl git repository |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 67 | export KHRONOS_ACCOUNT_NAME= <subversion login name for svn checkout of BIL> |
| 68 | ./update_external_sources.sh # fetches and builds glslang, llvm, LunarGLASS, and BIL |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 69 | cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug |
| 70 | cd dbuild |
| 71 | make |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 72 | ``` |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 73 | |
| 74 | To run XGL programs you must tell the icd loader where to find the libraries. Set the |
| 75 | environment variable LIBXGL_DRIVERS_PATH to the driver path. For example: |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 76 | ``` |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 77 | export LIBXGL_DRIVERS_PATH=$PWD/icd/intel |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 78 | ``` |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 79 | |
| Courtney Goeltzenleuchter | 39af8ef | 2015-01-06 17:32:22 -0700 | [diff] [blame] | 80 | To enable debug and validation layers with your XGL programs you must tell the icd loader |
| 81 | where to find the layer libraries. Set the environment variable LIBXGL_LAYERS_PATH to |
| 82 | the layer folder and indicate the layers you want loaded via LIBXGL_LAYER_NAMES. |
| 83 | For example, to enable the APIDump and DrawState layers, do: |
| 84 | ``` |
| 85 | export LIBXGL_LAYERS_PATH=$PWD/layers |
| 86 | export LIBXGL_LAYER_NAMES=APIDump:DrawState |
| 87 | ``` |
| 88 | |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame] | 89 | ##Linux Test |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 90 | |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 91 | The test executibles can be found in the dbuild/tests directory. The tests use the Google |
| Norbert Nopper | 9652dfd | 2015-01-22 20:52:34 +0100 | [diff] [blame] | 92 | gtest infrastructure. Tests available so far: |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 93 | - xglinfo: Report GPU properties |
| 94 | - xglbase: Test basic entry points |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 95 | - xgl_blit_tests: Test XGL Blits (copy, clear, and resolve) |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 96 | - xgl_image_tests: Test XGL image related calls needed by render_test |
| 97 | - xgl_render_tests: Render a single triangle with XGL. Triangle will be in a .ppm in |
| 98 | the current directory at the end of the test. |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 99 | |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame] | 100 | ##Linux Demos |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 101 | |
| JensOwen | 95c6227 | 2014-11-01 13:05:43 -0600 | [diff] [blame] | 102 | The demos executables can be found in the dbuild/demos directory. The demos use DRI 3 |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 103 | to render directly onto window surfaces. |
| 104 | - tri: a textured triangle |
| 105 | - cube: a textured spinning cube |
| 106 | |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame] | 107 | ##Linux Render Nodes |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 108 | |
| 109 | The render tests depend on access to DRM render nodes. |
| 110 | To make that available, a couple of config files need to be created to set a module option |
| 111 | and make accessible device files. |
| 112 | The system will need to be rebooted with these files in place to complete initialization. |
| 113 | These commands will create the config files. |
| 114 | |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 115 | ``` |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 116 | sudo tee /etc/modprobe.d/drm.conf << EOF |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 117 | # Enable render nodes |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 118 | options drm rnodes=1 |
| 119 | EOF |
| Courtney Goeltzenleuchter | a109944 | 2015-01-07 17:46:53 -0700 | [diff] [blame] | 120 | # this will add the rnodes=1 option into the boot environment |
| 121 | sudo update-initramfs -k all -u |
| JensOwen | 3ceb475 | 2014-11-01 13:18:21 -0600 | [diff] [blame] | 122 | ``` |
| 123 | ``` |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 124 | sudo tee /etc/udev/rules.d/drm.rules << EOF |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 125 | # Add permissions to render nodes |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 126 | SUBSYSTEM=="drm", ACTION=="add", DEVPATH=="/devices/*/renderD*", MODE="020666" |
| 127 | EOF |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 128 | ``` |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame] | 129 | |
| 130 | ##Windows System Requirements |
| 131 | |
| 132 | Windows 7+ with additional, software: |
| 133 | |
| 134 | - Microsoft Visual Studio 2013 Professional. Note: it is possible that lesser/older versions may work, but that has not been tested. |
| Ian Elliott | a3d5501 | 2015-02-13 10:57:55 -0700 | [diff] [blame] | 135 | - CMake (from http://www.cmake.org/cmake/resources/software.html). Note: Configure to add itself to the system PATH environment variable. |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame] | 136 | - Python 3 (from https://www.python.org/downloads). Note: Configure to add itself to the system PATH environment variable. |
| 137 | - Cygwin (especially a BASH shell and git packages--from https://www.cygwin.com/). |
| 138 | |
| 139 | ##Windows Build |
| 140 | |
| 141 | Cygwin is used in order to obtain a local copy of the Git repository, and to run the CMake command that creates Visual Studio files. Visual Studio is used to build the software, and will re-run CMake as appropriate. |
| 142 | |
| 143 | Example debug build: |
| 144 | ``` |
| 145 | cd GL-Next # cd to the root of the xgl git repository |
| 146 | mkdir _out64 |
| 147 | cd _out64 |
| 148 | cmake -G "Visual Studio 12 Win64" .. |
| 149 | ``` |
| 150 | |
| 151 | At this point, you can use Windows Explorer to launch Visual Studio by double-clicking on the "XGL.sln" file in the _out64 folder. Once Visual Studio comes up, you can select "Debug" or "Release" from a drop-down list. You can start a build with either the menu (Build->Build Solution), or a keyboard shortcut (Ctrl+Shift+B). As part of the build process, Python scripts will create additional Visual Studio files and projects, along with additional source files. All of these auto-generated files are under the "_out64" folder. |
| 152 | |
| 153 | To run XGL programs you must have an appropriate icd (installable client driver) that is either installed in the C:\Windows\System32 folder, or pointed to by the |
| 154 | environment variable LIBXGL_DRIVERS_PATH. This environment variable cannot be set with Cygwin, but must be set via Windows, and may require a system restart in order for it to take effect. Here is how to set this environment variable on a Windows 7 system: |
| 155 | |
| 156 | - Launch Control Panel (e.g. Start->Control Panel) |
| 157 | - Within the search box, type "environment variable" and click on "Edit the system environment variables" (or navigate there via "System and Security->System->Advanced system settings"). |
| 158 | - This will launch a window with several tabs, one of which is "Advanced". Click on the "Environment Variables..." button. |
| 159 | - For either "User variables" or "System variables" click "New...". |
| 160 | - Enter "LIBXGL_DRIVERS_PATH" as the variable name, and an appropriate Windows path to where your driver DLL is (e.g. C:\Users\username\GL-Next\_out64\icd\drivername\Debug). |
| 161 | |
| 162 | It is possible to specify multiple icd folders. Simply use a semi-colon (i.e. ";") to separate folders in the environment variable. |
| 163 | |
| 164 | The icd loader searches in all of the folders for files that are named "XGL_*.dll" (e.g. "XGL_foo.dll"). It attempts to dynamically load these files, and look for appropriate functions. |
| 165 | |
| 166 | To enable debug and validation layers with your XGL programs you must tell the icd loader |
| 167 | where to find the layer libraries, and which ones you desire to use. The default folder for layers is C:\Windows\System32. However, you can use the following environment variables to specify alternate locations, and to specify which layers to use: |
| 168 | |
| 169 | - LIBXGL_LAYERS_PATH (semi-colon-delimited set of folders to look for layers) |
| 170 | - LIBXGL_LAYER_NAMES (color-delimited list of layer names) |
| 171 | |
| 172 | For example, to enable the APIDump and DrawState layers, set: |
| 173 | |
| 174 | - "LIBXGL_LAYERS_PATH" to "C:\Users\username\GL-Next\_out64\layers\Debug" |
| 175 | - "LIBXGL_LAYER_NAMES to "APIDump:DrawState" |
| 176 | |
| 177 | The icd loader searches in all of the folders for files that are named "XGLLayer*.dll" (e.g. "XGLLayerParamChecker.dll"). It attempts to dynamically load these files, and look for appropriate functions. |