Browse Source

libstarpu.pc.in: only make public the CUDA flags

Nathalie Furmento 15 years ago
parent
commit
9d25e11734
2 changed files with 9 additions and 2 deletions
  1. 6 0
      configure.ac
  2. 3 2
      libstarpu.pc.in

+ 6 - 0
configure.ac

@@ -179,6 +179,8 @@ if test x$enable_cuda = xyes -o x$enable_cuda = xmaybe; then
 	
 	if test -d "$cuda_dir/include/"; then
 		CPPFLAGS="${CPPFLAGS} -I$cuda_dir/include/ "
+                STARPU_CUDA_CPPFLAGS="-I$cuda_dir/include/"
+                AC_SUBST(STARPU_CUDA_CPPFLAGS, $STARPU_CUDA_CPPFLAGS)
 		NVCCFLAGS="${NVCCFLAGS} -I$cuda_dir/include/ "
 	fi
 
@@ -194,11 +196,13 @@ if test x$enable_cuda = xyes -o x$enable_cuda = xmaybe; then
 	found_cudalib=no
 	if test -d "$cuda_dir/lib/"; then
 		LDFLAGS="${SAVED_LDFLAGS} -L$cuda_dir/lib/ "
+                STARPU_CUDA_LDFLAGS="-L$cuda_dir/lib/"
 		AC_SEARCH_LIBS([cuInit],[cuda],[found_cudalib=yes],[found_cudalib=no])
 	fi
 
 	if test x$found_cudalib=xno -a -d "$cuda_dir/lib64/"; then
 		LDFLAGS="${SAVED_LDFLAGS} -L$cuda_dir/lib64/ "
+                STARPU_CUDA_LDFLAGS="-L$cuda_dir/lib64/"
 	fi
 
 	AC_SEARCH_LIBS([cuInit],[cuda],[],[have_valid_cuda=no])
@@ -225,6 +229,8 @@ AM_CONDITIONAL(STARPU_USE_CUDA, test x$enable_cuda = xyes)
 if test x$enable_cuda = xyes; then
 	AC_DEFINE(STARPU_USE_CUDA, [1], [CUDA support is activated])
 
+        AC_SUBST(STARPU_CUDA_LDFLAGS, "$STARPU_CUDA_LDFLAGS -lcuda")
+
 	#in case this is a 64bit setup, we tell nvcc to use a -m64 flag
 	AC_CHECK_SIZEOF([void *])
 	if test x$SIZEOF_VOID_P = x8; then

+ 3 - 2
libstarpu.pc.in

@@ -6,6 +6,7 @@ includedir=@includedir@
 Name: starpu
 Description: offers support for heterogeneous multicore architecture
 Version: @PACKAGE_VERSION@
-Cflags: -I${includedir} @CPPFLAGS@
-Libs: -L${libdir} @LDFLAGS@ @LIBS@ -lstarpu
+Cflags: -I${includedir} @STARPU_CUDA_CPPFLAGS@
+Libs: -L${libdir} -lstarpu @STARPU_CUDA_LDFLAGS@
+Libs.private: @LDFLAGS@ @LIBS@
 Requires.private: @HWLOC_REQUIRES@ @GORDON_REQUIRES@