<commit_before>
# mpicxx must be on your path to build newsyn.  
#  on googoo, this means that /usr/local/mpich2-1.0.2/bin must be on your path.
#  on issdm, it's /usr/local/mpich2/bin.

# Hook for extra -I options, etc.
EXTRA_CFLAGS = 

# base
CFLAGS = -pg -g -Wall -I. -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE ${EXTRA_CFLAGS}
LDINC = ld -i -o
CC = g++
LIBS = -pthread

# darwin?
ifeq ($(target),darwin)
CFLAGS += -DDARWIN -D__FreeBSD__=10
LDINC = ar -rc
endif

# use Common C++ (for buffer.h)?
ifeq ($(use_ccpp),yes)
CFLAGS += -D_GNU_SOURCE -DBUFFER_USE_CCPP
LIBS += -lccgnu2 -ldl
endif


#for normal mpich2 machines
MPICC = mpicxx
MPICFLAGS = -DMPICH_IGNORE_CXX_SEEK ${CFLAGS}
MPILIBS = ${LIBS}

#for LLNL boxes without mpicxx
#MPICC = g++
#MPICFLAGS = ${CFLAGS} -I/usr/lib/mpi/include -L/usr/lib/mpi/mpi_gnu/lib
#MPILIBS = ${LIBS} -lelan -lmpi

EBOFS_OBJS= \
	ebofs/BlockDevice.o\
	ebofs/BufferCache.o\
	ebofs/Ebofs.o\
	ebofs/Allocator.o\
	ebofs/FileJournal.o

MDS_OBJS= \
	mds/MDS.o\
	mds/journal.o\
	mds/Server.o\
	mds/MDCache.o\
	mds/Locker.o\
	mds/Migrator.o\
	mds/MDBalancer.o\
	mds/CDentry.o\
	mds/CDir.o\
	mds/CInode.o\
	mds/AnchorTable.o\
	mds/AnchorClient.o\
	mds/LogEvent.o\
	mds/IdAllocator.o\
	mds/ClientMap.o\
	mds/MDLog.o

OSD_OBJS= \
	osd/PG.o\
	osd/ReplicatedPG.o\
	osd/RAID4PG.o\
	osd/Ager.o\
	osd/FakeStore.o\
	osd/OSD.o

OSDC_OBJS= \
	osdc/Objecter.o\
	osdc/ObjectCacher.o\
	osdc/Filer.o\
	osdc/Journaler.o

MON_OBJS= \
	mon/Monitor.o\
	mon/Paxos.o\
	mon/PaxosService.o\
	mon/OSDMonitor.o\
	mon/MDSMonitor.o\
	mon/ClientMonitor.o\
	mon/PGMonitor.o\
	mon/Elector.o\
	mon/MonitorStore.o

COMMON_OBJS= \
	msg/Message.o\
	common/Logger.o\
	common/Clock.o\
	common/Timer.o\
	config.o

CLIENT_OBJS= \
	client/FileCache.o\
	client/Client.o\
	client/SyntheticClient.o\
	client/Trace.o


# bdbstore?
ifeq ($(want_bdb),yes)
CFLAGS += -DUSE_OSBDB
LIBS = -ldb_cxx
OSD_OBJS += osbdb/OSBDB.o
OSBDB_OBJS = \
	osbdb/OSBDB.o
endif

TARGETS = cmon cosd cmds csyn newsyn fakesyn mkmonmap cmonctl cfuse fakefuse
NO_FUSE = cmon cosd cmds csyn newsyn fakesyn mkmonmap


SRCS=*.cc */*.cc *.h */*.h */*/*.h

all: depend ${TARGETS}

nofuse: depend ${NO_FUSE}

test: depend ${TEST_TARGETS}


# real bits
mkmonmap: mkmonmap.cc common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

cmon: cmon.cc mon.o msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

cmonctl: cmonctl.cc msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

cosd: cosd.cc osd.o ebofs.o msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

cmds: cmds.cc mds.o osdc.o msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

csyn: csyn.cc client.o osdc.o msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

cfuse: cfuse.cc client.o osdc.o client/fuse.o msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} -lfuse $^ -o $@



# misc
gprof-helper.so: test/gprof-helper.c
	gcc -shared -fPIC test/gprof-helper.c -o gprof-helper.so -lpthread -ldl 


# fake*
fakefuse: fakefuse.cc mon.o mds.o client.o osd.o osdc.o ebofs.o client/fuse.o msg/FakeMessenger.o common.o
	${CC} -pg ${CFLAGS} ${LIBS} -lfuse $^ -o $@

fakesyn: fakesyn.cc mon.o mds.o client.o osd.o ebofs.o osdc.o msg/FakeMessenger.o common.o
	${CC} -pg ${CFLAGS} ${LIBS} $^ -o $@


# mpi startup
newsyn: newsyn.cc mon.o mds.o client.o osd.o ebofs.o osdc.o msg/SimpleMessenger.o common.o
	${MPICC} -pg ${MPICFLAGS} ${MPILIBS} $^ -o $@

newsyn.nopg: newsyn.cc mon.o mds.o client.o osd.o ebofs.o osdc.o msg/SimpleMessenger.o common.o
	${MPICC} ${MPICFLAGS} ${MPILIBS} $^ -o $@


# ebofs<commit_msg>cleanups<commit_after>
# mpicxx must be on your path to build newsyn.  
#  on googoo, this means that /usr/local/mpich2-1.0.2/bin must be on your path.
#  on issdm, it's /usr/local/mpich2/bin.

# Hook for extra -I options, etc.
EXTRA_CFLAGS = 

# base
CFLAGS = -pg -g -Wall -I. -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE ${EXTRA_CFLAGS}
LDINC = ld -i -o
CC = g++
LIBS = -pthread

# darwin?
ifeq ($(target),darwin)
CFLAGS += -DDARWIN -D__FreeBSD__=10
LDINC = ar -rc
endif

# use Common C++ (for buffer.h)?
ifeq ($(use_ccpp),yes)
CFLAGS += -D_GNU_SOURCE -DBUFFER_USE_CCPP
LIBS += -lccgnu2 -ldl
endif


#for normal mpich2 machines
MPICC = mpicxx
MPICFLAGS = -DMPICH_IGNORE_CXX_SEEK ${CFLAGS}
MPILIBS = ${LIBS}

#for LLNL boxes without mpicxx
#MPICC = g++
#MPICFLAGS = ${CFLAGS} -I/usr/lib/mpi/include -L/usr/lib/mpi/mpi_gnu/lib
#MPILIBS = ${LIBS} -lelan -lmpi

EBOFS_OBJS= \
	ebofs/BlockDevice.o\
	ebofs/BufferCache.o\
	ebofs/Ebofs.o\
	ebofs/Allocator.o\
	ebofs/FileJournal.o

MDS_OBJS= \
	mds/MDS.o\
	mds/journal.o\
	mds/Server.o\
	mds/MDCache.o\
	mds/Locker.o\
	mds/Migrator.o\
	mds/MDBalancer.o\
	mds/CDentry.o\
	mds/CDir.o\
	mds/CInode.o\
	mds/AnchorTable.o\
	mds/AnchorClient.o\
	mds/LogEvent.o\
	mds/IdAllocator.o\
	mds/ClientMap.o\
	mds/MDLog.o

OSD_OBJS= \
	osd/PG.o\
	osd/ReplicatedPG.o\
	osd/RAID4PG.o\
	osd/Ager.o\
	osd/FakeStore.o\
	osd/OSD.o

OSDC_OBJS= \
	osdc/Objecter.o\
	osdc/ObjectCacher.o\
	osdc/Filer.o\
	osdc/Journaler.o

MON_OBJS= \
	mon/Monitor.o\
	mon/Paxos.o\
	mon/PaxosService.o\
	mon/OSDMonitor.o\
	mon/MDSMonitor.o\
	mon/ClientMonitor.o\
	mon/PGMonitor.o\
	mon/Elector.o\
	mon/MonitorStore.o

COMMON_OBJS= \
	msg/Message.o\
	common/Logger.o\
	common/Clock.o\
	common/Timer.o\
	config.o

CLIENT_OBJS= \
	client/FileCache.o\
	client/Client.o\
	client/SyntheticClient.o\
	client/Trace.o


# bdbstore?
ifeq ($(want_bdb),yes)
CFLAGS += -DUSE_OSBDB
LIBS = -ldb_cxx
OSD_OBJS += osbdb/OSBDB.o
OSBDB_OBJS = \
	osbdb/OSBDB.o
endif

TARGETS = cmon cosd cmds csyn newsyn fakesyn mkmonmap cmonctl cfuse fakefuse
NO_FUSE = cmon cosd cmds csyn newsyn fakesyn mkmonmap


SRCS=*.cc */*.cc *.h */*.h */*/*.h

all: depend ${TARGETS}

nofuse: depend ${NO_FUSE}

test: depend ${TEST_TARGETS}


# real bits
mkmonmap: mkmonmap.cc common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

cmon: cmon.cc mon.o msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

cmonctl: cmonctl.cc msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

cosd: cosd.cc osd.o ebofs.o msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

cmds: cmds.cc mds.o osdc.o msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

csyn: csyn.cc client.o osdc.o msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} $^ -o $@

cfuse: cfuse.cc client.o osdc.o client/fuse.o msg/SimpleMessenger.o common.o
	${CC} ${CFLAGS} ${LIBS} -lfuse $^ -o $@



# fake*
fakefuse: fakefuse.cc mon.o mds.o client.o osd.o osdc.o ebofs.o client/fuse.o msg/FakeMessenger.o common.o
	${CC} -pg ${CFLAGS} ${LIBS} -lfuse $^ -o $@

fakesyn: fakesyn.cc mon.o mds.o client.o osd.o ebofs.o osdc.o msg/FakeMessenger.o common.o
	${CC} -pg ${CFLAGS} ${LIBS} $^ -o $@


# mpi startup
newsyn: newsyn.cc mon.o mds.o client.o osd.o ebofs.o osdc.o msg/SimpleMessenger.o common.o
	${MPICC} -pg ${MPICFLAGS} ${MPILIBS} $^ -o $@


# ebofs
{'fraction_non_alphanumeric': 0.16906109418081555, 'fraction_numerical': 0.0034828036569438396, 'mean_word_length': 3.2595797280593324, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2853056', 'n_tokens_mistral': 3435, 'n_tokens_neox': 3305, 'n_words': 664}