- Welcome to Simply Fortran
- Purchasing and Activating Simply Fortran
- Using Simply Fortran
- The Simply Fortran Interface
- Editing in Simply Fortran
- Projects in Simply Fortran
- Building Projects
- Launching Projects
- Debugging Programs
- External Tools
- Version Control
- Options and Configuration
- Licensing
Project Options
The Project Options window configures most aspects of a given project with the exception of the files to be included. This window is project-specific, meaning different values will be present for different projects. Each panel in the project options dialog is described below:
General
This first panel allows users to change common project options.
Target Options
The target options specify the project’s final build product. Simply Fortran supports three basic target types: executables, shared libraries, and static libraries. Each is explained below.
Target Name
The target name specifies the final product of the build process. The target name is generated within the project’s base directory unless a relative path is specified.
Executable
Selecting this option instructs the compiler to create an executable as its product.
Shared Library
Building a shared library will generate a dynamic link library (DLL) from the project sources.
Static Library
A static library, which often ends in the suffixes lib or a, can be compiled into another library or executable.
Icon
If the target is an executable and the Windows GUI checkbox is checked, the icon button allow the user to select an icon from an icon file. The icon will be compiled into the resulting target and used as the program’s system menu and taskbar icon. By clicking the button, a file dialog will open allowing the user to select an appropriate icon ending with the .ico extension. Pressing Cancel in the file dialog will clear any previously selected icon. The icon, once selected, should be displayed in the button itself.
Architecture
Two architectures are available under Simply Fortran, either 32-bit or 64-bit. Both are available regardless of the Windows version currently in use, but 64-bit targets will not be executable on 32-bit versions of Windows. The default will match the current platform’s operating system.
Windows GUI
This option can be used when compiling programs that include a graphical user interface, or GUI. When unselected, a console will be opened every time the program is run. For most Fortran text-mode programs, opening is console is the desired behavior. However, if the program makes use of a GUI, the console may be undesirable. By clicking this checkbox, the compiler will be passed the -mwindows flag, which indicates that the program should not open a console at startup.
Launch
The launch panel allows the configuration of how the project will be executed from within Simply Fortran.
Executable
The executable field specifies the command to execute when launching the project. For executable projects, the command is fixed to the project’s target name, as explained above. However, if developing a shared library, the user may wish to launch an executable using this shared library while working within Simply Fortran. Specifying an executable manually allows for this use case.
Command Line Arguments
This box provides the user a way to specify arguments that should be passed to the executable when launched. These arguments may be commmand line arguments that the program will process internally. Alternatively, redirection operators can be used. If the user wishes to capture all program output to a text file, for example, the arguments:
> output.txt
could be added to this box.
Working Directory
By default, Simply Fortran will launch the executable using the project directory (defined as the directory containing the project file) as the working directory. Users can specify alternate working directories using either absolute or relative (to the project directory) paths.
External Console
If enabled this checkbox causes the exectable to be launched in a window external to Simply Fortran. This option may not be available on certain systems.
Build Before Launch
When checked, this option causes Simply Fortran to run “Build Project” before launching the executable. This process assures the developer that the project is up to date prior to launching.
Code Generation
The code generation panel allows control over optimization and debugging settings.
Optimization Level
This dropdown provides four different optimization options. The available modes are:
* None – No optimizations will be performed * Size – Generates the smallest possible target * Common – Allows for a number of common optimizations, equivalent to GNU Fortran’s “-02“ * Extreme – Allows for additional optimization, equivalent to GNU Fortran’s “-03”Aggressive Loop Optimizations
Enabling the option allows the compiler to perform a number of optimizations related to loops, including reordering nested loops and attempting to parallelize loops where possible.
Link Time Optimization
When this option is enabled, individual object files are compiled with additional information to enable the linker to perform additional optimizations. The linker can then perform additional cross-unit optimizations that may lead to performance improvements.
Enable Debugging
When enabled, debugging information is generated during compilation, allowing the program to be debugged when requested.
Enable Profiling
A target compiled with profiling enabled will generate data concerning the frequency and duration of function calls within the compiled target when the target is launched. This data can then be used to generate a profile analysis.
Target CPU
The dropdown offers a list of central processing units for which the compiled code can be tuned. If the resultant target is going to be distributed to others on different machines, generic is suggested as the best option. If the target will solely be used on the user’s machine, the native option will tune the target to make use of any features available on the user’s machine. Alternatively, a model may be selected from the dropdown.
When the Compile Strictly for Selection option is enabled, the resultant target will not run on CPUs that do not possess the features specified in the Target CPU’s dropdown box. Enabling this option can provide speed benefits at the cost of compatibility.
Memory Model
On Intel x86 and AMD64 platforms, the memory model of the resultant code can be specified. The model allows some flexibility with respect to how much memory a program may access. Notably, switching to a medium memory model allows static array allocations up to 2GB on 64-bit operating systems. The large memory model allows static allocations to exceed 4GB, but is unavailable on the Windows platform. For most cases and for software making heavy use of dynamically allocated arrays, the small memory model is sufficient.
This option is not applicable on CPUs that are not part of the x86/AMD64 family.
Please note that the above memory limitations may be futher constrained by the underlying operating system. For example, 32-bit Windows will not allow an executable, in general, to exceed 1.5GB of memory allocation total regardless of the theoretical limits of a 32-bit operating system and platform.
Fortran
The Fortran panel offers options related specifically to the Fortran compiler.
Use Double Precision for all Reals
Enabling this option promotes all variables and functions declared as Fortran REAL to double precision. Double precision can improve mathematic precision at the expense of memory consumed. Enabling this option does not affect variables explicitly declared as double precision.
Enable Cray Pointers
By default, GNU Fortran assumes that keywords associated with pointers are referring to Fortran 90 pointers. Enabling this option allows the compiler to accept Cray pointer syntax as well.
Enable Runtime Diagnostics
Enabling this option causes certain runtime checks to be performed while your target program runs. Specifically, warnings will be generated for:
- Indexing array elements outside known bounds
- Modifying the value of loop iteration variables
- Invalid memory states for pointers and allocatables
- Recursive calls to subroutines/functions that are not marked as recursive
- Generation of temporary arrays for the purposes of passing between subprograms
This feature can be helpful when debugging troublesome targets.
Enable C Preprocessor
When enabled, any Fortran source files are first fed into the C preprocessor. This option is useful if the source code uses preprocessor directives such as “#include” or “#ifdef.”
Enable OpenMP
Enabling this option allows the compiler to understand OpenMP directives while compiling code.
Enable Coarrays (Windows only)
Checking this options enables coarrays in the compiler and links against the experimental Approximatrix Windows Coarray Library. The resulting executable will, by default, launch multiple images of the executable which can share information via Fortran’s coarray syntax.
Non-standard Line Length
When enabled, the specified line length will be used as the maximum allowable line length for both free- and fixed-format Fortran source files.
Enforce Standard
If this option is enabled, the compiler will enforce the specified Fortran standard for all source files during compilation, disabling any compiler extensions or features unavailable in the chosen standard. If strict FORTRAN 77 compliance is necessary, legacy should be chosen.
Trap Floating Point Exceptions
Each checkbox in this field enables trapping common floating point errors and exceptions that can occur at runtime. When an exception occurs as the program runs, these options being enabled will cause the program to stop immediately. When running an executable in the debugger, the debugger will stop at the location of the exception.
Linker
This panel provides the user with some basic parameters for the linking step of the build process.
Static Linking
The first group of buttons controls whether the C, C++, and Fortran runtime libraries should be statically linked to the project. It is generally suggested that users select All Static because it eliminates dependencies on DLLs that may or may not be present on the path of the system where the project’s target will be used.
Build Import Library
This option is only enabled when constructing a shared library. When enabled, an import library will be generated along with the target DLL, which can ease linking the target DLL with other projects.
Link BLAS and LAPACK Libraries
Enabling this options links the OpenBLAS library included with Simply Fortran with your library or executable. The OpenBLAS library includes optimized versions of Basic Linear Algebra Subprograms (BLAS) and Linear Algebra Package (LAPACK) routines commonly used in Fortran software.
Compiler Flags
The compiler flags panel allows the user to manually enter additional flags to be used by the compilers and linker.
Package Flags
Also beneath the linker flags box is a button, Package Flags, that allows a user to select flags available from installed addon packages:
Addon packages are normally installed via the SF Package Manager. Please see http://packages.simplyfortran.com/ for more details.
The user can select one or more package templates listed from the list. Multiple selections can be made while holding down the Control key. If the user then presses Ok, the flags necessary to use the selected packages will be added to the Fortran Compiler, C Compiler, and Linker Flags for the current project.
File Locations
The file locations panel provides control over where certain paths needed by the compiler are located.
Build Directory
The build directory specifies the location for storing compiled files relative to the project’s home directory. By default Simply Fortran will create a directory at compile time and direct all compiler output to said directory. This directory is also deleted during the clean process.
Module Directory
The module directory is the location relative to the project’s home directory where modules are stored. At compile time, Simply Fortran will create this directory if necessary, and the module directory will be deleted during the clean process.
Users should not place files in the module directory as they will be deleted during the build process. To include external modules, users should specify a directory via the Search Directories option.
Search Directories
The Search Directories box lists the directories where the compilers search for libraries, headers, and Fortran modules.
The box contains two tabs corresponding to include search directories and library search directories. The include search directories corresponds not only to C compiler headers, but also to Fortran module files. The dialog is used only to specify the directories to search as opposed to actual libraries to incorporate during linking.
The Add… button opens a directory search dialog for the user to specify a directory. Similarly, the Remove button will remove any selection from the current search list. Default directories which are present in new projects can be removed using the Remove button, but are added back in simply by pressing the Add Defaults button.
Make Options
The final panel provides control over the project’s Makefile.
Allow Simply Fortran to Manage Makefiles
When enabled, Simply Fortran will customize the name of the project’s makefile based on the project’s name itself. This feature can help resolve issues when multiple projects reside in the same directory, keeping their makefiles separate. Enabling this feature implies always regenerating the makefile.
Makefile Name
This text box specifies the name of the Makefile to be created and used by Simply Fortran during the build process. This file will be created in the project’s directory.
Always Regenerate Makefile
By enabling this option, Simply Fortran will regenerate the makefile associated with the current project every time the user initiates the build process . Any user-created changes to a makefile will be destroyed if this option is selected. All dependencies will be updated during every build cycle, however, which is often useful for development projects and eliminates the generate makefile step.