Skip to content

Commit

Permalink
Merge pull request #251 from adanalis/2024.09.cuda_tests_pic
Browse files Browse the repository at this point in the history
CUDA Tests: Conditionally adding -fpic to nvcc.
  • Loading branch information
adanalis authored Sep 30, 2024
2 parents b7e1f9c + d33d7f4 commit 7427372
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/Makefile_comp_tests.target.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ OPTFLAGS= @OPTFLAGS@
TOPTFLAGS= @TOPTFLAGS@
OMPCFLGS = @OMPCFLGS@
UTILOBJS = $(TESTLIB)
BUILD_SHARED_LIB = @BUILD_SHARED_LIB@
BUILD_LIBSDE_SHARED = @BUILD_LIBSDE_SHARED@
BUILD_LIBSDE_STATIC = @BUILD_LIBSDE_STATIC@
NO_MPI_TESTS = @NO_MPI_TESTS@
Expand Down
3 changes: 3 additions & 0 deletions src/components/cuda/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ NVCC = $(PAPI_CUDA_ROOT)/bin/nvcc

PAPI_FLAG = -DPAPI # Comment this line for tests to run without PAPI profiling
NVCFLAGS = -g -ccbin='$(CC)' $(PAPI_FLAG)
ifeq ($(BUILD_SHARED_LIB),yes)
NVCFLAGS += -Xcompiler -fpic
endif
CFLAGS += -g $(PAPI_FLAG)
INCLUDE += -I$(PAPI_CUDA_ROOT)/include
CUDALIBS = -L$(PAPI_CUDA_ROOT)/lib64 -lcudart -lcuda
Expand Down
4 changes: 4 additions & 0 deletions src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ arch
LIBSDEFLAGS
BUILD_LIBSDE_STATIC
BUILD_LIBSDE_SHARED
BUILD_SHARED_LIB
LDL
LRT
EGREP
Expand Down Expand Up @@ -5666,9 +5667,12 @@ if test "$shared_lib" = "no" -a "$static_lib" = "no"; then
as_fn_error $? "Both shared and static libs are disabled" "$LINENO" 5
fi
BUILD_SHARED_LIB="no"
if test "$shared_lib" = "yes"; then
BUILD_SHARED_LIB="yes"
papiLIBS="shared"
fi
if test "$static_lib" = "yes"; then
papiLIBS="$papiLIBS static"
fi
Expand Down
3 changes: 3 additions & 0 deletions src/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -967,9 +967,12 @@ if test "$shared_lib" = "no" -a "$static_lib" = "no"; then
AC_MSG_ERROR(Both shared and static libs are disabled)
fi

BUILD_SHARED_LIB="no"
if test "$shared_lib" = "yes"; then
BUILD_SHARED_LIB="yes"
papiLIBS="shared"
fi
AC_SUBST(BUILD_SHARED_LIB)
if test "$static_lib" = "yes"; then
papiLIBS="$papiLIBS static"
fi
Expand Down

0 comments on commit 7427372

Please sign in to comment.