Results 1 to 4 of 4

Thread: Linking IMSL Fortran Numerical Libraries with Abaqus

  1. #1
    Junior Member
    Join Date
    Oct 2016
    Location
    Chennai, India
    Posts
    5

    Linking IMSL Fortran Numerical Libraries with Abaqus

    Hey,

    How can I link IMSL libraries with Abaqus? I have edited the abaqus_v6.env file to include 'imslmkl_dll.lib' in 'link_sl = ...' This doesn't however seem to work.

    I use the functions UMACH and IVPAG in my subroutine. Hence I keep getting the errors in the log file after I run the Abaqus job

    Code:
    error LNK2019: unresolved external symbol umach referenced in function umat
    error LNK2019: unresolved external symbol s_ivpag referenced in function umat
    My Abaqus environment file is as below

    Code:
    #
    #        System-Wide Abaqus Environment File
    #       -------------------------------------
    standard_parallel = ALL
    mp_mode = MPI
    mp_file_system = (DETECT,DETECT)
    mp_num_parallel_ftps = (4, 4)
    mp_environment_export = ('MPI_PROPAGATE_TSTP',
                             'ABA_CM_BUFFERING',
                             'ABA_CM_BUFFERING_LIMIT',
                             'ABA_ITERATIVE_SOLVER_VERBOSE',
                             'ABA_DMPSOLVER_BWDPARALLELOFF',
                             'ABA_ELP_SURFACE_SPLIT',
                             'ABA_ELP_SUSPEND',
                             'ABA_HOME',
                             'ABA_MEMORY_MODE',
                             'ABA_MPI_MESSAGE_TRACKING',
                             'ABA_MPI_VERBOSE_LEVEL',
                             'ABA_PATH',
                             'ABA_RESOURCE_MONITOR',
                             'ABA_RESOURCE_USEMALLINFO',
                             'ABAQUS_LANG',
                             'ABAQUSLM_LICENSE_FILE',
                             'ABQ_CRTMALLOC',
                             'ABQ_DATACHECK',
                             'ABQ_RECOVER',
                             'ABQ_RESTART',
                             'ABQ_SPLITFILE',
                             'ABQ_XPL_WINDOWDUMP',
                             'ABQ_XPL_PARTITIONSIZE',
                             'ABQLMHANGLIMIT',
                             'ABQLMQUEUE',
                             'ABQLMUSER',
                             'CCI_RENDEZVOUS',
                             'DOMAIN',
                             'DOMAIN_CPUS',
                             'DOUBLE_PRECISION',
                             'FLEXLM_DIAGNOSTICS',
                             'FOR0006',
                             'FOR0064',
                             'FOR_IGNORE_EXCEPTIONS',
                             'FOR_DISABLE_DIAGNOSTIC_DISPLAY',
                             'LD_PRELOAD',
                             'MP_NUMBER_OF_THREADS',
                             'MPC_GANG',
                             'MPI_FLAGS',
                             'MPI_RDMA_NENVELOPE',
                             'MPI_SOCKBUFSIZE',
                             'MPI_USE_MALLOPT_MMAP_MAX',
                             'MPI_USE_MALLOPT_MMAP_THRESHOLD',
                             'MPI_USE_MALLOPT_SBRK_PROTECTION',
                             'MPI_WORKDIR',
                             'MPCCI_SERVER',
                             'MPCCI_INITIAL_EXCHANGE',
                             '_MPCCI_CCM_CODE_IDS',
                             '_MPCCI_CODE_IDSTRING',
                             'ABAQUS_CCI_DEBUG',
                             'NCPUS',
                             'OMP_DYNAMIC',
                             'OMP_NUM_THREADS', 
                             'OUTDIR',
                             'PAIDUP',
                             'PARALLEL_METHOD',
                             'RAIDEV_NDREG_LAZYMEM',
                             'ABA_SYMBOLIC_GENERALCOLLAPSE',
                             'ABA_SYMBOLIC_GENERAL_MAXCLIQUERANK',
                             'ABA_ADM_MINIMUMINCREASE',
                             'ABA_ADM_MINIMUMDECREASE',
                             'IPATH_NO_CPUAFFINITY',
                             'MALLOC_MMAP_THRESHOLD_',
                             'ABA_EXT_SIMOUTPUT',
    			 'SMA_WS',
    			 'SMA_PARENT',
    			 'SMA_PLATFORM',
                             'ABA_PRE_DECOMPOSITION')
    
    import driverUtils, os
    
    compile_cpp=['cl', '/c', '/nologo', '/W0', '/MD', 
                 '/TP', '/EHsc', '/DNDEBUG', '/DWIN32', '/DTP_IP', '/D_CONSOLE', 
                 '/DNTI', '/DFLT_LIC', '/DOL_DOC', '/D__LIB__', '/DHKS_NT',
                 '/DABQ_NTI_NET', '/DFAR=', '/D_WINDOWS', '/DABQ_WIN86_64', 
                 '/O1', '/I%I']
    
    compile_fortran=['ifort', '/c','/DABQ_WIN86_64',
                     '/iface:cref', '/recursive', '/Qauto-scalar', '/QxW', '/nologo',
                     '/heap-arrays:1', '/Od', '/include:%I', '/Qopenmp', '/F60000000', '/libs:dll', '-free']
    
    link_sl=['LINK', '/nologo', '/INCREMENTAL:NO', '/subsystem:console', '/machine:AMD64', '/NODEFAULTLIB:LIBC.LIB', '/NODEFAULTLIB:LIBCMT.LIB', 
             '/DEFAULTLIB:OLDNAMES.LIB', '/DEFAULTLIB:LIBIFCOREMD.LIB', '/DEFAULTLIB:LIBIFPORTMD', '/DEFAULTLIB:LIBMMD.LIB',
             '/DEFAULTLIB:MSVCRT.LIB', '/DEFAULTLIB:kernel32.lib', '/DEFAULTLIB:user32.lib', '/DEFAULTLIB:advapi32.lib', 
    		 '/FIXED:NO', '/dll', '/def:%E', '/out:%U', '%F', '%A', '%L', '%B', 'oldnames.lib', 'user32.lib', 'ws2_32.lib',
             'netapi32.lib', 'advapi32.lib', 'imslmkl_dll.lib']
    #, '&&', 'mt', '/manifest', '%U.manifest', '/outputresource:%U', '&&', 'del', '%U.manifest']
    
    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', '/DEFAULTLIB:LIBMMD.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']
    #, '&&', 'mt', '/manifest', '%J.manifest', '/outputresource:%J', '&&', 'del', '%J.manifest']
    
    # Link command to be used for MAKE w/o fortran compiler.
    # remove the pound signs in order to remove the comments and have the file take effect.
    #
    #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', '&&', 'mt', '/manifest', '%J.manifest', '/outputresource:%J', '&&', 'del', '%J.manifest']
    
    # MPI Configuration
    mp_mode = THREADS
    
    mp_mpi_implementation = NATIVE
    mp_rsh_command = 'dummy %H -l %U -n %C'
    mp_mpirun_path = {}
    mpirun = ''
    progDir = os.environ.get('ProgramFiles','C:\\Program Files')
    
    for mpiDir in ('Microsoft HPC Pack', 'Microsoft HPC Pack 2008 R2', 'Microsoft HPC Pack 2008', 'Microsoft HPC Pack 2008 SDK'):
        mpirun = progDir + os.sep +  mpiDir + os.sep + 'bin' + os.sep + 'mpiexec.exe'
        if os.path.exists(mpirun):
           mp_mpirun_path[NATIVE] = mpirun
           break
    
    if os.environ.has_key('CCP_HOME'): 
       from queueCCS import QueueCCS           
       queues['default'] = QueueCCS(queueName='share')
       queues['share'] = QueueCCS(queueName='share')
       queues['local'] = QueueCCS(queueName='local')
       queues['genxmlshare'] = QueueCCS(queueName='genxmlshare')
       queues['genxmllocal'] = QueueCCS(queueName='genxmllocal') 
       del QueueCCS
       mpirun = os.path.join(os.environ['CCP_HOME'], 'bin', 'mpiexec.exe')
       if os.path.exists(mpirun):
           mp_mpirun_path[NATIVE] = mpirun
           run_mode=BATCH
    
    if mp_mpirun_path:
        mp_mode=MPI
    
    del progDir, mpiDir, mpirun
    
    graphicsEnv = driverUtils.locateFile(os.environ['ABA_PATH'],'site','graphicsConfig','env')
    if graphicsEnv:
        execfile(graphicsEnv)
    else:
        raise 'Cannot find the graphics configuration environment file (graphicsConfig.env)'
    
    del driverUtils, os, graphicsEnv
    license_server_type=FLEXNET
    
    abaquslm_license_file="27000@localhost"
    This is how my subroutine starts. I have used the FORTRAN USE statements for umach_int, ivpag_int and linear_operators. I have also INCLUDEd 'link_fnl_shared.h'

    Code:
          subroutine umat(stress,statev,ddsdde,sse,spd,scd,
         1 rpl,ddsddt,drplde,drpldt,
         2 stran,dstran,time,dtime,temp,dtemp,predef,dpred,cmname,
         3 ndi,nshr,ntens,nstatv,props,nprops,coords,drot,pnewdt,
         4 celent,dfgrd0,dfgrd1,noel,npt,layer,kspt,kstep,kinc)
    c
          use ivpag_int
          use umach_int
    c     use imsl_libraries
          use linear_operators
          include 'aba_param.inc'
          include 'link_fnl_shared.h'
    c
          character*80 cmname
          dimension stress(ntens),statev(nstatv),
         1ddsdde(ntens,ntens),ddsddt(ntens),drplde(ntens),
         2stran(ntens),dstran(ntens),time(2),predef(1),dpred(1),
         3props(nprops),coords(3),drot(3,3),dfgrd0(3,3),dfgrd1(3,3)
    c
    This is the function calls to UMACH and IVPAG

    Code:
    call ivpag (ido, fcn, fcnj, t, tend, y, tol=tol, param=param)
    Code:
    call umach (2, nout)
    Could someone help me sort out the linking of IMSL routines with Abaqus? What am I doing worng?

    - Feby

  2. #2
    Senior Member mecej4's Avatar
    Join Date
    Dec 2009
    Posts
    128
    When you use the /iface:cref option with the Intel Fortran compiler, external names are lower-cased. That is the reason why the link step failed -- the IMSL library has UMACH and S_IVPAG rather than umach and s_ivpag.

    I am not an Abaqus user, and I have nothing more to say regarding why you have /iface:cref in your Abaqus environment file.

  3. #3
    Junior Member
    Join Date
    Oct 2016
    Location
    Chennai, India
    Posts
    5
    Thank you for that bit of info. Digging around the ifort documentation I found a workaround. Abaqus uses the lowercase subroutine names. So I have added a compile option /names:as_is (while using /iface:cref) and have used uppercase UMACH and DIVPAG. I believe this should call the IMSL functions properly.

    However I still receive the following errors:
    Code:
    error LNK2019: unresolved external symbol UMACH referenced in function umat
    error LNK2019: unresolved external symbol DIVPAG referenced in function umat
    Any pointers on how to properly link the IMSL libraries with Abaqus/CAE?

  4. #4
    Junior Member
    Join Date
    Feb 2009
    Location
    Houston, TX
    Posts
    29
    Quote Originally Posted by feby.iitm View Post
    Thank you for that bit of info. Digging around the ifort documentation I found a workaround. Abaqus uses the lowercase subroutine names. So I have added a compile option /names:as_is (while using /iface:cref) and have used uppercase UMACH and DIVPAG. I believe this should call the IMSL functions properly.

    However I still receive the following errors:
    Code:
    error LNK2019: unresolved external symbol UMACH referenced in function umat
    error LNK2019: unresolved external symbol DIVPAG referenced in function umat
    Any pointers on how to properly link the IMSL libraries with Abaqus/CAE?
    These errors indicate you are missing libraries. You need to ensure the compiler can find .mod files and all of the required IMSL libraries. Verify the bitness of the application you are building matches the IMSL binaries. If you are building 32-bit application, you need to link to 32-bit binaries.

    IMSL Fortran provides an environment setup script, fnlsetup.bat in the bin directory. This will setup the needed compiler and environment variables you need when building with IMSL. If you do not wish to use these environment variables, you should check these variables to ensure you are linking in all of the required libraries. I recommend building a simple IMSL example first before attempting to build with additional libraries. In the examples directory you fill find a validate directory with a readme and sample code to build. The getting started guide will also walk you through building one of the examples from the documentation.

    If you are building in Visual Studio, make sure the libraries and Mod files are in the your project path. See the Getting Started guide for guidance.
    Jennifer Locke
    Product Manager, IMSL, Views, JViews, Elixir and Stingray
    P: 713.954.6454

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •