Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. MACROS=-DDERANDOMIZE -UVERBOSE
  25. CXXFLAGS=-g -Wall -O2
  26. CPPFLAGS=-DWORDS=$(WORDS) -I$(LIBEVENT)/include -I$(GMP)/include -std=c++11 $(MACROS)
  27. NVCCOPTS=-g -arch sm_30 --ptxas-options=-v -O2
  28. NVCC=nvcc $(NVCCOPTS)
  29. CXXFILES = dlrho.cc gen_N.cc
  30. CUFILES = parrhoasm.cu dpstream.cu
  31. 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
  32. PTX_TARGETS = parrhoasm.ptx
  33. NOMPI_TARGETS = gen_N dlrho controller dpnode worker desres
  34. TARGETS = $(NOMPI_TARGETS) mpi
  35. all: $(TARGETS)
  36. nompi: $(NOMPI_TARGETS)
  37. ptx: $(PTX_TARGETS)
  38. gen_N: gen_N.o
  39. g++ -g -Wall $^ -o $@ -lntl -L$(GMP)/lib -lgmp -lpthread
  40. dlrho: dlrho.o cudadl.o
  41. g++ -g -Wall $^ -o $@ -lntl -L$(GMP)/lib -lgmp -L$(CUDA)/lib64 -lcudart -lpthread
  42. dlrho.o: dlrho.cc
  43. g++ $(CXXFLAGS) $(CPPFLAGS) -I$(CUDA)/include $^ -c -o $@
  44. parrhoasm.ptx: parrhoasm.cu cios.asm dpstream.cu
  45. $(NVCC) $(CPPFLAGS) -c $< -o $@ --ptx
  46. cudadl.o: parrhoasm.cu cios.asm dpstream.cu
  47. $(NVCC) $(CPPFLAGS) -c $< -o $@
  48. test_cuda: parrhoasm.cu cios.asm dpstream.cu
  49. $(NVCC) -DTEST_CUDA $(CPPFLAGS) $< -o $@ -lntl -L$(GMP)/lib -lgmp -L$(CUDA)/lib64 -lcudart -lpthread
  50. cios.asm: gencios_reg_20
  51. ./gencios_reg_20 $(WORDS) > $@
  52. controller: controller.o evutils.o controller_main.o
  53. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -Wl,-rpath=$(LIBEVENT)/lib -levent -lntl -L$(GMP) -lgmp -lpthread
  54. dpnode: dpnode.o evutils.o dpnode_main.o
  55. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -Wl,-rpath=$(LIBEVENT)/lib -levent -lntl -L$(GMP) -lgmp -lpthread
  56. worker: worker.o evutils.o cudadl.o worker_main.o
  57. g++ -g -Wall $^ -o $@ -L$(LIBEVENT)/lib -Wl,-rpath=$(LIBEVENT)/lib -levent -levent_pthreads -lntl -L$(GMP) -lgmp -lpthread -L$(CUDA)/lib64 -lcudart
  58. worker.o: worker.cc
  59. g++ $(CXXFLAGS) $(CPPFLAGS) -I$(CUDA)/include $^ -c -o $@
  60. desres: controller_main.cc
  61. g++ $(CXXFLAGS) $(CPPFLAGS) -DTEST_DESIRED_RESOURCES $^ -o $@ -L$(LIBEVENT)/lib -Wl,-rpath=$(LIBEVENT)/lib -lntl -lgmp -lpthread
  62. mpi: mpi.o
  63. mpiCC -g -Wall $^ -o $@ -L/work/iang/sw/lib -lntl -L$(GMP) -lgmp -lpthread
  64. mpi.o: mpi.cc
  65. mpiCC $(CXXFLAGS) $(CPPFLAGS) $^ -c -o $@
  66. clean:
  67. -rm -f $(OFILES) $(PTX_TARGETS)
  68. veryclean: clean
  69. -rm -f $(TARGETS) cios.asm