Comments (13)
Has anyone found any solution to this?
from ethash.
my solution for this:
- install mingw & set windows enviroment path to mingw/bin
- create file python27/Lib/distutils/distutils.cfg
and put in it:
[build]
compiler=mingw32
[build_ext]
compiler=mingw32 - in core.c change alloca.h to malloc.h
- in src/libethhash/util_win32.c
comment out the whole debugf function - python setup.py install
and it worked finally
from ethash.
I was able to figure it out. It was still pointing to the 32 bit version of MWing.
from ethash.
@skyguy126,in the path: ethash/src/python/core.c
from ethash.
It fails when installing pyethash
from ethash.
I tried cloning the repo and removing alloca.h from the src/python, it gives this error:
E:\apps\Visual Studio 2015\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO
/LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\emu\appdata\l
ocal\programs\python\python35\Libs /LIBPATH:e:\projects\ethereum\ethx\venv\libs
/LIBPATH:e:\projects\ethereum\ethx\venv\PCbuild\amd64 "/LIBPATH:E:\apps\Visual S
tudio 2015\VC\LIB\amd64" "/LIBPATH:E:\apps\Visual Studio 2015\VC\ATLMFC\LIB\amd6
4" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10586.0\ucrt\x64" "
/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPAT
H:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10586.0\um\x64" /EXPORT:PyInit
_pyethash build\temp.win-amd64-3.5\Release\src/python/core.obj build\temp.win-am
d64-3.5\Release\src/libethash/io.obj build\temp.win-amd64-3.5\Release\src/libeth
ash/internal.obj build\temp.win-amd64-3.5\Release\src/libethash/sha3.obj build\t
emp.win-amd64-3.5\Release\src/libethash/util_win32.obj build\temp.win-amd64-3.5
Release\src/libethash/io_win32.obj build\temp.win-amd64-3.5\Release\src/libethas
h/mmap_win32.obj /OUT:build\lib.win-amd64-3.5\pyethash.cp35-win_amd64.pyd /IMPLI
B:build\temp.win-amd64-3.5\Release\src/python\pyethash.cp35-win_amd64.lib
core.obj : warning LNK4197: export 'PyInit_pyethash' specified multiple time
s; using first specification
Creating library build\temp.win-amd64-3.5\Release\src/python\pyethash.cp3
5-win_amd64.lib and object build\temp.win-amd64-3.5\Release\src/python\pyethash.
cp35-win_amd64.exp
io_win32.obj : error LNK2001: unresolved external symbol __imp_SHGetFolderPa
thA
build\lib.win-amd64-3.5\pyethash.cp35-win_amd64.pyd : fatal error LNK1120: 1
unresolved externals
error: command 'E:\apps\Visual Studio 2015\VC\BIN\x86_amd64\link.exe'
failed with exit status 1120
from ethash.
I'm still getting these same errors with pyethash through pip. Did you ever find a resolution to this?
from ethash.
dzabur. I tried this and i got further but now:
C:\MinGW\bin\gcc.exe -shared -s build\temp.win-amd64-2.7\Release\src\python\core.o build\temp.win-amd64-2.7\Release\src\libethash\io.o build\temp.win-amd64-2.7\Release\src\libethash\internal.o build\temp.win-amd64-2.7\Release\src\libethash\sha3.o build\temp.win-amd64-2.7\Release\src\libethash\util_win32.o build\temp.win-amd64-2.7\Release\src\libethash\io_win32.o build\temp.win-amd64-2.7\Release\src\libethash\mmap_win32.o build\temp.win-amd64-2.7\Release\src\python\pyethash.def -LC:\Python27\libs -LC:\Python27\PCbuild\amd64 -LC:\Python27\PC\VS9.0\amd64 -lpython27 -lmsvcr90 -o build\lib.win-amd64-2.7\pyethash.pyd
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x5e): undefined reference to `_imp__PyArg_ParseTuple'
Any ideas? I know it has something to do with 32 vs 64. I thought everything I am running related to Python is 64 bit ....
from ethash.
When I do as @dzabur saying, I get another issue like "previous declaration of 'printf' was here":
In file included from src/libethash/util_win32.c:23:0:
src/libethash/util.h:32:16: error: conflicting types for 'printf'
#define debugf printf
^
src/libethash/util_win32.c:29:6: note: in expansion of macro 'debugf'
void debugf(char const* str, ...)
^~~~~~
In file included from src/libethash/util_win32.c:22:0:
F:/MinGW/mingw64/x86_64-w64-mingw32/include/stdio.h:380:15: note: previous declaration of 'printf' was here
int __cdecl printf(const char * restrict _Format,...);
^~~~~~
error: command 'F:\MinGW\mingw64\bin\gcc.exe' failed with exit status 1
How to solve this new problem?
from ethash.
I try to comment out the whole debugf function in src/libethhash/util_win32.c, but a new problem arise:
F:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsvcr140
collect2.exe: error: ld returned 1 exit status
error: command 'F:\MinGW\mingw64\bin\gcc.exe' failed with exit status 1
from ethash.
@08zhangyi I'm now getting undefined reference errors, how did you manage to fix these. I am pretty sure I'm using a 64bit version of MinGW, is there any way to check.
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x183): undefined reference to `_imp__Py_BuildValue'
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x1ad): undefined reference to `_imp__PyExc_ValueError'
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x1b8): undefined reference to `_imp__PyErr_SetString'
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x1e8): undefined reference to `_imp__PyArg_ParseTuple'
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x228): undefined reference to `_imp__Py_BuildValue'
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x266): undefined reference to `_imp__PyArg_ParseTuple'
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x2b0): undefined reference to `_imp__Py_BuildValue'
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x2e1): undefined reference to `_imp__PyExc_ValueError'
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x2ec): undefined reference to `_imp__PyErr_SetString'
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x32c): undefined reference to `_imp__Py_InitModule4'
build\temp.win-amd64-2.7\Release\src\python\core.o:core.c:(.text+0x347): undefined reference to `_imp__PyModule_AddIntConstant'
EDIT: Now I am only getting the error in the last line of what is pasted above.
from ethash.
@skyguy126 , sorry, I have not meet these problems and I think the source code doesn't has any variuables like imp__Py_BuildValue. I think you can modify these variables' names by deleting the prefix 'imp'
from ethash.
@08zhangyi Figured it out, you have to add -D MS_WIN64
to the compile flags in setup.py. For future reference I guess.
from ethash.
Related Issues (20)
- Add simple instructions for dependencies, build, and install
- Why is ENABLE_SSE disabled? HOT 1
- undefined: crypto.Sha3Hash HOT 1
- Changes for windows HOT 7
- Strange loop
- Stack use after scope
- compile error HOT 2
- using this in a cpp application HOT 2
- Problem with using with Python for Windows. Please adapt compiler options… HOT 3
- Fix version numbers
- Replace this repo with chfast/ethash HOT 1
- not able to make benchmark_full HOT 7
- not able to collect dag
- munmap not delete the right address range
- can't find ethash_params in benchmarl.cpp
- unable to install pyethash HOT 13
- amazon linux: Running setup.py install for pyethash ... error
- test/python/requirements.txt is using pyethereum
- .
- Migrate away from obsolete 'distutils'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethash.