Unresolved externals with intrinsic Fortran functions

Unresolved externals with intrinsic Fortran functions

I've recently changed the core mathematical libraries we use from the Netlib versions of BLAS and LAPACK to the MKL versions. This has been going fine until I tried to link a Fortran binary to these libraries. During the linking there are a whole load of unresolved externals that relate to mathematical intrinsic Fortran functions such as SIN, COS and EXP. I don't understand how this should be related to the change of BLAS and LAPACK libraries.

The list of errors is:

Error    46     error LNK2001: unresolved external symbol _sinf    aero F.lib(adatin.obj)    
Error    15     error LNK2019: unresolved external symbol _powf referenced in function _L_ADATPUT_CIRCULATIONCONTROL    aero F.lib(adatput.obj)    
Error    10     error LNK2001: unresolved external symbol _powf    aero F.lib(aerofl.obj)    
Error    23     error LNK2001: unresolved external symbol _sinf    aero F.lib(aerofl.obj)    
Error    5     error LNK2001: unresolved external symbol ___powr4i4    aero F.lib(aeroit.obj)    
Error    28     error LNK2001: unresolved external symbol _sinf    aero F.lib(aeroit.obj)    
Error    54     error LNK2001: unresolved external symbol _tanf    aero F.lib(aeroit.obj)    
Error    3     error LNK2019: unresolved external symbol ___powr4i4 referenced in function _CALC_I    aero F.lib(calc_I.obj)    
Error    22     error LNK2001: unresolved external symbol _sinf    aero F.lib(dystal.obj)    
Error    58     error LNK2001: unresolved external symbol _expf    aero F.lib(dystal.obj)    
Error    25     error LNK2001: unresolved external symbol _sinf    aero F.lib(findf.obj)    
Error    24     error LNK2001: unresolved external symbol _sinf    aero F.lib(foilcon.obj)    
Error    9     error LNK2001: unresolved external symbol _powf    aero F.lib(forpul.obj)    
Error    29     error LNK2001: unresolved external symbol _sinf    aero F.lib(forpul.obj)    
Error    59     error LNK2001: unresolved external symbol _expf    aero F.lib(prantl.obj)    
Error    76     error LNK2019: unresolved external symbol _acosf referenced in function _PRANTL    aero F.lib(prantl.obj)    
Error    27     error LNK2001: unresolved external symbol _sinf    aero F.lib(tipsr.obj)    
Error    51     error LNK2001: unresolved external symbol _tanf    aero F.lib(vortind.obj)    
Error    57     error LNK2001: unresolved external symbol _expf    control F.lib(brake.obj)    
Error    8     error LNK2001: unresolved external symbol _powf    control F.lib(YawActuator.obj)    
Error    26     error LNK2001: unresolved external symbol _sinf    control F.lib(YawActuator.obj)    
Error    2     error LNK2001: unresolved external symbol _log10f    dcon F.lib(todiscon.obj)    
Error    79     fatal error LNK1120: 14 unresolved externals    C:\Alpha\Bladed\Main\Source\Output/x86/Debug\dtbladed.exe    
Error    55     error LNK2019: unresolved external symbol _f_pow2i referenced in function _L_EOM_GEN_BRAKE_STATUS    dyn_sim F.lib(eom_gen_functions.obj)    
Error    39     error LNK2001: unresolved external symbol _sinf    gener F.lib(gener.obj)    
Error    52     error LNK2001: unresolved external symbol _tanf    gener F.lib(gmod2_in.obj)    
Error    18     error LNK2001: unresolved external symbol _powf    gener F.lib(GMOD4.obj)    
Error    17     error LNK2001: unresolved external symbol _powf    gener F.lib(gmod4_in.obj)    
Error    40     error LNK2001: unresolved external symbol _sinf    gener F.lib(vsgrid.obj)    
Error    73     error LNK2001: unresolved external symbol ___powr8i4    general F.lib(dqnc79.obj)    
Error    1     error LNK2019: unresolved external symbol _log10f referenced in function _WRITEENCRYPTIONGROUPS    ghcom F.lib(crypt_in.obj)    
Error    49     error LNK2001: unresolved external symbol _sinf    multibody F.lib(ActiveDampers.obj)    
Error    42     error LNK2001: unresolved external symbol _sinf    multibody F.lib(AppliedLoads.obj)    
Error    38     error LNK2001: unresolved external symbol _sinf    multibody F.lib(BladeOutput.obj)    
Error    47     error LNK2001: unresolved external symbol _sinf    multibody F.lib(ConvertBladeToMB.obj)    
Error    45     error LNK2001: unresolved external symbol _sinf    multibody F.lib(LoadsForDiscon.obj)    
Error    43     error LNK2001: unresolved external symbol _sinf    multibody F.lib(MultibodyOutput.obj)    
Error    48     error LNK2001: unresolved external symbol _sinf    multibody F.lib(MultibodySetup.obj)    
Error    44     error LNK2001: unresolved external symbol _sinf    multibody F.lib(UpdateMultibodyArrays.obj)    
Error    19     error LNK2001: unresolved external symbol _sinf    rotor F.lib(f_ptc.obj)    
Error    50     error LNK2019: unresolved external symbol _tanf referenced in function _F_PTC    rotor F.lib(f_ptc.obj)    
Error    77     error LNK2001: unresolved external symbol _acosf    rotor F.lib(f_ptc.obj)    
Error    20     error LNK2001: unresolved external symbol _sinf    rotor F.lib(pointpos.obj)    
Error    6     error LNK2001: unresolved external symbol _powf    rotor F.lib(teetrs.obj)    
Error    60     error LNK2001: unresolved external symbol _expf    rotor F.lib(teetrs.obj)    
Error    16     error LNK2001: unresolved external symbol _powf    rotor F.lib(tmod2_in.obj)    
Error    74     error LNK2019: unresolved external symbol ___libm_sse2_sincosf referenced in function _TAILVANE    struct F.lib(tailvane.obj)    
Error    75     error LNK2019: unresolved external symbol ___libm_sse2_atan2f referenced in function _TAILVANE    struct F.lib(tailvane.obj)    
Error    41     error LNK2019: unresolved external symbol _sinf referenced in function _TGEOMIN    tower F.lib(tgeomin.obj)    
Error    21     error LNK2001: unresolved external symbol _sinf    tower F.lib(TowShadow.obj)    
Error    78     error LNK2019: unresolved external symbol _asinf referenced in function _TOWSHADOW    tower F.lib(TowShadow.obj)    
Error    70     error LNK2001: unresolved external symbol _tanhf    waves F.lib(calc_k.obj)    
Error    71     error LNK2001: unresolved external symbol _tanhf    waves F.lib(calcfcut.obj)    
Error    68     error LNK2001: unresolved external symbol _expf    waves F.lib(chaplin.obj)    
Error    72     error LNK2019: unresolved external symbol ___powr8i4 referenced in function _GETQ    waves F.lib(chaplin.obj)    
Error    35     error LNK2001: unresolved external symbol _sinf    waves F.lib(curr_put.obj)    
Error    11     error LNK2001: unresolved external symbol _powf    waves F.lib(currents.obj)    
Error    36     error LNK2001: unresolved external symbol _sinf    waves F.lib(currents.obj)    
Error    66     error LNK2001: unresolved external symbol _expf    waves F.lib(currents.obj)    
Error    53     error LNK2001: unresolved external symbol _tanf    waves F.lib(Currntin.obj)    
Error    12     error LNK2001: unresolved external symbol _powf    waves F.lib(jonswap.obj)    
Error    67     error LNK2001: unresolved external symbol _expf    waves F.lib(jonswap.obj)    
Error    30     error LNK2001: unresolved external symbol _sinf    waves F.lib(reg_airy.obj)    
Error    61     error LNK2001: unresolved external symbol _expf    waves F.lib(reg_airy.obj)    
Error    37     error LNK2001: unresolved external symbol _sinf    waves F.lib(seastate_xyz.obj)    
Error    4     error LNK2001: unresolved external symbol ___powr4i4    waves F.lib(wave_put.obj)    
Error    34     error LNK2001: unresolved external symbol _sinf    waves F.lib(wave_put.obj)    
Error    56     error LNK2019: unresolved external symbol _sinhf referenced in function _WAVE_PUT    waves F.lib(wave_put.obj)    
Error    65     error LNK2019: unresolved external symbol _expf referenced in function _WAVE_PUT    waves F.lib(wave_put.obj)    
Error    69     error LNK2019: unresolved external symbol _tanhf referenced in function _WAVE_PUT    waves F.lib(wave_put.obj)    
Error    33     error LNK2001: unresolved external symbol _sinf    wind F.lib(havsine.obj)    
Error    13     error LNK2001: unresolved external symbol _powf    wind F.lib(mevwake.obj)    
Error    63     error LNK2001: unresolved external symbol _expf    wind F.lib(mevwake.obj)    
Error    14     error LNK2001: unresolved external symbol _powf    wind F.lib(SpectralWind.obj)    
Error    32     error LNK2001: unresolved external symbol _sinf    wind F.lib(SpectralWind.obj)    
Error    64     error LNK2001: unresolved external symbol _expf    wind F.lib(SpectralWind.obj)    
Error    62     error LNK2001: unresolved external symbol _expf    wind F.lib(windp.obj)    
Error    31     error LNK2001: unresolved external symbol _sinf    wind F.lib(windsel.obj)    
Error    7     error LNK2001: unresolved external symbol _powf    wind F.lib(windv.obj)    

