Skip to content
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

Bug: No response with numpy 1.26.4, python 3.12.3, nuitka 2.3rc5 and --standalone #2882

Closed
ShapingView opened this issue May 22, 2024 · 2 comments
Assignees
Labels

Comments

@ShapingView
Copy link

ShapingView commented May 22, 2024

Update: It seems to work with numpy 1.26.3 but not with 1.26.4


My Environment

Running python 3.12.3 on windows 11 23H2

Nuitka version (used with mingw64)

2.3rc5
Commercial: None
Python: 3.12.3 (tags/v3.12.3:f6650f9, Apr  9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)]
Flavor: CPython Official
Executable: C:\Users\shapingview\Desktop\repos\venv-312-test\Scripts\python.exe
OS: Windows
Arch: x86_64
WindowsRelease: 11
Nuitka-Scons:WARNING: Windows SDK must be installed in Visual Studio for it to be usable with Nuitka. Use the Visual Studio installer for adding
Nuitka-Scons:WARNING: it.
Version C compiler: ~\AppData\Local\Nuitka\Nuitka\Cache\DOWNLO~1\gcc\x86_64\13.2.0-16.0.6-11.0.1-msvcrt-r1\mingw64\bin\gcc.exe (gcc 13.2.0).

python environment:

pip freeze
Nuitka @ https://github.com/Nuitka/Nuitka/archive/develop.zip#sha256=e972d115ec23c2e61236cf15eeb96e95e1c7fad5355e29abdc9f131859b05a29
numpy==1.26.4
ordered-set==4.1.0
zstandard==0.22.0

Script

Compiling this script (hw.py) does not work

import time
import numpy as np

def f(inp):
    print("Hello " + inp)

def main():
    time.sleep(np.random.uniform())
    f("nuitka!")


if __name__ == "__main__":
    main()
Version without numpy works
import time

def f(inp):
    print("Hello " + inp)

def main():
    time.sleep(.5)
    f("nuitka!")


if __name__ == "__main__":
    main()

Behavior

Running this script with python works fine, but after compilation with nutika it doesnt

> python .\hw.py  # works fine 
Hello nuitka!

Remark:

  • I am also using --mingw64 because I currently can't install newer MSVC versions. Not sure if that is relevant for this issue
  • Without --standalone it works
>  python.exe -m nuitka --mingw64 --standalone hw.py
Nuitka-Options: Used command line options: --mingw64 --standalone hw.py
Nuitka: Starting Python compilation with Nuitka '2.3rc5' on Python '3.12' commercial grade 'not installed'.
Nuitka: Completed Python level compilation and optimization.
Nuitka: Generating source code for C backend compiler.
Nuitka: Running data composer tool for optimal constant value handling.
Nuitka: Running C compilation via Scons.
Nuitka-Scons: Backend C compiler: gcc (gcc 13.2.0).
Nuitka-Scons: Backend linking program with 99 files (no progress information available for this stage).
Nuitka-Scons: Compiled 99 C files using ccache.
Nuitka-Scons: Cached C files (using ccache) with result 'cache hit': 99
Nuitka: Keeping build directory 'hw.build'.
Nuitka: Successfully created 'hw.dist\hw.exe'.

running > .\hw.dist\hw.exe does not return anything.

Thanks for your help! I'm looking forward to your feedback

@ShapingView ShapingView changed the title multiprocessing fails with python 3.12, nuitka 2.3rc5 and --standalone multiprocessing fails with python 3.12.3, nuitka 2.3rc5 and --standalone May 22, 2024
@ShapingView ShapingView changed the title multiprocessing fails with python 3.12.3, nuitka 2.3rc5 and --standalone Bug: No response with numpy 1.26.4, python 3.12.3, nuitka 2.3rc5 and --standalone May 22, 2024
@kayhayen
Copy link
Member

I just tried it, and it works fine with the current factory branch, at least. We also ran large parts of Nuitka-Watch against that and it should be good. There will be a pre-release of it soon too.

@kayhayen kayhayen self-assigned this May 23, 2024
@kayhayen kayhayen added the bug label May 23, 2024
@kayhayen
Copy link
Member

The bug I have fixed might be one that shows only in certain malloc situations, on every n-th run, maybe that is why you found another version to work.

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

No branches or pull requests

2 participants