- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to generate a message whose content I wish to pass at compile time using the option -Dname="string".
It seems impossible to pass a string having blanks, whatever combination of single and/or double quotes I use.
The documentation simply states ( http://software.intel.com/sites/products/documentation/doclib/stdxe/2013/composerxe/compiler/fortran-lin/GUID-37D702BD-347E-42FE-8F8E-1E9BFC477453.htm ) :
...
-Dname=value :
...
value : Is an optional integer or an optional character string delimited by double quotes; for example, Dname=string.
...
without any advice about the string content.
Here is a simple example.
$ cat testfppi.f
PRINT *,OPERATING_SYSTEM
END
# NB : here the blanks between double and single quotes are for readability only, I did not use them actually.
$ ifort -V -fpp -E -DOPERATING_SYSTEM=" 'Red Hat Linux' " testfppi.f
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 6, Version 13.0.0.079 Build 20120731
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.
ifort: error #10236: File not found: 'Hat'
ifort: error #10236: File not found: 'Linux'
# 1 "testfppi.f"
PRINT *,Red
END
I also tried escaping the blanks by backslashes, without success.
Is that the intended way of working for "-D" ? Is there any way to have blanks in such a string ?
Thanks in advance.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page