Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. NOMPI_TARGETS = gen_N dlrho controller dpnode worker
  32. TARGETS = $(NOMPI_TARGETS) mpi
  33. all: $(TARGETS)
  34. nompi: $(NOMPI_TARGETS)
  35. gen_N: gen_N.o
  36. g++ -g -Wall $^ -o $@ -lntl -L$(GMP)/lib -lgmp
  37. dlrho: dlrho.o cudadl.o
  38. g++ -g -Wall $^ -o $@ -lntl -L$(GMP)/lib -lgmp -L$(CUDA)/lib64 -lcudart
  39. dlrho.o: dlrho.cc
  40. g++ $(CXXFLAGS) $(CPPFLAGS) -I$(CUDA)/include $^ -c -o $@
  41. cudadl.o: parrhoasm.cu cios.asm dpstream.cu
  42. $(NVCC) $(CPPFLAGS) -c parrhoasm.cu -DWORDS=$(WORDS) -o cudadl.o
  43. cios.asm: gencios_reg_20
  44. ./gencios_reg_20 $(WORDS) > $@
  45. controller: controller.o evutils.o controller_main.o
  46. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -Wl,-rpath=$(LIBEVENT)/lib -levent -lntl -L$(GMP) -lgmp
  47. dpnode: dpnode.o evutils.o dpnode_main.o
  48. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -Wl,-rpath=$(LIBEVENT)/lib -levent -lntl -L$(GMP) -lgmp
  49. worker: worker.o evutils.o cudadl.o worker_main.o
  50. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -Wl,-rpath=$(LIBEVENT)/lib -levent -levent_pthreads -lntl -L$(GMP) -lgmp -lpthread -L$(CUDA)/lib64 -lcudart
  51. mpi: mpi.o
  52. 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
  53. mpi.o: mpi.cc
  54. mpiCC $(CXXFLAGS) $(CPPFLAGS) $^ -c -o $@
  55. clean:
  56. -rm -f $(OFILES)
  57. veryclean: clean
  58. -rm -f $(TARGETS) cios.asm