英文:
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_int32
和 1_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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论