From aba56610404c90143f7837aadfd19b769caf5460 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Tue, 17 Oct 2023 15:32:51 -0400 Subject: Add test for libsmctrl_set_global_mask() Also use static linking for tests, to avoid a need to set LD_LIBRARY_PATH to include the libsmctrl directory. --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index aa59792..cfbd971 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ CC = gcc +NVCC ?= nvcc # -fPIC is needed in all cases, as we may be linked into another shared library CFLAGS = -fPIC LDFLAGS = -lcuda -I/usr/local/cuda/include @@ -12,10 +13,15 @@ libsmctrl.a: libsmctrl.c libsmctrl.h $(CC) $< -c -o libsmctrl.o $(CFLAGS) $(LDFLAGS) ar rcs $@ libsmctrl.o -libsmctrl_test_gpc_info: libsmctrl_test_gpc_info.c - $(CC) $< -o $@ -L. -lsmctrl $(LDFLAGS) +# Use static linking with tests to avoid LD_LIBRARY_PATH issues +libsmctrl_test_gpc_info: libsmctrl_test_gpc_info.c libsmctrl.a + $(CC) $< -o $@ -g -L. -l:libsmctrl.a $(LDFLAGS) -tests: libsmctrl_test_gpc_info +libsmctrl_test_global_mask: libsmctrl_test_global_mask.cu libsmctrl.a + $(NVCC) $< -o $@ -g -L. -l:libsmctrl.a $(LDFLAGS) + +tests: libsmctrl_test_gpc_info libsmctrl_test_global_mask clean: - rm -f libsmctrl.so libsmctrl.a + rm -f libsmctrl.so libsmctrl.a libsmctrl_test_gpu_info \ + libsmctrl_test_global_mask -- cgit v1.2.2