回 帖 发 新 帖 刷新版面

主题:gfortran和openmp编程

有没有高手做过gfortran和openmp编程的。请教下。我现在写了一个简单的程序,程序如下:
program MainPro
    integer*4 :: sum,i
    
    
    !$OMP parallel
    do i=1,10000
      print *, i
    enddo
    !$omp end parallel
    
end
但是用gfortran运行的时候却得到以下的信息:
gfortran -fopenmp E:\Study\OpenMP\MainPro.f90 -o E:\Study\OpenMP
\MainPro_OpenMP.exe
Warning: .drectve `-aligncomm:__gfortrani_compile_options,5' unrecognized
Warning: .drectve `-aligncomm:__gfortrani_options,5' unrecognized
Warning: .drectve `-aligncomm:__gfortrani_unit_lock,2 ' unrecognized
Warning: .drectve `-aligncomm:__gfortrani_unit_root,2 ' unrecognized
Warning: .drectve `-aligncomm:__gfortrani_max_offset,3 ' unrecognized
Warning: .drectve `-aligncomm:__gfortrani_next_available_newunit,2' unrecognized

Warning: .drectve `-aligncomm:_gomp_tls_key,2 ' unrecognized
Warning: .drectve `-aligncomm:_gomp_thread_destructor,2 ' unrecognized
Warning: .drectve `-aligncomm:_gomp_thread_attr,2' unrecognized
Warning: .drectve `-aligncomm:_gomp_throttled_spin_count_var,3 ' unrecognized
Warning: .drectve `-aligncomm:_gomp_spin_count_var,3 ' unrecognized
Warning: .drectve `-aligncomm:_gomp_remaining_threads_count,2 ' unrecognized
Warning: .drectve `-aligncomm:_gomp_cpu_affinity_len,2 ' unrecognized
Warning: .drectve `-aligncomm:_gomp_cpu_affinity,2' unrecognized
Warning: .drectve `-aligncomm:___DTOR_LIST__,2 ' unrecognized
Warning: .drectve `-aligncomm:___CTOR_LIST__,2' unrecognized
D:\g95\bin/ld.exe: Dwarf Error: mangled line number section.
d:/gfortran/bin/../lib/gcc/i586-pc-mingw32/4.6.0/../../../libgfortran.a(main.o):
main.c:(.text$sprintf+0x1b): undefined reference to `___mingw_vsprintf'
D:\g95\bin/ld.exe: Dwarf Error: mangled line number section.
d:/gfortran/bin/../lib/gcc/i586-pc-mingw32/4.6.0/../../../libgfortran.a(transfer
.o):transfer.c:(.text$sprintf+0x1b): undefined reference to `___mingw_vsprintf'
D:\g95\bin/ld.exe: Dwarf Error: mangled line number section.
d:/gfortran/bin/../lib/gcc/i586-pc-mingw32/4.6.0/../../../libgfortran.a(unix.o):
unix.c:(.text$sprintf+0x1b): undefined reference to `___mingw_vsprintf'
D:\g95\bin/ld.exe: Dwarf Error: mangled line number section.
d:/gfortran/bin/../lib/gcc/i586-pc-mingw32/4.6.0/../../../libgfortran.a(format.o
):format.c:(.text$sprintf+0x1b): undefined reference to `___mingw_vsprintf'
D:\g95\bin/ld.exe: Dwarf Error: mangled line number section.
d:/gfortran/bin/../lib/gcc/i586-pc-mingw32/4.6.0/../../../libgfortran.a(list_rea
d.o):list_read.c:(.text$sprintf+0x1b): undefined reference to `___mingw_vsprintf
'
D:\g95\bin/ld.exe: Dwarf Error: mangled line number section.
d:/gfortran/bin/../lib/gcc/i586-pc-mingw32/4.6.0/../../../libgfortran.a(write.o)
:write.c:(.text$sprintf+0x1b): more undefined references to `___mingw_vsprintf'
follow
collect2: ld returned 1 exit status
不知道如何处理,请高手赐教。急啊,在线等。

回复列表 (共4个回复)

沙发

gcc用的版本编译libgfortran的问题
换个版本试试

板凳

dongyuanxun,你好。请问下你说的换个版本是换个gfortran的版本还是gcc的版本呢?谢谢!

3 楼

[quote]dongyuanxun,你好。请问下你说的换个版本是换个gfortran的版本还是gcc的版本呢?谢谢!
[/quote]
mingw gcc官方一般编译会包含gfortran

4 楼

ok,3q

我来回复

您尚未登录,请登录后再回复。点此登录或注册