## 4.2. Linking your own User Subroutines on Linux Platforms

The user-subroutine directory of the Linux installation package can be found under the platform specific directory in the autodyn/usrsub directory. For example, if Autodyn has been installed into the default directory, then the files required to create a customized version would be found in:

/ansys_inc/v182/autodyn/usrsub/linx64

We recommend that this whole directory and its subdirectories are copied to your home directory to avoid any permissions conflicts when editing and compiling the customized versions on Linux.

Note: On Red Hat 6.x Linux systems, you must install the following compatibility package in order for the user subroutines to be compiled and linked correctly :

    compat-libstdc++-33-3.2.3-69.el6.x86_64

This compatibility package can be found on your Linux distribution disk.

The files for editing are contained within this directory, and the libraries needed for compilation contained in the Module subdirectory. A script is supplied for compilation of customized Autodyn executables; to execute the script, type `./autolnk` within the user subroutine directory. This will compile each user subroutine FORTRAN file in turn, and then link with the Autodyn library to produce a customized Autodyn executable (and slave executable). Before running the autolnk script, the environment variable MPI_ROOT should be set, or the path to the Platform MPI directory set in the script. By default, Platform MPI is installed into the directory:

/ansys_inc/v182/commonfiles/MPI/Platform/9.1.3.1/<platform>

In order to run your customized Autodyn executable, you should set the environment variable CUSTOMIZED_AUTODYN to be the full path to the location of the customized Autodyn executables.

For example, for a customized Autodyn executable created in a user’s directory /home/autodyn_user/autodyn/customize, using the C shell, the environment variable is defined by:

    setenv CUSTOMIZED_AUTODYN /home/autodyn_user/autodyn/customize

Once this environment variable is set, run the standard Autodyn script (located by default in /ansys_inc/v182/autodyn/bin) and the customized executable will be run from the path defined by the variable.

In order to return to the standard Autodyn executable, you should be sure to unset the variable by typing:

    unsetenv CUSTOMIZED_AUTODYN

To run a customized parallel Autodyn simulation, the parallel configuration file (parallel.cfg) should contain the paths for the customized Autodyn executables. Located in the same directory as the customized Autodyn executables is a script called adslave182. This script sets up the environment variables at runtime required for the slave to execute. For further information regarding the parallel configuration files, please see the Autodyn Parallel Processing Guide.

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