Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fixed #4896 (fails to build with MSVC 2013) #5204

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
wants to merge 1 commit into from
Closed

fixed #4896 (fails to build with MSVC 2013) #5204

wants to merge 1 commit into from

Conversation

robberphex
Copy link
Contributor

fix build error with MSVC 2013 caused by C99 complex support

I already tested in Win8.1 with VS2013 Express 64bit.
Because I am not sure this patch is correct, please let me know if something is wrong in this patch.

How to build(Win8.1+VS2013)

  • Install VS2013 Express(it support 64bit, don't need Windows SDK)
  • In cmd, execute those commad:
cd \path\to\numpy
set VS100COMNTOOLS=%VS120COMNTOOLS%
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
python setup.py install

fix build error with MSVC 2013 caused by C99 complex support
@juliantaylor
Copy link
Contributor

wouldn't it be enough to replace complex with _Complex? I can see why MS did not implement complex but if they have enough support for numpy build to detect it as working maybe they have _Complex implemented

@robberphex
Copy link
Contributor Author

@juliantaylor I try to use _Complex double c99_z, but in VS2013, I get error: error C2065: '_Complex' : undeclared identifier.
`error C2065: '_Complex' : undeclared identifier

@juliantaylor
Copy link
Contributor

too bad
doesn't break my vs2008 setup so looks good to me, I'll merge after @peterl94 had a chance to test it

@robberphex
Copy link
Contributor Author

@juliantaylor And, VS2013 don't allow initialize a union by a struct, so I using assignment.

What means "too bad"? If the code is wrong, please let me know, I will correct it.

@juliantaylor
Copy link
Contributor

the code is fine, I just though vs2013 not support complex numbers in a c99 compatible way is bad
did you run the numpy testsuite after the build?

import numpy
numpy.test()

@robberphex
Copy link
Contributor Author

Sorry, in test, I got Python has stoped working.

@juliantaylor
Copy link
Contributor

with python2 or python3?
did you build your python yourself?
binary incompatibility might be the reason
using python from python.org, version2 stuff needs to be built with VS2008 and version 3 (>3.2 < 3.5) needs to be built with VS2010

@robberphex
Copy link
Contributor Author

I am testing with VS2013 in Windows 8.1, and Python 3.4,2(all is 64bit).

I am downloading VS2010 :(

@juliantaylor
Copy link
Contributor

can you run numpy.test(verbose=5) too see which test is crashing?

@robberphex
Copy link
Contributor Author

@juliantaylor It's test_multiarray.TestIO.test_ascii

@juliantaylor
Copy link
Contributor

thats failing for me too when building numpy with python.org python2 with VS2010, so probably not related to this change, I'm guessing the reason is binary incompatibility.
can you try python3? maybe the incompatibility between 2013 and 2010 is less severe

@robberphex
Copy link
Contributor Author

Python3 + VS2013 64bit build successfully, but cannot pass test.

@robberphex
Copy link
Contributor Author

I am sorry, compile error:
error: Command "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild\amd64 /LIBPATH:build\temp.win-amd64-3.4 npymath.lib npysort.lib /EXPORT:PyInit_multiarray build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\alloc.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\arrayobject.obj build\temp.win-amd64-3.4\Release\build\src.win-amd64-3.4\numpy\core\src\multiarray\arraytypes.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\array_assign.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\array_assign_scalar.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\array_assign_array.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\buffer.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\calculation.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\common.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\convert.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\convert_datatype.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\conversion_utils.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\ctors.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\datetime.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\datetime_strings.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\datetime_busday.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\datetime_busdaycal.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\descriptor.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\dtype_transfer.obj build\temp.win-amd64-3.4\Release\build\src.win-amd64-3.4\numpy\core\src\multiarray\einsum.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\flagsobject.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\getset.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\hashdescr.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\item_selection.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\iterators.obj build\temp.win-amd64-3.4\Release\build\src.win-amd64-3.4\numpy\core\src\multiarray\lowlevel_strided_loops.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\mapping.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\methods.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\multiarraymodule.obj build\temp.win-amd64-3.4\Release\build\src.win-amd64-3.4\numpy\core\src\multiarray\nditer_templ.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\nditer_api.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\nditer_constr.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\nditer_pywrap.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\number.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\numpymemoryview.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\numpyos.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\refcount.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\sequence.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\shape.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\scalarapi.obj build\temp.win-amd64-3.4\Release\build\src.win-amd64-3.4\numpy\core\src\multiarray\scalartypes.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\usertypes.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\ucsnarrow.obj build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\vdot.obj /OUT:build\lib.win-amd64-3.4\numpy\core\multiarray.pyd /IMPLIB:build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\multiarray.lib /MANIFESTFILE:build\temp.win-amd64-3.4\Release\numpy\core\src\multiarray\multiarray.pyd.manifest" failed with exit status 1120

But in last commit, I also meet same error. What's wrong?
tested with Python 3.4.2 64bit and VS2010 on Windows 8.1.

@juliantaylor
Copy link
Contributor

right master is still broken by #4852, maintenance/1.9.x should build
@ewmoore are you still going to fix that?

@juliantaylor
Copy link
Contributor

#5207 should fix the build on msvc

@robberphex
Copy link
Contributor Author

I apply my commit/patch to numpy 1.9.0(download from PyPi), and passed test.
Win 8.1, VS2010, Python3.4.2, ACML5.3.1, and all is 64bit

@peterlama
Copy link

It works for me as well using the maintenance/1.9.x branch. Is it supposed to work with master with #5207 applied too? I might have been doing something wrong, but it failed with an undefined reference to npy_pow.

VS2013 64-bit, Python 2.7.7

@peterlama
Copy link

Actually, never mind. It works with master too. I must of just temporarily messed something up.

@juliantaylor
Copy link
Contributor

I also got the pow error once and it disappeared when starting over, something may be a little weird on windows
thanks for testing, I'll merge this then

juliantaylor added a commit that referenced this pull request Oct 21, 2014
fixed #4896 (fails to build with MSVC 2013)
juliantaylor added a commit that referenced this pull request Oct 21, 2014
fixed #4896 (fails to build with MSVC 2013)
@juliantaylor
Copy link
Contributor

pushed as a4e68f4
thanks

@robberphex you used master to create this PR, please reset it to the original master to avoid issues when updating.

git checkout master
git reset origin/master

it is usually better to create a new branch for pull requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants