Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

include files (Xcode)

Claus
Beginner
711 Views
Hi,
the good news is, generally everything is working as I would want it: Converted my first old compaq-fortran project to ifort and XCode. Builds and runs fine now!
There is one thing though: include files. They reside in my src folder, and obviously are being dealt with correctly (as described in the help
file://localhost/opt/intel/Compiler/11.0/056/Documentation/compiler_f/com.intel.compilers.ifort.docset/Contents/Resources/Documents/ifort/doc_files/source/extfile/bldaps_for/common/bldaps_search_inclmod.htm

however, under "build results" in XCode I get a warning message for each include file, a la

warning: no rule to process file '$(PROJECT_DIR)/../src/ReadControlFile.inc' of type sourcecode.pascal for architecture i386

I tried with the rules under the info window tab rules of the target... unsuccesfully so far.
What's the correct way of dealing with include files in XCode?

Thanks again for your help,
Claus
0 Kudos
1 Solution
Kevin_D_Intel
Employee
711 Views
Glad to hear the good news!

The warning results because the include files have been added into the Compile Sources group for the target. Therefore, Xcode tries to compile them which is not necessary and that generates the "no rule" warning.

Next, notice the warning designates them as Pascal files. That designation can be changed to Fortran for each specific include file if you wish via: Right-click on the include filename, select Get info > General tab > File Type and choose the Fortran type that best reflects the contents. I do not believe this setting affects include files since these are not individually compiled.

To avoid the compilation warning, exclude the include files from Compile Sources for the target. To do that, do this:

1. Right-click on the include file name and select Get Info
2. Click the Targets tab
3. Uncheck the check-box indicating the target membership for your target

Repeat those steps for each include file that was added under Compile Sources.

The compiler defaults to searching the directory where the source file being compiled resides. If include files reside there, then the compilation succeeds without taking any special actions under Xcode. If the include files reside in another directory, then you must add a reference to the directory under the Fortran property setting Additional Include Directories for the target.

View solution in original post

0 Kudos
1 Reply
Kevin_D_Intel
Employee
712 Views
Glad to hear the good news!

The warning results because the include files have been added into the Compile Sources group for the target. Therefore, Xcode tries to compile them which is not necessary and that generates the "no rule" warning.

Next, notice the warning designates them as Pascal files. That designation can be changed to Fortran for each specific include file if you wish via: Right-click on the include filename, select Get info > General tab > File Type and choose the Fortran type that best reflects the contents. I do not believe this setting affects include files since these are not individually compiled.

To avoid the compilation warning, exclude the include files from Compile Sources for the target. To do that, do this:

1. Right-click on the include file name and select Get Info
2. Click the Targets tab
3. Uncheck the check-box indicating the target membership for your target

Repeat those steps for each include file that was added under Compile Sources.

The compiler defaults to searching the directory where the source file being compiled resides. If include files reside there, then the compilation succeeds without taking any special actions under Xcode. If the include files reside in another directory, then you must add a reference to the directory under the Fortran property setting Additional Include Directories for the target.
0 Kudos
Reply