From f9923a673ce2fcf13346b3427458a9b33921b62f Mon Sep 17 00:00:00 2001 From: Gambhiro Date: Tue, 15 Dec 2015 18:24:46 +0000 Subject: [PATCH] local symlinks --- .bzrignore | 3 +++ .gitignore | 3 +++ Builds/QtCreator/defaults.pri | 6 ++++-- README.md | 15 +++++++++++++-- include/.gitkeep | 0 lib/.gitkeep | 0 main.pro | 13 +++++++++++++ 7 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 include/.gitkeep create mode 100644 lib/.gitkeep diff --git a/.bzrignore b/.bzrignore index c1918f8..219ee6e 100644 --- a/.bzrignore +++ b/.bzrignore @@ -61,3 +61,6 @@ Builds/QtCreator/EmberCL/Makefile Builds/QtCreator/EmberGenome/Makefile Builds/QtCreator/EmberRender/Makefile Builds/QtCreator/Fractorium/Makefile +lib/libOpenCL.so +include/CL +include/GL diff --git a/.gitignore b/.gitignore index c1918f8..219ee6e 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,6 @@ Builds/QtCreator/EmberCL/Makefile Builds/QtCreator/EmberGenome/Makefile Builds/QtCreator/EmberRender/Makefile Builds/QtCreator/Fractorium/Makefile +lib/libOpenCL.so +include/CL +include/GL diff --git a/Builds/QtCreator/defaults.pri b/Builds/QtCreator/defaults.pri index 1faa59e..7a04e3e 100644 --- a/Builds/QtCreator/defaults.pri +++ b/Builds/QtCreator/defaults.pri @@ -24,6 +24,8 @@ CONFIG(debug, debug|release) { SRC_DIR = $$(PWD)/../../../Source SRC_COMMON_DIR = $$(PWD)/../../../Source/EmberCommon ASSETS_DIR = $$(PWD)/../../../Data +LOCAL_LIB_DIR = $$(PWD)/../../../lib +LOCAL_INCLUDE_DIR = $$(PWD)/../../../include macx { LIBS += -framework OpenGL @@ -45,8 +47,8 @@ macx { !macx { CONFIG += precompile_header - LIBS += -L/usr/lib/x86_64-linux-gnu -lGL - LIBS += -L/usr/lib/x86_64-linux-gnu -lOpenCL + LIBS += -L/usr/lib/x86_64-linux-gnu -L$LOCAL_LIB_DIR -lGL + LIBS += -L/usr/lib/x86_64-linux-gnu -L$LOCAL_LIB_DIR -lOpenCL QMAKE_LFLAGS_RELEASE += -s } diff --git a/README.md b/README.md index c584a36..53bc896 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,21 @@ sudo apt-get install git git clone https://github.com/mfeemster/fractorium ``` -Install the dependencies: +Install the dependencies. + +For Ubuntu 15.04 (vivid) and 15.10 (wily): ``` -sudo apt-get install g++ libdbus-1-dev libgl1-mesa-dev libgl-dev libglm-dev libjpeg-dev libpng12-dev libtbb-dev libxml2-dev qt5-default qt5-qmake qtbase5-dev libqt5opengl5-dev opencl-headers nvidia-opencl-dev +sudo apt-get install g++ libdbus-1-dev libgl1-mesa-dev libgl-dev libglm-dev libjpeg-dev libpng12-dev libtbb-dev libxml2-dev qt5-default qt5-qmake qtbase5-dev libqt5opengl5-dev opencl-headers/vivid +``` + +Note that `opencl-headers/vivid` is used to select version 1.2. You may want to +lock the package at that version to avoid automatic upgrades. + +Install the OpenCL drivers and opencl support for your hardware. For Nvidia: + +``` +sudo apt-get install nvidia-352 nvidia-352-dev nvidia-opencl-icd-352 nvidia-libopencl1-352 nvidia-prime nvidia-modprobe ``` Compile the binary: diff --git a/include/.gitkeep b/include/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/lib/.gitkeep b/lib/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/main.pro b/main.pro index fae22cb..d35a3e6 100644 --- a/main.pro +++ b/main.pro @@ -1,5 +1,18 @@ TEMPLATE = subdirs CONFIG += ordered +unix { + symlinks.commands = \ + test -e $$PWD/lib/libOpenCL.so || \ + ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 $$PWD/lib/libOpenCL.so; \ + test -e $$PWD/include/GL || \ + ln -s /usr/include/nvidia-352/GL $$PWD/include; \ + test -e $$PWD/include/CL || \ + ln -s /usr/include/nvidia-352/CL $$PWD/include; +} + SUBDIRS += Builds/QtCreator/Ember Builds/QtCreator/EmberCL Builds/QtCreator/EmberAnimate Builds/QtCreator/EmberGenome Builds/QtCreator/EmberRender Builds/QtCreator/Fractorium +sub-Builds-QtCreator-Ember-make_first-ordered.depends = symlinks + +QMAKE_EXTRA_TARGETS += sub-Builds-QtCreator-Ember-make_first-ordered symlinks