1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CXXFLAGS_MAINT_APPEND = -lpthread
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
#export DPKG_GENSYMBOLS_CHECK_LEVEL = 0
ifneq (,$(shell command -v nvcc))
export CC = cuda-gcc
export CXX = cuda-g++
endif
%:
dh $@ -Scmake+ninja
override_dh_auto_configure:
mkdir third-party
cd third-party; ln -s /usr/src/googletest googletest
ifneq (,$(shell command -v nvcc))
# CUDA
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DUSE_REDIS=ON \
-DUSE_IBVERBS=ON \
-DUSE_MPI=ON \
-DUSE_LIBUV=ON \
-DUSE_CUDA=ON \
-DGLOO_USE_CUDA_TOOLKIT=ON \
-DUSE_NCCL=ON \
-DUSE_ROCM=OFF \
-DUSE_RCCL=OFF \
-DBUILD_TEST=OFF \
-DBUILD_BENCHMARK=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_SHARED_LIBS=ON
else ifneq (,$(shell command -v hipcc))
# ROCm
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DUSE_REDIS=ON \
-DUSE_IBVERBS=ON \
-DUSE_MPI=ON \
-DUSE_LIBUV=ON \
-DUSE_CUDA=OFF \
-DGLOO_USE_CUDA_TOOLKIT=OFF \
-DUSE_NCCL=OFF \
-DUSE_ROCM=ON \
-DUSE_RCCL=ON \
-DBUILD_TEST=OFF \
-DBUILD_BENCHMARK=OFF \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DROCM_HOME=/usr
else
# CPU
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DUSE_REDIS=ON \
-DUSE_IBVERBS=ON \
-DUSE_MPI=ON \
-DUSE_LIBUV=ON \
-DUSE_CUDA=OFF \
-DGLOO_USE_CUDA_TOOLKIT=OFF \
-DUSE_NCCL=OFF \
-DUSE_ROCM=OFF \
-DUSE_RCCL=OFF \
-DBUILD_TEST=ON \
-DBUILD_BENCHMARK=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_SHARED_LIBS=ON
endif
# there is no 'test' target generated, do not use dh_auto_test
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# the test is flaky -- do not run it for now
# -find obj-* -type f -name 'gloo_test' -executable -exec sh -c '{}' +
endif
override_dh_auto_clean:
-$(RM) -rf third-party
dh_auto_clean
|