And the link command line is (I am compiling in debug):

/OUT:"C:\Alpha\Bladed\Main\Source\Output/x86/Debug\dtbladed.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:\Alpha\Bladed\Main\Source\Output\x86\Debug\\" /LIBPATH:"C:\Alpha\Bladed\Main\Source\\..\External\Intel Fortran 2013\mkl\ia32" /LIBPATH:"C:\Alpha\Bladed\Main\Source\\..\External\boost 1.55\lib\Debug" /LIBPATH:"C:\Alpha\Bladed\Main\Source\../External/GH/Dongle/Bladed/Lib/x86/Debug" /LIBPATH:"c:\dtExternal\OpenSSL\lib\VC12\x86\\" /LIBPATH:"c:\dtExternal\OpenSSL\lib\VC12\x86" /LIBPATH:"c:\dtExternal\Xerces\lib\VC12\x86\static" /LIBPATH:"c:\dtExternal\Xsec\lib\VC12\x86" /LIBPATH:"C:\Alpha\Bladed\Main\Source\../External/GH/Dongle/Bladed/Lib/x86/Debug" /NODEFAULTLIB:"LIBCMTD" /NODEFAULTLIB:"LIBMMDD" /MANIFEST /MANIFESTFILE:"C:\Alpha\Bladed\Main\Source\Output/x86/Debug\dtbladed.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Alpha\Bladed\Main\Source\Output/x86/Debug\dtbladed.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\Alpha\Bladed\Main\Source\Output/x86/Debug\dtbladed.lib" libifcoremd.lib GH.Wolverine.Native.Services.lib kernel32.lib user32.lib gdi32.lib advapi32.lib Version.lib shell32.lib GH.Common.HASP.API.C.55600.lib libeay32d.lib ssleay32d.lib xerces-c_3d.lib xsec_1_6d.lib mkl_core.lib mkl_intel_c.lib mkl_sequential.lib mkl_blas95.lib /NODEFAULTLIB:msvcrt.lib /verbose:lib

