Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # cudadl version 0.9: Compute discrete logs in smooth group orders
  2. # using CUDA
  3. # Copyright (C) 2012 by Ryan Henry and Ian Goldberg
  4. # {rhenry,iang}@cs.uwaterloo.ca
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of version 3 of the GNU General Public License as
  8. # published by the Free Software Foundation.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. LIBEVENT=/usr/local
  18. WORDS = 24
  19. CXXFLAGS=-g -Wall -O0
  20. CPPFLAGS=-DWORDS=$(WORDS) -I$(LIBEVENT)/include -I$(GMP)/include
  21. NVCCOPTS=-g -arch sm_20 --ptxas-options=-v -O2
  22. NVCC=nvcc $(NVCCOPTS)
  23. CXXFILES = dlrho.cc gen_N.cc
  24. CUFILES = parrhoasm.cu dpstream.cu
  25. OFILES = dlrho.o gen_N.o cudadl.o controller.o evutils.o dpnode.o worker.o
  26. TARGETS = gen_N dlrho controller dpnode worker
  27. all: $(TARGETS)
  28. gen_N: gen_N.o
  29. g++ -g -Wall $^ -o $@ -lntl -L$(GMP)/lib -lgmp
  30. dlrho: dlrho.o cudadl.o
  31. g++ -g -Wall $^ -o $@ -lntl -L$(GMP)/lib -lgmp -L$(CUDA)/lib64 -lcudart
  32. dlrho.o: dlrho.cc
  33. g++ $(CXXFLAGS) $(CPPFLAGS) -I$(CUDA)/include $^ -c -o $@
  34. cudadl.o: parrhoasm.cu cios.asm dpstream.cu
  35. $(NVCC) $(CPPFLAGS) -c parrhoasm.cu -DWORDS=$(WORDS) -o cudadl.o
  36. cios.asm: gencios_reg_20
  37. ./gencios_reg_20 $(WORDS) > $@
  38. controller: controller.o evutils.o
  39. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -levent -lntl -L$(GMP) -lgmp
  40. dpnode: dpnode.o evutils.o
  41. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -levent -lntl -L$(GMP) -lgmp
  42. worker: worker.o evutils.o
  43. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -levent -lntl -L$(GMP) -lgmp -lpthread
  44. clean:
  45. -rm -f $(OFILES)
  46. veryclean: clean
  47. -rm -f $(TARGETS) cios.asm