Skip to content

build/install problem on windows #1360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
breisfeld opened this issue May 31, 2012 · 14 comments
Closed

build/install problem on windows #1360

breisfeld opened this issue May 31, 2012 · 14 comments
Labels
Build Library building on various platforms
Milestone

Comments

@breisfeld
Copy link

platform: Windows 7
python: Python: Enthought Python Distribution, Version: 7.1-1 (32-bit)

numpy.version
'1.6.2'
scipy.version
'0.10.1'
$:git rev-parse master
5b98fdf

$ python setup.py install

...
g++ -shared build\temp.win32-2.7\Release\pandas\src\ujson\python\ujson.o build\temp.win32-2.7\Release\pandas\src\ujson\python\objtojson.o build\temp.w
in32-2.7\Release\pandas\src\ujson\python\jsontoobj.o build\temp.win32-2.7\Release\pandas\src\ujson\lib\ultrajsonenc.o build\temp.win32-2.7\Release\pan
das\src\ujson\lib\ultrajsondec.o build\temp.win32-2.7\Release\pandas\src\datetime\np_datetime.o -LC:\Python27\lib\site-packages\numpy\core\lib -LC:\Py
thon27\libs -LC:\Python27\PCbuild -lnpymath -lpython27 -lmsvcr90 -o build\lib.win32-2.7\pandas\_ujson.pyd
Found executable C:\Python27\Scripts\g++.exe
Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b
3b9a1e18e3b'" /DEFAULTLIB:"python27.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b
3b9a1e18e3b'" /DEFAULTLIB:"python27.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
C:\Python27\lib\site-packages\numpy\core\lib/npymath.lib(build/temp.win32-2.7/numpy/core/src/npymath/halffloat.obj):(.text+0x636): undefined reference
 to `_allshl'
C:\Python27\lib\site-packages\numpy\core\lib/npymath.lib(build/temp.win32-2.7/numpy/core/src/npymath/halffloat.obj):(.text+0x659): undefined reference
 to `_aullshr'
C:\Python27\lib\site-packages\numpy\core\lib/npymath.lib(build/temp.win32-2.7/numpy/core/src/npymath/halffloat.obj):(.text+0x7c5): undefined reference
 to `_allmul'
C:\Python27\lib\site-packages\numpy\core\lib/npymath.lib(build/temp.win32-2.7/numpy/core/src/npymath/halffloat.obj):(.text+0x7e1): undefined reference
 to `_allmul'
C:\Python27\lib\site-packages\numpy\core\lib/npymath.lib(build/temp.win32-2.7/numpy/core/src/npymath/halffloat.obj):(.text+0x831): undefined reference
 to `_allmul'
C:\Python27\lib\site-packages\numpy\core\lib/npymath.lib(build/temp.win32-2.7/numpy/core/src/npymath/halffloat.obj):(.text+0x84f): undefined reference
 to `_allmul'
collect2: ld returned 1 exit status
error: Command "g++ -shared build\temp.win32-2.7\Release\pandas\src\ujson\python\ujson.o build\temp.win32-2.7\Release\pandas\src\ujson\python\objtojso
n.o build\temp.win32-2.7\Release\pandas\src\ujson\python\jsontoobj.o build\temp.win32-2.7\Release\pandas\src\ujson\lib\ultrajsonenc.o build\temp.win32
-2.7\Release\pandas\src\ujson\lib\ultrajsondec.o build\temp.win32-2.7\Release\pandas\src\datetime\np_datetime.o -LC:\Python27\lib\site-packages\numpy\
core\lib -LC:\Python27\libs -LC:\Python27\PCbuild -lnpymath -lpython27 -lmsvcr90 -o build\lib.win32-2.7\pandas\_ujson.pyd" failed with exit status 1
@Komnomnomnom
Copy link
Contributor

Looks like a problem with the ujson extension linking to npymath. #1371 should fix it. (Or, due to licensing issues, the ujson extension might be removed, either way it should be fixed!)

@wesm
Copy link
Member

wesm commented Jun 2, 2012

This should be fixed in git master. Please let us know if it still doesn't build

@wesm wesm closed this as completed Jun 2, 2012
@breisfeld
Copy link
Author

Sadly, it still doesn't build:

$ git describe
v0.8.0b1-46-g952b272

$ python setup.py build

