- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, there
I have three files, a.inc, b.f90, and c.f90. Now I want to compile the three files via command line on Mac. How to include the header file a.inc? which command should I use.
Thanks much.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If a.inc is included using an INCLUDE statement then no additional command line options are needed if all three files reside in the same directory since the compiler defaults to searching the "current working directory". If they do not reside in the same directory then use the -I (capital "I") option to specify additional include search directories.
If a.inc is included using a #include statement, then you must add the -fpp option and any appropriate include paths using -I if the files do not reside in the same directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Kevin Davis (Intel)
If a.inc is included using an INCLUDE statement then no additional command line options are needed if all three files reside in the same directory since the compiler defaults to searching the "current working directory". If they do not reside in the same directory then use the -I (capital "I") option to specify additional include search directories.
If a.inc is included using a #include statement, then you must add the -fpp option and any appropriate include paths using -I if the files do not reside in the same directory.
Thanks much. Here is the command line I used:
ifort MPALE_SVD.INC MPALE_SVD_SHELL.f90 MPALE_SVD_SUB.f90 -L$MKLROOT -L$LIBRARY_PATH -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread
Error information is:
MPALE_SVD.INC(51): error #6406: Conflicting attributes or multiple declaration of name. [C11]
PARAMETER (C11 = 2465.0D8)
-----------------^
MPALE_SVD.INC(52): error #6406: Conflicting attributes or multiple declaration of name. [C12]
PARAMETER (C12 = 1473.0D8)
-----------------^
MPALE_SVD.INC(53): error #6406: Conflicting attributes or multiple declaration of name. [C44]
PARAMETER (C44 = 1247.0D8)
-----------------^
MPALE_SVD.INC(54): error #6406: Conflicting attributes or multiple declaration of name. [HARDMODUL]
PARAMETER (HARDMODUL =5.34D8)
-----------------^
MPALE_SVD.INC(55): error #6406: Conflicting attributes or multiple declaration of name. [SYMFLAG]
PARAMETER (SYMFLAG = 1)
-----------------^
MPALE_SVD.INC(56): error #6406: Conflicting attributes or multiple declaration of name. [EPFLAG]
PARAMETER (EPFLAG = 1)
-----------------^
MPALE_SVD.INC(57): error #6406: Conflicting attributes or multiple declaration of name. [CRSS]
PARAMETER (CRSS = 60.D6)
-----------------^
MPALE_SVD.INC(58): error #6406: Conflicting attributes or multiple declaration of name. [TAUS]
PARAMETER (TAUS = 122.0D6)
-----------------^
MPALE_SVD.INC(60): error #6406: Conflicting attributes or multiple declaration of name. [EPI]
PARAMETER (EPI = 100.)
-----------------^
If I am right, the .inc file is already used, but there is something wrong with my parameter definition?
Part of my environment .sh file is:
#!/bin/sh
export MKLROOT="/opt/intel/Compiler/11.1/058/Frameworks/mkl"
if [ -z "${INCLUDE}" ]
then
export INCLUDE="${MKLROOT}/Headers"
else
export INCLUDE="${MKLROOT}/Headers:$INCLUDE"
fi
best,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When including a file via INCLUDE or #include,you do not specify it on the ifort command line.
The errors seem to suggest MPALE_SVD.INC was already includedby one of the other .f90 files being compiled but hard to tell without seeing the full context of the errors.
Try removing MPALE_SVD.INC from the ifort command line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Kevin Davis (Intel)
When including a file via INCLUDE or #include,you do not specify it on the ifort command line.
The errors seem to suggest MPALE_SVD.INC was already includedby one of the other .f90 files being compiled but hard to tell without seeing the full context of the errors.
Try removing MPALE_SVD.INC from the ifort command line.
Thanks for your help.

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