Giter Site home page Giter Site logo

Comments (8)

roystgnr avatar roystgnr commented on May 24, 2024

On Mon, 14 Jan 2013, David Andrs wrote:

Using a clang compiler (3.1), ./configure script adds -fopenmp info CXXFLAGS and CFLAGS. It
should be -openmp.

We're using ax_openmp.m4 from the autoconf archive, which does try
-fopenmp before trying -openmp. My clang++ 3.0 seems to be happy with
either (at least it doesn't emit "argument unused during compilation"
warnings like it does with -thiswontwork)... if clang 3.1 is getting
more picky about its options, I'm not sure how to easily modify that
m4 file, which seems to assume that compilers will return errors upon
seeing unknown options, not just warnings.

from libmesh.

jwpeterson avatar jwpeterson commented on May 24, 2024

On Mon, Jan 14, 2013 at 3:22 PM, David Andrs [email protected]:

Using a clang compiler (3.1), ./configure script adds -fopenmp info
CXXFLAGS and CFLAGS. It should be -openmp.

I can take a look at this... it appears that because the AX_OPENMP script
tries the options in the following order:

ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none"

And clang doesn't return 1 (it only warns) if it sees -fopenmp, that
configure thinks it succeeds.

Easy fix: we could change the order in which the flags are tested, of
course this might break another compiler in the same manner.

More complicated: we could re-order the options based on knowing what the
compiler is. Seems to be a way of doing this through the
$OPENMP_[]_AC_LANG_PREFIX[]FLAGS variable (though I don't understand this
syntax).

Even more complicated: we could actually try to parse more detailed output
from the compiler (and look for warnings) but I don't know how to do that
in autoconf...

John

from libmesh.

andrsd avatar andrsd commented on May 24, 2024

Hmm. Tried it again today and I think I was wrong with the -openmp flag. If I use this switch, I do not get any error. However clang will interpret this switch as "-o penmp" and produces a file called penmp - which I did not notice before. Compiling from a command line with -fopenmp does not throw any warnings on my simple test C and C++ files. Thus, I am not quite sure why the libmesh build produces that " clang++: warning: argument unused during compilation: '-fopenmp' "... Feel free to mark this issue as wontfix or invalid unless you guys want to look at source of that unused flag warning...

from libmesh.

benkirk avatar benkirk commented on May 24, 2024

On Jan 15, 2013, at 9:42 AM, David Andrs [email protected] wrote:

" clang++: warning: argument unused during compilation: '-fopenmp'

The way I interpret that is that the argument was truly unused - e.g. the underlying file that was compiled had no OpenMP pragmas?

What happens if you try

./configure libmesh_CXXFLAGS="-Qunused-arguments" libmesh_CFLAGS="-Qunused-arguments"

?

-Ben

from libmesh.

jwpeterson avatar jwpeterson commented on May 24, 2024

On Tue, Jan 15, 2013 at 8:42 AM, David Andrs [email protected]:

Hmm. Tried it again today and I think I was wrong with the -openmp flag.
If I use this switch, I do not get any error. However clang will interpret
this switch as "-o penmp" and produces a file called penmp - which I did
not notice before. Compiling from a command line with -fopenmp does not
throw any warnings on my simple test C and C++ files. Thus, I am not quite
sure why the libmesh build produces that " clang++: warning: argument
unused during compilation: '-fopenmp' "... Feel free to mark this issue as
wontfix or invalid unless you guys want to look at source of that unused
flag warning...

Looks like this may have been a compiler bug. Here it was discussed in
October 2012:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-October/054459.html

Do you like the idea of adding -Qunused-arguments in compiler.m4 for all
clang builds?

John

from libmesh.

jwpeterson avatar jwpeterson commented on May 24, 2024

On Tue, Jan 15, 2013 at 8:54 AM, John Peterson [email protected] wrote:

On Tue, Jan 15, 2013 at 8:42 AM, David Andrs [email protected]
wrote:

Hmm. Tried it again today and I think I was wrong with the -openmp flag.
If I use this switch, I do not get any error. However clang will interpret
this switch as "-o penmp" and produces a file called penmp - which I did not
notice before. Compiling from a command line with -fopenmp does not throw
any warnings on my simple test C and C++ files. Thus, I am not quite sure
why the libmesh build produces that " clang++: warning: argument unused
during compilation: '-fopenmp' "... Feel free to mark this issue as wontfix
or invalid unless you guys want to look at source of that unused flag
warning...

Looks like this may have been a compiler bug. Here it was discussed in
October 2012:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-October/054459.html

Where by "bug" I mean "unsupported feature". I think David's clang
(3.1) was released 22 May 2012

http://llvm.org/releases/

i.e. prior to the discussion cited above.

Do you like the idea of adding -Qunused-arguments in compiler.m4 for all
clang builds?

If there's any desire for this, I will take a crack at adding it.

John

from libmesh.

andrsd avatar andrsd commented on May 24, 2024

On Tue, Jan 15, 2013 at 8:46 AM, Benjamin S. Kirk
[email protected]:

On Jan 15, 2013, at 9:42 AM, David Andrs [email protected]
wrote:

" clang++: warning: argument unused during compilation: '-fopenmp'

The way I interpret that is that the argument was truly unused - e.g. the
underlying file that was compiled had no OpenMP pragmas?

What happens if you try

./configure libmesh_CXXFLAGS="-Qunused-arguments"
libmesh_CFLAGS="-Qunused-arguments"

This works, i.e. no warnings generated during the build.

?

-Ben


Reply to this email directly or view it on GitHubhttps://github.com//issues/30#issuecomment-12273218.

David

from libmesh.

benkirk avatar benkirk commented on May 24, 2024

Resurrecting... John, I have no problem adding -Qunused-arguments

Looks like it is understood at least as far back as 2.8.

from libmesh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.