简体   繁体   English

Abaqus 2020 Linker 错误与 Intel OneAPI Fortran 编译器

[英]Abaqus 2020 Linker error with Intel OneAPI Fortran Compiler

Installation steps:安装步骤:

  1. Installed Visual Studio Community 2019, ensured Desktop C++ development is selected.安装了 Visual Studio Community 2019,确保选择 Desktop C++ development。

  2. Installed OneAPI Basic and then HPC.安装了 OneAPI Basic,然后安装了 HPC。

  3. Installed Abaqus 2020. Added the path of ifort to system path.安装了Abaqus 2020。将ifort的路径添加到系统路径中。 This enables calling ifort in system cmd.这可以在系统 cmd 中调用 ifort。

  4. Followed instructions in this blog and added按照此博客中的说明进行操作并添加

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

    to abq2020.bat.到 abq2020.bat。

Abaqus verify -user_std passes successfully. Abaqus 验证 -user_std 成功通过。 Suggesting Abaqus is linked correctly with Fortran compiler.建议 Abaqus 与 Fortran 编译器正确链接。 However, when attempting to run my own Fortran umat, Abaqus compiles the code but fails at the linking step with the following errors:但是,当尝试运行我自己的 Fortran umat 时,Abaqus 编译代码但在链接步骤失败并出现以下错误:

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.我认为问题在于大量与库相关的 linker 选项,如下所示。 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.这些库选项对于安装的许多版本的 Abaqus 都是相同的,例如 2019、2020 和 2023,所以我不确定到底是什么问题。

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

I was experiencing the same problem.我遇到了同样的问题。 I think your main objective is to debug the Abaqus subroutines.我认为您的主要目标是调试 Abaqus 子程序。

I could debug UMAT subroutines with the following win86_64.env file:我可以使用以下win86_64.env文件调试 UMAT 子例程:

#-*- mode: python -*-

#############################################################################
#                                                                           #
#     Compile and Link commands for ABAQUS on the Windows 64 Platform       #
#                                                                           #
#############################################################################

#import os # <-- Debugging
#os.environ['GLOBAL_ENABLE_FPE'] = 'TRUE' # <-- Debugging

# Location of the /include directory in the ABAQUS installation
abaHomeInc = os.path.abspath(os.path.join(os.environ.get('ABA_HOME', ''), os.pardir)) 

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]

## Fortran compile command for User Subroutines

compile_fortran=['ifort',
                 '/c', '/fpp', '/extend-source', 
                 '/DABQ_WIN86_64',  '/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
                 '/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']

## Link command to be used for ABAQUS/MAKE on machines without the Fortran compiler.
## Uncomment it to enable.
#
#link_exe=['LINK', '/nologo', '/INCREMENTAL:NO', '/subsystem:console', '/machine:AMD64', '/NODEFAULTLIB:LIBC.LIB', '/NODEFAULTLIB:LIBCMT.LIB',
#          '/DEFAULTLIB:OLDNAMES.LIB', '/DEFAULTLIB:MSVCRT.LIB', '/DEFAULTLIB:kernel32.lib', '/DEFAULTLIB:user32.lib', '/DEFAULTLIB:advapi32.lib',
#          '/FIXED:NO', '/LARGEADDRESSAWARE', '/out:%J', '%F', '%M', '%L', '%B', '%O',
#         'oldnames.lib', 'user32.lib', 'ws2_32.lib', 'netapi32.lib',
#         'advapi32.lib', 'msvcrt.lib', 'vcruntime.lib', 'ucrt.lib']

# Remove the temporary names from the namespace
del abaHomeInc

In my computer, this file is located in C:\SIMULIA\EstProducts\2021\win_b64\SMA\site\win86_64.env .在我的电脑中,此文件位于C:\SIMULIA\EstProducts\2021\win_b64\SMA\site\win86_64.env Depending on your Abaqus version and configurations, this path can vary.根据您的 Abaqus 版本和配置,此路径可能会有所不同。

Unfortunately, the warning messages remain.不幸的是,警告消息仍然存在。

After reaching out to Abaqus support, we got the following reply and following the instructions it solved the issue:在联系 Abaqus 支持人员后,我们得到了以下回复,并按照说明解决了问题:

  • 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.似乎 Fortran 编译器 (oneAPI) 已成功链接,但他们需要检查其 C++ 编译器 (Visual Studio) 和 linker 也被 Abaqus 看到。 They can verify this in their support.log file.他们可以在他们的 support.log 文件中验证这一点。
  • 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 |如果他们收到与缺少库/dll 相关的错误,则可能会使用 Visual Studio 2019 可再发行组件修复最新支持的 Visual C++ 可再发行组件下载 | Microsoft Learn (intalling x86 and x64). Microsoft Learn(安装 x86 和 x64)。
  • There are also some bugs/issues with oneAPI, they need to add these 2 lines to the abaqus_v6env : oneAPI 也有一些错误/问题,他们需要将这两行添加到abaqus_v6env
     compile_fortran += ['/names:lowercase',] link_sl='LINK /NODEFAULTLIB:LIBCMT.LIB /dll /def:%E /out:%U %F %A %L %B'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM