Skip to content

Commit

Permalink
makefiles fix for ligra + pbbslib
Browse files Browse the repository at this point in the history
  • Loading branch information
jeshi96 committed Mar 8, 2020
1 parent 82f3f70 commit e0c575a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 49 deletions.
20 changes: 20 additions & 0 deletions ligra/encodings/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include ../../makefile.variables

INCLUDE_DIRS = -I../../

ALL= byte.o byte_pd_amortized.o

all: $(ALL)

LIGRA_OBJS = $(wildcard ../*.o)

byte.o : byte.cc $(LIGRA_OBJS)
$(CC) $(INCLUDE_DIRS) $(CFLAGS) $(PFLAGS) -c $<

byte_pd_amortized.o : byte_pd_amortized.cc $(LIGRA_OBJS)
$(CC) $(INCLUDE_DIRS) $(CFLAGS) $(PFLAGS) -c $<

.PHONY : clean

clean :
rm -f *.o $(ALL)
26 changes: 13 additions & 13 deletions ligra/makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
include ../makefile.variables

ALL= bridge.o graph.o graph_io.o io.o ligra.o parse_command_line.o undirected_edge.o union_find.o
INCLUDE_DIRS = -I../

all: $(ALL)
ALL= bridge.o edge_map_blocked.o graph.o graph_io.o io.o ligra.o parse_command_line.o undirected_edge.o union_find.o

.PHONY : clean pbbslib
all: $(ALL)

pbbslib:
make -C ../pbbslib/
edge_map_blocked.o : edge_map_blocked.cc bridge.o graph.o
$(CC) $(INCLUDE_DIRS) $(CFLAGS) $(PFLAGS) -c $<

graph_io.o : graph_io.cc graph.o io.o pbbslib
$(CC) $(CFLAGS) $(PFLAGS) -c $<
graph_io.o : graph_io.cc graph.o io.o
$(CC) $(INCLUDE_DIRS) $(CFLAGS) $(PFLAGS) -c $<

graph.o : graph.cc bridge.o pbbslib
$(CC) $(CFLAGS) $(PFLAGS) -c $<
graph.o : graph.cc bridge.o
$(CC) $(INCLUDE_DIRS) $(CFLAGS) $(PFLAGS) -c $<

ligra.o : ligra.cc bridge.o graph.o graph_io.o parse_command_line.o pbbslib
$(CC) $(CFLAGS) $(PFLAGS) -c $<
ligra.o : ligra.cc bridge.o graph.o graph_io.o parse_command_line.o
$(CC) $(INCLUDE_DIRS) $(CFLAGS) $(PFLAGS) -c $<

%.o : %.cc pbbslib
$(CC) $(CFLAGS) $(PFLAGS) -c $<
%.o : %.cc
$(CC) $(INCLUDE_DIRS) $(CFLAGS) $(PFLAGS) -c $<

.PHONY : clean

Expand Down
4 changes: 1 addition & 3 deletions makefile.variables
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ ifdef EDGELONG
INTE = -DEDGELONG
endif

INCLUDE_DIRS = -I../

OPT = -O3 -g -DNDEBUG

CFLAGS = $(INCLUDE_DIRS) -mcx16 -std=c++17 -march=native -Wall $(OPT) $(INTT) $(INTE) -DAMORTIZEDPD $(CONCEPTS) -DUSEMALLOC -DNDEBUG
CFLAGS = -mcx16 -std=c++17 -march=native -Wall $(OPT) $(INTT) $(INTE) -DAMORTIZEDPD $(CONCEPTS) -DUSEMALLOC -DNDEBUG

OMPFLAGS = -DOPENMP -fopenmp
CILKFLAGS = -DCILK -fcilkplus
Expand Down
41 changes: 8 additions & 33 deletions pbbslib/strings/makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,13 @@
ifeq (, $(shell which jemalloc-config))
JEMALLOC =
else
JEMALLOCLD = $(shell jemalloc-config --libdir)
JEMALLOC = -L$(JEMALLOCLD) -ljemalloc
endif
include ../../makefile.variables

CONCEPTS = -fconcepts -DCONCEPTS
CFLAGS = -mcx16 -O3 -ldl -std=c++17 -march=native -Wall
ALL= string_basics.o

OMPFLAGS = -DOPENMP -fopenmp
CILKFLAGS = -DCILK -fcilkplus
HGFLAGS = -DHOMEGROWN -pthread
all: $(ALL)

ifdef CLANG
CC = clang++
PFLAGS = $(CILKFLAGS)
else ifdef CILK
CC = g++
PFLAGS = $(CILKFLAGS)
else ifdef OPENMP
CC = g++
PFLAGS = $(OMPFLAGS)
else ifdef HOMEGROWN
CC = g++
PFLAGS = $(HGFLAGS)
else ifdef SERIAL
CC = g++
PFLAGS =
else # default is homegrown
CC = g++
PFLAGS = $(HGFLAGS)
endif
string_basics.o : string_basics.cc
$(CC) $(CFLAGS) $(PFLAGS) -c $<

INCLUDE = -I../
.PHONY : clean

test_suffix_tree: suffix_tree.h suffix_array.h lcp.h test_suffix_tree.cpp
$(CC) $(CFLAGS) $(PFLAGS) $(INCLUDE) test_suffix_tree.cpp -o test_suffix_tree $(JEMALLOC)
clean :
rm -f *.o $(ALL)

0 comments on commit e0c575a

Please sign in to comment.