首页 > 解决方案 > OMPTrace:仅适用于 C/C++?或者是否也可以将它用于 Fortran?

问题描述

我正在尝试使用OMPTrace它是一种用于跟踪和可视化 OpenMP 程序执行的工具,如此处所示https://github.com/passlab/omptrace。我已经在一个简单的代码上测试了这个库C,它工作得很好(这个库很好地安装在/home/hakim/llvm-openmp/BUILD/omptrace/build/libomptrace.so)。我现在想知道它是否也适用于用Fortran. 我创建了一个makefile,如下所示:

OMP_INSTALL=/home/hakim/llvm-openmp-install
OMP_LIB_PATH=${OMP_INSTALL}/lib
OMPTRACE_LIB=/home/hakim/llvm-openmp/BUILD/omptrace/build/libomptrace.so

default:runhecese

heceseclang: hecese_OpenMP.f90
    clang -g -fopenmp hecese_OpenMP.f90 -o heceseclang
    objdump -d heceseclang >heceseclang.objdump

runhecese: heceseclang
    LD_PRELOAD=${OMP_LIB_PATH}/libomp.so:${OMPTRACE_LIB} ./heceseclang 


clean:
    rm heceselang heceseclang.objdump core

执行它时,我得到:

/usr/bin/ld: /tmp/hecese_OpenMP-67d132.o: in function `__tasks_MOD_ww0':
hecese_OpenMP.f90:(.text+0x1dc6): undefined reference to `pow'
/usr/bin/ld: hecese_OpenMP.f90:(.text+0x1df7): undefined reference to `pow'
/usr/bin/ld: hecese_OpenMP.f90:(.text+0x1e1c): undefined reference to `pow'
/usr/bin/ld: hecese_OpenMP.f90:(.text+0x1e37): undefined reference to `pow'
/usr/bin/ld: /tmp/hecese_OpenMP-67d132.o: in function `__tasks_MOD_w':
hecese_OpenMP.f90:(.text+0x1ed0): undefined reference to `pow'
/usr/bin/ld: /tmp/hecese_OpenMP-67d132.o:hecese_OpenMP.f90:(.text+0x1eeb): more undefined references to `pow' follow
/usr/bin/ld: /tmp/hecese_OpenMP-67d132.o: in function `MAIN__':
hecese_OpenMP.f90:(.text+0x36f1): undefined reference to `_gfortran_st_open'
/usr/bin/ld: hecese_OpenMP.f90:(.text+0x372c): undefined reference to `_gfortran_st_read'
/usr/bin/ld: hecese_OpenMP.f90:(.text+0x373b): undefined reference to `_gfortran_st_read_done'
/usr/bin/ld: hecese_OpenMP.f90:(.text+0x3776): undefined reference to `_gfortran_st_read'
/usr/bin/ld: hecese_OpenMP.f90:(.text+0x3794): undefined reference to `_gfortran_transfer_integer'
/usr/bin/ld: hecese_OpenMP.f90:(.text+0x37a3): undefined reference to `_gfortran_st_read_done'

我没有向您展示所有错误,因为以下错误与我已经展示过的相同。这都是关于undefined references. 我想知道它是否来自clang编译器。
我应该安装flang编译器并使用它而不是那个clang吗?我等待的结果是一个.graphml文件。

请问有什么帮助吗?

标签: cmakefilefortranclangopenmp

解决方案


推荐阅读