Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29163 Discussions

Unable to run BLAS and LAPACK examples

Feng__Jesse
New Contributor II
1,079 Views

I just learned that Intel has LAPACK installed in the oneAPI base toolkit but when testing the example codes such as https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-fortran/2024-2/blas-code-examples.html and https://www.intel.com/content/www/us/en/docs/onemkl/code-samples-lapack/2024-1/cgesv-example-fortran.html I am unable to compile. I get the following errors:

 

Severity Code Description Project File Line Suppression State
Error error LNK2019: unresolved external symbol SDOT referenced in function SDOT.void Test.obj

 

Severity Code Description Project File Line Suppression State
Error error LNK2019: unresolved external symbol CGESV referenced in function CGESV.t272p.t273p.t274p.t275p.t276p.t277p.t278p.t279p Test.obj

 

I simply created a main program code Fortran project and pasted the example codes in and saved the source code as test.for.

 

I double checked the installation and confirmed that I used default which did install the Intel MKL when I installed base and HPC toolkits. How do I properly link these libraries? I tried to read the documentation for Intel MKL and I failed to find the page that gave instructions on linking the libraries, if anyone can point me to the page that would also work. Thanks!

0 Kudos
1 Solution
andrew_4619
Honored Contributor III
1,031 Views

You need to tell the project you are using mkl:

 

andrew_4619_0-1719996978062.png

 

View solution in original post

0 Kudos
3 Replies
andrew_4619
Honored Contributor III
1,032 Views

You need to tell the project you are using mkl:

 

andrew_4619_0-1719996978062.png

 

0 Kudos
Feng__Jesse
New Contributor II
1,000 Views

Thanks, Andrew. Is dgeqrf the QR decomposition subroutine? More importantly, the ?geqrf page says the subroutines return "elementary reflectors for Q", does that mean it uses the householder reflection implementation? I currently have a custom-implemented QR decomposition using the Gram-Schmidt approach but it can become unstable while the householder approach should be much better.

0 Kudos
andrew_4619
Honored Contributor III
997 Views

My knowledge of mkl routines is pretty minimal, there are some on here that have in depth knowledge but there is also an mkl forum.

0 Kudos
Reply