帮助解决openmp编译问题 [英] help with openmp compilation problems

查看:119
本文介绍了帮助解决openmp编译问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的 C 代码中使用 omp 并且遇到了一个问题:在代码中我有#include但是当我尝试编译时:

I'm trying to use omp in my C code and am having a problem: in the code i have #include but when i try to compile with:

g++ -fopenmp -g -c parallel.c

g++ -fopenmp -g -c parallel.c

我收到 cc1plus:错误:无法识别的命令行选项fopenmp"当我尝试时:

I get cc1plus: error: unrecognized command line option "fopenmp" and when i try:

g++ -g -c parallel.c

g++ -g -c parallel.c

我收到两个错误:

omp.h:没有那个文件或目录,并且未在此范围内声明 malloc

omp.h: No such file or directory, and malloc not declared in this scope

我尝试使用带有 -fopenmp 的 gcc 并得到相同的错误.没有 -fopenmp 我仍然得到丢失的 omp.

i tried with gcc with -fopenmp and get the same error. without the -fopenmp i still get the missing omp.

推荐答案

OpenMP 仅受支持在 gcc 4.2 及更高版本中.您可能需要升级编译器.

OpenMP is only supported in gcc 4.2 and higher. You might need to upgrade your compiler.

这篇关于帮助解决openmp编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