aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2023-10-17 15:32:51 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2023-10-17 15:32:51 -0400
commitaba56610404c90143f7837aadfd19b769caf5460 (patch)
tree7cfd9598701c415cee78cc5ff60b748b43c68897 /Makefile
parent2c4b2d784815c5a2b4c49592b912c043f3d2a954 (diff)
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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 10 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index aa59792..cfbd971 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
1CC = gcc 1CC = gcc
2NVCC ?= nvcc
2# -fPIC is needed in all cases, as we may be linked into another shared library 3# -fPIC is needed in all cases, as we may be linked into another shared library
3CFLAGS = -fPIC 4CFLAGS = -fPIC
4LDFLAGS = -lcuda -I/usr/local/cuda/include 5LDFLAGS = -lcuda -I/usr/local/cuda/include
@@ -12,10 +13,15 @@ libsmctrl.a: libsmctrl.c libsmctrl.h
12 $(CC) $< -c -o libsmctrl.o $(CFLAGS) $(LDFLAGS) 13 $(CC) $< -c -o libsmctrl.o $(CFLAGS) $(LDFLAGS)
13 ar rcs $@ libsmctrl.o 14 ar rcs $@ libsmctrl.o
14 15
15libsmctrl_test_gpc_info: libsmctrl_test_gpc_info.c 16# Use static linking with tests to avoid LD_LIBRARY_PATH issues
16 $(CC) $< -o $@ -L. -lsmctrl $(LDFLAGS) 17libsmctrl_test_gpc_info: libsmctrl_test_gpc_info.c libsmctrl.a
18 $(CC) $< -o $@ -g -L. -l:libsmctrl.a $(LDFLAGS)
17 19
18tests: libsmctrl_test_gpc_info 20libsmctrl_test_global_mask: libsmctrl_test_global_mask.cu libsmctrl.a
21 $(NVCC) $< -o $@ -g -L. -l:libsmctrl.a $(LDFLAGS)
22
23tests: libsmctrl_test_gpc_info libsmctrl_test_global_mask
19 24
20clean: 25clean:
21 rm -f libsmctrl.so libsmctrl.a 26 rm -f libsmctrl.so libsmctrl.a libsmctrl_test_gpu_info \
27 libsmctrl_test_global_mask