Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Intel Fortran macros

Ben136KBC
Novice
255 Views

*I am attempting to define a macro iidatac which is defined to be "iidata," (note the comma at the end) or in some cases "" (blank, nothing).

So on the command line I add:

    /define:"iidatac=iidata,"

But then in the code I get this:

..\BlenderUnitOperation\krs_fortran_code\IsCacheableAssay.f90(1): error #5082: Syntax error, found IDENTIFIER 'IASSAYNUMBER' when expecting one of: ) ,
logical function IsCacheableAssay (iidatac iAssayNumber)
--------------------------------------------------^

Why? I expect the line "logical function IsCacheableAssay (iidatac iAssayNumber)" to become "logical function IsCacheableAssay (iidata, iAssayNumber)"

The manual does not contain much explanation of these subtleties...

Please help!

 

0 Kudos
4 Replies
Ben136KBC
Novice
245 Views

Hmm if a preprocess it with /E, then I see the correct substitution. So why is the compiler complaining then?

I also need to use this macro:

/define:"iidatap=iidata%"

But when I preprocess the file, the % seems to disappear?

Ben136KBC
Novice
239 Views

I am using:

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.5.281 Build 20190815
Copyright (C) 1985-2019 Intel Corporation. All rights reserved.

Ben136KBC
Novice
229 Views

Ok, it looks like you need /fpp to get it to process the macros.

Ben136KBC
Novice
226 Views

And for the % to work, you need %%% if it is inside a makefile. I am not a fan of macros, but in some cases they are necessary.

Reply