thegooglecodearchive / pymssql

Automatically exported from code.google.com/p/pymssql
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Can't compile on OS X 10.8.4 #125

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I got latest (pymssql-2.0.0b1-dev-20130403).

Here's the fatal error:

_mssql.c:257:10: fatal error: 'sqlfront.h' file not found

Full trace:

mark@macpro:pymssql-2.0.0b1-dev-20130403# python setup.py install
Compiling module Cython.Plex.Scanners ...
Compiling module Cython.Plex.Actions ...
Compiling module Cython.Compiler.Lexicon ...
Compiling module Cython.Compiler.Scanning ...
Compiling module Cython.Compiler.Parsing ...
Compiling module Cython.Compiler.Visitor ...
Compiling module Cython.Compiler.FlowControl ...
Compiling module Cython.Compiler.Code ...
Compiling module Cython.Runtime.refnanny ...
warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Utility'
/var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/easy_install-M9_3dW/Cython-0.19
.1/Cython/Compiler/Code.c:50081:19: warning: expression result unused 
[-Wunused-value]
    PyObject_INIT(o, t);
                  ^
/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/
python2.7/objimpl.h:164:69: note: expanded from macro 'PyObject_INIT'
    ( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
                                                                    ^
1 warning generated.

Installed 
/Users/mark/pymssql-2.0.0b1-dev-20130403/Cython-0.19.1-py2.7-macosx-10.8-x86_64.
egg
creating var
creating var/folders
creating var/folders/hn
creating var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn
creating var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T
cc -arch x86_64 -c 
/var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.c -o 
var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.o
/var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.c:1:1: 
warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main (int argc, char **argv) {
^~~~
/var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.c:2:5: 
warning: implicit declaration of function 'clock_gettime' is invalid in C99
      [-Wimplicit-function-declaration]
    clock_gettime();
    ^
2 warnings generated.
cc -arch x86_64 
var/folders/hn/40d_ql_d21n4kg32cc0sd5p40000gn/T/clock_gettimeOd2mcR.o -lrt -o 
a.out
ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
running install
running bdist_egg
running egg_info
writing pymssql.egg-info/PKG-INFO
writing top-level names to pymssql.egg-info/top_level.txt
writing dependency_links to pymssql.egg-info/dependency_links.txt
reading manifest file 'pymssql.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'win32/freetds.zip'
writing manifest file 'pymssql.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.8-x86_64/egg
running install_lib
running build_ext
skipping '_mssql.c' Cython extension (up-to-date)
building '_mssql' extension
creating build
creating build/temp.macosx-10.8-x86_64-2.7
cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include 
-I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -arch x86_64 
-I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/includ
e/python2.7 -c _mssql.c -o build/temp.macosx-10.8-x86_64-2.7/_mssql.o 
-Wno-parentheses-equality -DMSDBLIB
_mssql.c:257:10: fatal error: 'sqlfront.h' file not found
#include "sqlfront.h"
         ^
1 error generated.
error: command 'cc' failed with exit status 1

Original issue reported on code.google.com by markaric...@gmail.com on 1 Sep 2013 at 11:05

GoogleCodeExporter commented 9 years ago
This means that you need to install FreeTDS.

This is easily done on a Mac with:

* Homebrew -- `brew install freetds`
* MacPorts -- `port install freetds`
* Fink
etc.

You can also compile it from scratch if you don't use a package manager. Make 
sure to run ./configure with --enable-msdblib so that you don't get dates that 
are off by 1 month.

Original comment by msabr...@gmail.com on 2 Sep 2013 at 7:05

GoogleCodeExporter commented 9 years ago
Is there a different mirror I can use? I tried `brew install freetds` and get 
an HTTP 400:

curl: (22) The requested URL returned error: 400
Error: Download failed: 
http://mirrors.ibiblio.org/freetds/stable/freetds-0.91.tar.gz

Original comment by markaric...@gmail.com on 2 Sep 2013 at 7:25

GoogleCodeExporter commented 9 years ago
Downloading the source from 
http://mirrors.ibiblio.org/freetds/stable/freetds-0.91.tar.gz and doing 
`./configure --enable-msdblib` allowed `pip install pymssql` to build and 
install successfully. Thank you!!

Original comment by markaric...@gmail.com on 2 Sep 2013 at 7:30

GoogleCodeExporter commented 9 years ago
Reopening, because I think that we could add code to setup.py to print some 
useful info about how to install FreeTDS, kind of like I did with FreeBSD (see 
https://code.google.com/p/pymssql/issues/detail?id=97#c12)

Original comment by msabr...@gmail.com on 11 Sep 2013 at 5:18

GoogleCodeExporter commented 9 years ago
Good call. Please let me know if I may be of assistance in testing this change.

Original comment by markaric...@gmail.com on 11 Sep 2013 at 11:51

GoogleCodeExporter commented 9 years ago
Committed this change to add some helpful tips for installing FreeTDS on OS X.

@markarichman, let me know what you think.

Original comment by msabr...@gmail.com on 19 Sep 2013 at 5:44

GoogleCodeExporter commented 9 years ago
I don't see the change. I'm looking here: 
https://code.google.com/p/pymssql/source/list

Sorry, new to Google Code.

Original comment by markaric...@gmail.com on 19 Sep 2013 at 12:53

GoogleCodeExporter commented 9 years ago
@markarichman,

Oops, I forgot to post the link to the change. Note that we recently moved the 
source code repo from Google Code (Mercurial) to GitHub.

https://github.com/pymssql/pymssql/commit/5fddb67623b3f5b64d7cf3804105656861754b
29

Let me know if that change would've made installing pymssql on OS X easier for 
you.

Though I'm now starting to come back to the idea of bundling FreeTDS, since 
FreeTDS by default builds without --enable-msdblib, which can lead to problems 
with dates (see https://code.google.com/p/pymssql/wiki/FreeTDSAndDates)

Original comment by msabr...@gmail.com on 19 Sep 2013 at 2:51

GoogleCodeExporter commented 9 years ago
Ah yes! Sorry didn't know we switched to GitHub. Yes that message is perfect! 
The "--enable-msdblib" was the missing magic I needed.

Original comment by markaric...@gmail.com on 19 Sep 2013 at 3:19

GoogleCodeExporter commented 9 years ago
Cool!

Original comment by msabr...@gmail.com on 19 Sep 2013 at 3:51