Table of Contents generated with DocToc
#To build
- If you want to be able to read training/testing data from jpeg files, then please choose
BUILD_JPEG_SUPPORT
=ON
. You will need to provide turbojpeg library and headers, or compatible. Otherwise set toOFF
Required:
- git
- make
- cmake
- cmake-curses-gui
- gfortran
- g++ (should support c++11; eg 4.6 or better)
- An OpenCL-compatible driver installed, and OpenCL-compatible GPU
Optional:
- libjpeg62 or compatible, eg
sudo apt-get install libjpeg-turbo8-dev
(libjpeg-turbo is faster than original libjpeg6.2, by around 2-4 times, because it uses SIMD extensions)
git clone --recursive https://github.com/hughperkins/DeepCL.git
cd DeepCL
# if you need to use a specific branch, then choose that now, ie:
# git checkout some-branch-name
# git submodule update --recursive
mkdir build
cd build
ccmake ..
# in ccmake:
# - press 'c'/configure
# - choose the options you want
# - press 'c' /configure again
# - press 'g' / generate, then `q` / quit
make -j 4 install
The outputs will appear in subdirectories of ../dist
Note:
- be sure to add
--recursive
when you clone, else when you build it will complain about OpenCLHelper missing (or clew missing)- if you do forget, you can experiment with running
git submodule init --recursive
, and thengit submodule update --recursive
- if you do forget, you can experiment with running
- you might need to play around with commands such as
git submodule update --recursive
occasionally, to pull down new OpenCLHelper updates - note: recently, moved EasyCL/thirdparty/clew from submodule to simply copying in the files
- hopefully this makes new clones easier, but for now, if you already have a clone, when you next update, you might need to first remove the EasyCL/thirdparty/clew directory
Open a bash prompt, and run:
source /path/to/DeepCL/dist/bin/activate.sh
(where you need to modify /path/to/DeepCL
appropriately)
Keep the bash open, and go to the next section
Unit-tests:
deepcl_unittests
Most tests should pass, but one or two might fail. Please do feel free to raise an issue for failing tests, even if they fail intermittently.
Commandline training:
deepcl_train numtest=-1 numtrain=10000 datadir=/data/mnist
(change path to wherever the mnist data files are downloaded)
Required:
- git
- cmake
- Visual Studio 2015
- An OpenCL-compatible driver installed, and OpenCL-compatible GPU
Optional:
- (new) libjpeg62, or compatible, eg libjpeg-turbo (libjpeg-turbo is faster than original libjpeg6.2, by around 2-4 times, because it uses SIMD extensions)
- Python 2.7 or Python 3.5 (note: python 3.4 no longer supported, on Windows)
- in git, do
git clone --recursive https://github.com/hughperkins/DeepCL.git
- note: recently, moved EasyCL/thirdparty/clew from submodule to simply copying in the files
- hopefully this makes new clones easier, but for now, if you already have a clone, when you next update, you might need to first remove the EasyCL/thirdparty/clew directory
- if you need to use a specific branch, then choose that now, ie:
git checkout some-branch-name
, and thengit submodule update --recursive
- create a subdirectory
build
in the git clonedDeepCL
directory - open cmake, point at the
DeepCL
directory, and set to build in thebuild
subdirectoryconfigure
, select 'visual studio 2015' (or as appropriate)
- choose the options you want, eg turn python on/off, jpeg on/off
- click
generate
- open visual studio, and load any of the projects in the
build
directory- change release type to
Release
- choose
build
from thebuild
menu
- change release type to
- select 'INSTALL' project, right-click and 'Build'
The outputs will appear in the subdirectory 'dist'
Open a cmd prompt, and run:
call \path\to\DeepCL\dist\bin\activate.bat
(where you need to modify \path\to\DeepCL
appropriately)
Keep the cmd open, and go to the next section
First open a cmd prompt, and activate, as above, then:
Unit-tests:
deepcl_unittests
Most tests should pass, but one or two might fail. Please do feel free to raise an issue for failing tests, even if they fail intermittently.
Commandline training:
deepcl_train numtest=-1 numtrain=10000 datadir=c:\data\mnist
(change path to wherever the mnist data files are downloaded)
If you want to use the DeepCL library from C++, you will need to link with the following libraries:
- libDeepCL.so (or DeepCL.dll, on Windows)
- libEasyCL.so (or EasyCL.dll, on Windows)
- libclew.so / clew.dll
- libclBLAS.so / clBLAS.dll
- during build,
fatal error: CppRuntimeBoundary.h: No such file or directory
- make sure you ran
source ../dist/bin/activate.sh
, or similar (see above for exact command similar to this)
- make sure you ran
Using instructoins at https://stackoverflow.com/questions/12652178/compiling-libjpeg/19045485#19045485
- downloaded http://www.ijg.org/files/jpegsr9b.zip , unzipped
- downloaded http://www.bvbcode.com/code/f2kivdrh-395674-down , copied to unzipped jpeg-9b directory
- open cmd
- run
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
- run
nmake /f makefile.vc setup-v10
- open
jpeg.sln
in msvc2015, and build - (dont need
apps.sln
, ignore it) - you've built win32, into
release
directory- copy
jpeg.lib
somewhere
- copy
- now, redo, but selecting
x64
in the dropdown, in the menubar, at hte top of msvc ui- you have to do something like right-click, 'add configuration', and select architecture 'x64' to do this
- this will build into
x64\release
, instead of simplyrelease
This builds as a static library, so no need to distribute dlls and stuff