Macports compile of MySQL++ failing - mysql

Before running "sudo port install mysqlxx +universal", I installed the universal variant of mysql5.
...
checking whether -lm is needed to use C math functions... no
checking whether -lsocket is needed... no
checking whether -lnsl is needed... no
checking for MySQL library directory... /opt/local/lib/mysql5/mysql
checking for MySQL include directory... /opt/local/include/mysql5/mysql
checking if we can link to MySQL C API library directly... no
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for gzread in -lz... yes
checking whether adding -lz will let MySQL C API link succeed... no
configure: error: Unable to link to MySQL client library!

I suspect what's going on here is that you're running Snow Leopard. In previous versions of OS X, the default C++ compiler built 32-bit executables by default, but this changed to 64-bit in Snow Leopard. This can cause link problems with the MySQL C API library if it's not built as a Universal library supporting both 64- and 32-bit executables.
There are a bunch of ways around this problem, but most of the ones I know about either won't work with MacPorts or I don't know how to make them work. I've added a section on this to the MySQL++ README for Mac OS X, which you can read online, here.
Perhaps you can figure out how to adapt these solutions to the MacPorts build system. Something like this might work:
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 sudo port install mysqlxx +universal
That depends on those environment variables making it through the sudo and port barriers. You might have to get trickier. For instance:
sudo -s
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 port install mysqlxx +universal
As I commented above, it might be simplest to just build from the source tarball.

Related

Where does cuda-repo-cross-<identifier>-all.deb come from?

I am trying to set up a cross-compile environment on an AWS EC2 Ubuntu box targeting Nvida Xavier devices on Cuda 10.2. I tried following the "instructions" at https://docs.nvidia.com/cuda/archive/10.2/cuda-installation-guide-linux/index.html#cross-platform which say to install
sudo dpkg -i cuda-repo-cross-<identifier>_all.deb
but no clue as to where I might get hold of that .deb file, or what <identifier> should be replaced with. I have installed the native package cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb and there are a load of .deb files in /var/cuda-repo-10-2-local-10.2.89-440.33.01, but none of them are that one.
So it turns out that the instructions that can be found by googling for, for instance, "cuda install cross compile" are wrong, or at least so incomplete as makes no difference.
Instead, use the SDK manager https://developer.nvidia.com/nvidia-sdk-manager to install just the host tools. It does run without a GUI.

Octave forge packages installation

