Building the Target (Mac OS*)

To build the active target and configuration in Xcode, choose Build from the Build menu or click the Build button in the toolbar. To view the results of your build, choose Build Results from the Build menu in the Xcode toolbar. Further build details can be found by clicking the build transcript icon halfway down the Build Results window. This icon is located next to the warning icon and resembles a paragraph of printed text.

To build an individual file and not the entire project, select the file under the target and then choose Compile from the Action pop-up menu in the toolbar.

 Note

Choosing Build from the Build menu or clicking the Build button in the toolbar builds the target specified in the Active Target drop-down menu in the toolbar and not the target or source file currently selected in the Groups & Files list.

You can change the compilation order of the Xcode target sources. This is especially useful for compiling Fortran sources that define modules (producing .MOD files).  These can, in turn, be used by Fortran sources that use the modules. To re-order the files listed under Compile Sources, click a source and drag it before or after other compilations.

You can also use the xcodebuild utility to build a target. This utility uses the Xcode project file settings to build target projects from the command line. If you have previously configured your Xcode project to build with the Intel compiler, xcodebuild will invoke that compiler from the command line. The basic steps are as follows:

  1. Check that the Xcode project is configured to use the Intel Fortran compiler.

  2. Launch a terminal window by selecting Finder>Applications>Utilities>Terminal.

  3. Change directories to the project directory containing the Xcode project file.

  4. Issue an xcodebuild command similar to the following:
    xcodebuild -project test2.xcodeproj -target testapp -configuration Debug

  5. To run the program, type the following:
    ./build/Debug/testapp