12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- # CILK_ROOT must contains the GCC/Cilk root directory
- OS = $(shell uname)
- CPPFLAGS = -DNDEBUG -DMAX_GENUS=$(MAX_GENUS) -DQUOTIENT=$(QUOTIENT)
- CXXFLAGS = -std=c++11 -fcilkplus -g -Wall -O3 # -fsanitize=thread # -Winline
- ifeq ($(shell uname), Darwin)
- TARGET_ARCH = -march=corei7 -march=corei7
- LDFLAGS = -lcilkrts
- CXX = g++-6
- else
- TARGET_ARCH = -march=corei7 -mtune=corei7
- LDFLAGS = # -Wl,-rpath=$(CILK_ROOT)/lib64
- LDLIBS = -lcilkrts # -ltsan
- endif
- TARGET = treewalk
- SAGE = sage
- PYTHON = $(SAGE) -python
- # Experimental TBB stuff
- # Suppose that TBB is installed in $(TBB_ROOT)
- ifdef USE_TBB
- CPPFLAGS += -DTBB=1 -I$(TBB_ROOT)/include
- LDFLAGS +=-Wl,-rpath=$(TBB_ROOT)/lib/intel64/gcc4.4 -L$(TBB_ROOT)/lib/intel64/gcc4.4 -ltbbmalloc
- endif
- # Pour compiler avec une valeur différente: make MAX_GENUS=35
- DEFAULT_MAX_GENUS=40
- MAX_GENUS=$(DEFAULT_MAX_GENUS)
- DEFAULT_QUOTIENT=3
- QUOTIENT=$(DEFAULT_QUOTIENT)
- all: $(TARGET)
- monoid.o: monoid.cpp monoid.hpp
- treewalk.o: treewalk.cpp treewalk.hpp monoid.hpp
- treewalk: treewalk.o monoid.o
- $(CXX) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
- numeric_monoid.so: treewalk.cpp treewalk.hpp monoid.cpp monoid.hpp numeric_monoid.pxd numeric_monoid.pyx monoid.pxd treewalk.pxd
- $(PYTHON) setup.py build_ext --inplace
- clean:
- rm -rf $(TARGET) *.o build cysignals numeric_monoid.so numeric_monoid.html numeric_monoid.cpp
- test: all
- ./treewalk
- $(SAGE) -t --force-lib numeric_monoid.pyx
|