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

unresolved external symbol error in openmp_examples tests on Windows #1371

Open
tdusnoki opened this issue Jun 6, 2023 · 3 comments
Open
Labels
windows Add this to all windows specific issues or PRs

Comments

@tdusnoki
Copy link
Contributor

tdusnoki commented Jun 6, 2023

There are 37 failing test cases in openmp_examples test suite currently. Most of them share the same kind of error e.g.:

FAIL: Flang :: openmp_examples/lit/Example_collapse.2f.sh (42 of 166)
******************** TEST 'Flang :: openmp_examples/lit/Example_collapse.2f.sh' FAILED ********************
Script:
--
: 'RUN: at line 8';   env KEEP_FILES= FLAGS=" -IC:/install/include" TEST_SRC=C:/flang/test/openmp_examples/lit/Example_collapse.2f.sh MAKE_FILE_DIR=C:/flang/test/openmp_examples/lit/.. bash C:/flang/test/openmp_examples/lit/runmake | tee C:/flang/build/test/openmp_examples/lit/Output/Example_collapse.2f.sh.tmp
: 'RUN: at line 9';   cat C:\flang\build\test\openmp_examples\lit\Output\Example_collapse.2f.sh.tmp | c:\flang\build\bin\filecheck.exe C:\flang\test\openmp_examples\lit/runmake
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 8"
$ "env" "KEEP_FILES=" "FLAGS= -IC:/install/include" "TEST_SRC=C:/flang/test/openmp_examples/lit/Example_collapse.2f.sh" "MAKE_FILE_DIR=C:/flang/test/openmp_examples/lit/.." "bash" "C:/flang/test/openmp_examples/lit/runmake"
$ "tee" "C:/flang/build/test/openmp_examples/lit/Output/Example_collapse.2f.sh.tmp"
# command output:
------------------------------------ building test build
flang -Mfixed -c -c -IC:/flang/test/openmp_examples/lit/.. -IC:/install/include -mp    C:/flang/test/openmp_examples/lit/../sources/Example_collapse.2f.f -o Example_collapse.2f.o
warning: overriding the module target triple with x86_64-pc-windows-msvc19.35.32215 [-Woverride-module]
1 warning generated.
flang Example_collapse.2f.o  -IC:/install/include -mp -o Example_collapse.2f.out
Microsoft (R) Incremental Linker Version 14.35.32215.0
Copyright (C) Microsoft Corporation.  All rights reserved.

LINK : warning LNK4044: unrecognized option '/linker'; ignored
LINK : warning LNK4044: unrecognized option '/linker'; ignored
LINK : warning LNK4044: unrecognized option '/linker'; ignored
LINK : warning LNK4044: unrecognized option '/linker'; ignored
LINK : warning LNK4044: unrecognized option '/linker'; ignored
LINK : warning LNK4044: unrecognized option '/linker'; ignored
LINK : warning LNK4044: unrecognized option '/linker'; ignored
LINK : warning LNK4044: unrecognized option '/linker'; ignored
LINK : warning LNK4044: unrecognized option '/linker'; ignored
libcmt.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
Example_collapse.2f.o : error LNK2019: unresolved external symbol __nv_MAIN__F1L7_1_ referenced in function MAIN_
Example_collapse.2f.out : fatal error LNK1120: 1 unresolved externals
flang: error: linker command failed with exit code 1120 (use -v to see invocation)
make: *** [build] Error 1120
------------------------------------ executing test Example_collapse.2f
OMP_NUM_THREADS=4 Example_collapse.2f.out
/c/program files/git/usr/bin/sh: line 1: Example_collapse.2f.out: command not found
make: *** [run] Error 127
make: `verify' is up to date.
@kaadam kaadam added the windows Add this to all windows specific issues or PRs label Jun 6, 2023
@kaadam
Copy link
Collaborator

kaadam commented Jun 15, 2023

@bryanpkc @kiranchandramohan @pawosm-arm Hi, Could you give me some pointers what _nv_MAIN__F1L7_1 symbol is used for? The ll_get_outlined_funcname handles it in tools/flang2/flang2exe/outliner.cpp. Thanks.

@dmikushin
Copy link
Contributor

@kaadam This __nv_MAIN__F1L7_1_ looks like a symbol for a function generated for an OpenMP pragma. MAIN__F is the name of the source file, followed by the line number. You should find some #pragma on that line.

tdusnoki added a commit to tdusnoki/flang that referenced this issue Jun 27, 2023
This change enables mp_correct test suite to run on Windows.
(Test suite fails similarly to issue flang-compiler#1371)
bryanpkc pushed a commit that referenced this issue Jul 12, 2023
This change enables mp_correct test suite to run on Windows.
(Test suite fails similarly to issue #1371)
@harishch4
Copy link

harishch4 commented Aug 15, 2023

@tdusnoki can you show the LLVM IR file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
windows Add this to all windows specific issues or PRs
Projects
None yet
Development

No branches or pull requests

4 participants