Getting Started: Abaqus User Subroutine Compilation in Windows Using Intel OneAPI

Article by Bilal Abdul Halim on Jun 01, 2023

Want to use Abaqus and the Intel OneAPI to compile user subroutines in Windows but are unsure where to begin? In this article, we walk through each step of setting up the required software, setting up the development environment, and modifying Abaqus to support Intel OneAPI. Additionally, we'll outline how to automatically run the initialization batch file each time Abaqus is launched. 

To quickly begin compiling user subroutines, follow these instructions.

Compiler Installation 

To compile user subroutines in Windows with Abaqus and Intel OneAPI, you will need to download and install the following software in the specified order: 

  1. Microsoft Visual Studio 2022 
  2. Intel oneAPI Base Toolkit 
  3. Intel oneAPI HPC Toolkit 

During the installation of Microsoft Visual Studio 2022, select Desktop development with C++, which is all that is required to compile user subroutines with Abaqus. Note that Microsoft Visual Studio Community Edition is supported. 

Installing Visual Studio Community 2022

Once you've installed Visual Studio and rebooted your system, proceed to install the Intel OneAPI Base Toolkit. After installation, Intel OneAPI Base Toolkit automatically detects your Visual Studio 2022 installation and provides integration.  

Intel oneAPI Base Toolkit

Intel oneAPI Base Toolkit v 2023

If multiple versions of Visual Studio are present in your system, you can choose the version you want to integrate with.

Microsoft Visual Studio 2022 

After configuring the correct version of Visual Studio to use, proceed to install the Intel OneAPI HPC Toolkit. These toolkits provide the necessary compilers and libraries to compile user subroutines. 

What's Inside Intel oneAPI HPC Toolkit

For more information, visit the following links: 

Development Environment Setup

Once you've installed the Intel OneAPI HPC Toolkit, open an Intel Developer Command Window from the Start menu by going to 

Start Intel oneAPI 2023 Intel oneAPI command prompt for Intel 64 for Visual Studio 2022

Intel Developer Command Window

Alternatively, open a regular command prompt window and execute the following command to set the compiler environment variables: 

"C:\Program Files (x86)\Intel\oneAPI\setvars.bat

Set Complier Environment Variables

Switch to a directory where you have writing privileges and intend to carry out your work. It is worth noting that the oneAPI environment is solely configured in this terminal window. If you launch another terminal window, you will have to invoke the setvars.bat script to establish the oneAPI environment. 

Abaqus Modification for Intel OneAPI Support

Create an abaqus_v6.env file in your HOME directory and add the following: 

compile_fortran += ['/names:lowercase',] 

This is because of a bug in the Intel OneAPI compiler, which may be resolved in a future update. In case you encounter the Abaqus solver abruptly terminating with certain user subroutines, it is necessary to append the following line to the abaqus_v6.env file: 

link_sl='LINK /NODEFAULTLIB:LIBCMT.LIB /dll /def:%E /out:%U %F %A %L %B' 

Abaqus User Subroutine Verification Test

From the command configured with Intel OneAPI environment, run the following: 

abaqus verify –user_std 

Abaqus User Subroutine Verification Test

Configuring Abaqus Start Menu Shortcuts 

This method automates the execution of the initialization batch file every time Abaqus is launched from specific shortcuts. You only need to change the shortcuts for Abaqus Command, Abaqus CAE, and Abaqus Verification in order to use this method. 

The steps are as follows: 

  1. On the Start menu, locate the Abaqus Command prompt shortcut. Right-click it, select More, and choose Open file location

    Configure Abaqus Start Menu Shortcuts

  2. Right-click on the Abaqus Command shortcut and select Properties.
  3. In the target field, append this C:\Program Files (x86)\Intel\oneAPI\setvars.bat after the /k field. 

    Abaqus Command Properties

  4. Right-click on the Abaqus CAE shortcut in the same directory, select Properties, and pre-append C:\Program Files (x86)\Intel\oneAPI\setvars.bat to the target field, separating the commands with two ampersands (&&). 

    "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && C:\SIMULIA\EstProducts\2021\win_b64\resources\install\cae\launcher.bat cae || pause 

    Abaqus CAE Properties

    1. From the same directory, right-click on the Abaqus Verification shortcut, select Properties, and pre-append C:\Program Files (x86)\Intel\oneAPI\setvars.bat to the target field, as such: 

      "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" && C:\SIMULIA\EstProducts\2021\win_b64\resources\install\cae\launcher.bat -verify -all -log && notepad.exe verify.log || notepad.exe verify.log

      Abaqus Verification Properties

      Conclusion 

      By following the above steps, you can automate the execution of the initialization batch file each time you launch Abaqus from these shortcuts. This method eliminates the need to manually call the Intel setvars batch file every time you open the Abaqus Command prompt. The compiler will display a message every time the Abaqus shortcut is executed, indicating that this is the recommended method. Additionally, you must perform the same steps for each shortcut in future maintenance releases. 

      Related Articles

      How to Configure Managed DSLS

      How to Install Abaqus

      Abaqus and CATIA Now Available from GoEngineer: NOT Just for Enterprise!

      CATIA V5 Parametric Optimization Guide

      Fix Abaqus CAE IOError Permission Denied

      VIEW ALL ABAQUS ARTICLES

       

      About Bilal Abdul Halim

      Bilal Abdul Halim is an Application Engineer at GoEngineer specializing in Abaqus. Bilal holds a Bachelor’s degree in Mechanical Engineering and a Master's degree in Experimental Fluid Mechanics where he studied the effects of corona discharge on viscous oil using particle image velocimetry. When not at work, Bilal is usually playing ping pong or trying different restaurants.

      View all posts by Bilal Abdul Halim