From 369aab6af9d80d002f18bf537061665ed464b81e Mon Sep 17 00:00:00 2001
From: Pietro Incardona <incardon@mpi-cbg.de>
Date: Wed, 19 Aug 2015 15:32:09 +0200
Subject: [PATCH] Fixing installation script

---
 configure.ac    | 3 +--
 install         | 2 +-
 m4/ax_cuda.m4   | 6 ++++--
 src/Makefile.am | 2 +-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index e4f92882..5d394d32 100755
--- a/configure.ac
+++ b/configure.ac
@@ -98,8 +98,6 @@ AX_BOOST([1.52],[],[echo "boost not found"
 
 ####### Checking for GPU support
 
-AX_CUDA
-
 ## detect for NVCC
 
 if test x"$NVCC_EXIST" = x"yes"; then
@@ -115,6 +113,7 @@ if test x"$NVCC_EXIST" = x"yes"; then
 
   AC_MSG_RESULT($gpu_support)
   if test x"$gpu_support" = x"yes"; then
+        AX_CUDA
 	AC_DEFINE([GPU],[],[GPU support])
   fi
 else
diff --git a/install b/install
index 7ae2da8c..5d839548 100755
--- a/install
+++ b/install
@@ -60,7 +60,7 @@ if [ $install_req -eq 0 ]; then
 else
     while [ $conf_err -ne 0 ]
     do
-        ./configure $configure_options
+        ./configure $options $configure_options
         conf_err=$?
 
 	echo "Configure script terminated with $conf_err"
diff --git a/m4/ax_cuda.m4 b/m4/ax_cuda.m4
index 4787d15c..11e8c4fa 100644
--- a/m4/ax_cuda.m4
+++ b/m4/ax_cuda.m4
@@ -56,8 +56,10 @@ AS_IF([test "x$NVCC_EXIST" = "xno"],[],[
 
           # If $build_cpu contains "_64", append "64" to CUDA_LIBS
           AS_IF([echo $build_cpu | grep -q "_64"],
-                [CUDA_LIBS+="64"])
-                
+                [
+                 AS_IF([-d {CUDA_LIBS}lib64], [ CUDA_LIBS+="64"  ], [ ])
+                ])
+
           # Append " -lcuda -lcudart" to CUDA_LIBS
           CUDA_LIBS+=" -lcuda -lcudart"
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 51ebdfaf..118b0a40 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,7 +5,7 @@ bin_PROGRAMS = pdata
 pdata_SOURCES = main.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster.cpp ../openfpm_data/src/Memleak_check.cpp
 pdata_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH) $(METIS_INCLUDE) $(BOOST_CPPFLAGS)
 pdata_CFLAGS = $(CUDA_CFLAGS)
-pdata_LDADD = $(LINKLIBS) -L/usr/lib64/nvidia-bumblebee/ -lmetis
+pdata_LDADD = $(LINKLIBS) -lmetis
 
 .cu.o :
 	$(NVCC) $(NVCCFLAGS) -o $@ -c $<
-- 
GitLab