flang-compiler / flang

Flang is a Fortran language front-end designed for integration with LLVM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unresolved external symbol error in openmp_examples tests on Windows

tdusnoki opened this issue · comments

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.

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

@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 can you show the LLVM IR file?