Connecting R-Studio with MySQL leads to errors (Windows) - mysql

I used this guide: Using MySQL in R for Windows but it didn't help. I'm already searching for hours on this problem. Since I can't figure out my problem I just can send here the log when trying to install.packages('RMySQL',type='source')
> Warning in install.packages : package ‘RMySQL’ is not available (for
> R version 3.0.2) Installing package into ‘C:/Users/Mr.
> Kox/Documents/R/win-library/3.0’ (as ‘lib’ is unspecified) trying URL
> 'http://cran.rstudio.com/src/contrib/RMySQL_0.9-3.tar.gz' Content type
> 'application/x-gzip' length 165363 bytes (161 Kb) opened URL
> downloaded 161 Kb
>
> * installing *source* package 'RMySQL' ...
> ** Paket 'RMySQL' erfolgreich entpackt und MD5 Summen überprüft
> 0 [main] sh 6324 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer. Please report this problem to the public mailing
> list cygwin#cygwin.com checking for $MYSQL_HOME... C:/xampp/mysql
> cygwin warning: MS-DOS style path detected: C:/xampp/mysql
> Preferred POSIX equivalent is: /cygdrive/c/xampp/mysql CYGWIN
> environment variable option "nodosfilewarning" turns off this warning.
> Consult the user's guide for more details about POSIX paths:
> http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> ** libs Warnung: this package has a non-empty 'configure.win' file, so building only the main architecture
>
> 0 [main] make 6988 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer. Please report this problem to the public mailing
> list cygwin#cygwin.com cygwin warning: MS-DOS style path detected:
> C:/PROGRA~1/R/R-30~1.2/etc/x64/Makeconf Preferred POSIX equivalent
> is: /cygdrive/c/PROGRA~1/R/R-30~1.2/etc/x64/Makeconf CYGWIN
> environment variable option "nodosfilewarning" turns off this warning.
> Consult the user's guide for more details about POSIX paths:
> http://cygwin.com/cygwin-ug-net/using.html#using-pathnames gcc -m64 -I"C:/PROGRA~1/R/R-30~1.2/include" -DNDEBUG -I"C:/xampp/mysql"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -std=gnu99 -mtune=core2 -c RS-DBI.c -o RS-DBI.o RS-DBI.c: In function 'RS_na_set': RS-DBI.c:1219:11: warning: variable 'c' set but not used
> [-Wunused-but-set-variable] gcc -m64
> -I"C:/PROGRA~1/R/R-30~1.2/include" -DNDEBUG -I"C:/xampp/mysql"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -std=gnu99 -mtune=core2 -c RS-MySQL.c -o RS-MySQL.o RS-MySQL.c: In function 'RS_MySQL_fetch': RS-MySQL.c:657:13: warning: variable
> 'fld_nullOk' set but not used [-Wunused-but-set-variable] RS-MySQL.c:
> In function 'RS_DBI_invokeBeginGroup': RS-MySQL.c:1137:30: warning:
> variable 'val' set but not used [-Wunused-but-set-variable]
> RS-MySQL.c: In function 'RS_DBI_invokeNewRecord': RS-MySQL.c:1158:20:
> warning: variable 'val' set but not used [-Wunused-but-set-variable]
> RS-MySQL.c: In function 'RS_MySQL_dbApply': RS-MySQL.c:1219:38:
> warning: variable 'fld_nullOk' set but not used
> [-Wunused-but-set-variable] gcc -m64 -shared -s -static-libgcc -o
> RMySQL.dll tmp.def RS-DBI.o RS-MySQL.o C:/xampp/mysql/bin/libmySQL.dll
> -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-30~1.2/bin/x64 -lR collect2: ld returned 5 exit status ERROR: compilation failed for package 'RMySQL'
> * removing 'C:/Users/Mr. Kox/Documents/R/win-library/3.0/RMySQL'
> * restoring previous 'C:/Users/Mr. Kox/Documents/R/win-library/3.0/RMySQL' Warning in install.packages :
> running command '"C:/PROGRA~1/R/R-30~1.2/bin/x64/R" CMD INSTALL -l
> "C:\Users\Mr. Kox\Documents\R\win-library\3.0"
> C:\Users\MRFFAF~1.KOX\AppData\Local\Temp\RtmpCGe2RS/downloaded_packages/RMySQL_0.9-3.tar.gz'
> had status 1 Warning in install.packages : installation of package
> ‘RMySQL’ had non-zero exit status
>
> The downloaded source packages are in ‘C:\Users\Mr.
> Kox\AppData\Local\Temp\RtmpCGe2RS\downloaded_packages’
I think the main problem is in "collect2: ld returned 5 exit status". Well maybe you guys can help me out. Overall I just want to connect R-Studio with a MySQL database. Thanks.

