在 macOS Monterey (M1) 上编译 gfortran 测试代码时出现架构错误
我试图通过Macos Monterey(M1)版本12.3上的Fortran运行基本的测试代码(命名 test.f90 )。 代码为:
program test
integer, dimension(2,2) :: f,g
integer :: i,j
do i=1,2
do j=1,2
f(i,j)=2*i+j
g(i,j)=i+3*j
enddo
enddo
!print*,f ! gives f(x1,y1,z1),f(x2,y1,z1),...,f(x1,y2,z1),f(x2,y2,z1),...
print*,f
print*,g
print*,f*g
print*,f(:,:)*g(:,:)
f = reshape( (/1,2,3,4/), (/2,2/) )
print*,sum(f)
end program
GFORTRAN版本是:GNU FORTRAN(Homebrew GCC 11.2.0_3)11.2.0。 当我做 gfortran test.f90 时,以下错误弹出:
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd' for architecture arm64
I was trying to run a basic piece of test code (named test.f90) through fortran on macOS Monterey (M1) version 12.3.
The code is:
program test
integer, dimension(2,2) :: f,g
integer :: i,j
do i=1,2
do j=1,2
f(i,j)=2*i+j
g(i,j)=i+3*j
enddo
enddo
!print*,f ! gives f(x1,y1,z1),f(x2,y1,z1),...,f(x1,y2,z1),f(x2,y2,z1),...
print*,f
print*,g
print*,f*g
print*,f(:,:)*g(:,:)
f = reshape( (/1,2,3,4/), (/2,2/) )
print*,sum(f)
end program
The gfortran version is: GNU Fortran (Homebrew GCC 11.2.0_3) 11.2.0.
When I did gfortran test.f90, the following error popped up:
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libm.tbd' for architecture arm64
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论