Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28381 Discussions

Linking Fortran compiler with Abaqus (minimal required installation; no need to install Intel oneAPI

Prafull_Bhosale_IITB
6,543 Views
  1. Download and install Visual Studio Build tools 2022 with default options checked. (DO NOT UNCHECK OR CHECK ANY OTHER OPTIONS.)

    https://visualstudio.microsoft.com/downloads/?q=build+tools 

    Prafull_Bhosale_IITB_0-1645257912191.png

    Prafull_Bhosale_IITB_0-1645257770524.png

  2. Install Fortran compiler from this website

https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html

Prafull_Bhosale_IITB_0-1645257538109.png

 

  1. Install Math kernel Library also from above website

Prafull_Bhosale_IITB_1-1645257538123.png

 

  1. Add following in paths in Path environment variable in system:

C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\

C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build

  1. Add following lines in abaqus.bat file

call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"

call "C:\Program Files (x86)\Intel\oneAPI\compiler\2022.0.2\env\vars.bat" -arch intel64

call "C:\Program Files (x86)\Intel\oneAPI\mkl\2022.0.2\env\vars.bat" intel64

 

Prafull_Bhosale_IITB_2-1645257538126.png

 

  1. To check if linking is done, run:

First open Abaqus Command prompt and then enter following:

abaqus info=system

 

Output should be like shown below:

Prafull_Bhosale_IITB_3-1645257538127.png

 

  1. To check if fortran file is running:

First fetch a sample file from Abaqus repository.

               abaqus fetch job=std_user

 

This command will fetch sample file with user subroutine from Abaqus repository and put it in current directory.

 

  1. *******IMP step: Remove the commented lines; otherwise, the program will not work. This is due to some bug in intel oneAPI *********

std_user.for file after removing commented lines should look like as shown below:

     

Prafull_Bhosale_IITB_4-1645257538131.png

 

  1. Run

abaqus job=std_user user=std_user.for

 

Check std_user.log file. It should have "Abaqus JOB std_user COMPLETED" at the end of file.

Prafull_Bhosale_IITB_5-1645257538136.png

 

******DONE**********

 

References:

 https://community.intel.com/t5/Intel-Fortran-Compiler/The-Easy-and-Fast-Way-to-Install-JUST-Fortran-with-Intel-oneAPI/td-p/1360571 

19 Replies
Steve_Lionel
Honored Contributor III
6,528 Views

Please show the source file before the commented lines are removed. I am curious to know what the perceived bug is. (I am not an Abaqus user.)

0 Kudos
AlexanderAbanobi
Beginner
453 Views

SUBROUTINE DISP(U,KSTEP,KINC,TIME,NODE,NOEL,JDOF,COORDS)
C
INCLUDE 'ABA_PARAM.INC'
C
DIMENSION U(3),TIME(2),COORDS(3)
C
C THE PRIMARY FUNCTION IS F(T)=1.5 SIN(OMEGA T) + .5 COS(OMEGA T)
C WHERE OMEGA IS .1 PI AND T THE CURRENT TIME.
C THE APPROPRIATE INTEGRALS AND DERIVATIVES ARE COMPUTED ACCORDINGLY.
C
OMEGA=.314159
AOMGT=OMEGA*TIME(2)
CS=COS(AOMGT)
SN=SIN(AOMGT)
AN=.5
BN=1.5
IF(NODE.EQ.2.AND.JDOF.EQ.1) THEN
C THE FUNCTION IS DISPLACEMENT FOR NODE 2
C (DIFFERENTIATE FOR VEL AND ACC)
U(1)=AN*CS+BN*SN
U(2)=OMEGA*(-AN*SN+BN*CS)
U(3)=-OMEGA**2*(AN*CS+BN*SN)
ELSE IF(NODE.EQ.3.AND.JDOF.EQ.1) THEN
C THE FUNCTION IS VELOCITY FOR NODE 3 (INTEGRATE FOR DISP,
C DIFFERENTIATE FOR ACCELERATION)
U(1)=(AN*SN+BN*(1.0-CS))/OMEGA
U(2)=AN*CS+BN*SN
U(3)=OMEGA*(-AN*SN+BN*CS)
ELSE IF(NODE.EQ.4.AND.JDOF.EQ.1) THEN
C THE FUNCTION IS ACCELERATION FOR NODE 4
C (INTEGRATE FOR DISP AND VELOCITY)
U(1)=(AN*(1.0-CS)+BN*(AOMGT-SN))/OMEGA**2
U(2)=(AN*SN+BN*(1.0-CS))/OMEGA
U(3)=AN*CS+BN*SN
ENDIF
RETURN
END

0 Kudos
Hayel
Beginner
5,973 Views

Why this complier can not compile subroutines contain ABA_PARAM.INC? 

 

0 Kudos
Arjen_Markus
Honored Contributor I
5,949 Views

Like Steve, I do not use Abaqus, I merely know of its existence. As you do not indicate what the compiler complains about and why it fails to compile such subroutines, I can only guess what is going wrong: it cannot find the include file "ABA_PARAM.INC". You need to specify its location to the compiler, if that file is not in the same directory as the source file.

0 Kudos
Hayel
Beginner
5,912 Views

Thank you for you help. 

Abaqus compile the subroutine correctly and the analysis started, but then the analysis aborted and there is no results at all. 

0 Kudos
Hayel
Beginner
5,912 Views

This analysis is completed before in Abaqus 2017 and the link with VS2012 and Intel composer EX 2013. So why it is aborted in Abaqus 2022?

 

0 Kudos
Arjen_Markus
Honored Contributor I
5,894 Views

First of all: you may want to start a new thread, rather than continuing with this old one. It will allow you to give it a more appropriate title.

You do not give us much clues as to what is going on and wrong, I am afraid. Apparently, there are at least two components that are different from your working version: Abaqus went from version "2017" to "2022" and the Intel Fortran compiler evidently changed also. As I do not know Abaqus, I have no idea if that is responsible for the observed failure. But be aware that newer versions of compilers can bring out lurking mistakes and errors in programs.

Given that you do not indicate HOW the analysis is aborted (nor show any code), I can only give you general advice:

  • Try to find out if the analysis program printed a stacktrace, so that you can at least get some information on what went wrong.
  • Lacking that, try with an empty routine, possibly merely printing a message to a file on disk, so that you know it has been called.
  • If that succeeds, add print statements in the routine to see where it fails. At some point you may see the exact location - or, if you are unlucky, the problem will have gone. The latter is usually an indication that something like an uninitialised variable caused a runtime problem (accessing an array way out of bounds for instance).
  • What you can also try is creating a small program that simply calls your routine with the right set of arguments, to see if in such an isolated case things work or do not work.

Just very general advice ;).

 

