- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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)
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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"""
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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)
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.)
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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\)
---------------------------------------------------^
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Can you please ask your question on the HPC Toolkit Forum? They work on IMPI issues.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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
