Skip to content

Files

Latest commit

5a063d4 · Mar 27, 2025

History

History
73 lines (57 loc) · 3.83 KB

README.md

File metadata and controls

73 lines (57 loc) · 3.83 KB

hello-sparse-blas

Demonstrate sparse matrix-vector multiplication with Intel MKL. Also has various cmake structural components that are intended to be for generic projects.

Can easily use pFUnit or test-drive for unit testing.

Make sure you have the Intel oneAPI HPC Toolkit or Intel Fortran Essentials.

Then, you can configure, build, and run tests for the project.

# test-drive builds faster than pfunit
./config/intel_ubuntu_test_drive_fftpack_spblas

Alternatively, if on a system where you need to specify a different MKL library you can do this with the flags during configuration. The below bash script does the necessary configuration, as an example, for DKRZ's Levante.

./config/intel_levante_pfunit

You can build the documentation separately with

cmake --build build --target doxygen_docs 

See Documenting Fotran with Doxygen for some more details.

You can also check to see if a downstream project can find/fetch this package.

(
cd build 
make install
cd ..
cd test/downstream_project/ 
./config/local # uses local installation from make install to run hello world with repo lib
./config/fetch # fetchcontent this repo to run hello world with repo lib
)

On Writing CMakeLists for Fortran

In the **/CMakeLists.txt, the packages fortran-lang/stdlib, libfortran-support, fftpack, test-drive, libiconmath, and dynamics were used as inspiration for the cmake commands needed for building a portable Fortran project. Comments explicitly state # ... (from <libname>) to indicate projects inspired part of or the entire cmake command. These projects were used as inspiration due to their (a) wide-spread use and/or (b) credibility from expert authorship.

References