Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
240 Views

How to modify ABAQUS env file to include external fortran libraries

As I know, ABAQUS use IVF as default fortran compiler. I want to call external libraries in ABAQUS subroutine but I don't know how to include them during compiling and linking. I have searched many documents, then I fould the win86_64.env(my pc is WIN10, 64bit) might need to be modified.

compile_fortran

Fortran compile command. The command used at SIMULIA is included in the platform-specific environment file (win86_64.env or lnx86_64.env) in the solvers_install_dir/os/SMA/site/ subdirectory of the Abaqus services installation. This command should not normally be changed. It may be either a string or a tuple of strings. If the command is a tuple of strings, each string must represent a single command line argument.

The compilation of Fortran files using Fortran 90 freeform specifications is not supported by default. The abaqus_v6.env file in the /SMA/site/ subdirectory of the Abaqus installation includes comments that discuss the compile options.

link_exe

Command to link a postprocessing program. The command used at SIMULIA is included in the platform-specific environment file (win86_64.env or lnx86_64.env) in the solvers_install_dir/os/SMA/site/ subdirectory of the Abaqus services installation. This command should not normally be changed. It can be either a string or a tuple of strings. If the command is a tuple of strings, each string must represent a single command line argument. The values of the placemarkers are determined by the Abaqus execution procedure or by the command line options and cannot be modified by the user. User-specified external libraries can be linked with the usual link commands. The following placemarkers are used in link_exe:

%J

The job name (in this case the name of the executable to be created).

%F

The name of the object file created from the user's source file.

%M

The name of the internally created main object file.

%B

The name of the shared library of utility functions.

%O

The list of utility shared libraries for the output database application public interface.

%L

The list of directories containing shared libraries (HP only).

link_sl

Command to link a shared library. The command used at SIMULIA is included in the platform-specific environment file (win86_64.env or lnx86_64.env) in the solvers_install_dir/os/SMA/site/ subdirectory of the Abaqus services installation. This command, once its placemarkers have been exchanged, must be a valid command on the computer system where the shared library is linked. This command can be either a string or a tuple of strings. If the command is a tuple of strings, each string must represent a single command line argument. The values of the placemarkers are determined by the Abaqus execution procedure or by the command line options and cannot be modified by the user. The values of the placemarkers replace the placemarkers in the link_sl string. User-specified external libraries can be linked with the usual link commands. The following placemarkers are available:

%F

The name of the compiled object file.

%U

The name of the shared library.

%A

The name of the archive of compiled object files to be linked into the shared library.

%B

The name of the shared library of utility functions.

%E

The name of the file containing the names of the symbols to be exported from the shared library.

%L

The list of directories containing shared libraries (HP only).

These are several paragraphs that might be important as below

compile_cpp=['cl', '/c', '/W0', '/MD', '/TP',
             '/EHsc', '/DNDEBUG', '/DWIN32', '/DTP_IP', '/D_CONSOLE',
             '/DNTI', '/DFLT_LIC', '/DOL_DOC', '/D__LIB__', '/DHKS_NT',
             '/D_WINDOWS_SOURCE', '/DFAR=', '/D_WINDOWS', '/DABQ_WIN86_64', '%P',
             # '/O1', # <-- Optimization
             # '/Zi', # <-- Debug symbols
             '/I%I', '/I'+abaHomeInc]

compile_fmu=['win64CmpWrp', '-m64', '-msvc9', 'cl', '/LD', 
             '/D_WINDOWS', '/TC', '/W0',  '/I%I', '/I'+abaHomeInc]

compile_fortran=['ifort',
                 '/c', '/fpp', '/extend-source', 
                 '/DABQ_WIN86_64','/Qmkl:sequential',  '/DABQ_FORTRAN',
                 '/iface:cref',  '/recursive',
                 '/Qauto',  # <-- important for thread-safety of parallel user subroutines
                 '/align:array64byte',
                 '/Qpc64',                    # set FPU precision to 53 bit significand
                 '/Qprec-div', '/Qprec-sqrt', # improve precision of FP divides and sqrt
                 '/Qfma-',                    # disable floating point fused multiply-add
                 '/fp:precise',               # floating point model: precise 
                 '/Qimf-arch-consistency:true', # math library consistent results
                 '/Qfp-speculation:safe',     # floating point speculations only when safe
                 '/Qprotect-parens',          # honor parenthesis during expression evaluation
                 '/Qfp-stack-check',          # enable stack overflow protection checks
                 '/reentrancy:threaded',      # important for thread-safety
                 #'/Qinit=zero','/Qinit=arrays',  # automatically initialize all arrays to zero
                 '/Qinit=snan', '/Qinit=arrays',  # automatically initialize all arrays to SNAN
                 '/QxSSE3', '/QaxAVX',        # generate SSE3, SSE2, and SSE instructions
				 '/heap-arrays:10000000',
                 # '/Od', '/Ob0',  # <-- Disable Optimization for Debugging
                 # '/Zi',          # <-- Debugging Information
                 '/include:%I', '/include:'+abaHomeInc, '%P']

link_sl=['LINK',
         '/nologo', '/NOENTRY', '/INCREMENTAL:NO', '/subsystem:console', '/machine:AMD64',
         '/NODEFAULTLIB:LIBC.LIB', '/NODEFAULTLIB:LIBCMT.LIB',
         '/DEFAULTLIB:OLDNAMES.LIB', '/DEFAULTLIB:LIBIFCOREMD.LIB', '/DEFAULTLIB:LIBIFPORTMD.LIB', '/DEFAULTLIB:LIBMMD.LIB',
         '/DEFAULTLIB:kernel32.lib', '/DEFAULTLIB:user32.lib', '/DEFAULTLIB:advapi32.lib',
         '/FIXED:NO', '/dll',
         #'/debug', # <-- Debugging
         '/def:%E', '/out:%U', '%F', '%A', '%L', '%B', 
         'oldnames.lib', 'user32.lib', 'ws2_32.lib', 'netapi32.lib',
         'advapi32.lib', 'msvcrt.lib', 'vcruntime.lib', 'ucrt.lib']

link_exe=['LINK',
          '/nologo', '/INCREMENTAL:NO', '/subsystem:console', '/machine:AMD64', '/STACK:20000000',
          '/NODEFAULTLIB:LIBC.LIB', '/NODEFAULTLIB:LIBCMT.LIB', '/DEFAULTLIB:OLDNAMES.LIB', '/DEFAULTLIB:LIBIFCOREMD.LIB',
          '/DEFAULTLIB:LIBIFPORTMD.LIB', '/DEFAULTLIB:LIBMMD.LIB', '/DEFAULTLIB:kernel32.lib',
          '/DEFAULTLIB:user32.lib', '/DEFAULTLIB:advapi32.lib',
          '/FIXED:NO', '/LARGEADDRESSAWARE',
          # '/debug', # <-- Debugging
          '/out:%J', '%F', '%M', '%L', '%B', '%O',
          'oldnames.lib', 'user32.lib', 'ws2_32.lib', 'netapi32.lib',
          'advapi32.lib', 'msvcrt.lib', 'vcruntime.lib', 'ucrt.lib']

If I want to include external lib files, where should I modify?

Thanks  for any help.

0 Kudos
0 Replies