I'm having trouble installing MySQLdb 0.9.2 on Solaris 8. After I added symbolic links for the include and lib directories:
ln -s /usr/local/mysql/include /usr/local/include/mysql
ln -s /usr/local/mysql/lib /usr/local/lib/mysql
so that setup.py could find them, I got these errors:
bash-2.05# python setup.py build
running build
running build_py
running build_ext
building '_mysql' extension
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/mysql -I/usr/local/include/mysql -I/usr/local/mysql/include/mysql -I/usr/local/include/python2.3 -c _mysql.c -o build/temp.solaris-2.8-sun4u-2.3/_mysql.o -fPIC
_mysql.c: In function `_mysql_ConnectionObject_info':
_mysql.c:1150: warning: assignment discards qualifiers from pointer target type
_mysql.c: In function `_mysql_ConnectionObject_stat':
_mysql.c:1379: warning: assignment discards qualifiers from pointer target type
_mysql.c: At top level:
_mysql.c:2007: warning: initialization from incompatible pointer type
_mysql.c:2096: warning: initialization from incompatible pointer type
gcc -shared build/temp.solaris-2.8-sun4u-2.3/_mysql.o -L/usr/lib/mysql -L/usr/local/lib/mysql -L/usr/local/mysql/lib/mysql -Wl,-R/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -lmysqlclient_r -lz -o build/lib.solaris-2.8-sun4u-2.3/_mysql.so
ld: warning: file /usr/local/lib/mysql/libmysqlclient_r.a(libmysql.o): wrong ELF class: ELFCLASS64
bash-2.05#
Here's my configuration:
bash-2.05$ python
Python 2.3.3 (#1, Feb 11 2004, 14:47:54)
[GCC 3.3.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import zlib
>>> zlib.__version__
'1.0'
>>> ^D
bash-2.05$
The server is a Sun Netra T1, which has a 64-bit SPARC in it.
Is there some change I need to make to setup.py or is there some other configuration problem?
Many thanks!
Bob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, I found that adding '-m64' to the extra_link_args in setup.py allow a clean build and install. However, when I run python and enter 'import MySQLdb', I get this new error:
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/site-packages/MySQLdb/__init__.py", line 27, in ?
import _mysql
ImportError: ld.so.1: python: fatal: relocation error: file /usr/local/lib/python2.3/site-packages/_mysql.so: symbol mysql_errno: referenced symbol not found
>>>
Where is it SUPPOSED to find mysql_errno? I can't find it in the supplied code anywhere, so I guess that it should be supplied by MySQL and that the linker doesn't know where to look for it.
When you suggest 1.1.0, I assume you mean that I should get the sources from CVS, since I cannot find a distribution link for 1.1.0. Do you have any confidence that the linking has changed? If not, I think I'm better off just working through this.
Thanks for your help!
Bob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
bash-2.05# ldd /usr/local/lib/python2.3/site-packages/_mysql.so
libz.so => /usr/local/lib/libz.so
libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
/usr/platform/SUNW,UltraAX-i2/lib/libc_psr.so.1
bash-2.05# python
Python 2.3.3 (#1, Feb 11 2004, 14:47:54)
[GCC 3.3.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import os
>>> sys.platform
'sunos5'
>>> os.name
'posix'
>>> ^D
bash-2.05#
I saw that '/usr/local/lib' was already added to runtime_library_dirs, so I just added '/usr/lib' and tried it again and got the same message.
However, when I did it this time, I removed the build directory first. I found that I had to run 'python setup.py build' twice - once without the '-m64' and then again with it to get a build without the ELF errors. I don't know if that left me with a consistent build.
Anyway, the result was the same:
bash-2.05# python
Python 2.3.3 (#1, Feb 11 2004, 14:47:54)
[GCC 3.3.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "MySQLdb/__init__.py", line 27, in ?
import _mysql
ImportError: ld.so.1: python: fatal: relocation error: file /usr/local/lib/python2.3/site-packages/_mysql.so: symbol mysql_errno: referenced symbol not found
>>>
Thanks for your help - what next?
Bob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Odd. It appears you are getting libmysqlclient statically-linked in, since it does not appear in the ldd output, which is not necessariliy a bad thing, but it's odd because you have this unresolved symbol. Actually you are using libmysqlclient_r, which is the thread-safe version, which, again, is not a bad thing.
If you run this:
nm /usr/local/lib/python2.3/site-packages/_mysql.so | grep mysql
you'll see something like this:
00003200 t _mysql_ConnectionObject_Initialize
00009800 D _mysql_ConnectionObject_Type
00003700 t _mysql_ConnectionObject_affected_rows
000075c0 d _mysql_ConnectionObject_affected_rows__doc__
...
U mysql_dump_debug_info
U mysql_errno
U mysql_error
U mysql_escape_string
...
Except in your case, I think most of the mysql_* symbols will have a number and T in front of them instead of U. U is unresolved, which means that it's supposed to be fixed by the loader because it is linked against a dynamic library. You probably will see "U mysql_errno" since that isn't resolving, but it may well be none of the mysql_* symbols are resolved.
Can you also run: python setup.py clean
Followed by: python setup.py build
and report if you are still seeing this line in the output:
I think your _mysql.so was created by was not linked properly against the MySQL libraries (warnings are not fatal). Probably the -m64 linker args fixed this, but I want to make sure you started with a clean compile. I'm wondering if -m64 needs to be a compiler flag as well.
Oh, and can you run this in the shell and resport the output:
echo OSTYPE=$OSTYPE
echo MACHTYPE=$MACHTYPE
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've appended the transcript from my session at the end of this note so you can see the details, but here are the answers to your questions:
- nm shows that the mysql_* symbols are NOT resolved
- Without the -m64 linker arg, I do not see the "wrong ELF class: ELFCLASS64" error after 'python setup.py clean; python setup.py build', but I DO see that error after 'rm -fR build; python setup.py build'. I believe now that I never really got a clean link since the build was being done in parts. Is this a hint, though, that building after python setup.py clean doesn't produce the same results as building after rm -fR build?
- WITH the -m64 linker arg, I get "wrong ELF class: ELFCLASS32" after 'rm -fR build; python setup.py build'.
- WITH the -m64 flag for both the linker and the comiler, I get "/usr/local/include/python2.3/pyport.h:554:2: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
- OSTYPE=solaris2.8 and MACHTYPE=sparc-sun-solaris2.8
It does seem to be some kind of linker problem, but I don't know how to resolve it.
At this point, I'm going to guess that there's a mismatch of code modules (32-bit vs 64-bit) among your libraries. If you compiled your own MySQL, maybe it should be recompiled with -m64. You can probably use the file command on some of the MySQL libraries and that might provide a clue. You might have to do this for Python as well. Or doing so might make things worse; your call.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm having trouble installing MySQLdb 0.9.2 on Solaris 8. After I added symbolic links for the include and lib directories:
ln -s /usr/local/mysql/include /usr/local/include/mysql
ln -s /usr/local/mysql/lib /usr/local/lib/mysql
so that setup.py could find them, I got these errors:
bash-2.05# python setup.py build
running build
running build_py
running build_ext
building '_mysql' extension
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/mysql -I/usr/local/include/mysql -I/usr/local/mysql/include/mysql -I/usr/local/include/python2.3 -c _mysql.c -o build/temp.solaris-2.8-sun4u-2.3/_mysql.o -fPIC
_mysql.c: In function `_mysql_ConnectionObject_info':
_mysql.c:1150: warning: assignment discards qualifiers from pointer target type
_mysql.c: In function `_mysql_ConnectionObject_stat':
_mysql.c:1379: warning: assignment discards qualifiers from pointer target type
_mysql.c: At top level:
_mysql.c:2007: warning: initialization from incompatible pointer type
_mysql.c:2096: warning: initialization from incompatible pointer type
gcc -shared build/temp.solaris-2.8-sun4u-2.3/_mysql.o -L/usr/lib/mysql -L/usr/local/lib/mysql -L/usr/local/mysql/lib/mysql -Wl,-R/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -lmysqlclient_r -lz -o build/lib.solaris-2.8-sun4u-2.3/_mysql.so
ld: warning: file /usr/local/lib/mysql/libmysqlclient_r.a(libmysql.o): wrong ELF class: ELFCLASS64
bash-2.05#
Here's my configuration:
bash-2.05$ python
Python 2.3.3 (#1, Feb 11 2004, 14:47:54)
[GCC 3.3.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import zlib
>>> zlib.__version__
'1.0'
>>> ^D
bash-2.05$
The server is a Sun Netra T1, which has a 64-bit SPARC in it.
Is there some change I need to make to setup.py or is there some other configuration problem?
Many thanks!
Bob
Try 1.1.0 and see if that's any better. Unfortunately, I can't help with building on Solaris.
Actually, I found that adding '-m64' to the extra_link_args in setup.py allow a clean build and install. However, when I run python and enter 'import MySQLdb', I get this new error:
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/site-packages/MySQLdb/__init__.py", line 27, in ?
import _mysql
ImportError: ld.so.1: python: fatal: relocation error: file /usr/local/lib/python2.3/site-packages/_mysql.so: symbol mysql_errno: referenced symbol not found
>>>
Where is it SUPPOSED to find mysql_errno? I can't find it in the supplied code anywhere, so I guess that it should be supplied by MySQL and that the linker doesn't know where to look for it.
When you suggest 1.1.0, I assume you mean that I should get the sources from CVS, since I cannot find a distribution link for 1.1.0. Do you have any confidence that the linking has changed? If not, I think I'm better off just working through this.
Thanks for your help!
Bob
It's in the mysql-python-test section of the Files area. mysql_error is a symbol from libmysqlclient.
I suspect that libmysqlclient.so is not on your loader path. See what running:
ldd /usr/local/lib/python2.3/site-packages/_mysql.so
turns up. I suspect you will have to add the directory where libmysqlclient.so lives to runtime_library_dirs.
Also, report your values of sys.platform and os.name.
Here's the data you requested:
bash-2.05# ldd /usr/local/lib/python2.3/site-packages/_mysql.so
libz.so => /usr/local/lib/libz.so
libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
/usr/platform/SUNW,UltraAX-i2/lib/libc_psr.so.1
bash-2.05# python
Python 2.3.3 (#1, Feb 11 2004, 14:47:54)
[GCC 3.3.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import os
>>> sys.platform
'sunos5'
>>> os.name
'posix'
>>> ^D
bash-2.05#
I saw that '/usr/local/lib' was already added to runtime_library_dirs, so I just added '/usr/lib' and tried it again and got the same message.
However, when I did it this time, I removed the build directory first. I found that I had to run 'python setup.py build' twice - once without the '-m64' and then again with it to get a build without the ELF errors. I don't know if that left me with a consistent build.
Anyway, the result was the same:
bash-2.05# python
Python 2.3.3 (#1, Feb 11 2004, 14:47:54)
[GCC 3.3.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "MySQLdb/__init__.py", line 27, in ?
import _mysql
ImportError: ld.so.1: python: fatal: relocation error: file /usr/local/lib/python2.3/site-packages/_mysql.so: symbol mysql_errno: referenced symbol not found
>>>
Thanks for your help - what next?
Bob
Odd. It appears you are getting libmysqlclient statically-linked in, since it does not appear in the ldd output, which is not necessariliy a bad thing, but it's odd because you have this unresolved symbol. Actually you are using libmysqlclient_r, which is the thread-safe version, which, again, is not a bad thing.
If you run this:
nm /usr/local/lib/python2.3/site-packages/_mysql.so | grep mysql
you'll see something like this:
00003200 t _mysql_ConnectionObject_Initialize
00009800 D _mysql_ConnectionObject_Type
00003700 t _mysql_ConnectionObject_affected_rows
000075c0 d _mysql_ConnectionObject_affected_rows__doc__
...
U mysql_dump_debug_info
U mysql_errno
U mysql_error
U mysql_escape_string
...
Except in your case, I think most of the mysql_* symbols will have a number and T in front of them instead of U. U is unresolved, which means that it's supposed to be fixed by the loader because it is linked against a dynamic library. You probably will see "U mysql_errno" since that isn't resolving, but it may well be none of the mysql_* symbols are resolved.
Can you also run: python setup.py clean
Followed by: python setup.py build
and report if you are still seeing this line in the output:
ld: warning: file /usr/local/lib/mysql/libmysqlclient_r.a(libmysql.o): wrong ELF class: ELFCLASS64
I think your _mysql.so was created by was not linked properly against the MySQL libraries (warnings are not fatal). Probably the -m64 linker args fixed this, but I want to make sure you started with a clean compile. I'm wondering if -m64 needs to be a compiler flag as well.
Oh, and can you run this in the shell and resport the output:
echo OSTYPE=$OSTYPE
echo MACHTYPE=$MACHTYPE
I've appended the transcript from my session at the end of this note so you can see the details, but here are the answers to your questions:
- nm shows that the mysql_* symbols are NOT resolved
- Without the -m64 linker arg, I do not see the "wrong ELF class: ELFCLASS64" error after 'python setup.py clean; python setup.py build', but I DO see that error after 'rm -fR build; python setup.py build'. I believe now that I never really got a clean link since the build was being done in parts. Is this a hint, though, that building after python setup.py clean doesn't produce the same results as building after rm -fR build?
- WITH the -m64 linker arg, I get "wrong ELF class: ELFCLASS32" after 'rm -fR build; python setup.py build'.
- WITH the -m64 flag for both the linker and the comiler, I get "/usr/local/include/python2.3/pyport.h:554:2: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
- OSTYPE=solaris2.8 and MACHTYPE=sparc-sun-solaris2.8
It does seem to be some kind of linker problem, but I don't know how to resolve it.
Thanks for your help!
Bob
Here's the transcript of the session:
bash-2.05# nm /usr/local/lib/python2.3/site-packages/_mysql.so | grep mysql
/usr/local/lib/python2.3/site-packages/_mysql.so:
[50] | 0| 0|FILE |LOCL |0 |ABS |_mysql.c
[214] | 13032| 612|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_Initialize
[310] | 103672| 192|OBJT |GLOB |0 |22 |_mysql_ConnectionObject_Type
[221] | 14124| 100|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_affected_rows
[218] | 95456| 86|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_affected_rows__doc__
[143] | 19508| 224|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_change_user
[93] | 97744| 560|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_change_user__doc__
[157] | 19732| 96|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_character_set_name
[108] | 98304| 77|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_character_set_name__doc__
[215] | 13832| 76|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_clear
[177] | 13908| 216|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_close
[148] | 95400| 52|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_close__doc__
[191] | 22712| 292|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_dealloc
[139] | 14324| 164|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_dump_debug_info
[135] | 95720| 149|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_dump_debug_info__doc__
[163] | 14488| 96|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_errno
[133] | 95872| 146|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_errno__doc__
[164] | 14584| 96|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_error
[145] | 96024| 149|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_error__doc__
[144] | 20620| 96|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_field_count
[132] | 99800| 172|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_field_count__doc__
[212] | 19900| 96|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_get_host_info
[193] | 98472| 82|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_get_host_info__doc__
[180] | 19996| 96|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_get_proto_info
[138] | 98560| 109|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_get_proto_info__doc__
[206] | 20092| 96|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_get_server_info
[167] | 98672| 75|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_get_server_info__doc__
[91] | 23796| 148|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_getattr
[161] | 20188| 136|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_info
[179] | 98752| 129|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_info__doc__
[52] | 20324| 124|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_insert_id
[175] | 98888| 838|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_insert_id__doc__
[194] | 20448| 172|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_kill
[94] | 99728| 67|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_kill__doc__
[186] | 103192| 120|OBJT |LOCL |0 |21 |_mysql_ConnectionObject_memberlist
[70] | 102776| 416|OBJT |LOCL |0 |21 |_mysql_ConnectionObject_methods
[147] | 20920| 164|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_ping
[149] | 100184| 302|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_ping__doc__
[142] | 21084| 180|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_query
[202] | 100488| 152|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_query__doc__
[222] | 23004| 108|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_repr
[199] | 21264| 172|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_select_db
[166] | 100640| 352|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_select_db__doc__
[188] | 24040| 176|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_setattr
[205] | 21436| 164|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_shutdown
[87] | 100992| 103|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_shutdown__doc__
[197] | 21600| 144|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_stat
[217] | 101096| 228|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_stat__doc__
[141] | 21744| 432|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_store_result
[103] | 101328| 149|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_store_result__doc__
[97] | 22176| 120|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_thread_id
[88] | 101480| 321|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_thread_id__doc__
[158] | 13788| 44|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_traverse
[136] | 22296| 416|FUNC |LOCL |0 |11 |_mysql_ConnectionObject_use_result
[182] | 101808| 147|OBJT |LOCL |0 |16 |_mysql_ConnectionObject_use_result__doc__
[172] | 104108| 4|OBJT |LOCL |0 |23 |_mysql_DataError
[95] | 104100| 4|OBJT |LOCL |0 |23 |_mysql_DatabaseError
[130] | 104096| 4|OBJT |LOCL |0 |23 |_mysql_Error
[238] | 9928| 508|FUNC |GLOB |0 |11 |_mysql_Exception
[203] | 104116| 4|OBJT |LOCL |0 |23 |_mysql_IntegrityError
[174] | 104104| 4|OBJT |LOCL |0 |23 |_mysql_InterfaceError
[201] | 104120| 4|OBJT |LOCL |0 |23 |_mysql_InternalError
[190] | 104088| 4|OBJT |LOCL |0 |23 |_mysql_MySQLError
[90] | 104084| 4|OBJT |LOCL |0 |23 |_mysql_NULL
[89] | 104128| 4|OBJT |LOCL |0 |23 |_mysql_NotSupportedError
[210] | 104112| 4|OBJT |LOCL |0 |23 |_mysql_OperationalError
[208] | 104124| 4|OBJT |LOCL |0 |23 |_mysql_ProgrammingError
[140] | 12296| 500|FUNC |LOCL |0 |11 |_mysql_ResultObject_Initialize
[335] | 103864| 192|OBJT |GLOB |0 |22 |_mysql_ResultObject_Type
[151] | 94088| 380|OBJT |LOCL |0 |16 |_mysql_ResultObject__doc__
[159] | 12884| 148|FUNC |LOCL |0 |11 |_mysql_ResultObject_clear
[187] | 23112| 160|FUNC |LOCL |0 |11 |_mysql_ResultObject_data_seek
[181] | 101960| 44|OBJT |LOCL |0 |16 |_mysql_ResultObject_data_seek__doc__
[152] | 23552| 184|FUNC |LOCL |0 |11 |_mysql_ResultObject_dealloc
[131] | 17092| 312|FUNC |LOCL |0 |11 |_mysql_ResultObject_describe
[196] | 97336| 95|OBJT |LOCL |0 |16 |_mysql_ResultObject_describe__doc__
[150] | 19008| 500|FUNC |LOCL |0 |11 |_mysql_ResultObject_fetch_row
[107] | 97504| 236|OBJT |LOCL |0 |16 |_mysql_ResultObject_fetch_row__doc__
[200] | 17404| 256|FUNC |LOCL |0 |11 |_mysql_ResultObject_field_flags
[189] | 97432| 68|OBJT |LOCL |0 |16 |_mysql_ResultObject_field_flags__doc__
[146] | 23944| 96|FUNC |LOCL |0 |11 |_mysql_ResultObject_getattr
[213] | 103456| 40|OBJT |LOCL |0 |21 |_mysql_ResultObject_memberlist
[198] | 103312| 144|OBJT |LOCL |0 |21 |_mysql_ResultObject_methods
[160] | 20716| 100|FUNC |LOCL |0 |11 |_mysql_ResultObject_num_fields
[216] | 99976| 53|OBJT |LOCL |0 |16 |_mysql_ResultObject_num_fields__doc__
[53] | 20816| 104|FUNC |LOCL |0 |11 |_mysql_ResultObject_num_rows
[170] | 100032| 145|OBJT |LOCL |0 |16 |_mysql_ResultObject_num_rows__doc__
[106] | 23736| 60|FUNC |LOCL |0 |11 |_mysql_ResultObject_repr
[220] | 23272| 160|FUNC |LOCL |0 |11 |_mysql_ResultObject_row_seek
[165] | 102008| 51|OBJT |LOCL |0 |16 |_mysql_ResultObject_row_seek__doc__
[105] | 23432| 120|FUNC |LOCL |0 |11 |_mysql_ResultObject_row_tell
[211] | 102064| 63|OBJT |LOCL |0 |16 |_mysql_ResultObject_row_tell__doc__
[207] | 24216| 176|FUNC |LOCL |0 |11 |_mysql_ResultObject_setattr
[137] | 12796| 88|FUNC |LOCL |0 |11 |_mysql_ResultObject_traverse
[171] | 104092| 4|OBJT |LOCL |0 |23 |_mysql_Warning
[209] | 102128| 517|OBJT |LOCL |0 |16 |_mysql___doc__
[315] | 10436| 248|FUNC |GLOB |0 |11 |_mysql__fetch_row
[192] | 13644| 144|FUNC |LOCL |0 |11 |_mysql_connect
[195] | 94472| 926|OBJT |LOCL |0 |16 |_mysql_connect__doc__
[51] | 14224| 100|FUNC |LOCL |0 |11 |_mysql_debug
[120] | 95544| 169|OBJT |LOCL |0 |16 |_mysql_debug__doc__
[185] | 15232| 676|FUNC |LOCL |0 |11 |_mysql_escape
[134] | 96824| 158|OBJT |LOCL |0 |16 |_mysql_escape__doc__
[178] | 16504| 588|FUNC |LOCL |0 |11 |_mysql_escape_dict
[104] | 97160| 176|OBJT |LOCL |0 |16 |_mysql_escape_dict__doc__
[169] | 15908| 596|FUNC |LOCL |0 |11 |_mysql_escape_sequence
[71] | 96984| 173|OBJT |LOCL |0 |16 |_mysql_escape_sequence__doc__
[173] | 14680| 220|FUNC |LOCL |0 |11 |_mysql_escape_string
[102] | 96176| 302|OBJT |LOCL |0 |16 |_mysql_escape_string__doc__
[92] | 19828| 72|FUNC |LOCL |0 |11 |_mysql_get_client_info
[54] | 98384| 82|OBJT |LOCL |0 |16 |_mysql_get_client_info__doc__
[114] | 103496| 160|OBJT |LOCL |0 |21 |_mysql_methods
[176] | 17960| 500|FUNC |LOCL |0 |11 |_mysql_row_to_dict
[204] | 18460| 548|FUNC |LOCL |0 |11 |_mysql_row_to_dict_old
[168] | 17660| 300|FUNC |LOCL |0 |11 |_mysql_row_to_tuple
[96] | 14900| 332|FUNC |LOCL |0 |11 |_mysql_string_literal
[183] | 96480| 342|OBJT |LOCL |0 |16 |_mysql_string_literal__doc__
[162] | 12208| 88|FUNC |LOCL |0 |11 |_mysql_thread_safe
[184] | 94024| 57|OBJT |LOCL |0 |16 |_mysql_thread_safe__doc__
[1] | 0| 0|FILE |LOCL |0 |ABS |build/lib.solaris-2.8-sun4u-2.3/_mysql.so
[345] | 10684| 1524|FUNC |GLOB |0 |11 |init_mysql
[298] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_affected_rows
[275] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_change_user
[235] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_character_set_name
[304] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_close
[344] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_data_seek
[331] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_debug
[249] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_dump_debug_info
[268] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_errno
[285] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_error
[297] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_escape_string
[282] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_fetch_fields
[338] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_fetch_lengths
[269] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_fetch_row
[305] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_field_count
[243] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_free_result
[292] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_get_client_info
[254] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_get_host_info
[307] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_get_proto_info
[252] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_get_server_info
[260] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_info
[313] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_init
[240] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_insert_id
[340] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_kill
[322] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_num_fields
[272] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_num_rows
[301] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_options
[270] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_ping
[326] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_real_connect
[337] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_real_escape_string
[283] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_real_query
[346] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_row_seek
[244] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_row_tell
[280] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_select_db
[302] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_shutdown
[319] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_stat
[251] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_store_result
[258] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_thread_id
[303] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_thread_safe
[274] | 0| 0|NOTY |GLOB |0 |UNDEF |mysql_use_result
bash-2.05# cd MySQL-python-0.9.2
<<< NOTE: setup.py does NOT have the -m64 flag at this time. >>>
bash-2.05# python setup.py clean
running clean
removing 'build/temp.solaris-2.8-sun4u-2.3' (and everything under it)
bash-2.05# python setup.py build
running build
running build_py
running build_ext
bash-2.05# echo OSTYPE=$OSTYPE
OSTYPE=solaris2.8
bash-2.05# echo MACHTYPE=$MACHTYPE
MACHTYPE=sparc-sun-solaris2.8
bash-2.05# rm -fR build
bash-2.05# python setup.py build
running build
running build_py
creating build
creating build/lib.solaris-2.8-sun4u-2.3
copying CompatMysqldb.py -> build/lib.solaris-2.8-sun4u-2.3
copying _mysql_exceptions.py -> build/lib.solaris-2.8-sun4u-2.3
creating build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/__init__.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/converters.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/connections.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/cursors.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/sets.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/times.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
creating build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.solaris-2.8-sun4u-2.3
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/mysql -I/usr/local/include/mysql -I/usr/local/mysql/include/ -I/usr/local/include/python2.3 -c _mysql.c -o build/temp.solaris-2.8-sun4u-2.3/_mysql.o -fPIC
_mysql.c: In function `_mysql_ConnectionObject_info':
_mysql.c:1150: warning: assignment discards qualifiers from pointer target type
_mysql.c: In function `_mysql_ConnectionObject_stat':
_mysql.c:1379: warning: assignment discards qualifiers from pointer target type
_mysql.c: At top level:
_mysql.c:2007: warning: initialization from incompatible pointer type
_mysql.c:2096: warning: initialization from incompatible pointer type
gcc -shared build/temp.solaris-2.8-sun4u-2.3/_mysql.o -L/usr/lib/mysql -L/usr/local/lib/mysql -L/usr/local/mysql/lib/ -Wl,-R/usr/lib:/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -lmysqlclient_r -lz -o build/lib.solaris-2.8-sun4u-2.3/_mysql.so
ld: warning: file /usr/local/lib/mysql/libmysqlclient_r.a(libmysql.o): wrong ELF class: ELFCLASS64
bash-2.05#
<<< NOTE: I used 'vi setup.py' to set extra_link_args = ['-m64'] here >>>
bash-2.05# rm -fR build
bash-2.05# python setup.py build
running build
running build_py
creating build
creating build/lib.solaris-2.8-sun4u-2.3
copying CompatMysqldb.py -> build/lib.solaris-2.8-sun4u-2.3
copying _mysql_exceptions.py -> build/lib.solaris-2.8-sun4u-2.3
creating build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/__init__.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/converters.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/connections.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/cursors.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/sets.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/times.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
creating build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.solaris-2.8-sun4u-2.3
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/mysql -I/usr/local/include/mysql -I/usr/local/mysql/include/ -I/usr/local/include/python2.3 -c _mysql.c -o build/temp.solaris-2.8-sun4u-2.3/_mysql.o -fPIC
_mysql.c: In function `_mysql_ConnectionObject_info':
_mysql.c:1150: warning: assignment discards qualifiers from pointer target type
_mysql.c: In function `_mysql_ConnectionObject_stat':
_mysql.c:1379: warning: assignment discards qualifiers from pointer target type
_mysql.c: At top level:
_mysql.c:2007: warning: initialization from incompatible pointer type
_mysql.c:2096: warning: initialization from incompatible pointer type
gcc -shared build/temp.solaris-2.8-sun4u-2.3/_mysql.o -L/usr/lib/mysql -L/usr/local/lib/mysql -L/usr/local/mysql/lib/ -Wl,-R/usr/lib:/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -lmysqlclient_r -lz -o build/lib.solaris-2.8-sun4u-2.3/_mysql.so -m64
ld: fatal: file build/temp.solaris-2.8-sun4u-2.3/_mysql.o: wrong ELF class: ELFCLASS32
ld: fatal: File processing errors. No output written to build/lib.solaris-2.8-sun4u-2.3/_mysql.so
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
bash-2.05#
<<< NOTE: I used 'vi setup.py' to set extra_compile_args = ['-m64'] here (leaving extra_link_args = ['-m64']). >>>
bash-2.05# rm -fR build
bash-2.05# python setup.py build
running build
running build_py
creating build
creating build/lib.solaris-2.8-sun4u-2.3
copying CompatMysqldb.py -> build/lib.solaris-2.8-sun4u-2.3
copying _mysql_exceptions.py -> build/lib.solaris-2.8-sun4u-2.3
creating build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/__init__.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/converters.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/connections.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/cursors.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/sets.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
copying MySQLdb/times.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb
creating build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.solaris-2.8-sun4u-2.3/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.solaris-2.8-sun4u-2.3
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/mysql -I/usr/local/include/mysql -I/usr/local/mysql/include/ -I/usr/local/include/python2.3 -c _mysql.c -o build/temp.solaris-2.8-sun4u-2.3/_mysql.o -m64 -fPIC
In file included from /usr/local/include/python2.3/Python.h:48,
from pymemcompat.h:10,
from _mysql.c:31:
/usr/local/include/python2.3/pyport.h:554:2: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
_mysql.c: In function `_mysql_ConnectionObject_info':
_mysql.c:1150: warning: assignment discards qualifiers from pointer target type
_mysql.c: In function `_mysql_ConnectionObject_stat':
_mysql.c:1379: warning: assignment discards qualifiers from pointer target type
_mysql.c: At top level:
_mysql.c:2007: warning: initialization from incompatible pointer type
_mysql.c:2096: warning: initialization from incompatible pointer type
error: command 'gcc' failed with exit status 1
bash-2.05#
At this point, I'm going to guess that there's a mismatch of code modules (32-bit vs 64-bit) among your libraries. If you compiled your own MySQL, maybe it should be recompiled with -m64. You can probably use the file command on some of the MySQL libraries and that might provide a clue. You might have to do this for Python as well. Or doing so might make things worse; your call.