Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # CILK_ROOT must contains the GCC/Cilk root directory
  2. OS = $(shell uname)
  3. CPPFLAGS = -DNDEBUG -DMAX_GENUS=$(MAX_GENUS) -DQUOTIENT=$(QUOTIENT)
  4. CXXFLAGS = -std=c++11 -fcilkplus -g -Wall -O3 # -fsanitize=thread # -Winline
  5. ifeq ($(shell uname), Darwin)
  6. TARGET_ARCH = -march=corei7 -march=corei7
  7. LDFLAGS = -lcilkrts
  8. CXX = g++-6
  9. else
  10. TARGET_ARCH = -march=corei7 -mtune=corei7
  11. LDFLAGS = # -Wl,-rpath=$(CILK_ROOT)/lib64
  12. LDLIBS = -lcilkrts # -ltsan
  13. endif
  14. TARGET = treewalk
  15. SAGE = sage
  16. PYTHON = $(SAGE) -python
  17. # Experimental TBB stuff
  18. # Suppose that TBB is installed in $(TBB_ROOT)
  19. ifdef USE_TBB
  20. CPPFLAGS += -DTBB=1 -I$(TBB_ROOT)/include
  21. LDFLAGS +=-Wl,-rpath=$(TBB_ROOT)/lib/intel64/gcc4.4 -L$(TBB_ROOT)/lib/intel64/gcc4.4 -ltbbmalloc
  22. endif
  23. # Pour compiler avec une valeur différente: make MAX_GENUS=35
  24. DEFAULT_MAX_GENUS=40
  25. MAX_GENUS=$(DEFAULT_MAX_GENUS)
  26. DEFAULT_QUOTIENT=3
  27. QUOTIENT=$(DEFAULT_QUOTIENT)
  28. all: $(TARGET)
  29. monoid.o: monoid.cpp monoid.hpp
  30. treewalk.o: treewalk.cpp treewalk.hpp monoid.hpp
  31. treewalk: treewalk.o monoid.o
  32. $(CXX) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
  33. numeric_monoid.so: treewalk.cpp treewalk.hpp monoid.cpp monoid.hpp numeric_monoid.pxd numeric_monoid.pyx monoid.pxd treewalk.pxd
  34. $(PYTHON) setup.py build_ext --inplace
  35. clean:
  36. rm -rf $(TARGET) *.o build cysignals numeric_monoid.so numeric_monoid.html numeric_monoid.cpp
  37. test: all
  38. ./treewalk
  39. $(SAGE) -t --force-lib numeric_monoid.pyx