I'm trying to install image-2.6.1 package to GNU Octave, version 4.0.0. I downloaded image-2.6.1.tar.gz and tried to install it with
pkg install /home/vladimirmatveev/Downloads/image-2.6.1.tar.gz
but get an error.
configure: error: in `/tmp/oct-BAtlFb/image-2.6.1/src':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
checking for a sed that does not truncate output... /bin/sed
checking for octave... /usr/bin/octave
checking for mkoctfile... /usr/bin/mkoctfile
checking whether the C++ compiler works... no
pkg: error running the configure script for image.
error: called from 'configure_make' in file /usr/share/octave/4.0.0/m/pkg/private/configure_make.m near line 79, column 9
I am sure I have C/C++ compilers, they are gcc and g++ (when I am trying to install them with apt-get it says I already have a newest version and I am sure it is true).
I tried to set c/c++ compilers to system variables with
export CC=/usr/bin/gcc-4.8
export CXX=/usr/bin/g++-4.8
or
export CC=/usr/bin/gcc-5
export CXX=/usr/bin/g++-5
(I have both versions) but it didn't helped. It usually works for me when cmake can not find a compiler.
I found im-config.log file, but it contains only
Script for ibus started at run_im.
Script for auto started at run_im.
Script for default started at run_im.
I am not sure this is that config file which was mentioned in error message, but it is the only file which has suitable modification date.
I am working at ubuntu 16.04.
I unpackaged .tar.gz, cd to it and to src/, then run ./configure and there was no troubles found while checking compiler, here is the console log.
checking for a sed that does not truncate output... /bin/sed
checking for octave... /usr/bin/octave
checking for mkoctfile... /usr/bin/mkoctfile
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/bin/g++-5 accepts -g... yes
checking for /usr/bin/g++-5 option to enable C++11 features... -std=gnu++11
checking whether xmin is in the octave::math namespace... no
checking whether templated lambda functions accept '&const int'... yes
configure: creating ./config.status
config.status: creating im2double.m
config.status: creating Makefile
config.status: creating config.h
Here is full config log http://pastebin.com/u6MNSqCB

Installing Sphinx with MySQL 5.7

I am trying to install the Sphinx with MySQL 5.7 I have downloaded the tarball from Sphinx site whenever I am runnig this command sudo ./configure --prefix=/usr/local/sphinx --with-mysql I am getting this error.
configuring Sphinx
------------------
checking whether to use dynamic linking for DB drivers... no
checking for CFLAGS needed for pthreads... -pthread
checking for LIBS needed for pthreads... -lpthread
checking for pthreads... found
checking for pthread_mutex_timedlock... yes
checking whether to compile with MySQL support... dynamic
checking for mysql_config... mysql_config
checking for mysql_real_connect... no
checking for mysql_real_connect... no
checking MySQL include files... configure: error: missing include files.
******************************************************************************
ERROR: cannot find MySQL include files.
Check that you do have MySQL include files installed.
The package name is typically 'mysql-devel'.
If include files are installed on your system, but you are still getting
this message, you should do one of the following:
1) either specify includes location explicitly, using --with-mysql-includes;
2) or specify MySQL installation root location explicitly, using --with-mysql;
3) or make sure that the path to 'mysql_config' program is listed in
your PATH environment variable.
To disable MySQL support, use --without-mysql option.
******************************************************************************
I have tried with installing this `sudo apt-get install libmysqlclient-dev' still it doesn't I have even tried with supplying the MySQL include files path still it doesn't work. can anyone what causing this error ? I am using ubuntu 12.04.
Installing mysql-devel helped me for centos sudo yum install mysql-devel.
Suppose that for ubuntu package name is same.

Missing MySQL client

So I was following along with this tutorial:
https://www.youtube.com/watch?v=MX6wYbsUO-Y
It uses git.bash to install the mysql2 gem, and I'm stuck on the final step. The process he uses won't work for me, so instead, i just type:
gem install mysql2 -s http://rubygems.org
After this, it begins to work, but then it says the mysql client is missing:
gem install mysql2-0.3.7.gem --platform=ruby -- --with-mysql-dir=X: --with-mysql-lib=X:\lib
ERROR: Failed to build gem native extension.
c:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for mysql_query() in -lmysqlclient... no
-----
mysql client is missing. Check your installation of MySQL or Connector/C, and try again.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
I am very new to using mysql, and I don't even know where to begin, if anything, could anyone simply direct me to a resource where I could figure it out myself?
First of all please provide the version numbers when you are asking specific platform related questions
This is a 2 year old question but the problem still exists when starting ruby on windows
here are some steps needed to solve it ( as of aug 2017)
Please install Devkit and MSYS(now comes with ruby installer)
when installing mysql2 gem check if the version supplied from the rubygem repo is actually for your architecture and ruby version e.g. mysql2 0.4.9 does not provide compiled version for windows for ruby 2.4
if it is not provided then you need to compile it
3.a. First download the Mysql c connector from here the zip version is better
https://dev.mysql.com/downloads/connector/c/
important please keep in mind of your os architecture for example you must download 64 bit if you want to run it on 64 bit machine
3.b. Second extract it somewhere and the run this command
gem install mysql2 --platform=ruby -- '--with-mysql-lib="[your_full_path_to_extracted_mysql_connector]\lib" --with-mysql-include="[your_full_path_to_extracted_mysql_connector]\include"'
please keep in mind of the ' at the end it is important
It should say 1 gem installed
Check your connection using this command
rails db:schema:dump inside your project root directory. you will see a
new file in the db folder named schema.rb it means that it is working.
You will see specific problems displayed in the console, if any search it in the google you will find answers.
good luck :)
You need to download and install MySQL first.
If it's still not able to be found after you've installed it, supply the path on gem install.

MacPorts is unusable

I've recently installed MacPorts as explained on MacPorts website. All the process went well. The .profile file in my home directory has been updated (in this file the paths "/opt/local/bin" and "/opt/local/sbin" are added to the environment variable PATH) and all the macports files are in the directory "/opt". When I type "which port" in the shell, it returns "/opt/local/bin/port".
But something weird happens when I ask to install the port "octave-devel" (I've installed MacPorts to use Octave on my Mac in the first place). So when I enter the command "sudo port install octave-devel +atlas+docs" (as explained in GNU Octave wiki) in the terminal and type my password, the shell replies "Error: Port octave-devel not found". However the port "octave-devel" seems to exist because I've found its description on this page of the macports website.
Because I had to use Octave quickly I first wanted to uninstall MacPorts and install Fink instead and I tried the method described on the MacPorts website but after I typed "sudo port -fp uninstall installed" it returned "Error: No ports matched the given expression". I couldn't even uninstall this software! I really think that it is a problem of MacPorts itself and not the octave port but I can't find what exactly.
Eventually I used Octave on a Windows computer but it annoys me not to know what is wrong with MacPorts on my computer. And mainly, I want to be capable to use GNU Octave on my Mac because I need it for school.
Thank you in advance and happy holidays.
I'm not sure which version of OSX you are running, however, I have octave (not octave-devel) version 3.6.4 installed via macports on a machine running OSX 10.9.1. This was built using:
sudo port install octave
which yields a known bug building the atlas dependency that results from a missing fortran compiler. At this point you have two options. Before attempting to install octave first try to install atlas separately, either overriding the standard clang compiler with the gcc4x flag, or install atlas using:
sudo port install atlas +nofortran
which runs fine using clang. With atlas installed, octave should build to completion although there is a possibility that you will find an error regarding the use of arpack by apple as a vector library. Using +arpack is preferred, so it may be useful to load this by hand as well before starting your octave install.
Trying to install Octave using MacPorts I ran into a similar problem.
Summary
My solution was to first clean & build atlas separately using gcc47 instead of the default mpclang34. Then to build the default octave.
Details
This is on a MacBook running an older OS (10.7.5), the standard Octave (3.8.2) package failed to build - it hung on building the atlas dependency.
Solution:
sudo port clean atlas
sudo port -v install atlas +gcc48
sudo port -v install octave +atlas+docs
I'm currently going through the process of installing Octave via MacPorts. I used the following command which I found on Shifteleven.com:
sudo port install octave-devel +gcc45
It seems to be working so far. You also need to make sure you've installed the Xcode command line tools, which is something that I forgot to do the first time I tried.
I also ran into problems installing Octave using Macports on OSX 10.10.1 and solved them, similar to #Tom_N_PDX and #isak.
Short version
I got it working using one of the options described by #isak.
More detailed version
Running sudo port install octave failed because of the missing Fortran compiler problem.
I next installed Fortran using Macports sudo port install gcc48 and then tried re-installing Octave
sudo port clean octave
sudo port install octave
This "hung" on Atlas, as others have mentioned, although I now realize it just takes a long time and I killed it before it finished. Likely it would have worked, as the output said it had found Fortran
Selected C compiler: /usr/bin/clang
Selected F77 compiler: gfortran48
I then installed atlas separately, using the +gcc48 flag, as suggested by #isak
sudo port install atlas +gcc48
but it displayed the same compiler information as above (consistent with my conjecture that the above would have worked). This process took about 4 hours. You can monitor the progress of the task in the logfile (found with the command sudo port logfile atlas), which reassures you it's doing something and not "hung". (Oddly the output does halt mid-message, but it always eventually resumed. Also there were a lot of warning messages.)
Last, running the following worked:
sudo port clean octave
sudo port install +arpack
I actually first tried without the +arpack option and it worked but I got the following message, consistent with #isak's answer
WARNING: Dependency 'arpack' is installed with the +accelerate variant, using Apple's Vector Libraries which have some known bugs that can cause Octave to crash if using certain functions in arpack. The +atlas variant does not have these issues with Octave, but does take many hours to compile even on modern hardware.
When I reinstalled Octave with the +arpack flag it took less than a minute (because I had already installed Atlas).
I had a similar problem with MacPorts. I would recommend using HomeBrew instead. Here are the commands to install Octave on HomeBrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew upgrade
brew install octave