linkerfortranintel-fortranabaqus

Abaqus 2020 Linker error with Intel OneAPI Fortran Compiler


Installation steps:

  1. Installed Visual Studio Community 2019, ensured Desktop C++ development is selected.

  2. Installed OneAPI Basic and then HPC.

  3. Installed Abaqus 2020. Added the path of ifort to system path. This enables calling ifort in system cmd.

  4. Followed instructions in this blog and added

    @call "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat" intel64 vs2019

    to abq2020.bat.

Abaqus verify -user_std passes successfully. Suggesting Abaqus is linked correctly with Fortran compiler. However, when attempting to run my own Fortran umat, Abaqus compiles the code but fails at the linking step with the following errors:

Begin Linking Abaqus/Standard User Subroutines
libifcoremt.lib(for_vm.obj) : error LNK2005: for_allocate already defined in LIBIFCOREMD.LIB(libifcoremd.dll)
libifcoremt.lib(for_vm.obj) : error LNK2005: for_deallocate already defined in LIBIFCOREMD.LIB(libifcoremd.dll)
libifcoremt.lib(for_close.obj) : error LNK2005: for_close already defined in LIBIFCOREMD.LIB(libifcoremd.dll)
libifcoremt.lib(for_open.obj) : error LNK2005: for_open already defined in LIBIFCOREMD.LIB(libifcoremd.dll)
   Creating library standardU.lib and object standardU.exp
standardU_static.lib(SMAStsStdU_IF.obj) : warning LNK4204: 'C:\Users\zf1005.AD\AppData\Local\Temp\zf1005_test_1172\vc140.pdb' is missing debugging information for referencing module; linking object as if no debug info
standardU_static.lib(SMAStsUsubs_IF.obj) : warning LNK4204: 'C:\Users\zf1005.AD\AppData\Local\Temp\zf1005_test_1172\vc140.pdb' is missing debugging information for referencing module; linking object as if no debug info
standardU_static.lib(contactperm.obj) : warning LNK4204: 'C:\Users\zf1005.AD\AppData\Local\Temp\zf1005_test_1172\vc140.pdb' is missing debugging information for referencing module; linking object as if no debug info
standardU_static.lib(creep.obj) : warning LNK4204: 'C:\Users\zf1005.AD\AppData\Local\Temp\zf1005_test_1172\vc140.pdb' is missing debugging information for referencing module; linking object as if no debug info
standardU_static.lib(dflow.obj) : warning LNK4204: 'C:\Users\zf1005.AD\AppData\Local\Temp\zf1005_test_1172\vc140.pdb' is missing debugging information for referencing module; linking object as if no debug info
standardU_static.lib(dflux.obj) : warning LNK4204: 'C:\Users\zf1005.AD\AppData\Local\Temp\zf1005_test_1172\vc140.pdb' is missing debugging information for referencing module; linking object as if no debug info
standardU_static.lib(disp.obj) : warning LNK4204: 'C:\Users\zf1005.AD\AppData\Local\Temp\zf1005_test_1172\vc140.pdb' is missing debugging information for referencing module; linking object as if no debug info
standardU.dll : fatal error LNK1169: one or more multiply defined symbols found
standardU_static.lib(dload.obj) : warning LNK4204: 'C:\Users\zf1005.AD\AppData\Local\Temp\zf1005_test_1172\vc140.pdb' is missing debugging information for referencing module; linking object as if no debug info
Abaqus Error: Problem during linking - Abaqus/Standard User Subroutines.

I believe the issue is with the multitude of library-related linker options, shown below. These library options are the same for many versions of Abaqus installed, such as 2019, 2020, and 2023, so I am not sure what is actually the problem.

link_sl=['LINK',
         '/nologo', '/INCREMENTAL:NO', '/subsystem:console', '/machine:AMD64',#'/NOENTRY',
         '/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']

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']

Solution

  • After reaching out to Abaqus support, we got the following reply and following the instructions it solved the issue:

    • It seems the Fortran compiler (oneAPI) successfully linked but they need to check their C++ compiler (Visual Studio) and linker are seen by Abaqus as well. They can verify this in their support.log file.
    • If they get errors related to missing libraries/dlls it could potentially be fixed with the Visual Studio 2019 redistributables Latest supported Visual C++ Redistributable downloads | Microsoft Learn (intalling x86 and x64).
    • There are also some bugs/issues with oneAPI, they need to add these 2 lines to the abaqus_v6env:
      compile_fortran += ['/names:lowercase',]
      
      link_sl='LINK /NODEFAULTLIB:LIBCMT.LIB /dll /def:%E /out:%U %F %A %L %B'