"_8" 后缀是在链接 OpenMP 库的 Fortran 调用时附加的。

huangapple go评论132阅读模式
英文:

What is the "_8" postfix that is appended when linking openmp library fortran calls?

问题

以下是您要翻译的内容:

"我正在编译并尝试链接一些库,出现的一个问题是Fortran中对OpenMP的调用,比如:

!$    CALL omp_set_num_threads(foo)

最终会寻找一个符号

> nm dmumpsmex.mexa64 | grep omp_set_num
                 U omp_set_num_threads_8_@@OMP_1.0

带有附加的 _8 扩展名,我想知道这是从哪里来的,以及它表示什么?"

英文:

I'm compiling and trying to link together a couple of libraries, one issue that seems to arise is that a call to openmp in Fortran, like for example.

!$    CALL omp_set_num_threads(foo)

ends up looking for a symbol

> nm dmumpsmex.mexa64 | grep omp_set_num
                 U omp_set_num_threads_8_@@OMP_1.0

that is with a _8 extension appended, and I wonder where that comes from and what it signifies?

答案1

得分: 1

这些用于区分库中的通用过程的个别特定过程。这个是用于传入 8 字节整数作为参数的。

您可以测试调用两者,这里使用硬编码的种类 4 和 8,但您可以尝试任何其他种类的选择(例如 1_int321_int64):

  use omp_lib

  call omp_set_num_threads(1_4)
  call omp_set_num_threads(1_8)
end

然后您将得到:

             U omp_set_num_threads_@OMP_1.0
             U omp_set_num_threads_8_@OMP_1.0

当使用 gfortran 编译时,它使用 libgomp 库。

英文:

These distinguish the individual specific procedures for the generic procedures in the library. This one is for 8-byte integers as the argument.

You can test calling both, here with hard-wired kinds 4 and 8, but you can try any other kind selection (e.g. 1_int32 and 1_int64):

  use omp_lib

  call omp_set_num_threads(1_4)
  call omp_set_num_threads(1_8)
end

And you will get

         U omp_set_num_threads_@OMP_1.0
         U omp_set_num_threads_8_@OMP_1.0

when compiled with gfortran, which uses the libgomp library.

huangapple
  • 本文由 发表于 2023年3月3日 19:57:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/75626781.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定