Flang-new fail on complex division on version 19.1.4 (installed using Homebrew on OSX):
program test
integer, parameter :: n=2
complex(kind=8), dimension(n,n) :: V
V(1,1)=cmplx(4.0,2.0)
V(2,2)=cmplx(5.0,3.0)
V(1,2)=0.0
V(2,1)=0.5
PER=cmplx(1.2,1.2)
V(:,:)=V(:,:)/PER
end program test
I got a compilation issue:
alainhebert@Alains-MacBook-Air-2 test_complex % flang-new *.f90
Undefined symbols for architecture arm64:
β___divdc3β, referenced from:
__QQmain in test-8db182.o
ld: symbol(s) not found for architecture arm64
flang-new: error: linker command failed with exit code 1 (use -v to see invocation)
program test
integer, parameter :: n=2
complex(kind=8), dimension(n,n) :: V
complex(kind=8) :: PER
V(1,1)=cmplx(4.0,2.0)
V(2,2)=cmplx(5.0,3.0)
V(1,2)=0.0
V(2,1)=0.5
PER=cmplx(1.2,1.2)
V(:,:)=V(:,:)/PER
end program test
I am confuse because the GitHub post refers to OpenMP. I am not yet using OpenMP. I first want to run my code in scalar mode and test various bindings before going to parallel. Is there a simple way to correct my makefiles to avoid the issue or do I have to wait for a new Homebrew release?
I have no experience with Flang-new yet (just searching the net for divdc3 showed the above page), so no idea about the reason (sorryβ¦). But I guess it may be useful to ask LLVM Discourse also (if not yet)
Check the contents of /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib. Maybe -lclang is not enough and you need -lclang_rt or something similar.