<commit_before>AF_PATH ?= /opt/arrayfire
CUDA_PATH ?= /usr/local/cuda/
OCL_PATH ?= $(AF_PATH)

ifneq ($(shell uname), Linux)
$(error Only Linux supported for Java)
endif

ifeq ($(shell uname -m), x86_64)
  LIB:=lib64
else
  LIB:=lib
endif

AF_CFLAGS	= -I$(AF_PATH)/include
AF_CFLAGS      += -I$(JAVA_HOME)/include
AF_CFLAGS      += -I$(JAVA_HOME)/include/linux
AF_LIB_PATH	= $(AF_PATH)/$(LIB)/
AF_JAVA_PATH	= $(shell pwd)
AF_JAVA_LIB	= $(AF_JAVA_PATH)/$(LIB)/libaf_java.so

ifeq ($(findstring opencl, $(MAKECMDGOALS)), opencl)
	AF_CFLAGS += -DAFCL -I$(OCL_PATH)/include
	AF=afcl
	AF_JAVA_LIB_EXT=$(patsubst %.so, %_ocl.so, $(AF_JAVA_LIB))
else
	AF_CFLAGS += -I$(CUDA_PATH)/include
	AF=afcu
	AF_JAVA_LIB_EXT=$(patsubst %.so, %_cuda.so, $(AF_JAVA_LIB))
endif

cuda: all

opencl: all

all: $(AF_JAVA_LIB)

$(AF_JAVA_LIB): $(AF_JAVA_LIB_EXT)
	cp $(AF_JAVA_LIB_EXT) $(AF_JAVA_LIB)

$(AF_JAVA_LIB_EXT): $(AF_JAVA_PATH)/src/java_wrapper.cpp
	gcc -shared -fPIC $< $(AF_CFLAGS) -L$(AF_LIB_PATH) -l$(AF) -o $@

clean:
	rm -f lib/*.so lib64/*.so<commit_msg>Copy necessary libaf*.so files to $(LIB)<commit_after>AF_PATH ?= /opt/arrayfire
CUDA_PATH ?= /usr/local/cuda/
OCL_PATH ?= $(AF_PATH)

ifneq ($(shell uname), Linux)
$(error Only Linux supported for Java)
endif

ifeq ($(shell uname -m), x86_64)
  LIB:=lib64
else
  LIB:=lib
endif

AF_CFLAGS	= -I$(AF_PATH)/include
AF_CFLAGS      += -I$(JAVA_HOME)/include
AF_CFLAGS      += -I$(JAVA_HOME)/include/linux
AF_LIB_PATH	= $(AF_PATH)/$(LIB)/
AF_JAVA_PATH	= $(shell pwd)
AF_JAVA_LIB	= $(AF_JAVA_PATH)/$(LIB)/libaf_java.so

ifeq ($(findstring opencl, $(MAKECMDGOALS)), opencl)
	AF_CFLAGS += -DAFCL -I$(OCL_PATH)/include
	AF=afcl
	AF_JAVA_LIB_EXT=$(patsubst %.so, %_ocl.so, $(AF_JAVA_LIB))
else
	AF_CFLAGS += -I$(CUDA_PATH)/include
	AF=afcu
	AF_JAVA_LIB_EXT=$(patsubst %.so, %_cuda.so, $(AF_JAVA_LIB))
endif

cuda: all

opencl: all

all: $(AF_JAVA_LIB)

$(AF_JAVA_LIB): $(AF_JAVA_LIB_EXT)
	cp $(AF_JAVA_LIB_EXT) $(AF_JAVA_LIB)
	cp $(AF_LIB_PATH)/lib$(AF).so $(AF_JAVA_PATH)/$(LIB)

$(AF_JAVA_LIB_EXT): $(AF_JAVA_PATH)/src/java_wrapper.cpp
	gcc -shared -fPIC $< $(AF_CFLAGS) -L$(AF_LIB_PATH) -l$(AF) -o $@

clean:
	rm -f lib/*.so lib64/*.so
{'fraction_non_alphanumeric': 0.18407731247123793, 'fraction_numerical': 0.007363092498849517, 'mean_word_length': 5.072625698324022, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5761548', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1005, 'n_words': 179}