× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ok, still haven't gotten lunch yet, but I think I know the problem. When I
run pip install, it complained about missing mysql_config so I added
/usr/local/mysql/bin to the path and I could find mysql_config. Running
that, I see it outputs a bunch of stuff:

Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
Options:
--cflags [-I/usr/local/mysql/include -g -q64 -ma -qstrict
-qoptimize=2 -qmaxmem=8192 -qalign=natural -qldbl128 -DUNIV_AIX
-DUNIV_AIX]
--include [-I/usr/local/mysql/include]
--libs [-Wl,-brtl -L/usr/local/mysql/lib/mysql
-lmysqlclient -lz -lnsl_r -lm]
--libs_r [-Wl,-brtl -L/usr/local/mysql/lib/mysql
-lmysqlclient_r -lz -lnsl_r -lm]
--plugindir [/usr/local/mysql/lib/mysql/plugin]
--socket [/tmp/mysql.sock]
--port [0]
--version [5.1.59]
--libmysqld-libs [-Wl,-brtl -L/usr/local/mysql/lib/mysql -lmysqld
-ldl -lz -lnsl_r -lm -lrt]


It looks like the MySQL-python is using that output to detect the CFLAGS
to use when building itself. Since the MySQL connector was built with XLC
and also 64-bit (at least for the random version I have installed on this
box), it has -q64 in the CFLAGS.

Looks like the MySQL DB2 connector is mutually incompatible with the
Python we ship with OPS. You could try downloading the tar file and using
the /opt/freeware/bin/python_64 like so:

/opt/freeware/bin/python_64 setup.py build
/opt/freeware/bin/python_64 setup.py install

Of course, you'll need XLC for that unfortunately.


If you can deal with sqlite, you can use pysqlite at least. The sqlite
package that comes with Python was built against the Perzl sqlite (by
accident). If you install the Perzl sqlite it should work. (We're working
to fix this properly).



----- Original message -----
From: Pete Helgren <pete@xxxxxxxxxx>
Sent by: "OpenSource" <opensource-bounces@xxxxxxxxxxxx>
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxx>
Cc:
Subject: Re: [IBMiOSS] MySQL-Python
Date: Tue, Dec 27, 2016 12:24 PM

Thanks Kevin....with it being 75 degrees here I guess I am crazy to be
sitting indoors trying to compile code.....but this is my time to try
stuff while I have the week off...

FWIW setup.py has next to nothing in it:
--------------------------------------------------------
#!/usr/bin/env python

import os
import sys

from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup, Extension

if not hasattr(sys, "hexversion") or sys.hexversion < 0x02040000:
raise Error("Python 2.4 or newer is required")

if os.name == "posix":
from setup_posix import get_config
else: # assume windows
from setup_windows import get_config

metadata, options = get_config()
metadata['ext_modules'] = [Extension(sources=['_mysql.c'], **options)]
metadata['long_description'] =
metadata['long_description'].replace(r'\n', '')
setup(**metadata)

--------------------------------------------------------

But not sure where things like 'get_config' live unless setuptools has
it...

Pete Helgren
www.petesworkshop.com
GIAC Secure Software Programmer-Java
Twitter - Sys_i_Geek IBM_i_Geek

On 12/27/2016 12:11 PM, Kevin Adler wrote:
> Python has its own configuration: you create a setup.py. Typically
using
> either setuptools or distutils do abstract everything (just like
some
> people write their own configure, but most people use a tool like
autoconf
> to generate it instead). My guess is that the setup.py has some
special
> code for dealing with AIX and is using that code path (where the
majority
> of stuff has traditionally used XLC, even for open source). I have
no idea
> why it's adding -q64 though, since neither our Python nor the
Perzl python
> is built 64-bit (Perzl does have a python_64, but you have to go
out of
> your way to use it).
>
> Pete, I'll look in to it a bit after lunch - I'm here through the
end of
> the year, as unlike my other colleagues I seem to enjoy taking
vacations
> when it's above freezing for some crazy reason.:)

--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: [1]http://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at [2]http://archive.midrange.com/opensource.




References

Visible links
1. http://lists.midrange.com/mailman/listinfo/opensource
2. http://archive.midrange.com/opensource

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.