Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

PROGRAM EXAMPLE DOES NOT BUILD

WSinc
New Contributor I
544 Views

I copied the code from your library reference, vsl routines. in the documentation.

The example they give should run as a standalone program, correct ?

I put the include file along with it, but I get several entry points it cannot find.

so the build fails.

see attached file. This should be the same as your documentation example.

0 Kudos
15 Replies
WSinc
New Contributor I
544 Views

  

0 Kudos
Gennady_F_Intel
Moderator
544 Views

At the first glance everthing is ok with this test. Please try the simpliest way to build: ifort -mkl vsl.f90 

0 Kudos
mecej4
Honored Contributor III
543 Views

If you are building inside Visual Studio, you have to set the Visual Studio project properties properly to make the linker use the MKL libraries. See https://software.intel.com/en-us/mkl-windows-developer-guide-configuring-intel-visual-fortran-to-link-with-intel-mkl . For short and simple programs, building at the command line with the /Qmkl option, as Gennady recommended, is simpler.

The default configuration of the compiler does not link with optional libraries, whether they be MKL or IMSL, NAG, TBB, IPP, etc. The user has to specify that additional libraries are to be used, if any are desired, and provide information regarding the locations of the library files.

0 Kudos
WSinc
New Contributor I
544 Views

Well, when I first installed it, it goes thru this real lengthy stuff

"integrating with VS 2015"

Notice that the code example I gave  has an include and two USE statements.

why wouldnt that be sufficient ?

Is there someone from INTEL that can guide me on this matter ?

I could try that "add libraries" but I am not sure what the name of this library would be,

that has the VST_MKL stuff in it. The buildlog is a type of file that cant be sent directly.

But heres what it says:

Deleting intermediate files and output files for project 'Console8', configuration 'Debug|Win32'. Compiling with Intel(R) Visual Fortran Compiler 19.0.0.117 [IA-32]... ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\visual studio 2015\Projects\Console8\ranseq.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\visual studio 2015\Projects\Console8\test_rn2.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\visual studio 2015\Projects\Console8\trand.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\visual studio 2015\Projects\Console8\factors.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\visual studio 2015\Projects\Console8\dima.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\Visual Studio 2010\Projects\linsol\matprt.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\Visual Studio 2010\Projects\linsol\utran.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\visual studio 2015\Projects\Console8\makelin.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\visual studio 2015\Projects\Console8\rswaps.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\visual studio 2015\Projects\Console8\matmpy.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\visual studio 2015\Projects\Console8\vsl.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\documents\Visual Studio 2010\Projects\linsol\usolve.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" /Qm32 "C:\Users\Administrator\3D Objects\lsolve.f90" Linking... Link /OUT:"Debug\Console8.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"mkl_intel_ilp64.lib" /LIBPATH:"mkl_intel_thread.lib" /LIBPATH:"mkl_core.lib" /LIBPATH:"libiomp5md.lib" /MANIFEST /MANIFESTFILE:"Debug\Console8.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\Administrator\documents\visual studio 2015\Projects\Console8\Console8\Debug\Console8.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"C:\Users\Administrator\documents\visual studio 2015\Projects\Console8\Console8\Debug\Console8.lib" -qm32 "Debug\ranseq.obj" "Debug\test_rn2.obj" "Debug\trand.obj" "Debug\factors.obj" "Debug\dima.obj" "Debug\matprt.obj" "Debug\utran.obj" "Debug\makelin.obj" "Debug\rswaps.obj" "Debug\matmpy.obj" "Debug\vsl.obj" "Debug\usolve.obj" "Debug\lsolve.obj" vsl.obj : error LNK2019: unresolved external symbol _VSLNEWSTREAM referenced in function _MAIN__ vsl.obj : error LNK2019: unresolved external symbol _VDRNGGAUSSIAN referenced in function _MAIN__ vsl.obj : error LNK2019: unresolved external symbol _VSLDELETESTREAM referenced in function _MAIN__ Debug\Console8.exe : fatal error LNK1120: 3 unresolved externals Console8 - 4 error(s), 0 warning(s)

------------------------------------------------------------------------------------------------------------------------------------------

Notice above the three links it cannot find, despite all the added libraries i put in.

0 Kudos
WSinc
New Contributor I
543 Views

Of course I could use THE IFORT line, but the problem really is about using attaching the proper MKL library from a more complicated program.

That requires the use of VS2015, hopefully.

0 Kudos
mecej4
Honored Contributor III
544 Views

The linker errors are the result of (i) your choosing inconsistent compiler options -- you specified /Qm32, which is appropriate if you wish to build a 32-bit object, but you seem to be inclined towards linking with 64 bit MKL libraries (e.g., mkl_intel_ilp64.lib), (ii) a misunderstanding about what /LIBPATH is intended for, and, perhaps as a consequence, (iii) failure to specify any MKL libraries to link with.

0 Kudos
Gennady_F_Intel
Moderator
544 Views

and also this article may help to properly build your case under VS IDE: https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-compiling-and-linking-with-microsoft-visual-cc#

0 Kudos
WSinc
New Contributor I
544 Views

That article is NOT ABOUT Fortran, its about C++.

There are not any similar options under FORTRAN.

Here are the LIBPATHS I have:

mkl_intel_ilp64.lib;

mkl_intel_thread.lib;

mkl_core.lib;

libiomp5md.lib

You can see that MKL is mentioned, the 64 bit version I installed.

actually it installs 32 bit versions also.

So, should we conclude that there is NO WAY to link to the MKL from Visual studio 2015 ?

(Using Fortran code)

Maybe an INTEL person would know how to do this ?

0 Kudos
Gennady_F_Intel
Moderator
544 Views

In the case if you use Fortran, then the only difference to use Fortran compiler option /4I8 

0 Kudos
Gennady_F_Intel
Moderator
544 Views

we can create the simplest VS2015 based Fortran solution with this vsl.f90 file and share with you if you need.

0 Kudos
WSinc
New Contributor I
544 Views

Sure, just one simple example that ACTUALLY WORKS would be appreciated.

But I would like to see what you put under "project properties."

 

I put what I thought was the proper LIBRARY adds, but that was not enough.

apparently that example they give with the include and USE statements is not enough.

Where would I put the "4I8" option you mentioned ?

I dont see anything about that anywhere.

I added it as an extra option, it  did not complain about it, but I still get the three

unknown entry points.

0 Kudos
Gennady_F_Intel
Moderator
544 Views

I developed for you the vs 2015 solution and attached to this thread. you may just change the include and an additional option patches accordingly your installation

0 Kudos
WSinc
New Contributor I
544 Views

I unzipped it, but then VS2015 cannot find the solution file/folder. do I have to move it somewhere before I unzip it ?

Otherwise, there is no way to run the program.

 

I CANNOT do anything with what you sent.

Send it to yourself, see what happens.

 

The file explorer sees it, does VS 2015 does not.

0 Kudos
WSinc
New Contributor I
544 Views

I finally had to say that TMP was the solution, then it ran.

But I had to insert a READ statement at the end so I could see the output before it exits.

0 Kudos
Gennady_F_Intel
Moderator
544 Views

thus we hope the problem with linking under VS IDE is resolved.

0 Kudos
Reply