Thanks in advance

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Your problem doesn't appear to be related to blas and lapack.  I'm not doing well at guessing the missing parts of your link command quotation (is it so big that parts are being dropped, including which tool is performing the link?).  It does appear that your link doesn't refer to the basic math library.

Were your Fortran libraries built with a different compiler than you are using currently?  For example, it would be difficult to use MKL if you built libraries with a mingw Fortran.  If any Fortran compiler other than ifort or possibly CVF is involved, the question isn't topical here.

The link command line I stated came from a Visual studio Fortran project in Properties->Linker->Command Line. All the libraries stated are part of the same visual studio solution and they all use the Intel Fortran compiler.

I tried adding libm.lib to the linker input, but in this case there are multiply defined symbols as some definitions seem to clash with trigonometric functions in math.h called from C++ (this Fortran project links to both Intel Fortran and Visual C++ libraries). It's strange that it didn't need the basic math library before (maybe VS included it by default?) and now it does even though the only changes I've made are to replace the BLAS and LAPACK libraries. I should also mention that I'm using the cblas functions in the mkl libraries rather than the stdcall versions

Could you do a clean rebuild and post the build log (as an attachment) please?

      thank you --

                      --Lorri

Quote:

Lorri Menard (Intel) wrote:

Could you do a clean rebuild and post the build log (as an attachment) please?

      thank you --

                      --Lorri

I don't have authorisation to add attachments here so I've sent it in a message

I see that your posted link command line contains:   /NODEFAULTLIB:"LIBMMDD"

That seems like a good reason you wouldn't link the math library?

Note also that Intel supplies its own, optimized version of libm, and its own header file mathimf.h, that contains additional functionality compared to math.h, though that doesn't look like the issue here.

Leave a Comment

Please sign in to add a comment. Not a member? Join today