Giter VIP home page Giter VIP logo

Comments (13)

artemistomaras avatar artemistomaras commented on July 17, 2024 13

Has anyone found any solution to this?

from ethash.

dzabur avatar dzabur commented on July 17, 2024 1

my solution for this:

  1. install mingw & set windows enviroment path to mingw/bin
  2. create file python27/Lib/distutils/distutils.cfg
    and put in it:
    [build]
    compiler=mingw32
    [build_ext]
    compiler=mingw32
  3. in core.c change alloca.h to malloc.h
  4. in src/libethhash/util_win32.c
    comment out the whole debugf function
  5. python setup.py install
    and it worked finally

from ethash.

richbram avatar richbram commented on July 17, 2024 1

I was able to figure it out. It was still pointing to the 32 bit version of MWing.

from ethash.

08zhangyi avatar 08zhangyi commented on July 17, 2024 1

@skyguy126,in the path: ethash/src/python/core.c

from ethash.

emum8 avatar emum8 commented on July 17, 2024

It fails when installing pyethash

from ethash.

emum8 avatar emum8 commented on July 17, 2024

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.

coreyalane avatar coreyalane commented on July 17, 2024

I'm still getting these same errors with pyethash through pip. Did you ever find a resolution to this?

from ethash.

richbram avatar richbram commented on July 17, 2024

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.

08zhangyi avatar 08zhangyi commented on July 17, 2024

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.

08zhangyi avatar 08zhangyi commented on July 17, 2024

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.

skyguy126 avatar skyguy126 commented on July 17, 2024

@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.

08zhangyi avatar 08zhangyi commented on July 17, 2024

@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.

skyguy126 avatar skyguy126 commented on July 17, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.