Generate Radioss User Libraries

Radioss user libraries are built on Windows and Linux with two different compilers: Intel Fortran or Gfortran.

Radioss UserLib SDK Overview

The Radioss UserLib SDK permits generating a dynamic library made of libraries and compiling scripts for a range of Windows and Linux versions.
    userlib_sdk
  ├── linux64_i18.1         : Linux 64 Bit with Intel compiler 2018.1
  ├── linux64               : Linux 64 Bit with Intel Compiler 12.1.3 or Higher
  ├── linux64_gfortran      : Linux 64 Bit with GNU Gfortran 4.4.5 to 4.4.9
  ├── linux64_sp_i18.1      : Linux 64 Bit Single Precision with Intel compiler 2018.1
  ├── linux64_sp            : Linux 64 Bit Single Precision with INTEL Compiler 12.1.3 or Higher
  ├── linux64_sp_gfortran   : Linux 64 Bit Single Precision with GNU Gfortran 4.4.5 or Higher
  ├── win64_i18.1_vs2015    : Windows 64 Bits with INTEL Compiler 2018.1 / 
  |                           Microsoft Visual Studio 2015
  ├── win64                 : Windows 64 Bits with INTEL Compiler 12.1.3 or higher
  ├── win64_gfortran_7.2    : Windows 64 Bits with GNU MinGW Fortran 7.2 
  ├── win64_gfortran        : Windows 64 Bits with GNU MinGW Fortran 4.9.2 
  ├── win64_sp_i18.1_vs2015 : Windows 64 Bits Single Precision 
  |                            with INTEL Compiler 2018.1 / Microsoft Visual Studio 2015
  └── win64_sp              : Windows 64 Bits Single Precision with INTEL Compiler 12.1.3 or 
                              higher

Each directory contains a static library and a build script.

Prerequesites

OS Version

The recommended operating system is the same as the recommended operating system for Altair Simulation.

Compiler

Install the compiler that best fits your needs:
Intel Compiler for Linux and Windows
Gfortran for Linux
  • Gfortran is embedded in the Linux distribution. Install it using Linux Package installer.
  • Gfortran must be version 4.4.5 or higher.
MinGW Gfortran compiler for Windows
  • MinGW is a Windows port of the GNU gcc and Gfortran compiler.
  • Download MinGW Gfortran at http://sourceforge.net/projects/mingw-w64/.
  • Choose the following install options:
    • Version: 4.92
    • Architecture: X86_64
    • Thread: win32
    • Exception: seh
    • Build Revision: Latest
MinGW Gfortran 7.2 compiler for Windows
  • MinGW is a Windows port of the GNU gcc and Gfortran compiler.
  • Download MinGW Gfortran at http://sourceforge.net/projects/mingw-w64/.
  • Choose the following install options:
    • Version: 7.2
    • Architecture: X86_64
    • Thread: win32
    • Exception: seh
    • Build Revision: Latest

UserLib SDK Installation

SDK Location

The Radioss UserLib SDK is shipped in Altair Simulation installation and located in %ALTAIR_HOME%/hwsolvers/radioss/userlib_sdk

If you received the SDK in a separate package, copy it in your target directory.

Environment Variable Settings

Set two environment variables:
  • RAD_USERLIB_SDK_PATH: PATH to SDK ROOT

    The following examples were installed with Altair Simulation and ALTAIR_HOME environment variable set.

    • Linux (bash):
      export RAD_USERLIB_SDK_PATH=$ALTAIR_HOME/hwsolvers/radioss/userlib_sdk
    • Windows:
      set RAD_USERLIB_SDK_PATH=%ALTAIR_HOME%\hwsolvers\radioss\userlib_sdk
  • RAD_USERLIB_ARCH
    The target Architecture Windows/Linux compiler flavor
    • Linux (bash):
      export RAD_USERLIB_ARCH=linux64

Generate a Dynamic Library Using the Build Script

Each UserLib version has its own script.

   userlib_sdk
    ├── linux64                 : build_userlib_linux64.sh
    ├── linux64_i18.1           : build_userlib_linux64.sh
    ├── linux64_gfortran        : build_userlib_linux64_gfortran.sh
    ├── linux64_sp              : build_userlib_linux64_sp.sh
    ├── linux64_sp_i18.1        : build_userlib_linux64_sp.sh
    ├── linux64_sp_gfortran_7.2 : build_userlib_linux64_sp_gfortran_7.2.sh
    ├── linux64_sp_gfortran     : build_userlib_linux64_sp_gfortran.sh
    ├── win64_i18.1_vs2015      : build_userlib_win64.bat
    ├── win64                   : build_userlib_win64.bat
    ├── win64_gfortran          : build_userlib_win64_gfortran.bat
    ├── win64_sp_i18.1_vs2015   : build_userlib_win64_sp.bat
    └── win64_sp                : build_userlib_win64_sp.bat

