tanrj / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

compilation fails in ubuntu #68

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

I have iodbc library on my system instead of odbc, which makes pyodbc.so
linkage failat the end of compilation. 

What steps will reproduce the problem?
1. git clone git://github.com/mkleehammer/pyodbc.git
2. python setup.py build

The following patch helps in my case please consider:
steger@kisagy:/tmp/pyodbc$ git diff
diff --git a/setup.py b/setup.py
index 4a96a0e..caf806f 100755
--- a/setup.py
+++ b/setup.py
@@ -47,8 +47,8 @@ def main():
         # OS name not windows, but still on Windows
         libraries.append('odbc32')

-    elif sys.platform == 'darwin':
-        # OS/X now ships with iODBC.
+    elif sys.platform == 'darwin' or sys.platform == 'linux2':
+        # OS/X and Ubuntu now ships with iODBC.
         libraries.append('iodbc')

     else:

Bests,
 Józsi

Original issue reported on code.google.com by steger.j...@gmail.com on 26 Aug 2009 at 8:40

GoogleCodeExporter commented 8 years ago
Are you sure Ubuntu doesn't ship with unixODBC also?

I might have to use a dynamic search or something to find them...

Thanks for the patch.  I'm concerned this would break other distros though.  
I'll do 
some testing and research.

Original comment by mkleehammer on 5 Sep 2009 at 4:51

GoogleCodeExporter commented 8 years ago
Unfortunately this is not an Ubuntu specific issue. I checked and saw that in 
Debian
Lenny both libiodbc2-dev and unixodbc-dev are installable from distribution 
packages
(they conflict each other of course). And in either case the sys.platform has
'linux2' value...

Original comment by steger.j...@gmail.com on 8 Sep 2009 at 12:03

GoogleCodeExporter commented 8 years ago
Am still not sure this is a good idea.  Can you check out the comments on the 
Building page?

  http://code.google.com/p/pyodbc/wiki/Building

There are a couple that discuss building on Ubuntu.

Original comment by mkleehammer on 31 Dec 2009 at 6:51

GoogleCodeExporter commented 8 years ago
Building should allow you to specify which on the command line. UnixODBC is 
usually the default, but iodbc is very common. Maybe even have UnixODBC as 
default and try iodbc on failure. 

Original comment by chris...@gmail.com on 15 Dec 2010 at 5:36