|
| 1 | +# |
| 2 | +CC = gcc |
| 3 | +CXX = g++ |
| 4 | +OPTIX = /usr/local/OptiX-3.0.1 |
| 5 | +NVCC = nvcc |
| 6 | +ARCH = -arch sm_30 |
| 7 | +C_FLAGS = -O3 -m64 -fPIC |
| 8 | +NVCC_FLAGS = -m64 -use_fast_math --compiler-options '-fPIC' |
| 9 | +CURAND_LIBS = -lcurand |
| 10 | +OPTIX_FLAGS = -I$(OPTIX)/include -L$(OPTIX)/lib64 |
| 11 | +OPTIX_LIBS = -loptix |
| 12 | +CUDA_FLAGS = -I/usr/local/cuda/include -L/usr/local/cuda/lib |
| 13 | +CUDPP_PATH = /usr/local/cudpp-2.1/ |
| 14 | +CUDPP_FLAGS = -I/$(CUDPP_PATH)/include -L/$(CUDPP_PATH)/lib |
| 15 | +CUDPP_LIBS = -lcudpp_hash -lcudpp |
| 16 | +PYTHON_FLAGS = -I/usr/local/anaconda/include/python2.7 -L/usr/local/anaconda/lib/ |
| 17 | +PYTHON_LIBS = -lpython2.7 |
| 18 | +PNG_FLAGS = -L/ |
| 19 | +PNG_LIBS = -lpng15 |
| 20 | +LIBS = |
| 21 | + |
| 22 | + |
| 23 | +COBJS = mt19937ar.o \ |
| 24 | + print_banner.o \ |
| 25 | + set_positions_rand.o \ |
| 26 | + copy_points.o \ |
| 27 | + macroscopic.o \ |
| 28 | + microscopic.o \ |
| 29 | + find_E_grid_index.o \ |
| 30 | + find_E_grid_index_quad.o \ |
| 31 | + sample_fission_spectra.o \ |
| 32 | + sample_fixed_source.o \ |
| 33 | + tally_spec.o \ |
| 34 | + escatter.o \ |
| 35 | + iscatter.o \ |
| 36 | + cscatter.o \ |
| 37 | + fission.o \ |
| 38 | + absorb.o \ |
| 39 | + make_mask.o \ |
| 40 | + print_histories.o \ |
| 41 | + pop_secondaries.o \ |
| 42 | + pop_source.o \ |
| 43 | + rebase_yield.o \ |
| 44 | + flip_done.o \ |
| 45 | + whistory.o \ |
| 46 | + wgeometry.o \ |
| 47 | + optix_stuff.o \ |
| 48 | + primitive.o \ |
| 49 | + write_to_file.o \ |
| 50 | + reaction_edges.o \ |
| 51 | + device_copies.o \ |
| 52 | + |
| 53 | +ptx_objects = camera.ptx \ |
| 54 | + hits.ptx \ |
| 55 | + miss.ptx \ |
| 56 | + box.ptx \ |
| 57 | + cylinder.ptx \ |
| 58 | + hex.ptx\ |
| 59 | + hits_mesh.ptx \ |
| 60 | + box_mesh.ptx \ |
| 61 | + cylinder_mesh.ptx \ |
| 62 | + hex_mesh.ptx\ |
| 63 | + sphere_mesh.ptx\ |
| 64 | + |
| 65 | + |
| 66 | +all: $(ptx_objects) \ |
| 67 | + $(COBJS) \ |
| 68 | + libwarp.so |
| 69 | + |
| 70 | +clean: |
| 71 | + rm -f *.ptx *.o *.so gpu debug optixtest |
| 72 | + |
| 73 | +camera.ptx: |
| 74 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) $(OPTIX_FLAGS) $(OPTIX_LIBS) -ptx camera.cu |
| 75 | + |
| 76 | +hits.ptx: |
| 77 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) $(OPTIX_FLAGS) $(OPTIX_LIBS) -ptx hits.cu |
| 78 | + |
| 79 | +miss.ptx: |
| 80 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) $(OPTIX_FLAGS) $(OPTIX_LIBS) -ptx miss.cu |
| 81 | + |
| 82 | +box.ptx: |
| 83 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) $(OPTIX_FLAGS) $(OPTIX_LIBS) -ptx box.cu |
| 84 | + |
| 85 | +cylinder.ptx: |
| 86 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) $(OPTIX_FLAGS) $(OPTIX_LIBS) -ptx cylinder.cu |
| 87 | + |
| 88 | +hex.ptx: |
| 89 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) $(OPTIX_FLAGS) $(OPTIX_LIBS) -ptx hex.cu |
| 90 | + |
| 91 | +hits_mesh.ptx: |
| 92 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) $(OPTIX_FLAGS) $(OPTIX_LIBS) -ptx hits_mesh.cu |
| 93 | + |
| 94 | +box_mesh.ptx: |
| 95 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) $(OPTIX_FLAGS) $(OPTIX_LIBS) -ptx box_mesh.cu |
| 96 | + |
| 97 | +cylinder_mesh.ptx: |
| 98 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) $(OPTIX_FLAGS) $(OPTIX_LIBS) -ptx cylinder_mesh.cu |
| 99 | + |
| 100 | +hex_mesh.ptx: |
| 101 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) $(OPTIX_FLAGS) $(OPTIX_LIBS) -ptx hex_mesh.cu |
| 102 | + |
| 103 | +sphere_mesh.ptx: |
| 104 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) $(OPTIX_FLAGS) $(OPTIX_LIBS) -ptx sphere_mesh.cu |
| 105 | + |
| 106 | +mt19937ar.o: |
| 107 | + $(CXX) $(C_FLAGS) -c -O mt19937ar.cpp |
| 108 | + |
| 109 | +print_banner.o: |
| 110 | + $(NVCC) $(NVCC_FLAGS) -c -O print_banner.cpp |
| 111 | + |
| 112 | +set_positions_rand.o: |
| 113 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c set_positions_rand.cu |
| 114 | + |
| 115 | +find_E_grid_index.o: |
| 116 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c find_E_grid_index.cu |
| 117 | + |
| 118 | +find_E_grid_index_quad.o: |
| 119 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c find_E_grid_index_quad.cu |
| 120 | + |
| 121 | +sample_fission_spectra.o: |
| 122 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c sample_fission_spectra.cu |
| 123 | + |
| 124 | +sample_fixed_source.o: |
| 125 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c sample_fixed_source.cu |
| 126 | + |
| 127 | +macroscopic.o: |
| 128 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c macroscopic.cu |
| 129 | + |
| 130 | +microscopic.o: |
| 131 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c microscopic.cu |
| 132 | + |
| 133 | +copy_points.o: |
| 134 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c copy_points.cu |
| 135 | + |
| 136 | +tally_spec.o: |
| 137 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c tally_spec.cu |
| 138 | + |
| 139 | +escatter.o: |
| 140 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c escatter.cu |
| 141 | + |
| 142 | +iscatter.o: |
| 143 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c iscatter.cu |
| 144 | + |
| 145 | +cscatter.o: |
| 146 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c cscatter.cu |
| 147 | + |
| 148 | +fission.o: |
| 149 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c fission.cu |
| 150 | + |
| 151 | +absorb.o: |
| 152 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c absorb.cu |
| 153 | + |
| 154 | +make_mask.o: |
| 155 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c make_mask.cu |
| 156 | + |
| 157 | +print_histories.o: |
| 158 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c print_histories.cu |
| 159 | + |
| 160 | +pop_secondaries.o: |
| 161 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c pop_secondaries.cu |
| 162 | + |
| 163 | +pop_source.o: |
| 164 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c pop_source.cu |
| 165 | + |
| 166 | +rebase_yield.o: |
| 167 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c rebase_yield.cu |
| 168 | + |
| 169 | +flip_done.o: |
| 170 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c flip_done.cu |
| 171 | + |
| 172 | +device_copies.o: |
| 173 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c device_copies.cu |
| 174 | + |
| 175 | +reaction_edges.o: |
| 176 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c reaction_edges.cu |
| 177 | + |
| 178 | +write_to_file.o: |
| 179 | + $(NVCC) $(ARCH) $(NVCC_FLAGS) -c write_to_file.cu |
| 180 | + |
| 181 | +whistory.o: |
| 182 | + $(CXX) $(C_FLAGS) $(OPTIX_FLAGS) $(CUDPP_FLAGS) $(PNG_FLAGS) $(PYTHON_FLAGS) $(CUDA_FLAGS) -c whistory.cpp |
| 183 | + |
| 184 | +wgeometry.o: |
| 185 | + $(CXX) $(C_FLAGS) -c wgeometry.cpp |
| 186 | + |
| 187 | +primitive.o: |
| 188 | + $(CXX) $(C_FLAGS) -c primitive.cpp |
| 189 | + |
| 190 | +optix_stuff.o: device_copies.o |
| 191 | + $(CXX) -m64 -fPIC $(OPTIX_FLAGS) $(CUDA_FLAGS) $(PNG_FLAGS) -c optix_stuff.cpp |
| 192 | + |
| 193 | +libwarp.so: $(ptx_objects) $(COBJS) |
| 194 | + $(NVCC) --shared $(NVCC_FLAGS) $(OPTIX_FLAGS) $(CUDPP_FLAGS) $(PYTHON_FLAGS) $(PNG_FLAGS) $(CURAND_LIBS) $(OPTIX_LIBS) $(CUDPP_LIBS) $(PYTHON_LIBS) $(PNG_LIBS) $(COBJS) -o libwarp.so |
| 195 | + |
| 196 | +gpu: libwarp.so |
| 197 | + $(NVCC) -m64 $(OPTIX_FLAGS) $(CUDPP_FLAGS) $(PYTHON_FLAGS) -L/mnt/scratch/gpu-cpp -lwarp main.cpp -o $@ |
| 198 | + |
| 199 | +optixtest: libwarp.so |
| 200 | + $(NVCC) -m64 $(OPTIX_FLAGS) $(CUDPP_FLAGS) $(PYTHON_FLAGS) -L/Users/rmb/code/gpu-cpp -lwarp -loptix optixtest.cpp -o $@ |
| 201 | + |
| 202 | +warp.py: libwarp.so |
| 203 | + swig warp.i |
0 commit comments