<commit_before>ROOT=../../..

CXX=g++
CXXFLAGS=-std=c++11 -Wall -Wno-unknown-pragmas -fPIC
INCLUDES=-I $(ROOT)/eigen3 -I $(ROOT)/libfastsparse
LDFLAGS=-lm -lopenblas -lpthread

LIBOBJS = mvnormal.o chol.o linop.o noisemodels.o session.o gen_random.o model.o result.o
LIBOBJS += matrix_io.o macauoneprior.o spikeandslab.o macauprior.o normalprior.o data.o
LIBOBJS += ini.o INIReader.o
LIBOBJS += counters.o
LIBSMURFF = libsmurff-cpp.a

.PHONY: all clean smurff tests bench_nrandn bench_wishart bench_mvnormal

all: smurff

clean:
	rm -f *.o *.a smurff tests bench_nrandn bench_wishart bench_mvnormal

smurff: $(LIBSMURFF) cmd_session.o
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(ROOT)/smurff-cpp/smurff.cpp $(LIBSMURFF) $(LDFLAGS) cmd_session.o -o $@

tests: $(LIBSMURFF)
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(ROOT)/smurff-cpp/tests.cpp $(LIBSMURFF) $(LDFLAGS) -o $@

bench_nrandn:
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(ROOT)/smurff-cpp/mvnormal.cpp $(LDFLAGS) -DTEST -DTEST_MVNORMAL -DBENCH -DBENCH_NRANDN -o $@

bench_wishart:
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(ROOT)/smurff-cpp/mvnormal.cpp $(LDFLAGS) -DTEST -DTEST_MVNORMAL -DBENCH -DBENCH_COND_NORMALWISHART -DBENCH_NORMAL_WISHART -o $@

bench_mvnormal:
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(ROOT)/smurff-cpp/mvnormal.cpp $(LDFLAGS) -DTEST -DTEST_MVNORMAL -DBENCH -DBENCH_MVNORMAL -o $@

$(LIBSMURFF): $(LIBOBJS)
	ar -rcs $(LIBSMURFF) $(LIBOBJS)

%.o : $(ROOT)/smurff-cpp/%.cpp
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@

%.o : $(ROOT)/smurff-cpp/%.c
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
<commit_msg>Remove extra preprocessor arguments from bench target<commit_after>ROOT=../../..

CXX=g++
CXXFLAGS=-std=c++11 -Wall -Wno-unknown-pragmas -fPIC
INCLUDES=-I $(ROOT)/eigen3 -I $(ROOT)/libfastsparse
LDFLAGS=-lm -lopenblas -lpthread

LIBOBJS = mvnormal.o chol.o linop.o noisemodels.o session.o gen_random.o model.o result.o
LIBOBJS += matrix_io.o macauoneprior.o spikeandslab.o macauprior.o normalprior.o data.o
LIBOBJS += ini.o INIReader.o
LIBOBJS += counters.o
LIBSMURFF = libsmurff-cpp.a

.PHONY: all clean smurff tests bench_nrandn bench_wishart bench_mvnormal

all: smurff

clean:
	rm -f *.o *.a smurff tests bench_nrandn bench_wishart bench_mvnormal

smurff: $(LIBSMURFF) cmd_session.o
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(ROOT)/smurff-cpp/smurff.cpp $(LIBSMURFF) $(LDFLAGS) cmd_session.o -o $@

tests: $(LIBSMURFF)
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(ROOT)/smurff-cpp/tests.cpp $(LIBSMURFF) $(LDFLAGS) -o $@

bench_nrandn:
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(ROOT)/smurff-cpp/mvnormal.cpp $(LDFLAGS) -DBENCH -DBENCH_NRANDN -o $@

bench_wishart:
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(ROOT)/smurff-cpp/mvnormal.cpp $(LDFLAGS) -DBENCH -DBENCH_COND_NORMALWISHART -DBENCH_NORMAL_WISHART -o $@

bench_mvnormal:
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(ROOT)/smurff-cpp/mvnormal.cpp $(LDFLAGS) -DBENCH -DBENCH_MVNORMAL -o $@

$(LIBSMURFF): $(LIBOBJS)
	ar -rcs $(LIBSMURFF) $(LIBOBJS)

%.o : $(ROOT)/smurff-cpp/%.cpp
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@

%.o : $(ROOT)/smurff-cpp/%.c
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@

{'fraction_non_alphanumeric': 0.18420190101606032, 'fraction_numerical': 0.0019665683382497543, 'mean_word_length': 4.76937618147448, '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': '4655244', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1335, 'n_words': 260}