Found the solution. It's pretty easy.
Go to R-Studio -> Tools -> Options -> R-Version -> and here instead of the current choose "[Default] [32-bit] C:\Program Files\R\R-3.0.2"
Now it works for the issue above. Have fun.

Use RODBC and this guide: http://www.joyofdata.de/blog/make-r-talk-to-mysql-on-windows/
You are using R 64bit apparently - it is important to then use the 64bit connector.

Related

Compiling MariaDB Connector v1.0.5 and/or Mysql Connection v 5.3.4

I am trying to compile MariaDB Connector v1.0.5 and/or Mysql Connection v 5.3.4.
I have MariaDB Server v.10.0.21 installed on a Slackware server. I just need to get a MYSQL connector working, doesn't matter which one.
Also applied the patch mentioned in Is there compatible ODBC driver with Mariadb 10 on Linux?
When I compile the MariaDB Connector I get an error saying "MariaDB not found".
When I compile the Mysql Connector I get the following error:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
MYSQL_LIB
linked by target "myodbc5a" in directory /downloads/mysql-connector-odbc-5.3.4-src/driver
linked by target "myodbc5w" in directory /downloads/mysql-connector-odbc-5.3.4-src/driver
linked by target "myodbc5S" in directory /downloads/mysql-connector-odbc-5.3.4-src/setupgui
linked by target "myodbc-installer" in directory /downloads/mysql-connector-odbc-5.3.4-src/installer
OUTOUT from Error File
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/gmake "cmTryCompileExec3523358880/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec3523358880.dir/build.make CMakeFiles/cmTryCompileExec3523358880.dir/build
gmake1: Entering directory /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o -c /usr/share/cmake-2.8/Modules/CheckFunct
ionExists.c
Linking C executable cmTryCompileExec3523358880
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3523358880.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o -o cmTryCompileExec3523358880 -rdynamic -lpth
reads
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../x86_64-slackware-linux/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec3523358880] Error 1
gmake[1]: Leaving directory/downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec3523358880/fast] Error 2
Determining if the function dlopen exists failed with the following output:
Change Dir: /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/gmake "cmTryCompileExec1888052970/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec1888052970.dir/build.make CMakeFiles/cmTryCompileExec1888052970.dir/build
gmake1: Entering directory /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=dlopen -o CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o -c /usr/share/cmake-2.8/Modules/CheckFunctionExist
s.c
Linking C executable cmTryCompileExec1888052970
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1888052970.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=dlopen CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o -o cmTryCompileExec1888052970 -rdynamic
CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o: In functionmain':
CheckFunctionExists.c:(.text+0x15): undefined reference to dlopen'
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec1888052970] Error 1
gmake[1]: Leaving directory/downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec1888052970/fast] Error 2
Blockquote
Just use the precompiled versions. Copy the libraries to the lib and include directories.

bugzilla: install-module.pl GD return shows an error

