Makefile 2.5 KB

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