...
pandas\src\sparse.c:21789:13: warning: too many arguments for format
writing build\temp.win32-2.7\Release\pandas\src\_sparse.def
C:\Python27\Scripts\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.7\Release\pandas\src\sparse.o build\temp.win3
2-2.7\Release\pandas\src\_sparse.def -LC:\Python27\libs -LC:\Python27\PCbuild -lpython27 -lmsvcr90 -o build\lib.win
32-2.7\pandas\_sparse.pyd
building 'pandas._ujson' extension
creating build\temp.win32-2.7\Release\pandas\src\ujson
creating build\temp.win32-2.7\Release\pandas\src\ujson\python
creating build\temp.win32-2.7\Release\pandas\src\ujson\lib
C:\Python27\Scripts\gcc.exe -mno-cygwin -mdll -O -Wall -Ipandas/src/ujson/python -Ipandas/src/ujson/lib -Ipandas/sr
c/datetime -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c pandas/src/
ujson/python/ujson.c -o build\temp.win32-2.7\Release\pandas\src\ujson\python\ujson.o
C:\Python27\Scripts\gcc.exe -mno-cygwin -mdll -O -Wall -Ipandas/src/ujson/python -Ipandas/src/ujson/lib -Ipandas/sr
c/datetime -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c pandas/src/
ujson/python/objToJSON.c -o build\temp.win32-2.7\Release\pandas\src\ujson\python\objtojson.o
In file included from pandas/src/ujson/python/objToJSON.c:9:0:
pandas/src/ujson/lib/ultrajson.h:87:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'JSUINT32'
pandas/src/datetime/np_datetime.h:59:12: warning: '_days_per_month_table' defined but not used
pandas/src/ujson/python/objToJSON.c:128:14: warning: 'PyIntToINT64' defined but not used
error: command 'gcc' failed with exit status 1

@wesm wesm reopened this Jun 2, 2012
@wesm
Copy link
Member

wesm commented Jun 3, 2012

Building on mingw32 again and all the tests are passing except for 32-bit segfaulting issues in pandas\tests\test_ujson.py that we are aware of. So closing this issue

@wesm wesm closed this as completed Jun 3, 2012
@breisfeld
Copy link
Author

$ git describe
v0.8.0b1-72-g4a6fd01

$ python setup.py build

...
C:\Python27\Scripts\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.7\Release\pandas\src\sparse.o build\temp.win32-2.7
\Release\pandas\src\_sparse.def -LC:\Python27\libs -LC:\Python27\PCbuild -lpython27 -lmsvcr90 -o build\lib.win32-2.7\pan
das\_sparse.pyd
building 'pandas._ujson' extension
creating build\temp.win32-2.7\Release\pandas\src\ujson
creating build\temp.win32-2.7\Release\pandas\src\ujson\python
creating build\temp.win32-2.7\Release\pandas\src\ujson\lib
C:\Python27\Scripts\gcc.exe -mno-cygwin -mdll -O -Wall -Ipandas/src/ujson/python -Ipandas/src/ujson/lib -Ipandas/src/dat
etime -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c pandas/src/ujson/pyth
on/ujson.c -o build\temp.win32-2.7\Release\pandas\src\ujson\python\ujson.o
C:\Python27\Scripts\gcc.exe -mno-cygwin -mdll -O -Wall -Ipandas/src/ujson/python -Ipandas/src/ujson/lib -Ipandas/src/dat
etime -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c pandas/src/ujson/pyth
on/objToJSON.c -o build\temp.win32-2.7\Release\pandas\src\ujson\python\objtojson.o
In file included from pandas/src/ujson/python/objToJSON.c:9:0:
pandas/src/ujson/lib/ultrajson.h:87:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'JSUINT32'
pandas/src/datetime/np_datetime.h:59:12: warning: '_days_per_month_table' defined but not used
pandas/src/ujson/python/objToJSON.c:128:14: warning: 'PyIntToINT64' defined but not used
error: command 'gcc' failed with exit status 1

@Komnomnomnom
Copy link
Contributor

Looks like the MINGW macro check isn't suitable for some versions, I'll look into a better method. Do you know what version of mingw you're using?

@breisfeld
Copy link
Author

I'm not sure if this will help, but the compiler invocation used in part of the pandas build for ujson is as follows:

C:\Python27\Scripts\gcc.exe -mno-cygwin -mdll -O -Wall -Ipandas/src/ujson/python -Ipandas/src/ujson/lib -Ipandas/src/dat
etime -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c pandas/src/ujson/pyth
on/ujson.c -o build\temp.win32-2.7\Release\pandas\src\ujson\python\ujson.o

And the version of gcc provided by Enthought in the distribution is

$ C:\Python27\Scripts\gcc.exe --version
gcc.exe (GCC) 4.5.2 20101015 (prerelease)

@wesm wesm reopened this Jun 3, 2012
@wesm
Copy link
Member

wesm commented Jun 3, 2012

