public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rasmus Vikhamar-Sandberg <rasmus.vikhamar-sandberg@uit.no>
To: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>
Subject: gfortran preprocessor compiler options
Date: Fri, 1 Dec 2023 17:20:02 +0000	[thread overview]
Message-ID: <SV0P279MB061006D338595C0153869636BC81A@SV0P279MB0610.NORP279.PROD.OUTLOOK.COM> (raw)

[-- Attachment #1: Type: text/plain, Size: 657 bytes --]

Hello.
I have a question. I posted it first on stackoverflow.
https://stackoverflow.com/questions/77585795/how-do-i-get-gfortran-to-generate-architecture-specific-predefined-macros.

The question is how do I get gfortran to generate architecture specific predefined macros like __SSE2__, __AVX__ and __AVX512F__?
If I run
echo | gfortran -E -dM -march=native
I get the desired predefined macros printed to the screen. If I compile with
gfortran -c <source.f90> -cpp -march=native
I don't get all of the predefined macros. It is almost as if gfortran does not pass the compiler option -march=native to the preprocessor.

Best,
Rasmus Vikhamar


                 reply	other threads:[~2023-12-01 17:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SV0P279MB061006D338595C0153869636BC81A@SV0P279MB0610.NORP279.PROD.OUTLOOK.COM \
    --to=rasmus.vikhamar-sandberg@uit.no \
    --cc=fortran@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).