Skip to content

Commit

Permalink
native: Add oclgrind dep
Browse files Browse the repository at this point in the history
Issue #88.
  • Loading branch information
ChrisCummins committed Mar 25, 2017
1 parent 796651e commit 885f17c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@

# native stuff
/native/cmake
/native/gpuverify
/native/libclc
/native/llvm
/native/gpuverify
/native/ninja
/native/oclgrind

# build cache
/.cache
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ include make/gpuverify.make
include make/ninja.make
include make/llvm.make
include make/libclc.make
include make/oclgrind.make

data_symlinks = \
$(root)/clgen/data/bin/clang \
Expand Down
53 changes: 53 additions & 0 deletions make/oclgrind.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Makefile module to pull OCLgrind dependency
#
# Usage:
#
# * Add '$(oclgrind)' to list of prerequisites.
# * Requires $(llvm), $(ninja), and $(cmake).
#
# Copyright 2017 Chris Cummins <[email protected]>.
#
# This file is part of CLgen.
#
# CLgen is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# CLgen is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with CLgen. If not, see <http://www.gnu.org/licenses/>.
#
oclgrind_version := c3760d07365b74ccda04cd361e1b567a6d99dd8c
oclgrind_remote := [email protected]:jrprice/Oclgrind.git
oclgrind_dir := $(root)/native/oclgrind/$(oclgrind_version)
oclgrind := $(oclgrind_dir)/install/bin/oclgrind

oclgrind: $(oclgrind)

oclgrind_cmake = $(cmake) .. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=../install \
-DLLVM_DIR=$(llvm_build)/lib/cmake/llvm \
-DCLANG_ROOT=$(llvm_src)/tools/clang \
-DCMAKE_CXX_FLAGS="-I$(llvm_build)/tools/clang/include" \
-DCMAKE_MAKE_PROGRAM=$(ninja) -G Ninja

$(oclgrind):
mkdir -p $(root)/native/oclgrind
cd $(root)/native/oclgrind && git clone $(oclgrind_remote) $(oclgrind_version)
cd $(oclgrind_dir) && git reset --hard $(oclgrind_version)
rm -rf $(oclgrind_dir)/.git
mkdir $(oclgrind_dir)/build $(oclgrind_dir)/install
cd $(oclgrind_dir)/build && $(oclgrind_cmake)
cd $(oclgrind_dir)/build && $(ninja)
cd $(oclgrind_dir)/build && $(ninja) test
cd $(oclgrind_dir)/build && $(ninja) install

.PHONY: distclean-oclgrind
distclean-oclgrind:
rm -rf $(root)/native/oclgrind
distclean_targets += distclean-oclgrind

0 comments on commit 885f17c

Please sign in to comment.