2011-12-09 21:50:25 +01:00
|
|
|
|
2014-04-07 05:09:45 +02:00
|
|
|
devel = 1
|
2013-03-25 21:39:15 +01:00
|
|
|
|
|
|
|
BISON = bison
|
|
|
|
FLEX = flex
|
2011-12-09 21:50:25 +01:00
|
|
|
|
2016-11-19 20:46:39 +01:00
|
|
|
CXX = g++ -std=c++11
|
2016-11-19 20:55:11 +01:00
|
|
|
#CXX = OMPI_CXX=clang++ mpic++ -fno-color-diagnostics --stdlib=libc++ --std=c++11 -I/u/cseed/llvm-3.1/lib/c++/v1
|
2016-11-19 20:46:39 +01:00
|
|
|
#CXX = clang++ -fno-color-diagnostics --stdlib=libc++ --std=c++11
|
2011-12-09 21:50:25 +01:00
|
|
|
|
2013-03-25 21:39:15 +01:00
|
|
|
INCLUDES = -I. -I/opt/local/include
|
2011-12-09 21:50:25 +01:00
|
|
|
|
2013-03-25 21:55:52 +01:00
|
|
|
# OPTFLAGS = -g
|
2016-11-28 09:26:41 +01:00
|
|
|
OPTFLAGS = -O2 -g
|
2017-01-13 11:51:49 +01:00
|
|
|
# OPTFLAGS = -O2 -DNDEBUG
|
2011-12-09 21:50:25 +01:00
|
|
|
|
2013-03-25 21:39:15 +01:00
|
|
|
LDFLAGS = -L/opt/local/lib
|
2011-12-09 21:50:25 +01:00
|
|
|
|
2013-03-25 21:39:15 +01:00
|
|
|
CXXFLAGS = $(OPTFLAGS) -DHOME="\"`pwd`\"" -Wall -Wno-unused $(INCLUDES)
|
2011-12-09 21:50:25 +01:00
|
|
|
|
|
|
|
LIB_OBJS = lib/refcount.o \
|
|
|
|
lib/lib.o lib/smallbitset.o lib/bitset.o lib/setcommon.o lib/io.o lib/directed_multigraph.o
|
2011-12-27 19:40:59 +01:00
|
|
|
ALGEBRA_OBJS = algebra/algebra.o algebra/grading.o algebra/polynomial.o
|
2012-04-11 07:06:04 +02:00
|
|
|
KNOTKIT_OBJS = planar_diagram.o dt_code.o knot_diagram.o cube.o steenrod_square.o \
|
|
|
|
spanning_tree_complex.o \
|
2011-12-09 21:50:25 +01:00
|
|
|
smoothing.o cobordism.o knot_tables.o sseq.o \
|
|
|
|
knot_parser/knot_parser.o knot_parser/knot_scanner.o \
|
|
|
|
rd_parser/rd_parser.o rd_parser/rd_scanner.o
|
|
|
|
|
2016-11-19 21:01:10 +01:00
|
|
|
PERIODICITY_OBJS = periodicity.o
|
|
|
|
|
|
|
|
COMMON_OBJS = $(KNOTKIT_OBJS) $(ALGEBRA_OBJS) $(LIB_OBJS) $(PERIODICITY_OBJS)
|
2011-12-09 21:50:25 +01:00
|
|
|
|
|
|
|
LIB_HEADERS = lib/lib.h lib/show.h lib/refcount.h lib/pair.h lib/maybe.h lib/vector.h \
|
2012-07-28 14:14:11 +02:00
|
|
|
lib/set_wrapper.h lib/set.h lib/hashset.h \
|
|
|
|
lib/ullmanset.h lib/bitset.h lib/smallbitset.h lib/setcommon.h \
|
2011-12-09 21:50:25 +01:00
|
|
|
lib/map_wrapper.h lib/map.h lib/hashmap.h lib/ullmanmap.h lib/mapcommon.h \
|
|
|
|
lib/unionfind.h lib/priority_queue.h lib/io.h \
|
|
|
|
lib/directed_multigraph.h
|
|
|
|
ALGEBRA_HEADERS = algebra/algebra.h algebra/grading.h algebra/module.h \
|
2011-12-14 19:07:53 +01:00
|
|
|
algebra/Z2.h algebra/linear_combination.h \
|
|
|
|
algebra/Z.h algebra/Zp.h algebra/Q.h \
|
2011-12-09 21:50:25 +01:00
|
|
|
algebra/polynomial.h algebra/multivariate_polynomial.h \
|
2011-12-27 19:40:59 +01:00
|
|
|
algebra/multivariate_laurentpoly.h algebra/fraction_field.h
|
2011-12-09 21:50:25 +01:00
|
|
|
KNOTKIT_HEADERS = knotkit.h planar_diagram.h dt_code.h knot_diagram.h \
|
2012-04-11 07:06:04 +02:00
|
|
|
smoothing.h cobordism.h cube.h steenrod_square.h \
|
|
|
|
spanning_tree_complex.h cube_impl.h sseq.h simplify_chain_complex.h
|
2011-12-09 21:50:25 +01:00
|
|
|
|
2016-11-19 21:01:10 +01:00
|
|
|
PERIODICITY_HEADERS = periodicity.h
|
|
|
|
|
2017-02-04 20:09:15 +01:00
|
|
|
LIBS = -lgmpxx -lgmp -lz -lpthread
|
2011-12-09 21:50:25 +01:00
|
|
|
|
2013-03-25 21:39:15 +01:00
|
|
|
all: kk
|
2011-12-09 21:50:25 +01:00
|
|
|
|
|
|
|
%.o : %.cc
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
|
|
%.o : %.cpp
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
2013-03-25 21:39:15 +01:00
|
|
|
kk: kk.o $(COMMON_OBJS)
|
2017-02-04 20:09:15 +01:00
|
|
|
$(CXX) $(LDFLAGS) -o kk $^ $(LIBS)
|
|
|
|
|
|
|
|
kk_from_file: kk_from_file.o $(COMMON_OBJS)
|
|
|
|
$(CXX) $(LDFLAGS) -o kk_from_file $^ $(LIBS) -lpthread
|
2011-12-09 21:50:25 +01:00
|
|
|
|
|
|
|
main: main.o $(COMMON_OBJS)
|
|
|
|
$(CXX) $(LDFLAGS) -o main $^ $(LIBS)
|
|
|
|
|
2012-04-11 23:51:14 +02:00
|
|
|
mpimain: mpimain.o mpi_aux.o $(COMMON_OBJS)
|
2012-05-03 21:49:26 +02:00
|
|
|
$(CXX) $(LDFLAGS) -o mpimain $^ $(LIBS)
|
2012-04-11 23:51:14 +02:00
|
|
|
|
2011-12-09 21:50:25 +01:00
|
|
|
testlib: testlib.o $(COMMON_OBJS)
|
|
|
|
$(CXX) $(LDFLAGS) -o testlib $^
|
|
|
|
|
2013-03-25 21:39:15 +01:00
|
|
|
ifeq ($(devel),1)
|
2011-12-09 21:50:25 +01:00
|
|
|
knot_parser/knot_parser.cc knot_parser/knot_parser.hh: knot_parser/knot_parser.yy
|
|
|
|
$(BISON) knot_parser/knot_parser.yy -o knot_parser/knot_parser.cc
|
|
|
|
|
|
|
|
knot_parser/knot_scanner.cc: knot_parser/knot_scanner.ll
|
|
|
|
$(FLEX) -o knot_parser/knot_scanner.cc knot_parser/knot_scanner.ll
|
|
|
|
|
|
|
|
javakh_parser/javakh_parser.cc javakh_parser/javakh_parser.hh: javakh_parser/javakh_parser.yy
|
|
|
|
$(BISON) javakh_parser/javakh_parser.yy -o javakh_parser/javakh_parser.cc
|
|
|
|
|
|
|
|
javakh_parser/javakh_scanner.cc: javakh_parser/javakh_scanner.ll
|
|
|
|
$(FLEX) -o javakh_parser/javakh_scanner.cc javakh_parser/javakh_scanner.ll
|
|
|
|
|
|
|
|
rd_parser/rd_parser.cc rd_parser/rd_parser.hh: rd_parser/rd_parser.yy
|
|
|
|
$(BISON) rd_parser/rd_parser.yy -o rd_parser/rd_parser.cc
|
|
|
|
|
|
|
|
rd_parser/rd_scanner.cc: rd_parser/rd_scanner.ll
|
|
|
|
$(FLEX) -o rd_parser/rd_scanner.cc rd_parser/rd_scanner.ll
|
2013-03-25 21:39:15 +01:00
|
|
|
endif
|
2011-12-09 21:50:25 +01:00
|
|
|
|
|
|
|
.PHONY: parser_files
|
|
|
|
parser_files: \
|
|
|
|
knot_parser/knot_parser.cc knot_parser/knot_parser.hh \
|
|
|
|
knot_parser/knot_scanner.cc \
|
|
|
|
javakh_parser/javakh_parser.cc javakh_parser/javakh_parser.hh \
|
|
|
|
javakh_parser/javakh_scanner.cc \
|
|
|
|
rd_parser/rd_parser.cc rd_parser/rd_parser.hh \
|
|
|
|
rd_parser/rd_scanner.cc
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f *.o lib/*.o algebra/*.o knot_parser/*.o rd_parser/*.o
|
2013-03-25 21:39:15 +01:00
|
|
|
rm -f main kk mpimain
|
2011-12-09 21:50:25 +01:00
|
|
|
rm -f gmon.out
|
|
|
|
|
|
|
|
.PHONY: realclean
|
|
|
|
realclean: clean
|
|
|
|
rm -f knot_parser/knot_parser.cc knot_parser/knot_parser.hh
|
|
|
|
rm -f knot_parser/knot_scanner.cc
|
|
|
|
rm -f knot_parser/location.hh knot_parser/position.hh knot_parser/stack.hh
|
|
|
|
rm -f javakh_parser/javakh_parser.cc javakh_parser/javakh_parser.hh
|
|
|
|
rm -f javakh_parser/javakh_scanner.cc
|
|
|
|
rm -f javakh_parser/location.hh javakh_parser/position.hh javakh_parser/stack.hh
|
|
|
|
rm -f rd_parser/rd_parser.cc rd_parser/rd_parser.hh
|
|
|
|
rm -f rd_parser/rd_scanner.cc
|
|
|
|
rm -f rd_parser/location.hh rd_parser/position.hh rd_parser/stack.hh
|
|
|
|
|
|
|
|
$(LIB_OBJS): $(LIB_HEADERS)
|
|
|
|
$(ALGEBRA_OBJS): $(ALGEBRA_HEADERS) $(LIB_HEADERS)
|
2016-11-19 21:01:10 +01:00
|
|
|
$(KNOTKIT_OBJS) main.o mpimain.o kk.o: $(KNOTKIT_HEADERS) $(ALGEBRA_HEADERS) $(LIB_HEADERS) $(PERIODICITY_HEADERS)
|
2016-11-28 09:26:41 +01:00
|
|
|
$(PERIODICITY_OBJS) : $(PERIODICITY_HEADERS) $(ALGEBRA_HEADERS) $(LIB_HEADERS)
|
2012-04-11 23:51:14 +02:00
|
|
|
|
|
|
|
mpimain.o mpi_aux.o: mpi_aux.h
|