<commit_before>UNAME = $(shell uname)

THIS_MAKEFILE = $(realpath $(filter %Makefile, $(MAKEFILE_LIST)))
ROOT_DIR = $(strip $(shell dirname $(THIS_MAKEFILE)))

ifeq ($(UNAME), Linux)
CCFLAGS=$(shell python3-config --cflags) -std=c++11 -fPIC
LDFLAGS=$(shell python3-config --ldflags) -lboost_python-py34 -lz
endif

ifeq ($(UNAME), Darwin)
# The /opt includes are in case this is a macports install of python and boost python
CCFLAGS=$(shell python-config --cflags) -I /opt/local/include -std=c++11
LDFLAGS=$(shell python-config --ldflags) -L /opt/local/lib -lboost_python3-mt -lz
endif

NUMPY_PATH=$(shell python3 -c "import numpy; print(numpy.__path__[0] + '/core/include')")

PY_SRCS=$(shell ls $(ROOT_DIR)/python/*.cpp)
PY_OBJS=$(PY_SRCS:$(ROOT_DIR)/python/%.cpp=build/py_%.o)
NUMPY_SRCS=$(shell ls $(ROOT_DIR)/numpy/*.cpp)
NUMPY_OBJS=$(NUMPY_SRCS:$(ROOT_DIR)/numpy/%.cpp=build/numpy_%.o)



build/py_%.o: $(ROOT_DIR)/python/%.cpp
	mkdir -p build
	$(CXX) $(CCFLAGS) -c $< -o $@

build/numpy_%.o: $(ROOT_DIR)/numpy/%.cpp
	mkdir -p build
	$(CXX) $(CCFLAGS) -I $(NUMPY_PATH) -c $< -o $@

build/halide.so: $(PY_SRCS) $(PY_OBJS) $(NUMPY_SRCS) $(NUMPY_OBJS)
	mkdir -p build
	$(CXX) $(PY_OBJS) $(NUMPY_OBJS) $(LDFLAGS) ../bin/libHalide.a -shared -o $@

clean:
	rm -rf build

test: build/halide.so
	$(ROOT_DIR)/run_apps.sh
	$(ROOT_DIR)/run_tutorial.sh<commit_msg>Fix location of libHalide.a in python makefile<commit_after>UNAME = $(shell uname)

THIS_MAKEFILE = $(realpath $(filter %Makefile, $(MAKEFILE_LIST)))
ROOT_DIR = $(strip $(shell dirname $(THIS_MAKEFILE)))

ifeq ($(UNAME), Linux)
CCFLAGS=$(shell python3-config --cflags) -std=c++11 -fPIC
LDFLAGS=$(shell python3-config --ldflags) -lboost_python-py34 -lz
endif

ifeq ($(UNAME), Darwin)
# The /opt includes are in case this is a macports install of python and boost python
CCFLAGS=$(shell python-config --cflags) -I /opt/local/include -std=c++11
LDFLAGS=$(shell python-config --ldflags) -L /opt/local/lib -lboost_python3-mt -lz
endif

NUMPY_PATH=$(shell python3 -c "import numpy; print(numpy.__path__[0] + '/core/include')")

PY_SRCS=$(shell ls $(ROOT_DIR)/python/*.cpp)
PY_OBJS=$(PY_SRCS:$(ROOT_DIR)/python/%.cpp=build/py_%.o)
NUMPY_SRCS=$(shell ls $(ROOT_DIR)/numpy/*.cpp)
NUMPY_OBJS=$(NUMPY_SRCS:$(ROOT_DIR)/numpy/%.cpp=build/numpy_%.o)



build/py_%.o: $(ROOT_DIR)/python/%.cpp
	mkdir -p build
	$(CXX) $(CCFLAGS) -c $< -o $@

build/numpy_%.o: $(ROOT_DIR)/numpy/%.cpp
	mkdir -p build
	$(CXX) $(CCFLAGS) -I $(NUMPY_PATH) -c $< -o $@

build/halide.so: $(PY_SRCS) $(PY_OBJS) $(NUMPY_SRCS) $(NUMPY_OBJS)
	mkdir -p build
	$(CXX) $(PY_OBJS) $(NUMPY_OBJS) $(LDFLAGS) ../lib/libHalide.a -shared -o $@

clean:
	rm -rf build

test: build/halide.so
	$(ROOT_DIR)/run_apps.sh
	$(ROOT_DIR)/run_tutorial.sh
{'fraction_non_alphanumeric': 0.1969421186749181, 'fraction_numerical': 0.008008736803785948, 'mean_word_length': 4.822033898305085, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6477894', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1115, 'n_words': 241}