compile a file with openmp ,but failed

F

firenet

gcc -g -fopenmp openmp.c -o openmp
cc1: error: unrecognized command line option "-fopenmp"

i wrote a simple openmp.c and wanted to compile it, but i got this
error.
What should i do ?
Thanks
 
C

Christopher Benson-Manica

firenet said:
gcc -g -fopenmp openmp.c -o openmp
cc1: error: unrecognized command line option "-fopenmp"
i wrote a simple openmp.c and wanted to compile it, but i got this
error.
What should i do ?

Start by asking gcc questions on the appropriate gcc mailing list:
http://gcc.gnu.org/lists.html. (The newsgroups aren't much use.) We
don't discuss gcc here. <ot>However, what part of "unrecognized
command line option" didn't make sense? Have a look at your friendly
gcc man page and/or the friendly web while you're at it.</ot>
 
M

Martin Ambuhl

firenet said:
gcc -g -fopenmp openmp.c -o openmp
cc1: error: unrecognized command line option "-fopenmp"

i wrote a simple openmp.c and wanted to compile it, but i got this
error.
What should i do ?

Try not using the unrecognized command line option "-fopenmp". What did
you think that it should do, anyway? If you really think there is some
needed option that "-fopenmp" might be close to, ask in a gcc newsgroup.
Questions about particular implementation options belong in newsgroups
or mailing lists for those implementations, not in <
which is about the C programming language. <ot> But no version of gcc
that I have has such an option. </ot>
 
K

Keith Thompson

firenet said:
gcc -g -fopenmp openmp.c -o openmp
cc1: error: unrecognized command line option "-fopenmp"

i wrote a simple openmp.c and wanted to compile it, but i got this
error.

OpenMP is an extension to C (or to Fortran). It requires special
compiler support. <OT>gcc does not support it by default</OT>

I presume you got "-fopenmp" from some documentation somewhere.
Consult that documentation, or other documentation from the same
source, to find out how to enable the option, or some other way to use
OpenMP with gcc, or some way to use OpenMP with a different compiler.

You might try www.openmp.org and/or a Google search for "gcc openmp".
 
T

Tim Prince

Keith said:
OpenMP is an extension to C (or to Fortran). It requires special
compiler support. <OT>gcc does not support it by default</OT>

I presume you got "-fopenmp" from some documentation somewhere.
Consult that documentation, or other documentation from the same
source, to find out how to enable the option, or some other way to use
OpenMP with gcc, or some way to use OpenMP with a different compiler.
Presumably, that documentation would have indicated that only current
releases of gcc support OpenMP.
 
K

Keith Thompson

Tim Prince said:
Presumably, that documentation would have indicated that only current
releases of gcc support OpenMP.

<OT>Actually, the current gcc documentation mentions the "-fopenmp"
option, but it says nothing about when it was introduced.</OT>
 
F

firenet

Try not using the unrecognized command line option "-fopenmp". What did
you think that it should do, anyway? If you really think there is some
needed option that "-fopenmp" might be close to, ask in a gcc newsgroup.
Questions about particular implementation options belong in newsgroups
or mailing lists for those implementations, not in <which is about the C programming language. <ot> But no version of gcc
that I have has such an option. </ot>

Thank you.
I tried it without the option,it seems right.
But the program didn't work well as i think,i'll go to read my
documentation.
Anyway, thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top