ALOK_05
Beginner
5,704 Views

hi,

I am following  the same steps on Abaqus 2022, VS:2022. but facing problem of linking Fortran compiler after typing "Abaqus info=system" in cmd window.it shows

ALOK_05_0-1675244452020.png

this is for the path.

 

ALOK_05_1-1675244498640.png

please help me in resolving the issue

0 Kudos
ALOK_05
Beginner
5,642 Views

I am able to resolve this issue by adding the "vs 2022" after intel64 in abaqus bat file, but currently iam facing problem with verification. after typing "Abaqus verify -user_std"in cmd window.

ALOK_05_0-1675329854698.png

 

0 Kudos
andrew_4619
Honored Contributor II
5,691 Views

The ABAQUS comment is not quite correct anymore. in the command window run C:\Program Files (x86)\Intel\oneAPI\setvars

and see if that helps.

0 Kudos
ALOK_05
Beginner
5,690 Views

i have to add this in "C:\Program Files (x86)\Intel\oneAPI\setvars" in Abaqus bat file

0 Kudos
ALOK_05
Beginner
5,409 Views

"Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.8.0 Build 20221119_000000
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.

End Compiling Abaqus/Standard User Subroutines
Begin Linking Abaqus/Standard User Subroutines
LINK : fatal error LNK1181: cannot open input file 'user32.lib'
Abaqus Error: Problem during linking - Abaqus/Standard User Subroutines.
This error may be due to a mismatch in the Abaqus user subroutine arguments.
These arguments sometimes change from release to release, so user subroutines
used with a previous release of Abaqus may need to be adjusted.
Abaqus/Analysis exited with error"

Getting this after "std_user.log file" in cmd window

 

0 Kudos
Steve_Lionel
Honored Contributor III
5,408 Views

The failure to find user32.lib, which is a Windows API library, suggests that you are not correctly establishing the compiler build environment.  You earlier wrote about adding a call to setvars.bat, which should do this. As you are showing us only the error output and not what led up to it, it's difficult to comment further.

0 Kudos
ALOK_05
Beginner
5,407 Views

hi steve, 

thanks for reply.

i have followed the whatever step is suggested initially . I am able to link Fortran with Abaqus

ALOK_05_0-1676474262257.png

 the result after typing "abaqus info=system" in cmd window.

ALOK_05_1-1676474353737.png

the reuslt after "abaqus verify -user_std" in cmd window.

 

"Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.8.0 Build 20221119_000000
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.

End Compiling Abaqus/Standard User Subroutines
Begin Linking Abaqus/Standard User Subroutines
LINK : fatal error LNK1181: cannot open input file 'user32.lib'
Abaqus Error: Problem during linking - Abaqus/Standard User Subroutines.
This error may be due to a mismatch in the Abaqus user subroutine arguments.
These arguments sometimes change from release to release, so user subroutines
used with a previous release of Abaqus may need to be adjusted.
Abaqus/Analysis exited with errors"

 

Getting this after "std_user.log file" in cmd window

 I hope I am to show the what leads to error. if any further information is required i am happy to share 

 

 

 

 

0 Kudos
andrew_4619
Honored Contributor II
5,401 Views

You would need to look at the link command used. There is the possibility of some libabry path direction on the link command or it gets this from the environment (path).  Maybe the log file mentioned will help?

Anyway a Steve days user32 is a windows system library and does not have much to do with the "user subroutine" you are trying to build.

0 Kudos
Steve_Lionel
Honored Contributor III
5,372 Views

I'd remark that this is an ABAQUS issue, not an Intel compiler issue.

0 Kudos
ALOK_05
Beginner
5,360 Views

hi steve can you help me in figuring out the issue with ABAQUS & help me in resolving the same

0 Kudos
Steve_Lionel
Honored Contributor III
5,328 Views

@ALOK_05 , sorry, I have never used ABAQUS. If you have an issue with the Intel Fortran compiler that shows when not invoking it from the unseen ABAQUS bat file, feel free to ask here. Otherwise please contact ABAQUS support.

0 Kudos
Barbara_P_Intel
Moderator
5,329 Views

@ALOK_05, did you see this post, How to Use Intel's Fortran Compiler with Abaqus? Maybe there is info there to help you.

 

0 Kudos
Reply