[Zope] Need help to compile MySQL-python-0.9.0
Tri Quach
tquach@k12.hi.us
Wed, 04 Jun 2003 15:09:47 -1000
This is a multi-part message in MIME format.
--Boundary_(ID_peCdaqqlWcv0vIgq8gAd0w)
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: quoted-printable
Hello ,
I tried to connect Zope to mysql data base on Unix server. When I =
compiled MySQL-python-0.9.0, I got this error.
# /usr/local/Zope-2.5.0/Zope-2.5.0-solaris-2.6-sparc/bin/python setup.py =
build
running build
running build_py
not copying CompatMysqldb.py (output up-to-date)
not copying _mysql_exceptions.py (output up-to-date)
not copying MySQLdb/__init__.py (output up-to-date)
not copying MySQLdb/converters.py (output up-to-date)
not copying MySQLdb/connections.py (output up-to-date)
not copying MySQLdb/cursors.py (output up-to-date)
not copying MySQLdb/sets.py (output up-to-date)
not copying MySQLdb/times.py (output up-to-date)
not copying MySQLdb/constants/__init__.py (output up-to-date)
not copying MySQLdb/constants/CR.py (output up-to-date)
not copying MySQLdb/constants/FIELD_TYPE.py (output up-to-date)
not copying MySQLdb/constants/ER.py (output up-to-date)
not copying MySQLdb/constants/FLAG.py (output up-to-date)
not copying MySQLdb/constants/REFRESH.py (output up-to-date)
not copying MySQLdb/constants/CLIENT.py (output up-to-date)
running build_ext
building '_mysql' extension
skipping _mysql.c (build/temp.solaris-2.8-sun4u-2.1/_mysql.o up-to-date)
gcc -shared build/temp.solaris-2.8-sun4u-2.1/_mysql.o =
-L/usr/local/mysql/lib/libmysqlclient.a -lmysqlclient -lz -o =
build/lib.solaris-2.8-sun4u-2.1/_mysql.so
ld: fatal: library -lmysqlclient: not found
ld: fatal: File processing errors. No output written to =
build/lib.solaris-2.8-sun4u-2.1/_mysql.so
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1 =20
I have mysql version 4.0 on my server. This is my setup.py looks like. =
Please tell me what need to be changed.
#!/usr/bin/env python
"""Setup script for the MySQLdb module distribution."""
import os, sys
from distutils.core import setup
from distutils.extension import Extension
YES =3D 1
NO =3D 0
# set this to 1 if you have the thread-safe mysqlclient library
thread_safe_library =3D NO
# You probably don't have to do anything past this point. If you
# do, please mail me the configuration for your platform. Don't
# forget to include the value of sys.platform and os.name.
mysqlclient =3D thread_safe_library and "mysqlclient_r" or "mysqlclient"
if sys.platform =3D=3D "linux-i386": # Red Hat
include_dirs =3D ['/usr/include/mysql']
library_dirs =3D ['/usr/lib/mysql']
libraries =3D [mysqlclient, "z"]
runtime_library_dirs =3D []
extra_objects =3D []
elif sys.platform in ("freebsd4", "openbsd2"):=20
include_dirs =3D ['/usr/local/include/mysql']
library_dirs =3D ['/usr/local/lib/mysql']
libraries =3D [mysqlclient, "z"]
runtime_library_dirs =3D []
extra_objects =3D []
elif sys.platform =3D=3D "win32":
include_dirs =3D [r'c:\mysql\include']
library_dirs =3D [r'c:\mysql\lib\opt']
libraries =3D [mysqlclient, 'zlib', 'msvcrt', 'libcmt',
'wsock32', 'advapi32']
runtime_library_dirs =3D []
extra_objects =3D [r'c:\mysql\lib\opt\mysqlclient.lib']
elif os.name =3D=3D "posix": # most Linux/UNIX platforms
include_dirs =3D ['/usr/local/mysql/include/mysql.h']
library_dirs =3D ['/usr/local/mysql/lib/libmysqlclient.a']
# MySQL-3.23 seems to need libz
libraries =3D [mysqlclient, "z"]
# On some platorms, this can be used to find the shared libraries
# at runtime, if they are in a non-standard location. Doesn't
# work for Linux gcc.
## runtime_library_dirs =3D library_dirs
runtime_library_dirs =3D []
# This can be used on Linux to force use of static mysqlclient lib
## extra_objects =3D ['/usr/lib/mysql/libmysqlclient.a']
extra_objects =3D []
else:
raise "UnknownPlatform", "sys.platform=3D%s, os.name=3D%s" % \
(sys.platform, os.name)
=20
long_description =3D \
"""Python interface to MySQL-3.23
MySQLdb is an interface to the popular MySQL database server for Python.
extra_objects =3D []
else:
raise "UnknownPlatform", "sys.platform=3D%s, os.name=3D%s" % \
(sys.platform, os.name)
=20
long_description =3D \
"""Python interface to MySQL-3.23
MySQLdb is an interface to the popular MySQL database server for Python.
The design goals are:
- Compliance with Python database API version 2.0=20
- Thread-safety=20
- Thread-friendliness (threads will not block each other)=20
- Compatibility with MySQL-3.23 and later
This module should be mostly compatible with an older interface
written by Joe Skinner and others. However, the older version is
a) not thread-friendly, b) written for MySQL 3.21, c) apparently
not actively maintained. No code from that version is used in
MySQLdb. MySQLdb is free software.
"""
setup (# Distribution meta-data
name =3D "MySQL-python",
version =3D "0.9.0",
description =3D "An interface to MySQL",
long_description=3Dlong_description,
author =3D "Andy Dustman",
author_email =3D "andy@dustman.net",
licence =3D "GPL",
url =3D "http://dustman.net/andy/python/MySQLdb",
# Description of the modules and packages in the distribution
py_modules =3D ["CompatMysqldb",
"_mysql_exceptions",
"MySQLdb.converters",
"MySQLdb.connections",
"MySQLdb.cursors",
"MySQLdb.sets",
"MySQLdb.times",
"MySQLdb.constants.CR",
"MySQLdb.constants.FIELD_TYPE",
"MySQLdb.constants.ER",
"MySQLdb.constants.FLAG",
"MySQLdb.constants.REFRESH",
"MySQLdb.constants.CLIENT",
],
ext_modules =3D [Extension(
name=3D'_mysql',
sources=3D['_mysql.c'],
include_dirs=3Dinclude_dirs,
library_dirs=3Dlibrary_dirs,
runtime_library_dirs=3Druntime_library_dirs,
libraries=3Dlibraries,
extra_objects=3Dextra_objects,
)],
)
Thank you for your helpl,
Tri.
--Boundary_(ID_peCdaqqlWcv0vIgq8gAd0w)
Content-type: text/html; charset=iso-8859-1
Content-transfer-encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>Hello ,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I tried to connect Zope to mysql =
data base on=20
Unix server. When I compiled MySQL-python-0.9.0, I got =
this=20
error.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>#=20
/usr/local/Zope-2.5.0/Zope-2.5.0-solaris-2.6-sparc/bin/python setup.py=20
build<BR>running build<BR>running build_py<BR>not copying =
CompatMysqldb.py=20
(output up-to-date)<BR>not copying _mysql_exceptions.py (output=20
up-to-date)<BR>not copying MySQLdb/__init__.py (output =
up-to-date)<BR>not=20
copying MySQLdb/converters.py (output up-to-date)<BR>not copying=20
MySQLdb/connections.py (output up-to-date)<BR>not copying =
MySQLdb/cursors.py=20
(output up-to-date)<BR>not copying MySQLdb/sets.py (output =
up-to-date)<BR>not=20
copying MySQLdb/times.py (output up-to-date)<BR>not copying=20
MySQLdb/constants/__init__.py (output up-to-date)<BR>not copying=20
MySQLdb/constants/CR.py (output up-to-date)<BR>not copying=20
MySQLdb/constants/FIELD_TYPE.py (output up-to-date)<BR>not copying=20
MySQLdb/constants/ER.py (output up-to-date)<BR>not copying=20
MySQLdb/constants/FLAG.py (output up-to-date)<BR>not copying=20
MySQLdb/constants/REFRESH.py (output up-to-date)<BR>not copying=20
MySQLdb/constants/CLIENT.py (output up-to-date)<BR>running =
build_ext<BR>building=20
'_mysql' extension<BR>skipping _mysql.c=20
(build/temp.solaris-2.8-sun4u-2.1/_mysql.o up-to-date)<BR>gcc -shared=20
build/temp.solaris-2.8-sun4u-2.1/_mysql.o=20
-L/usr/local/mysql/lib/libmysqlclient.a -lmysqlclient -lz -o=20
build/lib.solaris-2.8-sun4u-2.1/_mysql.so<BR><STRONG>ld: fatal: library=20
-lmysqlclient: not found</STRONG><BR>ld: fatal: File processing errors. =
No=20
output written to build/lib.solaris-2.8-sun4u-2.1/_mysql.so<BR>collect2: =
ld=20
returned 1 exit status<BR>error: command 'gcc' failed with exit status =
1 =20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I have mysql version 4.0 on my =
server. This=20
is my setup.py looks like. Please tell me what need to be=20
changed.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>#!/usr/bin/env python</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>"""Setup script for the MySQLdb module=20
distribution."""</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>import os, sys<BR>from distutils.core =
import=20
setup<BR>from distutils.extension import Extension</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>YES =3D 1<BR>NO =3D 0</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2># set this to 1 if you have the =
thread-safe=20
mysqlclient library<BR>thread_safe_library =3D NO</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2># You probably don't have to do =
anything past this=20
point. If you<BR># do, please mail me the configuration for your =
platform.=20
Don't<BR># forget to include the value of sys.platform and =
os.name.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>mysqlclient =3D thread_safe_library and =
"mysqlclient_r" or "mysqlclient"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>if sys.platform =3D=3D "linux-i386": # =
Red=20
Hat<BR> include_dirs =3D=20
['/usr/include/mysql']<BR> library_dirs =3D=20
['/usr/lib/mysql']<BR> libraries =3D [mysqlclient,=20
"z"]<BR> runtime_library_dirs =3D =
[]<BR> =20
extra_objects =3D []<BR>elif sys.platform in ("freebsd4", "openbsd2"):=20
<BR> include_dirs =3D=20
['/usr/local/include/mysql']<BR> library_dirs =3D=20
['/usr/local/lib/mysql']<BR> libraries =3D =
[mysqlclient,=20
"z"]<BR> runtime_library_dirs =3D =
[]<BR> =20
extra_objects =3D []<BR>elif sys.platform =3D=3D =
"win32":<BR> =20
include_dirs =3D [r'c:\mysql\include']<BR> =
library_dirs =3D=20
[r'c:\mysql\lib\opt']<BR> libraries =3D [mysqlclient, =
'zlib',=20
'msvcrt',=20
'libcmt',<BR> =
=20
'wsock32', 'advapi32']<BR> runtime_library_dirs =3D=20
[]<BR> extra_objects =3D=20
[r'c:\mysql\lib\opt\mysqlclient.lib']<BR>elif os.name =3D=3D "posix": # =
most=20
Linux/UNIX platforms<BR> include_dirs =3D=20
['/usr/local/mysql/include/mysql.h']<BR> library_dirs =
=3D=20
['/usr/local/mysql/lib/libmysqlclient.a']<BR> # =
MySQL-3.23=20
seems to need libz<BR> libraries =3D [mysqlclient,=20
"z"]<BR> # On some platorms, this can be used to find =
the=20
shared libraries<BR> # at runtime, if they are in a=20
non-standard location. Doesn't<BR> # work for Linux=20
gcc.<BR> ## runtime_library_dirs =3D=20
library_dirs<BR> runtime_library_dirs =3D=20
[]<BR> # This can be used on Linux to force use of =
static=20
mysqlclient lib<BR> ## extra_objects =3D=20
['/usr/lib/mysql/libmysqlclient.a']<BR> extra_objects =
=3D=20
[]<BR>else:<BR> raise "UnknownPlatform", =
"sys.platform=3D%s,=20
os.name=3D%s" % =
\<BR> =20
(sys.platform, os.name)<BR> <BR>long_description =3D=20
\<BR>"""Python interface to MySQL-3.23</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>MySQLdb is an interface to the popular =
MySQL=20
database server for Python.<BR> extra_objects =3D=20
[]<BR>else:<BR> raise "UnknownPlatform", =
"sys.platform=3D%s,=20
os.name=3D%s" % =
\<BR> =20
(sys.platform, os.name)<BR> <BR>long_description =3D=20
\<BR>"""Python interface to MySQL-3.23</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>MySQLdb is an interface to the popular =
MySQL=20
database server for Python.<BR>The design goals are:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>- Compliance =
with Python=20
database API version 2.0 <BR>- Thread-safety=20
<BR>- Thread-friendliness (threads will not =
block each=20
other) <BR>- Compatibility with MySQL-3.23 and=20
later</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>This module should be mostly compatible =
with an=20
older interface<BR>written by Joe Skinner and others. However, the older =
version=20
is<BR>a) not thread-friendly, b) written for MySQL 3.21, c) =
apparently<BR>not=20
actively maintained. No code from that version is used in<BR>MySQLdb. =
MySQLdb is=20
free software.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>"""</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>setup (# Distribution=20
meta-data<BR> name =3D=20
"MySQL-python",<BR> version =
=3D=20
"0.9.0",<BR> description =3D =
"An=20
interface to MySQL",<BR> =20
long_description=3Dlong_description,<BR> &nb=
sp; =20
author =3D "Andy Dustman",<BR> =
author_email =3D "<A=20
href=3D"mailto:andy@dustman.net">andy@dustman.net</A>",<BR> &n=
bsp; =20
licence =3D "GPL",<BR> url =3D =
"<A=20
href=3D"http://dustman.net/andy/python/MySQLdb">http://dustman.net/andy/p=
ython/MySQLdb</A>",</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial =
size=3D2> #=20
Description of the modules and packages in the distribution</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial =
size=3D2> =20
py_modules =3D=20
["CompatMysqldb",<BR> &nbs=
p;  =
;=20
"_mysql_exceptions",<BR> &=
nbsp; &n=
bsp;=20
"MySQLdb.converters",<BR> =
&=
nbsp;=20
"MySQLdb.connections",<BR>  =
; =
=20
"MySQLdb.cursors",<BR> &nb=
sp; &nbs=
p;=20
"MySQLdb.sets",<BR> =
=
"MySQLdb.times",<BR>  =
; =
=20
"MySQLdb.constants.CR",<BR> &nbs=
p;  =
; =20
"MySQLdb.constants.FIELD_TYPE",<BR> &n=
bsp; &nb=
sp; =20
"MySQLdb.constants.ER",<BR> &nbs=
p;  =
; =20
"MySQLdb.constants.FLAG",<BR> &n=
bsp; &nb=
sp; =20
"MySQLdb.constants.REFRESH",<BR>  =
; =
=20
"MySQLdb.constants.CLIENT",<BR> =
&=
nbsp;=20
],</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial =
size=3D2> =20
ext_modules =3D=20
[Extension(<BR> &nbs=
p; =20
name=3D'_mysql',<BR>  =
; =20
sources=3D['_mysql.c'],<BR> &nbs=
p; =20
include_dirs=3Dinclude_dirs,<BR>  =
; =20
library_dirs=3Dlibrary_dirs,<BR>  =
; =20
runtime_library_dirs=3Druntime_library_dirs,<BR> &=
nbsp; =20
libraries=3Dlibraries,<BR>  =
; =20
extra_objects=3Dextra_objects,<BR> &nb=
sp; =20
)],<BR>)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thank you for your helpl,</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>Tri.</FONT></DIV></FONT></DIV></BODY></HTML>
--Boundary_(ID_peCdaqqlWcv0vIgq8gAd0w)--