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

how to compile and link a oneapi hello-world.cpp

lambda
Beginner
1,668 Views

Hello fellow developers and INTEL experts.

 

I'm having a lot of trouble to try and use INTEL onapi implementation of BLAS/PBLAS/BLACS/LAPACK/SCALAPACK and message passing routines.

 

First I installed oneapi base software for linux. After a lot of frustraded attempts to compile some code with icc, I found out that the intel classic compiler is not provided with the base package.

 

Tried to compile an example provided by the oneapi-cli and, as well, a lot of trouble to link and compile. No include and libs directives in the makefile.

 

I discovered that the environment of oneapi-base provided trhough docker images functions properly. I was able to build and run an oneapi-cli example.

 

Then I found out that one could use the package config tool to obtain cflags and libs option to compile programs. (? I dont understand why the cflags and lib directives are not present in the example that was pointed out as the primary test of oneapi package)

https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-hpc-linux/top/run-a-sample-project-using-the-command-line.html#run-a-sample-project-using-the-command-line

 

All I need for now is to find a way to code and build a C application that could use the parallel capabilities of the scalapack routines to solve generalized nonsymmetric eigenproblems.

 

Thing that will help me:

-A howto about building oneapi-cli examples (the make file provided is not working)

-Some additional configuration steps to setup a working oneapi environment (I already use the setvars.sh script and source it once every oneapi session!)

-An example code of scalapack routine usage with compile, link and running directions.

 

Thank you very much for any help or encouraging words! (right now oneapi seems a great tool but I'm scared of it)

 

 

PS. I'm also trying to use INTEL's devcloud infrastrcture to follow some learning material. But so far I'm not able to authenticate myself in the devcloud. For that I open another question in the support.

0 Kudos
1 Solution
VidyalathaB_Intel
Moderator
1,623 Views

Hi Leandro,

 

Thanks for reaching out to us.

 

>>I found out that the intel classic compiler is not provided with the base package.

 

Yes, you are right! The Intel classic compilers and MPI library come with oneAPI HPC Toolkit package. Since you already installed Base Toolkit we suggest you install oneAPI HPC toolkit also.

Please find the link below for downloading oneAPI HPC Toolkit

https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit-download.html

 

>>Tried to compile an example provided by the oneapi-cli and, as well, a lot of trouble to link and compile...A howto about building oneapi-cli examples

 

Could you please let us know what are the issues that you are facing when building sample programs (also which sample code you tried) from oneapi-cli so that it would help us better and assist you accordingly?

Here are the screenshots for the couple of examples that I have tested from oneapi-cli 

----Vector-add

VidyalathaB_Intel_0-1659009691374.png

----matrix multiplication using oneMKL GEMM operation

VidyalathaB_Intel_1-1659009710634.png

 

>>Some additional configuration steps to setup a working oneapi environment (I already use the setvars.sh script and source it once every oneapi session!)

 

Running the setvars.sh script file would suffice to initialize the oneAPI environment.

Please refer to the below link for more details 

https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html

 

>>An example code of scalapack routine usage with compile, link and running directions

 

To use oneMKL in your application you can always take help from link line advisor a tool which will help you to get the required libraries that are recommended for a particular use case

Please refer to the below link of the link line advisor

https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html?wapkw=link%20line%20advisor#gs.7n5gax

 

Also, you can refer to the mkl developer guide for Linux which has more details about linking and usage of oneMKL

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-linux-developer-guide/top/linking-your-application-with-onemkl.html

 

Here is a thread with a similar discussion regarding the issue that you are looking for (compiling, linking & running of a scalapack code) I hope it will give you a basic idea of what you are looking for

https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-OneAPI-MKL-Scalapack-call-gives-segmentation-fault/m-p/1377292#M33045

 

Hope it helps and please get back to us if you still have any issues.

 

Regards,

Vidya.

 

View solution in original post

0 Kudos
3 Replies
VidyalathaB_Intel
Moderator
1,624 Views

Hi Leandro,

 

Thanks for reaching out to us.

 

>>I found out that the intel classic compiler is not provided with the base package.

 

Yes, you are right! The Intel classic compilers and MPI library come with oneAPI HPC Toolkit package. Since you already installed Base Toolkit we suggest you install oneAPI HPC toolkit also.

Please find the link below for downloading oneAPI HPC Toolkit

https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit-download.html

 

>>Tried to compile an example provided by the oneapi-cli and, as well, a lot of trouble to link and compile...A howto about building oneapi-cli examples

 

Could you please let us know what are the issues that you are facing when building sample programs (also which sample code you tried) from oneapi-cli so that it would help us better and assist you accordingly?

Here are the screenshots for the couple of examples that I have tested from oneapi-cli 

----Vector-add

VidyalathaB_Intel_0-1659009691374.png

----matrix multiplication using oneMKL GEMM operation

VidyalathaB_Intel_1-1659009710634.png

 

>>Some additional configuration steps to setup a working oneapi environment (I already use the setvars.sh script and source it once every oneapi session!)

 

Running the setvars.sh script file would suffice to initialize the oneAPI environment.

Please refer to the below link for more details 

https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html

 

>>An example code of scalapack routine usage with compile, link and running directions

 

To use oneMKL in your application you can always take help from link line advisor a tool which will help you to get the required libraries that are recommended for a particular use case

Please refer to the below link of the link line advisor

https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html?wapkw=link%20line%20advisor#gs.7n5gax

 

Also, you can refer to the mkl developer guide for Linux which has more details about linking and usage of oneMKL

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-linux-developer-guide/top/linking-your-application-with-onemkl.html

 

Here is a thread with a similar discussion regarding the issue that you are looking for (compiling, linking & running of a scalapack code) I hope it will give you a basic idea of what you are looking for

https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-OneAPI-MKL-Scalapack-call-gives-segmentation-fault/m-p/1377292#M33045

 

Hope it helps and please get back to us if you still have any issues.

 

Regards,

Vidya.

 

0 Kudos
VidyalathaB_Intel
Moderator
1,566 Views

Hi @lambda ,

 

Reminder:

 

As we haven't heard back from you, could you please provide us with an update regarding the issue? Please do let us know if you need any other information apart from the one that we have provided in the previous post and you can get back to us if you face any issues.

 

Regards,

Vidya.

 

VidyalathaB_Intel
Moderator
1,550 Views

Hi Leondro,


Thanks for accepting our solution.

Please post a new question if you need any additional assistance from Intel as this thread will no longer be monitored.


Have a Nice Day!


Regards,

Vidya.


0 Kudos
Reply