Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. -include Makefile.local
  18. GMP ?= /usr/local
  19. CUDA ?= /usr/local/cuda
  20. LIBEVENT ?= /usr/local
  21. CXX ?= g++
  22. WORDS = 24
  23. CXXFLAGS=-g -Wall -O0
  24. CPPFLAGS=-DWORDS=$(WORDS) -I$(LIBEVENT)/include -I$(GMP)/include
  25. NVCCOPTS=-g -arch sm_20 --ptxas-options=-v -O2
  26. NVCC=nvcc $(NVCCOPTS)
  27. CXXFILES = dlrho.cc gen_N.cc
  28. CUFILES = parrhoasm.cu dpstream.cu
  29. OFILES = dlrho.o gen_N.o cudadl.o controller.o evutils.o dpnode.o worker.o
  30. TARGETS = gen_N dlrho controller dpnode worker
  31. all: $(TARGETS)
  32. gen_N: gen_N.o
  33. g++ -g -Wall $^ -o $@ -lntl -L$(GMP)/lib -lgmp
  34. dlrho: dlrho.o cudadl.o
  35. g++ -g -Wall $^ -o $@ -lntl -L$(GMP)/lib -lgmp -L$(CUDA)/lib64 -lcudart
  36. dlrho.o: dlrho.cc
  37. g++ $(CXXFLAGS) $(CPPFLAGS) -I$(CUDA)/include $^ -c -o $@
  38. cudadl.o: parrhoasm.cu cios.asm dpstream.cu
  39. $(NVCC) $(CPPFLAGS) -c parrhoasm.cu -DWORDS=$(WORDS) -o cudadl.o
  40. cios.asm: gencios_reg_20
  41. ./gencios_reg_20 $(WORDS) > $@
  42. controller: controller.o evutils.o
  43. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -levent -lntl -L$(GMP) -lgmp
  44. dpnode: dpnode.o evutils.o
  45. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -levent -lntl -L$(GMP) -lgmp
  46. worker: worker.o evutils.o cudadl.o
  47. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -levent -levent_pthreads -lntl -L$(GMP) -lgmp -lpthread -L$(CUDA)/lib64 -lcudart
  48. clean:
  49. -rm -f $(OFILES)
  50. veryclean: clean
  51. -rm -f $(TARGETS) cios.asm