Window Scripts

Scripts

*********************************************
** Generating Radioss Dynamic User Library **
*********************************************

build_userlib_win64.bat /STARTER "Starter source files" /ENGINE "Engine Source files" /LIBRARY "additional static Library" /OUTFILE Library_name [Optional Argument]

[Optional Argument]
/FREE : Source code is in Fortran 90 Free Format
/ADDFLAG "Additional compiler Flags" : Additional compiler flags to set
/LINK_FLAGS "Additional link flags"  : add link Flags like library files to link with.
Script
Description
/STARTER
Starter source files. Add these files in quotation marks.
/ENGINE
Engine source files. Add these files in quotation marks.
/LIBRARY
Optional. Additional static library for link.
/OUTFILE
Optional. A specified library name other than the default.
/FREE
Optional. Use this if source code is written in Fortran 95 Free Format.
/ADDFLAG
Optional. Use this to set additional compiler flags. Add flags in quotation marks.
/LINK_FLAGS
Optional. Advanced users only. Use this to add additional link flags or 3rd party libraries during the dynamic libraries creation phase.

Compiling LAW29 for shells (LECM29.F and SIGEPS29C.F) and Generating a Library with Default Name

F:\>%RAD_USERLIB_SDK_PATH%\%RAD_USERLIB_ARCH%\build_userlib_win64.bat /STARTER "lecm29.F" /ENGINE "sigeps29c.F"

F:\>echo off

*********************************************
** Generating Radioss Dynamic User Library **
*********************************************

Preparing Library
-----------------

Compiling: lecm29.F
----------

lecm29.F


Compiling: sigeps29c.F
----------

sigeps29c.F


Creating library: libraduser_win64.dll
----------------
		Creating library libraduser_win64.lib 
		Creating object libraduser_win64.dll

Done
----

F:\>

Linux Scripts

Scripts

*********************************************
** Generating Radioss Dynamic user library **
*********************************************


Script Usage

build_userlib_linux64.sh starter="Starter source files" engine="Engine Source files" library="Additional static Library" outfile="Optional library name" [Optional Arguments]

[Optional Arguments]
-free : Source files are in Fortran 90 Free Format
-addflag "Additional Compiling Arguments" - Advanced Users Only
-link_flags "Additional Linking Arguments" - Advanced Users Only
Script
Description
starter
Starter source files. Add quotation marks if more than one file is set.
Engine
Engine source files. Add quotation marks if more than one file is set.
library
Optional. Additional static library for link.
outfile
Optional. A specified library name other than the default.
-free
Use this option if source code is written in Fortran 95 Free Format.
-addflag””
Advanced user only. Use this to set additional compiler flags. Add flags in quotation marks.
-link_flags=“ “
Advanced users only. Use this to add additional link flags or 3rd party libraries during the dynamic libraries creation phase.

Compiling LAW29 for shells (LECM29.F and SIGEPS29C.F) and Generating a Library with Default Name

neo DDS/LOI29> $RAD_USERLIB_SDK_PATH/$RAD_USERLIB_ARCH/build_userlib_linux64.sh starter="lecm29.F" engine="sigeps29c.F"
 
*********************************************
** Generating Radioss Dynamic user library **
*********************************************
 
 Compiling:  lecm29.F
-----------
 
Compiling:  sigeps29c.F
----------
 
Creating library:  libraduser_linux64.so
-----------------
 
Done
----

Generated Library Name

In Windows, the default generated library is named libraduser_win64.dll if /OUTFILE “Alternate library name” is not set.

In Linux, the default generated library is named libraduser_linux64.so if outfile=”Alternate library name” is not set.

Load the User Library

When using the alternate library name option, use –dylib [library name] command line argument in Starter or Engine subroutines to load the library.

The library load sequence below in Starter and Engine subroutines is in order of priority.
  1. -dylib [alternate library name] command line argument.
  2. If RAD_USERLIB_LIBPATH is set, load libraduser_win64.dll or libraduser_linux64.so in the directory defined in this environment variable.
  3. Load libraduser_win64.dll or libraduser_linux64.so in the local execution directory.
  4. Load libraduser_win64.dll or libraduser_linux64.so using the %PATH% environment variable (Windows) or $LD_LIBRARY_PATH environment variable (Linux).

A message is printed in the output files when the library is successfully loaded.

Windows 64 example:
EXTERNAL LIBRARY FOR USERS CODE INTERFACE  
-----------------------------------------  
LIBRARY NAME  . . . . . . . . . . . . . . . . . . . . libraduser_win64.dll
Altair Radioss USERS CODE INTERFACE VERSION  . . . . . . . .1301504220

When user options are used in the Radioss Input Deck, the code in the user library is used.