| 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 | |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame^] | 6 | ##Linux System Requirements |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 7 | Ubuntu 14.04 LTS, (Ubuntu 14.10 needed for DRI 3 demos) |
| 8 | |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 9 | ``` |
| Norbert Nopper | 86647a9 | 2015-01-22 20:47:49 +0100 | [diff] [blame] | 10 | 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] | 11 | sudo apt-get build-dep mesa |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 12 | ``` |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 13 | |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame^] | 14 | ##Linux Build |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 15 | |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 16 | 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] | 17 | The standard build process builds the icd, the icd loader and all the tests. |
| 18 | |
| 19 | Example debug build: |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 20 | ``` |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 21 | cd xgl # cd to the root of the xgl git repository |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 22 | export KHRONOS_ACCOUNT_NAME= <subversion login name for svn checkout of BIL> |
| 23 | ./update_external_sources.sh # fetches and builds glslang, llvm, LunarGLASS, and BIL |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 24 | cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug |
| 25 | cd dbuild |
| 26 | make |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 27 | ``` |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 28 | |
| 29 | To run XGL programs you must tell the icd loader where to find the libraries. Set the |
| 30 | environment variable LIBXGL_DRIVERS_PATH to the driver path. For example: |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 31 | ``` |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 32 | export LIBXGL_DRIVERS_PATH=$PWD/icd/intel |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 33 | ``` |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 34 | |
| Courtney Goeltzenleuchter | 39af8ef | 2015-01-06 17:32:22 -0700 | [diff] [blame] | 35 | To enable debug and validation layers with your XGL programs you must tell the icd loader |
| 36 | where to find the layer libraries. Set the environment variable LIBXGL_LAYERS_PATH to |
| 37 | the layer folder and indicate the layers you want loaded via LIBXGL_LAYER_NAMES. |
| 38 | For example, to enable the APIDump and DrawState layers, do: |
| 39 | ``` |
| 40 | export LIBXGL_LAYERS_PATH=$PWD/layers |
| 41 | export LIBXGL_LAYER_NAMES=APIDump:DrawState |
| 42 | ``` |
| 43 | |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame^] | 44 | ##Linux Test |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 45 | |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 46 | 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] | 47 | gtest infrastructure. Tests available so far: |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 48 | - xglinfo: Report GPU properties |
| 49 | - xglbase: Test basic entry points |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 50 | - xgl_blit_tests: Test XGL Blits (copy, clear, and resolve) |
| Courtney Goeltzenleuchter | b5fdda2 | 2014-09-01 18:05:45 -0600 | [diff] [blame] | 51 | - xgl_image_tests: Test XGL image related calls needed by render_test |
| 52 | - xgl_render_tests: Render a single triangle with XGL. Triangle will be in a .ppm in |
| 53 | the current directory at the end of the test. |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 54 | |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame^] | 55 | ##Linux Demos |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 56 | |
| JensOwen | 95c6227 | 2014-11-01 13:05:43 -0600 | [diff] [blame] | 57 | 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] | 58 | to render directly onto window surfaces. |
| 59 | - tri: a textured triangle |
| 60 | - cube: a textured spinning cube |
| 61 | |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame^] | 62 | ##Linux Render Nodes |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 63 | |
| 64 | The render tests depend on access to DRM render nodes. |
| 65 | To make that available, a couple of config files need to be created to set a module option |
| 66 | and make accessible device files. |
| 67 | The system will need to be rebooted with these files in place to complete initialization. |
| 68 | These commands will create the config files. |
| 69 | |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 70 | ``` |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 71 | sudo tee /etc/modprobe.d/drm.conf << EOF |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 72 | # Enable render nodes |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 73 | options drm rnodes=1 |
| 74 | EOF |
| Courtney Goeltzenleuchter | a109944 | 2015-01-07 17:46:53 -0700 | [diff] [blame] | 75 | # this will add the rnodes=1 option into the boot environment |
| 76 | sudo update-initramfs -k all -u |
| JensOwen | 3ceb475 | 2014-11-01 13:18:21 -0600 | [diff] [blame] | 77 | ``` |
| 78 | ``` |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 79 | sudo tee /etc/udev/rules.d/drm.rules << EOF |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 80 | # Add permissions to render nodes |
| Mike Stroyan | a768fc1 | 2014-10-30 15:59:54 -0600 | [diff] [blame] | 81 | SUBSYSTEM=="drm", ACTION=="add", DEVPATH=="/devices/*/renderD*", MODE="020666" |
| 82 | EOF |
| JensOwen | ef27114 | 2014-11-01 13:11:50 -0600 | [diff] [blame] | 83 | ``` |
| Ian Elliott | 40e7dd9 | 2015-02-05 12:22:51 -0700 | [diff] [blame^] | 84 | |
| 85 | ##Windows System Requirements |
| 86 | |
| 87 | Windows 7+ with additional, software: |
| 88 | |
| 89 | - Microsoft Visual Studio 2013 Professional. Note: it is possible that lesser/older versions may work, but that has not been tested. |
| 90 | - CMake (from https://www.python.org/downloads). Note: Configure to add itself to the system PATH environment variable. |
| 91 | - Python 3 (from https://www.python.org/downloads). Note: Configure to add itself to the system PATH environment variable. |
| 92 | - Cygwin (especially a BASH shell and git packages--from https://www.cygwin.com/). |
| 93 | |
| 94 | ##Windows Build |
| 95 | |
| 96 | 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. |
| 97 | |
| 98 | Example debug build: |
| 99 | ``` |
| 100 | cd GL-Next # cd to the root of the xgl git repository |
| 101 | mkdir _out64 |
| 102 | cd _out64 |
| 103 | cmake -G "Visual Studio 12 Win64" .. |
| 104 | ``` |
| 105 | |
| 106 | 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. |
| 107 | |
| 108 | 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 |
| 109 | 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: |
| 110 | |
| 111 | - Launch Control Panel (e.g. Start->Control Panel) |
| 112 | - 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"). |
| 113 | - This will launch a window with several tabs, one of which is "Advanced". Click on the "Environment Variables..." button. |
| 114 | - For either "User variables" or "System variables" click "New...". |
| 115 | - 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). |
| 116 | |
| 117 | It is possible to specify multiple icd folders. Simply use a semi-colon (i.e. ";") to separate folders in the environment variable. |
| 118 | |
| 119 | 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. |
| 120 | |
| 121 | To enable debug and validation layers with your XGL programs you must tell the icd loader |
| 122 | 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: |
| 123 | |
| 124 | - LIBXGL_LAYERS_PATH (semi-colon-delimited set of folders to look for layers) |
| 125 | - LIBXGL_LAYER_NAMES (color-delimited list of layer names) |
| 126 | |
| 127 | For example, to enable the APIDump and DrawState layers, set: |
| 128 | |
| 129 | - "LIBXGL_LAYERS_PATH" to "C:\Users\username\GL-Next\_out64\layers\Debug" |
| 130 | - "LIBXGL_LAYER_NAMES to "APIDump:DrawState" |
| 131 | |
| 132 | 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. |