Pum*_*use 1 c++ linux makefile openmp
我已经移走了正在Visual Studio中运行并构建的并行程序。我正在使用c ++并在intel编译器上进行编译。我必须将项目移至Linux机器上并运行它。所以我做了下面的make文件。
parallel: main.o Node.o
icpc -o parallel main.o Node.o
main.o: main.cpp
icpc -c $(CONFIG) main.cpp
Node.o: Node.cpp
icpc -c $(CONFIG) Node.cpp
clean:
rm -f parallel *.o core core.*
CONFIG = -openmp
Run Code Online (Sandbox Code Playgroud)
但是得到这个输出。我无法弄清楚为什么它在Windows上无法正常工作。
main.cpp:(.text+0x4e): undefined reference to `__kmpc_begin'
main.cpp:(.text+0xa2): undefined reference to `__kmpc_global_thread_num'
main.cpp:(.text+0xb2): undefined reference to `__kmpc_ok_to_fork'
main.cpp:(.text+0xc9): undefined reference to `__kmpc_fork_call'
main.cpp:(.text+0xdb): undefined reference to `__kmpc_serialized_parallel'
main.cpp:(.text+0xfa): undefined reference to `__kmpc_end_serialized_parallel'
main.cpp:(.text+0x106): undefined reference to `__kmpc_ok_to_fork'
"" "" '"" """
Run Code Online (Sandbox Code Playgroud)
尽管我认为这不是我的项目,但没有必要。
http://bitbucket.org/pumphouse/disjoint-sets-serial-parallel
您没有链接-openmp;将第二行更改为
icpc $(CONFIG) -o parallel main.o Node.o
Run Code Online (Sandbox Code Playgroud)