Makefile 3.1 KB

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