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

zig cc -fopenmp fails with error lld-link: error: undefined symbol: __kmpc_for_static_init_4 #16796

Open
twobob opened this issue Aug 13, 2023 · 3 comments
Labels
bug Observed behavior contradicts documented or intended behavior zig cc Zig as a drop-in C compiler feature
Milestone

Comments

@twobob
Copy link

twobob commented Aug 13, 2023

Zig Version

0.12.0-dev.66+5e0107fbc

Steps to Reproduce and Observed Behavior

c:\zig\zig cc -march=native -ffinite-loops -DCOMPILER="ZIG" -Ofast -fno-math-errno -D_WIN32 -o runzig.exe -I. -xc save_to_file.c run.c win.c base64_utils.c

works

c:\zig\zig cc -march=native -ffinite-loops -fopenmp -DCOMPILER="ZIG" -Ofast -fno-math-errno -D_WIN32 -o runzig.exe -I. -xc save_to_file.c run.c win.c base64_utils.c
LLD Link... lld-link: error: undefined symbol: __kmpc_for_static_init_4
... elided
lld-link: error: undefined symbol: __kmpc_for_static_fini
lld-link: error: undefined symbol: __kmpc_fork_call
does not work

Expected Behavior

I thought it would just compile tbh

@twobob twobob added the bug Observed behavior contradicts documented or intended behavior label Aug 13, 2023
@twobob
Copy link
Author

twobob commented Aug 13, 2023

oh #7702

I see. Maybe i should just close this

@jacobly0 jacobly0 added the zig cc Zig as a drop-in C compiler feature label Aug 13, 2023
@aleloi
Copy link

aleloi commented Jul 26, 2024

@twobob, I don't understand your comment #16796 (comment) - why is this a dup of #7702? #7702 is about exposing SIMD ops as functions, but this is about linking to openmp. AFAIK, __kmpc_fork_call, __kmpc_for_static_init_4 etc are openmp functions

@andrewrk andrewrk added this to the 0.16.0 milestone Jul 26, 2024
@twobob
Copy link
Author

twobob commented Sep 15, 2024

Seemed holistically related since it wasn't avail yet. My mistake if it wasn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior zig cc Zig as a drop-in C compiler feature
Projects
None yet
Development

No branches or pull requests

4 participants