Bug #86638 Building mySQL Connector/C from sources on OSX 10.8
Submitted: 9 Jun 2017 14:53 Modified: 10 Jun 2017 17:12
Reporter: Igor Korot Email Updates:
Status: Unsupported Impact on me:
None 
Category:Connector / C Severity:S2 (Serious)
Version: OS:MacOS (10.8)
Assigned to: CPU Architecture:Any

[9 Jun 2017 14:53] Igor Korot
Description:
Hi,
The page https://dev.mysql.com/doc/connector-c/en/connector-c-installation-source-unix.html talks about building the connector on *nix OS.
However there is no documentation or the clear explanation how to build Connector/C from sources on OSX.
Background: There is no DMG package for the OSX 10.8 to be installed. So I was advised to download the source code and build the connector from sources.
I downloaded it, downloaded and installed latest available CMake, but there is no instructions on how to build the Connector from sources on OSX.

Can someone provide this information here or update the documentation link I posted above?

I tried to send an E-mail to the ML but unfortunately that E-mail bounced back with the error: "Address sending spam".
I also tried to post on the forum but didn't receive any replies from anyone.

Please help as this looks like the only way of communication to mySQL people.

TIA!

How to repeat:
This is a documentation/explanation missing issue.
[9 Jun 2017 14:56] Igor Korot
I also poswted on SO: https://stackoverflow.com/questions/44447065/compiling-mysql-connector-for-osx
[9 Jun 2017 16:41] MySQL Verification Team
Output of cmake -G "Unix Makefiles"

Attachment: cmake_mac.txt (text/plain), 13.99 KiB.

[9 Jun 2017 16:42] MySQL Verification Team
Output of make

Attachment: c_connector_mac.txt (text/plain), 17.78 KiB.

[9 Jun 2017 16:45] MySQL Verification Team
Thank you for the bug report.

https://www.mysql.com/it/support/eol-notice.html

February 10, 2016
Support EOL for Mac OS X v10.8

Due to very low demand, MySQL has stopped development and support for Mac OS X 10.8. Users are requested to upgrade to recent versions of OS X (10.9+). Source and binaries for previously released versions will continue to be available from the archives.

I was able to build on Sierra using intructions for Unix see attached files.

miguel:mysql-connector-c-6.1.10-src miguel$ cmake --version
cmake version 3.4.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).
miguel:mysql-connector-c-6.1.10-src miguel$

miguel:mysql-connector-c-6.1.10-src miguel$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
miguel:mysql-connector-c-6.1.10-src miguel$

miguel:mysql-connector-c-6.1.10-src miguel$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
[9 Jun 2017 16:52] Igor Korot
Hi, Miguel,
[quote]
Due to very low demand, MySQL has stopped development and support for Mac OS X 10.8. Users are requested to upgrade to recent versions of OS X (10.9+). Source and binaries for previously released versions will continue to be available from the archives.
[/quote]
They are not. You do have binaries for 10.4/10.5 which Apple itself dropped a long time ago, but not for 10.8. You don't even have a binary for 10.6 anymore - this OS support was dropped fairly recently.

Anyway I will try this when I get back home. IIRC, I wasn't able to build the connector with the latest CMake.

BTW, I'm curious - why do you use CMake? Why not provide an actual Makefile's for *nix/OSX builds?
[10 Jun 2017 16:21] Igor Korot
I just ran a CMake GUI program and generated Xcode project for Debug version of the library.
Then I opened the project inside Xcode and compiled. It was successful.
Next I copied the resulting .dylib files to my project and added the dylib to the Xcode project inside my program.

It compiled and linked fine, but gave an exception during the run-time.

I will try next to use "Unix Makefiles" from the Terminal.
[10 Jun 2017 17:12] MySQL Verification Team
Thank you for the feedback.