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 user libraries are built on Windows X86-64, Linux X86-64 and Arm64.

Radioss UserLib SDK permits the generation of a dynamic library with the user code, some libraries and compiling scripts.
  ├── linux64_intel         : Linux X86-64 with Intel compiler 2020.4

  ├── linux64_sp_intel	  : Linux X86-64 Single Precision with INTEL Compiler 2020.4 or Higher

  ├── linuxa64_armflang	  : Linux Arm64 with armflang 22.1 or higher
  ├── linuxa64_sp_armflang  : Linux Arm64 Single Precision with armflang 22.1 or higher
  ├── win64_intel	 : Windows 64 Bits with INTEL Compiler 2020.4 / 
  |                           Microsoft Visual Studio 2019 or higher

  ├── win64_sp_intel  : Windows 64 Bits Single Precision 
  |                            with INTEL Compiler 2020.4.1 / Microsoft Visual Studio 2019 or higher

Gfortran versions for Linux X86-64, Linux Arm64, and Windows X86-64 can be found at https://github.com/OpenRadioss/Tools.

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 HyperWorks.

Compiler

Install the compiler that best fits your needs:
Intel Compiler for Linux and Windows

UserLib SDK Installation

SDK Location

The Radioss UserLib SDK is shipped in Altair HyperWorks 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 HyperWorks 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_intel

Generate a Dynamic Library Using the Build Script

Each UserLib version has its own script.

userlib_sdk
    ├── linux64_intel           : build_userlib.bash
    ├── linux64_sp_intel        : build_userlib.bash 
    ├── linuxa64_armflang       : build_userlib.bash
    ├── linux64_sp_armflang     : build_userlib.bash

    ├── win64_intel             : build_userlib.bat

    └── win64_sp_intel          : build_userlib.bat

Window Scripts

Scripts

All scripts have command line arguments to permit the library generation. Their functionality are the same. Althought, the syntax between the Linux and Windows scripts are different.

Execute the script without any argument to see all available options.
*********************************************
** 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.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.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.bash 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.