我已经安装了 C++ 和 Fortran 编译器并测试了 (C++) 程序(串行和并行版本)。
在 Fortran 中编译(并行化)代码而不启用该-openmp选项时应以(默认)串行模式编译代码
但在 C++ 中,我收到了诸如未定义引用之类的错误 omp_get_thread_num
但是在 Fortran 中,当您编译没有 -fopenmp 标志的代码时,它会忽略任何以$!omp类似开头的代码
$!omp id = omp_get_thread_num()
Run Code Online (Sandbox Code Playgroud)
C++ 中有没有类似的选项?
我想编写一个 Makefile,它使用来自两个不同数组的两个输入执行命令
a = A B C
b = 1 2 3
./run A 1
./run B 2
./run C 3
Run Code Online (Sandbox Code Playgroud)
我不知道如何编写它,因为无法访问 Makefile 中的数组索引