Makefile 2.9 KB

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