- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following types of preprocessor directives fail in ifx, while it is valid in ifort and gfortran:
program test_fpp
implicit none
#ifdef PRE_PROC_DIR
write(*, *) "Version : ", PRE_PROC_DIR
#endif
end program test_fpp
ifort:
$ ifort -DPRE_PROC_DIR=\""0.1.0 ifx-test"\" -fpp test_fpp.f90 ; ./a.out
Version : 0.1.0 ifx-test
ifx:
$ ifx -DPRE_PROC_DIR=\""0.1.0 ifx-test"\" -fpp test_fpp.f90 ; ./a.out
/tmp/ifx05354667172WKmlC/ifx1ycjS6.i90: catastrophic error: Internal Compiler Error: Only one file name allowed on command line
compilation aborted for test_fpp.f90 (code 1)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like command line parsing issue. Try:
ifx -DPRE_PROC_DIR=ABCDEFG -fpp test_fpp.f90 ; ./a.out
to see if it is an enquoted text (with arg delimiter) issue.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for reporting this.
Here's a workaround: I took out the space, kept the shell escapes and ifx compiles it without error. It runs as expected.
As @jimdempseyatthecove said, it looks like a parsing error. The ICE is reported on the .i90 file, the file that has been preprocessed.
I filed a bug report, CMPLRLLVM-49553.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One of the compiler team found another workaround. Lead the macro definition with a letter; keep the space. For example, -DPRE_PROC_DIR="""V0.1.0 ifx-test"""
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your response.
Following error occurred when I tried your recommendations:
$ ifx -DPRE_PROC_DIR="""V0.1.0 ifx-test""" -fpp test_fpp.f90 ; ./a.out
test_fpp.f90(8): error #5082: Syntax error, found REAL_CONSTANT '.1' when expecting one of: :: ) ( , : * <END-OF-STATEMENT> ; . % (/ + - [ ] /) . ** /
// ...
write(*, *) "Version : ", V0.1.0 ifx-test
--------------------------------^
compilation aborted for test_fpp.f90 (code 1)
$ ifx -DPRE_PROC_DIR=ABCDEFG -fpp test_fpp.f90 ; ./a.out
test_fpp.f90(8): error #6404: This name does not have a type, and must have an explicit type. [ABCDEFG]
write(*, *) "Version : ", ABCDEFG
------------------------------^
compilation aborted for test_fpp.f90 (code 1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is no much the compiler, but the interference of the quoting rules. Try:
ifx -DPRE_PROC_DIR="\"V0.1.0 ifx-test\"" -fpp test_fpp.f90
The double quotes are eliminated by the shell you use, so the preprocessor never sees any. The backslash escapes the ones around the string so that these ARE passed to the preprocessor. I tested this both on Windows and Linux :).
(I noticed one thing: the preprocessor is aware of literal strings, text in quotes is not replaced.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, it works, although the definition must start with a letter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a similar issue as above. I am trying to include compiler directives on a command line that starts with mpiifort (not ifort). There seems to be an issue with the spaces in the character strings.
mpiifort -c /Qipo /O2 /wrap-margin- -fpp -DGITHASH_PP="\"FDS-6.8.0-1034-gb2f9f39-master\"" -DGITDATE_PP="\"Wed Nov 29 10:25:10 2023 -0500\"" -DBUILDDATE_PP="\"Wed 11/29/2023 11:39 AM\"" -DCOMPVER_PP="\""Intel ifort 2021.11.0"\"" -DWITH_MKL
/I"C:\Program Files (x86)\Intel\oneAPI\mkl\latest"\include ../../Source/func.f90
mpifc.bat for the Intel(R) MPI Library 2021.11 for Windows*
Copyright Intel Corporation.
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.11.0 Build 20231010_
000000
Copyright (C) 1985-2023 Intel Corporation. All rights reserved.
ifort: command line warning #10161: unrecognized source type 'Nov'; object file assumed
ifort: command line warning #10161: unrecognized source type '29'; object file assumed
ifort: command line warning #10161: unrecognized source type '10:25:10'; object file assumed
ifort: command line warning #10161: unrecognized source type '2023'; object file assumed
ifort: command line warning #10006: ignoring unknown option '/0500" -DBUILDDATE_PP=\Wed 11/29/2023 11:39 AM"'
../../Source\func.f90(5966): error #5078: Unrecognized token '\' skipped
WRITE(LU,'(A,A)') ' Revision : ',TRIM(\FDS-6.8.0-1034-gb2f9f39-master\)
---------------------------------------------------^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I should add that my problems are on Windows using the Command Prompt. I run setvars.bat and that works fine. Also, everything works on linux with mpiifort and compiler directives.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please ask your question on the HPC Toolkit Forum? They work on IMPI issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue is fixed in the 2025.0 ifx release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Prior to getting the 2025.0 fix. As a work around, mpiifort ... executes mpiifort.bat, which calls mpifc.bat, which then calls ifort.exe (or maybe ifx.exe).
In order to pass arguments with spaces, you may require an additional quote/enquote around those arguments. It looks like you have two, you may need three.
... "\"\"Wed 11...\"\"" ...
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page