Skip to content

Commit

Permalink
parent a239951
Browse files Browse the repository at this point in the history
author Steven Johnson <[email protected]> 1600463221 -0700
committer Steven Johnson <[email protected]> 1600973808 -0700

Require C++17 for Halide.

(We previously required C++11, although Make builds typically ended up using C++14 due to `llvm-config --cxxflags` specifying it.)
  • Loading branch information
steven-johnson committed Sep 24, 2020
1 parent a239951 commit 33b96df
Show file tree
Hide file tree
Showing 74 changed files with 196 additions and 196 deletions.
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ endif ()
# Export all symbols on Windows to match GCC/Clang behavior on Linux/macOS
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

# Require standard C++14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Require standard C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)

# MSVC won't set __cplusplus correctly unless this flag is also set
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:-Zc:__cplusplus>)

##
# Import dependencies
Expand Down
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ LLVM_GIT_LLD_INCLUDE_DIR = $(shell $(LLVM_CONFIG) --src-root | sed -e 's/\\/\//g
LLVM_SYSTEM_LIBS=$(shell ${LLVM_CONFIG} --system-libs --link-static | sed -e 's/[\/&]/\\&/g')
LLVM_AS = $(LLVM_BINDIR)/llvm-as
LLVM_NM = $(LLVM_BINDIR)/llvm-nm
LLVM_CXX_FLAGS = -std=c++11 $(filter-out -O% -g -fomit-frame-pointer -pedantic -W% -W, $(shell $(LLVM_CONFIG) --cxxflags | sed -e 's/\\/\//g' -e 's/\([a-zA-Z]\):/\/\1/g;s/-D/ -D/g;s/-O/ -O/g')) -I$(LLVM_GIT_LLD_INCLUDE_DIR)
LLVM_CXX_FLAGS = -std=c++17 $(filter-out -O% -g -fomit-frame-pointer -pedantic -W% -W, $(shell $(LLVM_CONFIG) --cxxflags | sed -e 's/\\/\//g' -e 's/\([a-zA-Z]\):/\/\1/g;s/-D/ -D/g;s/-O/ -O/;s/c++14/c++17/g')) -I$(LLVM_GIT_LLD_INCLUDE_DIR)
OPTIMIZE ?= -O3
OPTIMIZE_FOR_BUILD_TIME ?= -O0

Expand Down Expand Up @@ -246,7 +246,7 @@ LLVM_SHARED_LIBS = -Wl,-rpath=$(LLVM_LIBDIR) -L $(LLVM_LIBDIR) -lLLVM

LLVM_LIBS_FOR_SHARED_LIBHALIDE=$(if $(WITH_LLVM_INSIDE_SHARED_LIBHALIDE),$(LLVM_STATIC_LIBS),$(LLVM_SHARED_LIBS))

TUTORIAL_CXX_FLAGS ?= -std=c++11 -g -fno-omit-frame-pointer $(RTTI_CXX_FLAGS) -I $(ROOT_DIR)/tools $(SANITIZER_FLAGS) $(LLVM_CXX_FLAGS_LIBCPP)
TUTORIAL_CXX_FLAGS ?= -std=c++17 -g -fno-omit-frame-pointer $(RTTI_CXX_FLAGS) -I $(ROOT_DIR)/tools $(SANITIZER_FLAGS) $(LLVM_CXX_FLAGS_LIBCPP)
# The tutorials contain example code with warnings that we don't want
# to be flagged as errors, so the test flags are the tutorial flags
# plus our warning flags.
Expand Down Expand Up @@ -934,8 +934,8 @@ $(INCLUDE_DIR)/Halide.h: $(SRC_DIR)/../LICENSE.txt $(HEADERS) $(BIN_DIR)/build_h
$(BIN_DIR)/build_halide_h $(SRC_DIR)/../LICENSE.txt $(HEADERS) > $(INCLUDE_DIR)/Halide.h
# Also generate a precompiled version in the same folder so that anything compiled with a compatible set of flags can use it
@mkdir -p $(INCLUDE_DIR)/Halide.h.gch
$(CXX) -std=c++11 $(TEST_CXX_FLAGS) -I$(ROOT_DIR) $(OPTIMIZE) -x c++-header $(INCLUDE_DIR)/Halide.h -o $(INCLUDE_DIR)/Halide.h.gch/Halide.default.gch
$(CXX) -std=c++11 $(TEST_CXX_FLAGS) -I$(ROOT_DIR) $(OPTIMIZE_FOR_BUILD_TIME) -x c++-header $(INCLUDE_DIR)/Halide.h -o $(INCLUDE_DIR)/Halide.h.gch/Halide.test.gch
$(CXX) -std=c++17 $(TEST_CXX_FLAGS) -I$(ROOT_DIR) $(OPTIMIZE) -x c++-header $(INCLUDE_DIR)/Halide.h -o $(INCLUDE_DIR)/Halide.h.gch/Halide.default.gch
$(CXX) -std=c++17 $(TEST_CXX_FLAGS) -I$(ROOT_DIR) $(OPTIMIZE_FOR_BUILD_TIME) -x c++-header $(INCLUDE_DIR)/Halide.h -o $(INCLUDE_DIR)/Halide.h.gch/Halide.test.gch

$(INCLUDE_DIR)/HalideRuntime%: $(SRC_DIR)/runtime/HalideRuntime%
echo Copying $<
Expand All @@ -959,7 +959,7 @@ $(INCLUDE_DIR)/HalidePyTorchCudaHelpers.h: $(SRC_DIR)/runtime/HalidePyTorchCudaH

$(BIN_DIR)/build_halide_h: $(ROOT_DIR)/tools/build_halide_h.cpp
@-mkdir -p $(@D)
$(CXX) -std=c++11 $< -o $@
$(CXX) -std=c++17 $< -o $@

-include $(OBJECTS:.o=.d)
-include $(INITIAL_MODULES:.o=.d)
Expand All @@ -973,7 +973,7 @@ RUNTIME_TRIPLE_64 = "le64-unknown-unknown-unknown"
RUNTIME_TRIPLE_WIN_32 = "i386-unknown-unknown-unknown"
RUNTIME_TRIPLE_WIN_64 = "x86_64-unknown-windows-unknown"

# -std=gnu++98 is deliberate; we do NOT want c++11 here,
# -std=gnu++98 is deliberate; we do NOT want c++17 here,
# as we don't want static locals to get thread synchronization stuff.
RUNTIME_CXX_FLAGS = -O3 -fno-vectorize -ffreestanding -fno-blocks -fno-exceptions -fno-unwind-tables -std=gnu++98

Expand Down Expand Up @@ -1500,7 +1500,7 @@ $(FILTERS_DIR)/external_code.halide_generated.cpp: $(BIN_DIR)/external_code.gene
@mkdir -p $(@D)
$(CURDIR)/$< -g external_code -e c_source -o $(CURDIR)/$(FILTERS_DIR) target=$(TARGET)-no_runtime external_code_is_bitcode=false

$(FILTERS_DIR)/autograd_grad.a: $(BIN_DIR)/autograd.generator $(DISTRIB_DIR)/lib/libautoschedule_mullapudi2016.$(SHARED_EXT)
$(FILTERS_DIR)/autograd_grad.a: $(BIN_DIR)/autograd.generator $(DISTRIB_DIR)/lib/libautoschedule_mullapudi2016.$(SHARED_EXT)
@mkdir -p $(@D)
# FIXME: The autoscheduler looks for libHalide in the same
# directory, which is normally a distro. But the generator
Expand Down Expand Up @@ -1630,7 +1630,7 @@ $(FILTERS_DIR)/%.registration.o: $(FILTERS_DIR)/%.registration.cpp

$(FILTERS_DIR)/%.rungen: $(BUILD_DIR)/RunGenMain.o $(BIN_DIR)/$(TARGET)/runtime.a $(FILTERS_DIR)/%.registration.o $(FILTERS_DIR)/%.a
@mkdir -p $(@D)
$(CXX) -std=c++11 -I$(FILTERS_DIR) \
$(CXX) -std=c++17 -I$(FILTERS_DIR) \
$(BUILD_DIR)/RunGenMain.o \
$(BIN_DIR)/$(TARGET)/runtime.a \
$(call alwayslink,$(FILTERS_DIR)/$*.registration.o) \
Expand Down Expand Up @@ -1686,7 +1686,7 @@ $(FILTERS_DIR)/multi_rungen: $(BUILD_DIR)/RunGenMain.o $(BIN_DIR)/$(TARGET)/runt
$(FILTERS_DIR)/cxx_mangling.registration.o $(FILTERS_DIR)/cxx_mangling.a \
$(FILTERS_DIR)/pyramid.registration.o $(FILTERS_DIR)/pyramid.a
@mkdir -p $(@D)
$(CXX) -std=c++11 -I$(FILTERS_DIR) \
$(CXX) -std=c++17 -I$(FILTERS_DIR) \
$(BUILD_DIR)/RunGenMain.o \
$(BIN_DIR)/$(TARGET)/runtime.a \
$(call alwayslink,$(FILTERS_DIR)/blur2x2.registration.o) \
Expand All @@ -1707,7 +1707,7 @@ $(FILTERS_DIR)/multi_rungen2: $(BUILD_DIR)/RunGenMain.o $(BIN_DIR)/$(TARGET)/run
$(FILTERS_DIR)/cxx_mangling.a \
$(FILTERS_DIR)/pyramid.a
@mkdir -p $(@D)
$(CXX) -std=c++11 -I$(FILTERS_DIR) $^ $(GEN_AOT_LD_FLAGS) $(IMAGE_IO_LIBS) -o $@
$(CXX) -std=c++17 -I$(FILTERS_DIR) $^ $(GEN_AOT_LD_FLAGS) $(IMAGE_IO_LIBS) -o $@

$(BIN_DIR)/tutorial_%: $(ROOT_DIR)/tutorial/%.cpp $(BIN_DIR)/libHalide.$(SHARED_EXT) $(INCLUDE_DIR)/Halide.h $(INCLUDE_DIR)/HalideRuntime.h
@ if [[ $@ == *_run ]]; then \
Expand Down Expand Up @@ -1761,7 +1761,7 @@ $(BIN_DIR)/tutorial_lesson_21_auto_scheduler_generate: $(ROOT_DIR)/tutorial/less
# ...in that order.
LESSON_21_MACHINE_PARAMS = 32,16777216,40

$(BIN_DIR)/tutorial_lesson_21_auto_scheduler_run: $(ROOT_DIR)/tutorial/lesson_21_auto_scheduler_run.cpp $(BIN_DIR)/tutorial_lesson_21_auto_scheduler_generate $(DISTRIB_DIR)/lib/libautoschedule_mullapudi2016.$(SHARED_EXT)
$(BIN_DIR)/tutorial_lesson_21_auto_scheduler_run: $(ROOT_DIR)/tutorial/lesson_21_auto_scheduler_run.cpp $(BIN_DIR)/tutorial_lesson_21_auto_scheduler_generate $(DISTRIB_DIR)/lib/libautoschedule_mullapudi2016.$(SHARED_EXT)
@-mkdir -p $(TMP_DIR)
# Run the generator
$(BIN_DIR)/tutorial_lesson_21_auto_scheduler_generate -g auto_schedule_gen -o $(TMP_DIR) -e static_library,c_header,schedule -f auto_schedule_false target=host auto_schedule=false
Expand Down Expand Up @@ -1872,7 +1872,7 @@ test_adams2019: distrib
test_li2018: distrib build_python_bindings
$(MAKE) -f $(SRC_DIR)/autoschedulers/li2018/Makefile test \
HALIDE_DISTRIB_PATH=$(CURDIR)/$(DISTRIB_DIR) \
HALIDE_PYTHON_BINDINGS_PATH=$(CURDIR)/$(BIN_DIR)/python3_bindings
HALIDE_PYTHON_BINDINGS_PATH=$(CURDIR)/$(BIN_DIR)/python3_bindings

time_compilation_test_%: $(BIN_DIR)/test_%
$(TIME_COMPILATION) compile_times_correctness.csv make -f $(THIS_MAKEFILE) $(@:time_compilation_test_%=test_%)
Expand Down Expand Up @@ -2235,10 +2235,10 @@ $(DISTRIB_DIR)/halide.tgz: distrib
mv $(BUILD_DIR)/halide.tgz $(DISTRIB_DIR)/halide.tgz

$(BIN_DIR)/HalideTraceViz: $(ROOT_DIR)/util/HalideTraceViz.cpp $(INCLUDE_DIR)/HalideRuntime.h $(ROOT_DIR)/tools/halide_image_io.h $(ROOT_DIR)/tools/halide_trace_config.h
$(CXX) $(OPTIMIZE) -std=c++11 $(filter %.cpp,$^) -I$(INCLUDE_DIR) -I$(ROOT_DIR)/tools -L$(BIN_DIR) -o $@
$(CXX) $(OPTIMIZE) -std=c++17 $(filter %.cpp,$^) -I$(INCLUDE_DIR) -I$(ROOT_DIR)/tools -L$(BIN_DIR) -o $@

$(BIN_DIR)/HalideTraceDump: $(ROOT_DIR)/util/HalideTraceDump.cpp $(ROOT_DIR)/util/HalideTraceUtils.cpp $(INCLUDE_DIR)/HalideRuntime.h $(ROOT_DIR)/tools/halide_image_io.h
$(CXX) $(OPTIMIZE) -std=c++11 $(filter %.cpp,$^) -I$(INCLUDE_DIR) -I$(ROOT_DIR)/tools -I$(ROOT_DIR)/src/runtime -L$(BIN_DIR) $(IMAGE_IO_CXX_FLAGS) $(IMAGE_IO_LIBS) -o $@
$(CXX) $(OPTIMIZE) -std=c++17 $(filter %.cpp,$^) -I$(INCLUDE_DIR) -I$(ROOT_DIR)/tools -I$(ROOT_DIR)/src/runtime -L$(BIN_DIR) $(IMAGE_IO_CXX_FLAGS) $(IMAGE_IO_LIBS) -o $@

# Run clang-format on most of the source. The tutorials directory is
# explicitly skipped, as those files are manually formatted to
Expand Down
4 changes: 2 additions & 2 deletions README_cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ boilerplate.
cmake_minimum_required(VERSION 3.16)
project(HalideExample)
set(CMAKE_CXX_STANDARD 11) # or newer
set(CMAKE_CXX_STANDARD 17) # or newer
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
Expand All @@ -530,7 +530,7 @@ immediately after setting the minimum version.

The next three variables set the project-wide C++ standard. The first,
[`CMAKE_CXX_STANDARD`][cmake_cxx_standard], simply sets the standard version.
Halide requires at least C++11. The second,
Halide requires at least c++17. The second,
[`CMAKE_CXX_STANDARD_REQUIRED`][cmake_cxx_standard_required], tells CMake to
fail if the compiler cannot provide the requested standard version. Lastly,
[`CMAKE_CXX_EXTENSIONS`][cmake_cxx_extensions] tells CMake to disable
Expand Down
4 changes: 2 additions & 2 deletions apps/HelloAndroid/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.apache.tools.ant.taskdefs.condition.Os

// Avoid conflicts with Bazel on case-insensitive filesystems
buildDir = 'gradle_build'
buildDir = 'gradle_build'

repositories {
jcenter()
Expand Down Expand Up @@ -51,7 +51,7 @@ sources {
executables {
hello_generator {
binaries.all {
cppCompiler.args "-std=c++11", "-g", "-Wall", "-fno-rtti", "-I", "${projectDir}/../../include", "-I", "${projectDir}/../../build/include"
cppCompiler.args "-std=c++17", "-g", "-Wall", "-fno-rtti", "-I", "${projectDir}/../../include", "-I", "${projectDir}/../../build/include"
// "/bin" assumes Makefile build for Halide; "/build/lib" assumes CMake build
linker.args "-lHalide", "-ldl", "-lpthread", "-lz", "-L", "${projectDir}/../../bin", "-L", "${projectDir}/../../build/lib"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/HelloAndroid/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
android update project -p . --target android-17
mkdir -p bin
c++ jni/hello_generator.cpp ../../tools/GenGen.cpp \
-g -fno-rtti -Wall -std=c++11 \
-g -fno-rtti -Wall -std=c++17 \
-I ../../include -I ../../build/include \
-L ../../bin -lHalide -ldl -lpthread -lz \
-o bin/hello_generator
Expand Down
2 changes: 1 addition & 1 deletion apps/HelloAndroid/jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
APP_ABI := armeabi armeabi-v7a arm64-v8a mips x86_64 x86
APP_PLATFORM := android-17
APP_STL := gnustl_static
APP_CPPFLAGS := -std=c++11
APP_CPPFLAGS := -std=c++17
4 changes: 2 additions & 2 deletions apps/HelloAndroidCamera2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.apache.tools.ant.taskdefs.condition.Os

// Avoid conflicts with Bazel on case-insensitive filesystems
buildDir = 'gradle_build'
buildDir = 'gradle_build'

repositories {
jcenter()
Expand Down Expand Up @@ -56,7 +56,7 @@ sources {
executables {
halide_generator {
binaries.all {
cppCompiler.args "-std=c++11", "-g", "-Wall", "-fno-rtti", "-I", "${projectDir}/../../include", "-I", "${projectDir}/../../build/include"
cppCompiler.args "-std=c++17", "-g", "-Wall", "-fno-rtti", "-I", "${projectDir}/../../include", "-I", "${projectDir}/../../build/include"
// "/bin" assumes Makefile build for Halide; "/build/lib" assumes CMake build
linker.args "-lHalide", "-ldl", "-lpthread", "-lz", "-L", "${projectDir}/../../bin", "-L", "${projectDir}/../../build/lib"
}
Expand Down
4 changes: 2 additions & 2 deletions apps/HelloAndroidCamera2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ fi
mkdir -p bin

c++ jni/edge_detect_generator.cpp ../../tools/GenGen.cpp \
-g -fno-rtti -Wall -std=c++11 \
-g -fno-rtti -Wall -std=c++17 \
-I ../../include -I ../../build/include \
-L ../../bin -lHalide -ldl -lpthread -lz \
-o bin/edge_detect_generator

c++ jni/deinterleave_generator.cpp ../../tools/GenGen.cpp \
-g -fno-rtti -Wall -std=c++11 \
-g -fno-rtti -Wall -std=c++17 \
-I ../../include -I ../../build/include \
-L ../../bin -lHalide -ldl -lpthread -lz \
-o bin/deinterleave_generator
Expand Down
2 changes: 1 addition & 1 deletion apps/HelloAndroidCamera2/jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
APP_ABI := armeabi armeabi-v7a arm64-v8a mips x86_64 x86
APP_PLATFORM := android-21
APP_STL := c++_static
APP_CPPFLAGS := -std=c++11 -fno-rtti -fexceptions
APP_CPPFLAGS := -std=c++17 -fno-rtti -fexceptions
2 changes: 1 addition & 1 deletion apps/HelloAndroidGL/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e
android update project -p . --target android-17
cd jni
c++ -std=c++11 halide_gl_filter.cpp -L ../../../bin -lHalide -I ../../../include -ldl -lpthread -lz
c++ -std=c++17 halide_gl_filter.cpp -L ../../../bin -lHalide -I ../../../include -ldl -lpthread -lz
HL_TARGET=arm-32-android-opengl-debug DYLD_LIBRARY_PATH=../../../bin LD_LIBRARY_PATH=../../../bin ./a.out
cd ..
pwd
Expand Down
9 changes: 5 additions & 4 deletions apps/HelloPyTorch/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ def generate_pybind_wrapper(path, headers, has_cuda):
s += "#define HL_PT_CUDA\n"
s += "#include \"HalidePyTorchHelpers.h\"\n"
for h in headers:
s += "#include \"{}\"\n".format(os.path.splitext(h)[0]+".pytorch.h")
s += "#include \"{}\"\n".format(os.path.splitext(h)[0] + ".pytorch.h")
if has_cuda:
s += "#undef HL_PT_CUDA\n"

s += "\nPYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {\n"
for h in headers:
name = os.path.splitext(h)[0]
s += " m.def(\"{}\", &{}_th_, \"PyTorch wrapper of the Halide pipeline {}\");\n".format(
name, name, name)
name, name, name)
s += "}\n"
with open(path, 'w') as fid:
fid.write(s)
Expand All @@ -46,7 +46,7 @@ def generate_pybind_wrapper(path, headers, has_cuda):
has_cuda = True

include_dirs = [build_dir, os.path.join(halide_dir, "include")]
compile_args = ["-std=c++11", "-g"]
compile_args = ["-std=c++17", "-g"]
if platform.system() == "Darwin": # on osx libstdc++ causes trouble
compile_args += ["-stdlib=libc++"]

Expand Down Expand Up @@ -79,7 +79,8 @@ def generate_pybind_wrapper(path, headers, has_cuda):
extension = CUDAExtension(ext_name, sources,
include_dirs=include_dirs,
extra_objects=hl_libs,
libraries=["cuda"], # Halide ops need the full cuda lib, not just the RT library
# Halide ops need the full cuda lib, not just the RT library
libraries=["cuda"],
extra_compile_args=compile_args)
else:
print("Generating CPU wrapper")
Expand Down
2 changes: 1 addition & 1 deletion apps/HelloiOS/HelloiOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "echo \"${SRCROOT}\"\ncd \"${SRCROOT}/HelloiOS\"\n\n# Echoing commands to output makes it easier to debug XCode failures.\n# Failure on undefined vars is always a good idea.\nset -ex\n\n# xcode puts all sorts of junk in the environment which\n# prevents building a binary for osx (instead of ios).\n# sudo'ing to yourself gives a fresh environment.\nsudo -u ${USER} \\\nc++ reaction_diffusion_2_generator.cpp ${SRCROOT}/../../tools/GenGen.cpp \\\n-std=c++11 \\\n-fno-rtti \\\n-I ${SRCROOT}/../../include \\\n-I ${SRCROOT}/../../build/include \\\n-I ${SRCROOT}/../../tools \\\n-arch x86_64 \\\n-L ${SRCROOT}/../../bin \\\n-lHalide \\\n-o ${DERIVED_FILE_DIR}/reaction_diffusion_2_generator\n\n\nif [ \"${arch}\" == \"x86_64\" ]\nthen\n# assume simulator, which requires osx rather than ios\nTARGET=x86-64-osx\nelse\n# TODO: sniff arm-32 builds here; for now, just assume arm-64 only\nTARGET=arm-64-ios\nfi\n\nfor GEN in init update render; do\n(cd ${DERIVED_FILE_DIR}; \\\nDYLD_LIBRARY_PATH=${SRCROOT}/../../bin:${SRCROOT}/../../build/lib \\\n./reaction_diffusion_2_generator -g reaction_diffusion_2_${GEN} -f reaction_diffusion_2_${GEN} -n reaction_diffusion_2_${GEN} -o ${DERIVED_FILE_DIR} target=${TARGET}-user_context)\ndone\n\nfor GEN in init update render; do\n(cd ${DERIVED_FILE_DIR}; \\\nDYLD_LIBRARY_PATH=${SRCROOT}/../../bin:${SRCROOT}/../../build/lib \\\n./reaction_diffusion_2_generator -g reaction_diffusion_2_${GEN} -f reaction_diffusion_2_metal_${GEN} -n reaction_diffusion_2_metal_${GEN} -o ${DERIVED_FILE_DIR} target=${TARGET}-metal-user_context)\ndone\n";
shellScript = "echo \"${SRCROOT}\"\ncd \"${SRCROOT}/HelloiOS\"\n\n# Echoing commands to output makes it easier to debug XCode failures.\n# Failure on undefined vars is always a good idea.\nset -ex\n\n# xcode puts all sorts of junk in the environment which\n# prevents building a binary for osx (instead of ios).\n# sudo'ing to yourself gives a fresh environment.\nsudo -u ${USER} \\\nc++ reaction_diffusion_2_generator.cpp ${SRCROOT}/../../tools/GenGen.cpp \\\n-std=c++17 \\\n-fno-rtti \\\n-I ${SRCROOT}/../../include \\\n-I ${SRCROOT}/../../build/include \\\n-I ${SRCROOT}/../../tools \\\n-arch x86_64 \\\n-L ${SRCROOT}/../../bin \\\n-lHalide \\\n-o ${DERIVED_FILE_DIR}/reaction_diffusion_2_generator\n\n\nif [ \"${arch}\" == \"x86_64\" ]\nthen\n# assume simulator, which requires osx rather than ios\nTARGET=x86-64-osx\nelse\n# TODO: sniff arm-32 builds here; for now, just assume arm-64 only\nTARGET=arm-64-ios\nfi\n\nfor GEN in init update render; do\n(cd ${DERIVED_FILE_DIR}; \\\nDYLD_LIBRARY_PATH=${SRCROOT}/../../bin:${SRCROOT}/../../build/lib \\\n./reaction_diffusion_2_generator -g reaction_diffusion_2_${GEN} -f reaction_diffusion_2_${GEN} -n reaction_diffusion_2_${GEN} -o ${DERIVED_FILE_DIR} target=${TARGET}-user_context)\ndone\n\nfor GEN in init update render; do\n(cd ${DERIVED_FILE_DIR}; \\\nDYLD_LIBRARY_PATH=${SRCROOT}/../../bin:${SRCROOT}/../../build/lib \\\n./reaction_diffusion_2_generator -g reaction_diffusion_2_${GEN} -f reaction_diffusion_2_metal_${GEN} -n reaction_diffusion_2_metal_${GEN} -o ${DERIVED_FILE_DIR} target=${TARGET}-metal-user_context)\ndone\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
5 changes: 4 additions & 1 deletion apps/bgu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ project(bgu)
enable_testing()

# Set up language settings
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)

# MSVC won't set __cplusplus correctly unless this flag is also set
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:-Zc:__cplusplus>)

# Find Halide
find_package(Halide REQUIRED)

Expand Down
5 changes: 4 additions & 1 deletion apps/bilateral_grid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ project(bilateral_grid)
enable_testing()

# Set up language settings
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)

# MSVC won't set __cplusplus correctly unless this flag is also set
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:-Zc:__cplusplus>)

# Find Halide
find_package(Halide REQUIRED)

Expand Down
5 changes: 4 additions & 1 deletion apps/blur/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ project(blur)
enable_testing()

# Set up language settings
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)

# MSVC won't set __cplusplus correctly unless this flag is also set
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:-Zc:__cplusplus>)

# Find Halide
find_package(Halide REQUIRED)
find_package(OpenMP)
Expand Down
5 changes: 4 additions & 1 deletion apps/c_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ project(c_backend)
enable_testing()

# Set up language settings
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)

# MSVC won't set __cplusplus correctly unless this flag is also set
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:-Zc:__cplusplus>)

# Find Halide
find_package(Halide REQUIRED)

Expand Down
5 changes: 4 additions & 1 deletion apps/camera_pipe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ project(camera_pipe)
enable_testing()

# Set up language settings
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)

# MSVC won't set __cplusplus correctly unless this flag is also set
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:-Zc:__cplusplus>)

# Find Halide
find_package(Halide REQUIRED)

Expand Down
5 changes: 4 additions & 1 deletion apps/conv_layer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ project(conv_layer)
enable_testing()

# Set up language settings
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)

# MSVC won't set __cplusplus correctly unless this flag is also set
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:-Zc:__cplusplus>)

# Find Halide
find_package(Halide REQUIRED)

Expand Down
Loading

0 comments on commit 33b96df

Please sign in to comment.