### 18.3.1. Creating the Shared Libraries

A script called `cfx5mkext` is used to create shared libraries. You can run `cfx5mkext -help` for information on the arguments accepted by the script. To create the shared libraries, run at the command line:

    cfx5mkext myroutine1.F myroutine2.F

This creates an architecture-specific directory in the current working directory. This directory contains the shared object library `myroutine1.dll` (Windows). A single library is created for all files passed to `cfx5mkext`. By default, the library is named using the first file specified in the `cfx5mkext` command.

Important: Use a capital F as the file extension for Fortran source to be run through the preprocessor.

If you are using one of the double precision CFX-Solver executables, you should use the `-double` option with `cfx5mkext` to compile your subroutines. For details, see Double-Precision Executables in the CFX-Solver Manager User's Guide.

If you want to create shared libraries for “large problem” executables, use the `-large` option. For details, see Large Problem Executables in the CFX-Solver Manager User's Guide.

You can specify a different name for the shared object library using the `-name` option. The `-dest` option can be used to set the location of the library. For example,

    cfx5mkext -name UserRoutine -dest /home/user/SharedLibraries myroutine.F

creates `UserRoutine.dll` (for Windows) in an architecture-specific subdirectory in /home/user/SharedLibraries.

When specifying the library name in CFX-Pre (or in a CCL file), any prefix or suffix (lib, .so, .sl, .dll) added to the name should not be included.

When specifying the library path in CFX-Pre (or in a CCL file), you should specify an absolute path to the directory that contains the architecture-specific subdirectories (for example, /home/user/SharedLibraries in the previous example. On Windows systems, this might be F:\user\SharedLibraries). Library path lists are supported to enable distributed parallel runs across different architectures. For details, see Library Name and Library Path in the CFX-Pre User's Guide.

Note: The double-precision solver uses 'auto promotion' of REAL data to DOUBLE. Specifically, when you include the `-double` option in your `cfx5mkext` command line, this activates auto-promotion and gives you double-precision User Fortran.

Release 18.2 - © ANSYS, Inc. All rights reserved.