My apologies-- I didn't push the fix that fixed the build on mingw32. Give me a minute and will push

@wesm
Copy link
Member

wesm commented Jun 3, 2012

OK building cleanly for me after dc491f5 on mingw32, Win32 EPD 7.1-1

@breisfeld
Copy link
Author

[C:..\packages\pandas]:git describe
v0.8.0b1-73-gdc491f5

This version builds and installs cleanly for me. Great job!

Unfortunately, one of the tests causes the interpreter to quit:

$ nosetests -v pandas

...
pandas.tseries.tests.test_offsets.test_monthrange ... ok
pandas.tseries.tests.test_offsets.test_format ... ok
pandas.tseries.tests.test_offsets.test_ole2datetime ... ok
pandas.tseries.tests.test_offsets.test_to_datetime1 ... ok
pandas.tseries.tests.test_offsets.test_normalize_date ... ok
pandas.tseries.tests.test_offsets.test_to_m8 ... ok
pandas.tseries.tests.test_offsets.test_Hour ... ok
pandas.tseries.tests.test_offsets.test_Minute ... ok
pandas.tseries.tests.test_offsets.test_Second ... ok
pandas.tseries.tests.test_offsets.test_hasOffsetName ... ok
pandas.tseries.tests.test_offsets.test_get_offset_name ... ok
pandas.tseries.tests.test_offsets.test_get_offset ... ok
pandas.tseries.tests.test_offsets.test_parse_time_string ... ok
pandas.tseries.tests.test_offsets.test_get_standard_freq ... ok
pandas.tseries.tests.test_offsets.test_quarterly_dont_normalize ... ok
test_conv_annual (pandas.tseries.tests.test_period.TestFreqConversion) ...

The interpreter then quits ("python.exe: python.exe has stopped working. Windows is checking for a solution to the problem...").

@wesm
Copy link
Member

wesm commented Jun 3, 2012

I saw one other report of that test failing for someone else. I haven't been able to reproduce yet, though

@wesm
Copy link
Member

wesm commented Jun 3, 2012

Scratch that. I'm able to get a segfault on that set of tests with mingw32. I'll look into it

@Komnomnomnom
Copy link
Contributor

Note with the mingw on my windows xp vm I am now back to getting a build error with the current master

pandas/src/ujson/lib/ultrajson.h:83:26: error: conflicting types for 'uint32_t'
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h:32:20: note: previous declaration of 'uint32_t' was here

Full message:

C:\Documents and Settings\kierano\Work\git\pandas_mingw>python setup.py build_ext --inplace --compiler=mingw32
running build_ext
skipping 'pandas\src\generated.c' Cython extension (up-to-date)
skipping 'pandas\src\tseries.c' Cython extension (up-to-date)
skipping 'pandas\src\sparse.c' Cython extension (up-to-date)
building 'pandas._ujson' extension
c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Ipandas/src/ujson/python -Ipandas/src/ujson/lib -Ipandas/src/datetime -Ic:\Python27\lib\site-packages
\numpy\core\include -Ic:\Python27\include -Ic:\Python27\PC -c pandas/src/ujson/python/ujson.c -o build\temp.win32-2.7\Release\pandas\src\ujson\python\
ujson.o
c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Ipandas/src/ujson/python -Ipandas/src/ujson/lib -Ipandas/src/datetime -Ic:\Python27\lib\site-packages
\numpy\core\include -Ic:\Python27\include -Ic:\Python27\PC -c pandas/src/ujson/python/objToJSON.c -o build\temp.win32-2.7\Release\pandas\src\ujson\pyt
hon\objtojson.o
In file included from pandas/src/ujson/python/objToJSON.c:9:0:
pandas/src/ujson/lib/ultrajson.h:83:26: error: conflicting types for 'uint32_t'
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdint.h:32:20: note: previous declaration of 'uint32_t' was here
pandas/src/datetime/np_datetime.h:59:12: warning: '_days_per_month_table' defined but not used
pandas/src/ujson/python/objToJSON.c:128:14: warning: 'PyIntToINT64' defined but not used
error: command 'gcc' failed with exit status 1

I guess ideally these types should be checked for in a configure script or similar.

@wesm
Copy link
Member

wesm commented Jun 4, 2012

I fixed the test_period.py segfaults, the remaining issues are coming from ujson which looks like it may need to be factored into a separate extension until the mingw32 issues can be sorted out. I'm going to close this issue and create a separate one for the ujson issues-- you can safely use the pandas build, just steer clear of the to_json and from_json functions

@wesm wesm closed this as completed Jun 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms
Projects
None yet
Development

No branches or pull requests

3 participants