Community
cancel
Showing results for 
Search instead for 
Did you mean: 
DAYENG66
Beginner
109 Views

Fortran Compiler for Ansys

Jump to solution

I am trying to use and Ansys batch file to compile some user programmable features in ANSYS.  I am using a .bat file from ANSYS to create the dynamically linked library.  When I did this with a previous employer it required a very old version of Visual Studio (VS2012 with VS2012 C++ update4) and then I installed Intel Parallel Studio XE 2015) with the licenses purchased at a fairly high cost.

It seems that newer ANSYS version are a more current.  The current Ansys version calls for.  Microsoft Visual Studio Professional 2017 Version 15.0 (including the MS C++ compiler), Intel C++ 2019.3.203 and Intel Visual FORTRAN 2019.3.203.  How do I get these versions of Intel C++ and Fortran?  I can install Intel® Fortran Compiler Classic 2021.1 and Intel® Fortran Compiler (Beta), but don't see 2019.3.203.  It seems like these compilers installed at no cost (could that be true?)

When I attempt with the "classic fortran" it does not recognize the ifort command.  I have the following up environment variable.  IFORT_COMPILER19=C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.2\windows\

I will attach the .bat file as a .txt.  I suspect I am doing something silly,  or I don't have the right installation.  I notice in the .bat file the following line where ifort_home is the environment variable above.   I can't find compilervars.bat in that location.

call "%IFORT_HOME%\bin\compilervars.bat" %IFORT_PLATFORM% %VSVER%

 

 

0 Kudos

Accepted Solutions
Steve_Lionel
Black Belt Retired Employee
101 Views

The oneAPI file is called setvars.bat - different from before.

View solution in original post

5 Replies
DAYENG66
Beginner
107 Views

It is giving me trouble attaching the .bin file as a .txt file

Steve_Lionel
Black Belt Retired Employee
102 Views

The oneAPI file is called setvars.bat - different from before.

View solution in original post

DAYENG66
Beginner
85 Views

Hmm.  Perhaps ansys revised their ansusershared.bat file between the version I have on my laptop and that of my desktop.  Unfortunately the student version which I am using currently does not have the option to custom install.  So I had to copy the customization folder that included the .bat file

I changed my environment variable path since that file is located in an earlier folder, and modified the .bat file.  It executes no but aborts during compilation.  In the past, it was a bit more graceful with compilation errors.  After fixing the error and rerunning it needed to install .NET Framework 3.5 )includes .Net 2.0 and 3.0) but seems to have work.   I will test it and report back.  Thanks for your help.

 

mecej4
Black Belt
72 Views

To most of us, excepting the few who are also users of Ansys (and such third party packages), there is little to gain from reading vendor batch files such as the one that you attached. You will have to read the Ansys documentation or consult other users of Ansys and modify those batch files to make Ansys work with a different version of the Intel compiler than the one referenced in the Ansys documentation.

DAYENG66
Beginner
53 Views

This is actually the 3rd time I have gotten ANSYS user programmable features to compile.  The first time I had an IT department set it up.  The 2nd time an IT guy purchased the license and I set it up.  This time I am unemployed and on my own.  Each time the methodology changed a little.   Ansys help can best be described as "bread crumbs" to help you find your way.  I am just really pleased that I was able to do it this time without buying anything.  I recall the compilers being rather pricey before.  The advice to look for the setvars file was exactly what I needed.

I have confirmed that it successfully created the .dll files (USERCREEP in this case).