Trying to setup bugzilla on mac. trying to install DBD mysql but get the following error back:
> enter code hereChecking if your kit is complete... Looks good Warning
> (mostly harmless): No library found for -lmysqlclient Using DBI 1.631
> (for perl 5.018002 on darwin-thread-multi-2level) installed in
> /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI/
> Writing Makefile for DBD::mysql Writing MYMETA.yml and MYMETA.json cp
> lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm cp
> lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod cp
> lib/DBD/mysql.pm blib/lib/DBD/mysql.pm cp lib/Bundle/DBD/mysql.pm
> blib/lib/Bundle/DBD/mysql.pm cp README.pod blib/lib/DBD/README.pod cc
> -c -I/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI -I/Applications/MAMP/Library/include -fno-omit-frame-pointer -g -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -Os -DVERSION=\"4.032\" -DXS_VERSION=\"4.032\" "-I/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE"
> dbdimp.c In file included from dbdimp.c:20: ./dbdimp.h:21:10: fatal
> error: 'mysql.h' file not found
> #include <mysql.h> /* Comes with MySQL-devel */
> ^ 1 error generated. make: *** [dbdimp.o] Error 1 CAPTTOFU/DBD-mysql-4.032.tar.gz /usr/bin/make -- NOT OK Skipping
> test because of notest pragma Running make install Make had returned
> bad status, install seems impossible
Cant proceed any further with the setup
It's looking for the header files and libraries for MySQL, which are an external dependencies for DBD::mysql. You either need to install the MySQL, the MySQL client libraries, or tell the installer where you installed those.

R library RMySQL doesn't start

I have installed R3.0.1. Rtools is also installed. MySQL version 5.7 is installed. I want to connect R to MySQL, and I am trying to do that through RMySQL package in R.
While the installation of RMySQL is finally done after looking at various SO questions, the library command gives error. Please see below complete R logs. Please help.
> install.packages("RMySQL",type="source")
trying URL 'http://cran.rstudio.com/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
downloaded 161 Kb
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
checking for $MYSQL_HOME... C:/Program Files/MySQL/MySQL Server 5.7
cygwin warning:
MS-DOS style path detected: C:/Program
Preferred POSIX equivalent is: /cygdrive/c/Program
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
test: Files/MySQL/MySQL: unknown operand
** libs
Warning: this package has a non-empty 'configure.win' file,
so building only the main architecture
cygwin warning:
MS-DOS style path detected: D:/SOFTWA~1/R-30~1.3/etc/x64/Makeconf
Preferred POSIX equivalent is: /cygdrive/d/SOFTWA~1/R-30~1.3/etc/x64/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
gcc -m64 -I"D:/SOFTWA~1/R-30~1.3/include" -DNDEBUG -I"C:/Program Files/MySQL/MySQL Server 5.7"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall - std=gnu99 -mtune=core2 -c RS-DBI.c -o RS-DBI.o
RS-DBI.c: In function 'RS_na_set':
RS-DBI.c:1219:11: warning: variable 'c' set but not used [-Wunused-but-set-variable]
gcc -m64 -I"D:/SOFTWA~1/R-30~1.3/include" -DNDEBUG -I"C:/Program Files/MySQL/MySQL Server 5.7"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall - std=gnu99 -mtune=core2 -c RS-MySQL.c -o RS-MySQL.o
RS-MySQL.c: In function 'RS_MySQL_fetch':
RS-MySQL.c:657:13: warning: variable 'fld_nullOk' set but not used [-Wunused-but-set- variable]
RS-MySQL.c: In function 'RS_DBI_invokeBeginGroup':
RS-MySQL.c:1137:30: warning: variable 'val' set but not used [-Wunused-but-set-variable]
RS-MySQL.c: In function 'RS_DBI_invokeNewRecord':
RS-MySQL.c:1158:20: warning: variable 'val' set but not used [-Wunused-but-set-variable]
RS-MySQL.c: In function 'RS_MySQL_dbApply':
RS-MySQL.c:1219:38: warning: variable 'fld_nullOk' set but not used [-Wunused-but-set-variable]
gcc -m64 -shared -s -static-libgcc -o RMySQL.dll tmp.def RS-DBI.o RS-MySQL.o C:/Program Files/MySQL/MySQL Server 5.7/bin/libmySQL.dll - Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LD:/SOFTWA~1/R-30~1.3/bin/x64 -lR
installing to D:/Softwares/R-3.0.3/library/RMySQL/libs/x64
** R
** inst
** preparing package for lazy loading
Creating a generic function for 'format' from package 'base' in package 'RMySQL'
Creating a generic function for 'print' from package 'base' in package 'RMySQL'
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
MYSQL_HOME defined as C:/Program Files/MySQL/MySQL Server 5.7
* DONE (RMySQL)
The downloaded source packages are in
‘C:\Users\mitrabhanu.panda\AppData\Local\Temp\RtmpgZHT8R\downloaded_packages’
> library(RMySQL)
Looking in C:\Program Files/MySQL, C:/MySQL, D:/MySQL, E:/MySQL, F:/MySQL, G:/MySQL, C:/xampp/MySQL, D:/xampp/MySQL, E:/xampp/MySQL, F:/xampp/MySQL, G:/xampp/MySQL, C:/Apps/MySQL, D:/Apps/MySQL, E:/Apps/MySQL, F:/Apps/MySQL, G:/Apps/MySQL
Found C:\Program Files/MySQL
Error : .onLoad failed in loadNamespace() for 'RMySQL', details:
call: setwd(bin)
error: character argument expected
Error: package or namespace load failed for ‘RMySQL’
Please let me know what I have done wrong.
As written in my comment, here is the sample code for reading a table from mysql:
require(RJDBC)
j <- JDBC(classPath='/path/to/mysql/jdbc/jar', driverClass='com.mysql.jdbc.Driver')
connection <- dbConnect(j, 'jdbc:mysql://localhost/databasename', 'myusername','mypassword')
on.exit(dbDisconnect(connection))
data.frame.from.sql <- dbReadTable(connection, 'tablename')
This will read the table named tablename from databasename into data.frame.from.sql as an R data frame that you can manipulate as you see fit. I hope this helps.

Error undefined reference to `cutCreateTimer'

I have the cuda 4.0 toolkit installed in my Ubuntu 12.04 server. When I am trying to build a cuda code present in Rodinia benchmark suite. I was getting the following error. i.e, after running the make command
ncclab#slave13:~/Downloads/rodinia_2.4$ make
cd cuda/cfd; make; cp euler3d euler3d_double pre_euler3d pre_euler3d_double /home/ncclab/Downloads/rodinia_2.4/bin/linux/cuda
make[1]: Entering directory `/home/ncclab/Downloads/rodinia_2.4/cuda/cfd'
nvcc -O2 -Xptxas -v --gpu-architecture=compute_20 --gpu-code=compute_20 euler3d.cu -o euler3d -I/if10/kw5na/NVIDIA_GPU_Computing_SDK4/C/common/inc -L/if10/kw5na/NVIDIA_GPU_Computing_SDK4/C/lib
euler3d.cu:35: warning: #warning "the kernels may fail too launch on some systems if the block length is too large"
euler3d.cu:35: warning: #warning "the kernels may fail too launch on some systems if the block length is too large"
By here the euler3d was built
nvcc -Xptxas -v -O3 --gpu-architecture=compute_20 --gpu-code=compute_20 euler3d_double.cu -o euler3d_double -I/if10/kw5na/NVIDIA_GPU_Computing_SDK4/C/common/inc -L/if10/kw5na/NVIDIA_GPU_Computing_SDK4/C/lib
/tmp/tmpxft_0000532d_00000000-12_euler3d_double.o: In function `main':
tmpxft_0000532d_00000000-1_euler3d_double.cudafe1.cpp:(.text+0x22d9): undefined reference to `cutCreateTimer'
tmpxft_0000532d_00000000-1_euler3d_double.cudafe1.cpp:(.text+0x22f7): undefined reference to `cutStartTimer'
tmpxft_0000532d_00000000-1_euler3d_double.cudafe1.cpp:(.text+0x2457): undefined reference to `cutStopTimer'
tmpxft_0000532d_00000000-1_euler3d_double.cudafe1.cpp:(.text+0x246c): undefined reference to `cutGetAverageTimerValue'
collect2: ld returned 1 exit status
make[1]: *** [euler3d_double] Error 1
make[1]: Leaving directory `/home/ncclab/Downloads/rodinia_2.4/cuda/cfd'
cp: cannot stat `euler3d_double': No such file or directory
cp: cannot stat `pre_euler3d': No such file or directory
cp: cannot stat `pre_euler3d_double': No such file or directory
make: *** [CUDA] Error 1
By searching I came to know that there may be a problem with libcutil
But I had the libcutil_x86_64.a in ~/NVIDIA_GPU_Computing_SDK/C/lib
Edit: The contents of various folders are
ncclab#slave13:~/NVIDIA_GPU_Computing_SDK/C/lib$ ls
libcutil_x86_64.a libparamgl_x86_64.a librendercheckgl_x86_64.a
~/Downloads/rodinia_2.4/cuda/cfd$ ls
euler3d euler3d_double.cu Makefile~ pre_euler3d.cu README
euler3d.cu Makefile Makefile_nvidia pre_euler3d_double.cu run
ncclab#slave13:~/NVIDIA_GPU_Computing_SDK/C/common/inc$ ls
bank_checker.h cutil_inline.h GL nvVector.h stopwatch_base.h
cmd_arg_reader.h cutil_inline_runtime.h multithreading.h nvWidgets.h stopwatch_base.inl
cuda_drvapi_dynlink.c cutil_math.h nvGlutWidgets.h paramgl.h stopwatch.h
cutil_gl_error.h dynlink nvGLWidgets.h param.h stopwatch_linux.h
cutil_gl_inline.h dynlink_d3d10.h nvMath.h rendercheck_d3d10.h
cutil.h dynlink_d3d11.h nvMatrix.h rendercheck_d3d11.h
cutil_inline_bankchecker.h error_checker.h nvQuaternion.h rendercheck_d3d9.h
cutil_inline_drvapi.h exception.h nvShaderUtils.h rendercheck_gl.h
the partial contents of the makefile are
all: euler3d euler3d_double pre_euler3d pre_euler3d_double
euler3d: euler3d.cu
nvcc -O2 -Xptxas -v --gpu-architecture=compute_20 --gpu-code=compute_20 euler3d.cu -o euler3d -I$(CUDA_SDK_PATH)/common/inc -L$(CUDA_SDK_PATH)/lib $(CUTIL_LIB)
euler3d_double: euler3d_double.cu
nvcc -Xptxas -v -O3 --gpu-architecture=compute_20 --gpu-code=compute_20 euler3d_double.cu -o euler3d_double -I$(CUDA_SDK_PATH)/common/inc -L$(CUDA_SDK_PATH)/lib $(CUTIL_LIB)
pre_euler3d: pre_euler3d.cu
nvcc -Xptxas -v -O3 --gpu-architecture=compute_20 --gpu-code=compute_20 pre_euler3d.cu -o pre_euler3d -I$(CUDA_SDK_PATH)/common/inc -L$(CUDA_SDK_PATH)/lib $(CUTIL_LIB)
pre_euler3d_double: pre_euler3d_double.cu
nvcc -Xptxas -v -O3 --gpu-architecture=compute_20 --gpu-code=compute_20 pre_euler3d_double.cu -o pre_euler3d_double -I$(CUDA_SDK_PATH)/common/inc -L$(CUDA_SDK_PATH)/lib $(CUTIL_LIB)
The euler3d has been successfully built. The errors are occurring for all the remaining three files.So I don't think there is any problems in the directories they are referring to
I really don't understand why the undefined reference to `cutCreateTimer' and others are occurring. But searching in SE I came to know that when there is any problem with cutil.h or libcutil these problems exits. I was a newbie of linux environment. So please help me
Edit 2: In a include file named make.config the following lines were present
# CUDA SDK installation path
#SDK_DIR = $(HOME)/NVIDIA_GPU_Computing_SDK/C
SDK_DIR =/if10/kw5na/NVIDIA_GPU_Computing_SDK4/C
#SDK_DIR =/if10/kw5na/NVIDIA_CUDA_Computing_SDK4/C
Here by default the 2nd option was selected and the euler3d was built. So I thought there may be a problem because of this. But changing it does not change the problem I was facing
and about cutil library present in make file
CUDA_SDK_PATH := $(SDK_DIR)
# Determine the correct version of the cutil library
CUTIL_LIB = # -lcutil
ifeq ($(shell uname -m), x86_64)
ifeq ($(shell if test -e $(SDK_DIR)/lib/libcutil_x86_64.a; then echo T; else echo F; fi), T)
CUTIL_LIB = #-lcutil_x86_64
endif
endif
Which I think was correct
The problem is that your compile command is specifying the library path, but not the library itself that is providing the cut... functionality.
This is apparently the makefile line that is generating the nvcc compile command for euler3d_double:
euler3d_double: euler3d_double.cu
nvcc -Xptxas -v -O3 --gpu-architecture=compute_20 --gpu-code=compute_20 euler3d_double.cu -o euler3d_double -I$(CUDA_SDK_PATH)/common/inc -L$(CUDA_SDK_PATH)/lib $(CUTIL_LIB)
This is the generated compile command:
nvcc -Xptxas -v -O3 --gpu-architecture=compute_20 --gpu-code=compute_20 euler3d_double.cu -o euler3d_double -I/if10/kw5na/NVIDIA_GPU_Computing_SDK4/C/common/inc -L/if10/kw5na/NVIDIA_GPU_Computing_SDK4/C/lib
You'll note that the last two tokens in the makefile line are:
-L$(CUDA_SDK_PATH)/lib $(CUTIL_LIB)
The -L$... token is getting converted to the correct library path. But the $(CUTIL_LIB) token should be getting converted to something like -lcutil or perhaps -lcutil_x86_64, but that is not happening. As a result, the library that provides the cut...Timer... functions is missing, and so those appear to be undefined.
I would inspect the Makefile carefully to see if there are any end-of-line characters or other oddities that are different between the line that specifies how euler3d_double should be built and the previous lines that specify how euler3d should be built.
You should also be able to confirm this by looking at the nvcc compile command line generated for euler3d (which you don't show) and comparing it to the one for euler3d_double (which is failing).

ld cannot find libmysqlclient

I remember, years ago when I started using mySQL, it was a nightmare to set up things "just so," so that the libraries were found (especially mySQL libraries!). In my case, I believe ldconfig was the tool that sorted things out. Flash forward to 2012 - have just installed a new "primary" system that includes 64-bit Ubuntu 12.04, and I'm in the process of making sure all my sources will compile. Imagine my surprise that I'm back in the same boat with libmysqlclient.
My web searches have revealed much to try, nothing that helps. Along the way, I found this trick: gcc ... mysql_config --cflags --libs - very nice, but that didn't help.
So, for example, the result of:
gcc -D_FILE_OFFSET_BITS=64 `mysql_config --cflags --libs` \
-o check-my-ip \
-s check-my-ip.c ../common/ini-file.c
is
/tmp/ccxAgCqr.o: In function `updateTables':
/usr/local/src/check-my-ip/check-my-ip.c:373: undefined reference to `mysql_init'
/usr/local/src/check-my-ip/check-my-ip.c:374: undefined reference to `mysql_real_connect'
/usr/local/src/check-my-ip/check-my-ip.c:381: undefined reference to `mysql_error'
/usr/local/src/check-my-ip/check-my-ip.c:381: undefined reference to `mysql_errno'
/usr/local/src/check-my-ip/check-my-ip.c:397: undefined reference to `mysql_field_count'
/usr/local/src/check-my-ip/check-my-ip.c:398: undefined reference to `mysql_use_result'
/usr/local/src/check-my-ip/check-my-ip.c:399: undefined reference to `mysql_fetch_row'
/usr/local/src/check-my-ip/check-my-ip.c:419: undefined reference to `mysql_free_result'
/usr/local/src/check-my-ip/check-my-ip.c:422: undefined reference to `mysql_field_count'
/usr/local/src/check-my-ip/check-my-ip.c:429: undefined reference to `mysql_close'
/tmp/ccxAgCqr.o: In function `myQuery':
/usr/local/src/check-my-ip/check-my-ip.c:439: undefined reference to `mysql_query'
/usr/local/src/check-my-ip/check-my-ip.c:441: undefined reference to `mysql_error'
/tmp/ccxAgCqr.o: In function `indexExists':
/usr/local/src/check-my-ip/check-my-ip.c:464: undefined reference to `mysql_field_count'
/usr/local/src/check-my-ip/check-my-ip.c:465: undefined reference to `mysql_use_result'
/usr/local/src/check-my-ip/check-my-ip.c:466: undefined reference to `mysql_fetch_row'
/usr/local/src/check-my-ip/check-my-ip.c:471: undefined reference to `mysql_free_result'
collect2: ld returned 1 exit status
make: *** [check-my-ip] Error 1
Output from mysql_config --cflags --libs is:
-I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g
-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -ldl
These are some other commands that may be helpful in diagnosis:
$ ldconfig -p | grep mysql
libmysqlclient.so.18 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18
libmysqlclient.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libmysqlclient.so
$ ls -l /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18
lrwxrwxrwx 1 root root 24 Jun 11 10:21 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
$ ls -l /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
-rw-r--r-- 1 root root 3408136 Jun 11 10:21 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
I did an aptitude search libmysql and noted that there are 37 lines, most of which have the i386 designation (like: libmysqld-pic:i386),
and I notice that there are zero lines with x86_64 (or -64) in that output; is that part of the problem? (Here are those 37 lines)
$ aptitude search libmysql
p libmysql++-dev - MySQL C++ library bindings (development)
p libmysql++-dev:i386 - MySQL C++ library bindings (development)
p libmysql++-doc - MySQL C++ library bindings (documentation and exampl
p libmysql++3 - MySQL C++ library bindings (runtime)
p libmysql++3:i386 - MySQL C++ library bindings (runtime)
p libmysql-cil-dev - MySQL database connector for CLI
p libmysql-diff-perl - module for comparing the table structure of two MySQ
p libmysql-java - Java database (JDBC) driver for MySQL
p libmysql-ocaml - OCaml bindings for MySql
p libmysql-ocaml:i386 - OCaml bindings for MySql
p libmysql-ocaml-dev - OCaml bindings for MySql
p libmysql-ocaml-dev:i386 - OCaml bindings for MySql
v libmysql-ocaml-dev-dnim6:i386 -
v libmysql-ocaml-dev-jygp6 -
v libmysql-ocaml-dnim6:i386 -
v libmysql-ocaml-jygp6 -
p libmysql-ruby - Transitional package for ruby-mysql
v libmysql-ruby:i386 -
p libmysql-ruby1.8 - Transitional package for ruby-mysql
v libmysql-ruby1.8:i386 -
p libmysql-ruby1.9.1 - Transitional package for ruby-mysql
v libmysql-ruby1.9.1:i386 -
p libmysql6.4-cil - MySQL database connector for CLI
i libmysqlclient-dev - MySQL database development files
p libmysqlclient-dev:i386 - MySQL database development files
v libmysqlclient15-dev -
v libmysqlclient15-dev:i386 -
i A libmysqlclient18 - MySQL database client library
p libmysqlclient18:i386 - MySQL database client library
p libmysqlcppconn-dev - MySQL Connector for C++ (development files)
p libmysqlcppconn-dev:i386 - MySQL Connector for C++ (development files)
p libmysqlcppconn5 - MySQL Connector for C++ (library)
p libmysqlcppconn5:i386 - MySQL Connector for C++ (library)
i libmysqld-dev - MySQL embedded database development files
p libmysqld-dev:i386 - MySQL embedded database development files
p libmysqld-pic - MySQL database development files
p libmysqld-pic:i386 - MySQL database development files
Here's the content of /usr/lib/mysql
$ find /usr/lib/mysql
/usr/lib/mysql
/usr/lib/mysql/plugin
/usr/lib/mysql/plugin/qa_auth_client.so
/usr/lib/mysql/plugin/auth.so
/usr/lib/mysql/plugin/qa_auth_server.so
/usr/lib/mysql/plugin/semisync_master.so
/usr/lib/mysql/plugin/libdaemon_example.so
/usr/lib/mysql/plugin/ha_example.so
/usr/lib/mysql/plugin/adt_null.so
/usr/lib/mysql/plugin/auth_test_plugin.so
/usr/lib/mysql/plugin/auth_socket.so
/usr/lib/mysql/plugin/qa_auth_interface.so
/usr/lib/mysql/plugin/semisync_slave.so
/usr/lib/mysql/plugin/mypluglib.so
I don't know what else to try, where else to look, and would appreciate any pointers.
Linker flags should always be specified last:
gcc -D_FILE_OFFSET_BITS=64 `mysql_config --cflags` \
-o check-my-ip \
-s check-my-ip.c ../common/ini-file.c \
`mysql_config --libs`