Linking Abaqus with a Fortran compiler
Linking Abaqus with a Fortran compiler
Compile user subroutines in Windows with Abaqus and Intel OneAPI (same for all version of Abaqus)
Compiler Installation:
To compile user subroutines in Windows with Abaqus and Intel OneAPI, you will need to download and install in the following order:
1. Microsoft Visual Studio 2017 or 2019 https://visualstudio.microsoft.com/downloads/
2. Intel oneAPI Base Toolkit https://software.intel.com/content/www/us/en/develop/tools/oneapi/base-toolkit/download.html
3. Intel oneAPI HPC Toolkit https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit/download.html
When installing Visual Studio 2017 or 2019, “Desktop development with C++” is all that is needed to compile user subroutines with Abaqus. Note that Microsoft Visual Studio Community Edition is supported.
Review the following links:
• https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-toolkit-release- notes.html
• https://software.intel.com/content/www/us/en/develop/articles/intel-compilers-compatibility-with- microsoft-visual-studio-and-xcode.html
• https://visualstudio.microsoft.com/vs/compare/
Microsoft Visual Studio Installation:
After installing Visual Studio and rebooting, install the Intel oneAPI Base Toolkit:
Intel OneAPI provides Integration with Visual Studio* 2017 and 2019 and will detect your Visual Studio installation. Select the version of Visual Studio to be integrated.
After completing the Intel oneAPI Base Toolkit installation, install the Intel oneAPI HPC Toolkit:
Development Environment setup:
Once the Intel OneAPI HPC Toolkit is installed, you can open an Intel Developer Command Window from the Start Menu:
Start -> Intel oneAPI 2021 -> Intel oneAPI command prompt for Intel 64 for Visual Studio 2019
You can also 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”
Change to a directory where you have write permissions and plan to work.
The oneAPI envrionment is only set within this terminal window. If you open another terminal window, you will need to call the setvars.bat to set the oneAPI environment.
Abaqus modification for Intel oneAPI support:
Create an abaqus_v6.env file in your HOME directory and add the followng: compile_fortran += ['/names:lowercase',]
The above is due to an Intel oneAPI compiler bug that may be fixed in a future release. If you are seeing the Abaqus solver abort immeditely with some user subroutines, you will also need to add the following line to the abaqus_v6.env:
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
Configuring the Abaqus Start Menu shortcuts
With this approach, the initialization batch file will be automatically executed each time Abaqus is launched from the shortcuts. Only three of the shortcuts will need this change:
• Abaqus Command
• Abaqus CAE
• Abaqus Verification
1. Navigate to the 'Abaqus Command' prompt shortcut on the Start menu, right click on the shortcut, choose more, and then choose “Open file location”
2. Right click on the Abaqus Command shortcut and choose properties.
3. Append "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" after the /k in the target field.
4. Right click on the Abaqus CAE shortcut in the same directory and choose properties. 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
From the same directory, right click on the Abaqus verification shortcut and choose properties. Pre-append, “C:\Program Files (x86)\Intel\oneAPI\setvars.bat” to the target field.
"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
Using the compiler in the above examples, the following message will appear each time the Abaqus shortcut is executed:
This is the recommended method if you do not want to manually call the Intel setvars batch file each time you open the Abaqus Command prompt. You will need to perform the above sequence for each shortcut in subsequent maintenance releases.