Merge branch 'master' into nvptx_merge

This commit is contained in:
evghenii
2014-07-07 16:30:12 +02:00
29 changed files with 397 additions and 231 deletions

View File

@@ -34,11 +34,41 @@
# ispc Makefile
#
define newline
endef
define WARNING_BODY
============================== !!! WARNING !!! =============================== \n
Location of LLVM files in your PATH is different than path in LLVM_HOME \n
variable (or LLVM_HOME is not set). The most likely this means that you are \n
using default LLVM installation on your system, which is very bad sign. \n
Note, that ISPC uses LLVM optimizer and is highly dependent on it. We recommend \n
using *patched* version of LLVM 3.3 or 3.4. Patches are availible in \n
llvm_patches folder. You can build LLVM manually, or run our scripts, which \n
will do all the work for you. Do the following: \n
1. Create a folder, where LLVM will reside and set LLVM_HOME variable to its \n
path. \n
2. Set ISPC_HOME variable to your ISPC location (probably current folder).
3. Run alloy.py tool to checkout and build LLVM: \n
alloy.py -b --version=3.4 \n
4. Add $$LLVM_HOME/bin-3.4/bin path to your PATH. \n
==============================================================================
endef
# If you have your own special version of llvm and/or clang, change
# these variables to match.
LLVM_CONFIG=$(shell which llvm-config)
CLANG_INCLUDE=$(shell $(LLVM_CONFIG) --includedir)
RIGHT_LLVM = $(WARNING_BODY)
ifdef LLVM_HOME
ifeq ($(findstring $(LLVM_HOME), $(LLVM_CONFIG)), $(LLVM_HOME))
RIGHT_LLVM = LLVM from $$LLVM_HOME is used.
endif
endif
# Enable ARM by request
# To enable: make ARM_ENABLED=1
ARM_ENABLED=0
@@ -56,7 +86,7 @@ endif
ARCH_TYPE = $(shell arch)
LLVM_CXXFLAGS=$(shell $(LLVM_CONFIG) --cppflags)
LLVM_VERSION=LLVM_$(shell $(LLVM_CONFIG) --version | sed -e s/\\./_/ -e s/svn// -e s/\.0//)
LLVM_VERSION=LLVM_$(shell $(LLVM_CONFIG) --version | sed -e 's/svn//' -e 's/\./_/' -e 's/\..*//')
LLVM_VERSION_DEF=-D$(LLVM_VERSION)
LLVM_COMPONENTS = engine ipo bitreader bitwriter instrumentation linker nvptx
@@ -84,7 +114,7 @@ ifeq ($(LLVM_VERSION),LLVM_3_4)
endif
ifeq ($(LLVM_VERSION),LLVM_3_5)
ISPC_LIBS += -lcurses
ISPC_LIBS += -lcurses -lz
endif
ifeq ($(ARCH_OS),Linux)
@@ -188,6 +218,7 @@ llvm_check:
echo "ERROR: llvm-config not found in your PATH"; \
echo "******************************************"; \
echo; exit 1)
@echo -e '$(subst $(newline), ,$(RIGHT_LLVM))'
print_llvm_src: llvm_check
@echo Using LLVM `llvm-config --version` from `llvm-config --libdir`