Build mathlink.pyd for Python on windows using Mathematica 10

Apparently the Mathlink Python extension hasn't been updated for a while. As shown below, it is not linking to the correct libraries. Also, the API seems to have been updated, while Mathlink's source code does not.

C:\Program Files\Wolfram Research\Mathematica\10.0\SystemFiles\Links\Python
>python setup.py build
running build
running build_ext
building 'mathlink' extension
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox
 /MD /W3 /GS- /DNDEBUG -DWINDOWS_MATHLINK "-IC:\Program Files\Wolfram Research\M
athematica\10.0\SystemFiles\Links\MathLink\DeveloperKit\Windows\CompilerAddition
s\mldev32\include" -Ic:\Python27\include -Ic:\Python27\PC /Tcmathlink.c /Fobuild
\temp.win32-2.7\Release\mathlink.obj
mathlink.c
mathlink.c(1473) : warning C4013: 'MLDisownByteString' undefined; assuming exter n returning int
mathlink.c(1555) : warning C4013: 'MLDisownString' undefined; assuming extern returning int
mathlink.c(1885) : warning C4013: 'MLDisownSymbol' undefined; assuming extern returning int
mathlink.c(2094) : warning C4013: 'MLDisownIntegerList' undefined; assuming extern returning int
mathlink.c(2167) : warning C4013: 'MLDisownRealList' undefined; assuming extern returning int
mathlink.c(2238) : warning C4013: 'MLDisownIntegerArray' undefined; assuming extern returning int
mathlink.c(2259) : warning C4013: 'MLDisownRealArray' undefined; assuming extern returning int
mathlink.c(3861) : warning C4047: 'function' : 'unsigned long' differs in levels of indirection from 'MLParametersPointer'
mathlink.c(3861) : warning C4024: 'MLNewParameters' : different types for formal and actual parameter 1
mathlink.c(3861) : warning C4020: 'MLNewParameters' : too many actual parameters 
mathlink.c(3861) : warning C4047: '=' : 'ulong_ct' differs in levels of indirect ion from 'MLEnvironmentParameter'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo
 /INCREMENTAL:NO "/LIBPATH:C:\Program Files\Wolfram Research\Mathematica\10.0\Sy
stemFiles\Links\MathLink\DeveloperKit\Windows\CompilerAdditions\mldev32\lib" /LI
BPATH:c:\Python27\libs /LIBPATH:c:\Python27\PCbuild ml32i3m.lib /EXPORT:initmath
link build\temp.win32-2.7\Release\mathlink.obj /OUT:build\lib.win32-2.7\mathlink
.pyd /IMPLIB:build\temp.win32-2.7\Release\mathlink.lib /MANIFESTFILE:build\temp.
win32-2.7\Release\mathlink.pyd.manifest Creating library build\temp.win32-2.7\Release\mathlink.lib and object build\temp.win32-2.7\Release\mathlink.exp
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownByteString referenced in function _mathlink_GetLong
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownString referenced in function _mathlink_GetString
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownSymbol referenced in function _mathlink_GetSymbol
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownIntegerList referenced in function _mathlink_GetIntegerList
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownRealList referenced in function _mathlink_GetFloatList
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownIntegerArray referenced in function _mathlink_GetIntArray
mathlink.obj : error LNK2019: unresolved external symbol _MLDisownRealArray referenced in function _mathlink_GetFloatArray
mathlink.obj : error LNK2019: unresolved external symbol _MLNewParameters@8 referenced in function _Env_Alloc
build\lib.win32-2.7\mathlink.pyd : fatal error LNK1120: 8 unresolved externals
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link
.exe"' failed with exit status 1120

      

Any suggestions are appreciated.

+3
python wolfram-mathematica window


source to share


No one has answered this question yet

Check out similar questions:

5504
Does Python have a ternary conditional operator?
5231
What are metaclasses in Python?
4473
Calling an external command in Python
3790
How can I safely create a subdirectory?
3602
Does Python have a substring method "contains"?
3119
What is the difference between Python list methods that are appended and expanded?
2818
Finding the index of an element by specifying the list that contains it in Python
2568
How to find the current time in Python
2453
How do I install pip on Windows?
1476
How do I find Waldo with Mathematica?



All Articles
Loading...
X
Show
Funny
Dev
Pics