I need a mysql-client for Eclipse Helios/Perl EPIC, running under windows7. Perl5.10 is running under cygwin on the same machine. I'm really strugglying to compile mysql sources with cmake under cygwin. I have also read the transition guide from "configure" to "cmake".
Here is the last test I tried among dozen of previous variants :
Libraries and source Preparation :
apt-cyg install make cmake gcc4-core gcc4-g++ libncurses-devel libncursesw-devel readline libstdc++6 libstdc++6-devel
mkdir -p /usr/local/src
mkdir -p /usr/local/mysql
cd /usr/local/src
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.9.tar.gz/from/http://mirrors.ircam.fr/pub/mysql/
find . -type f -name "*.tar.gz" -exec tar -zxvf {} \;
find . -type d -name "mysql-*" -exec cd {} \;
Build/Install
CC=gcc; CFLAGS=-O3 ; CXX=gcc ; CXXFLAGS=-O3; export CC CFLAGS CXX CXXFLAGS
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_EMBEDDED_SERVER=0 -DWITH_LIBEDIT=0 -DISABLE_SHARED=1
Build is stopped at 86% with
[ 86%] Building CXX object sql/CMakeFiles/mysqld.dir/main.cc.o
Linking CXX executable mysqld.exe
Creating library file: libmysqld.dll.a
libsql.a(mysqld.cc.o):mysqld.cc:(.rdata$_ZTV12Comp_creator[vtable for Comp_creator]+0x10): undefined reference to `___cxa_pure_virtual'
collect2: ld returned 1 exit status
make[2]: *** [sql/mysqld.exe] Error 1
make[1]: *** [sql/CMakeFiles/mysqld.dir/all] Error 2
I read 100's of threads but blindly as lacking compilation skills.
Maybe is there also an alternative or better solution to run my existing mysql debugging server hosted in a Debian's VM (as guest on my windows machine) from Eclipse.. ?
Suggestions are more than welcome.
Thx in advance
hum, looks like that there is no absolute need to do that to use perl epic with Eclipse, as cygwin perl embeds already the DBI modules (to be loaded with CPAN). So it's a way to get around this problem.
Related
I am trying to run MySQL in an R script running inside a Docker (actually Rocker) container, but am getting an error on the “install_packages(…” step. The only solution I found that was somewhat similar was specific to running RedHat Linux (I am running Mac OS X 10.15) and the solution included pointing to several directories that I do not have. Running under RStudio or from the command line, RMySQL loads without a problem.
Dockerfile:
FROM rocker/r-ver:latest
RUN mkdir /home/analysis
COPY install_packages.R /home/analysis/install_packages.R
COPY script_basic.R /home/analysis/script_basic.R
RUN Rscript /home/analysis/install_packages.R
CMD Rscript /home/analysis/script_basic.R
R files:
script_basic.R
library( RMySQL )
install_packages.R
install_packages(“RMySQL”)
Commands and responses:
$ docker build -t myapp .
…
Successfully tagged myapp:latest
$ docker run -it --rm myapp
Loading required package: DBI
Error: package or namespace load failed for ‘RMySQL’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/local/lib/R/site-library/RMySQL/libs/RMySQL.so':
libmysqlclient.so.21: cannot open shared object file: No such file or directory
Execution halted
$
I believe that rocker/r-dev does not include the libraries you need to get this to run. Untested, but try something like this.
Dockerfile
FROM rocker/r-ver:latest
RUN mkdir /home/analysis
RUN apt-get update \
&& apt-get install -y --no-install-recommends libmariadbclient-dev
COPY install_packages.R /home/analysis/install_packages.R
COPY script_basic.R /home/analysis/script_basic.R
RUN Rscript /home/analysis/install_packages.R
CMD Rscript /home/analysis/script_basic.R
You can find the need for certain libraries on https://cran.r-project.org/web/packages/RMySQL/index.html, as
SystemRequirements: libmariadb-client-dev | libmariadb-client-lgpl-dev | libmysqlclient-dev (deb), mariadb-devel (rpm), mariadb | mysql-connector-c (brew), mysql56_dev (csw)
and a note on how to install them in RMySQL's github README.md's Installation section.
(The CRAN page references libmysqlclient-dev, but the github page suggests "the mariadb implementation is much better". I don't know the premise of the statement, just explaining why I suggested one and CRAN listed another.)
When I try to test out invoking a serverless function handler using the serverless-rust plugin I get the error
/usr/bin/ld: cannot find -lmysqlclient
collect2: error: ld returned 1 exit status
You will need to use the hooks in the lambda-rust docker builder to install the necessary dependencies and include the library files in the packaged build.
First create a directory at the root of the project named .lambda-rust and in it create two files:
install
#!/usr/bin/env bash
echo "installing mysql dependencies"
yum install -y mysql-devel
and
package
#!/usr/bin/env bash
echo "packaging mysql library"
zip -j "$1.zip" /usr/lib64/mysql/libmysqlclient.so.18
Adjust the name of the library file for whichever is installed for you (I added a line with echo $(ls /usr/lib64/mysql) in one of the scripts to see what files existed after the install)
I'm trying to build from source MariaDB on CentOS 7. I have only done the following commands before I get the error shown in this image:
$ cd /usr/local/src
$ wget https://downloads.mariadb.org/interstitial/mariadb-5.5.40/source/mariadb-5.5.40.tar.gz/from/http%3A//ftp.ddg.lth.se/mariadb
$ tar xzvf mariadb
$ cd mariadb-5.5.40/
$ chown -R root.root .
$ cmake . -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mariadb
proof that libaio-devel is installed
For anyone that is in a similar situation, cmake apparently does a pretty bad job of re-checking dependencies, even removing the cache file doesn't work very well.
Just delete and re-extract from the .tar.gz and then cmake again, if you actually have the dependencies then they will be found.
I have a linux ubuntu 10.04 LTS freshly installed on my x64 PC, and I just followed this step-by-step installation guide to install NVidia CUDA on my PC. But when I cd into ~/NVIDIA_GPU_Computing_SDK/C/src/nbody and try to make the nbody simulation, it just prints out:
/usr/bin/ld: cannot find -lGL
collect2: ld returned 1 exit status
make: *** [../../bin/linux/release/nbody] Error 1
Is this a solvable problem?
I'm a newbie in Linux (and in Cuda programming) so please help me understanding.
cd /usr/lib/
ls -la | grep libGL.so
if libGL.so exists
sudo rm libGL.so
then run
sudo ln -s libGL.so.270.41.19 libGL.so
or whatever version of libGL.so you have
Use the Synaptic Package Manager and install the packages with libgl, libglu, libglut, etc. For example, libgl1-mesa and all its dev variants, freeglut, etc.
sudo apt-get install build-essential x-window-system-dev
will also get you the vast majority of those.
I'm trying to compile a C++ program and one of the classes uses . g++ is not able to find the libraries would be my guess. The command i use to compile is -
g++ c1.cpp c2.cpp c3.cpp c4.cpp -o c4 -lm -lmysqlclient
c3.cpp is the file that needs mysql.h. This works perfectly on my local machine, but refuses to run on the server with the error
cannot find -lmysqlclient
I tried finding the libmysqlclient.so files on the server using the find command, I don't think they are present there
uname -a
reveals
SunOS opteron 5.10 Generic_139556-08 i86pc i386 i86pc
user#opteron 12:26:02 ~/c++/projname/
I realize that i need to link some libraries, but where and how?
Any help would be appreciated.
Thanks.
Whatever library packages u think is not installed can be installed using sudo apt-get install. But the problem is to find the right name of the package apt-get can understand. So how to do that ?! simple
use command : sudo apt-cache search <filename>
For eg.: in this case lmysqlclient
sudo apt-cache search mysqlclient
(remember to exclude 'l' from the actual name ,ie, mysqlclient and not lmysqlclient).
This outputs:
libmysqlclient-dev - MySQL database development files
In the above -libmysqlclient-dev is the name that apt-get can recognize and solve our cannot find lmysqlclient problem
so now type: sudo apt-get install libmysqlclient-dev from interface.
After its done, try making your required file.
Simplifying #SriHariY.S's answer-
Try installing it with sudo apt-get install libmysqlclient-dev.
Do you have the MySQL client libraries? Can you look for it as
find / -name "libmysqlclient.so" -type f -print 2>/dev/null
Also, you can use the -R flag on linker to hardlink the libmysqlclient as
g++ -R/usr/local/mysql/lib ....
Or, you can export the LD_LIBRARY_PATH_32 or LD_LIBRARY_PATH_64 as
export LD_LIBRARY_PATH_32=$MYSQL_HOME/lib
Urko,
On Ubuntu 18 I used this command to find a name of required package for fixing this error:
apt search lmysqlclient
After this I installed missing package:
sudo apt install libmariadbclient-dev-compat