Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imkl pkgconfig files don't work (but can be fixed!) #2700

Open
SimonPinches opened this issue Mar 24, 2022 · 2 comments
Open

imkl pkgconfig files don't work (but can be fixed!) #2700

SimonPinches opened this issue Mar 24, 2022 · 2 comments

Comments

@SimonPinches
Copy link

The pkgconfig/*.pc files created by the imkl module reference the $MKLROOT environment variable which is not usable within *.pc files. The solution I adopted was to add a line MKLROOT=${prefix} after the definition of includedir by doing:
sed -i '/^includedir=.*/a MKLROOT=${prefix}' /opt/EasyBuild/software/imkl/*/mkl/bin/pkgconfig/*

@ocaisa
Copy link
Member

ocaisa commented Apr 12, 2022

@bartoldeman I thought I remember seeing discussion on this but I can't find it now, is this resolved?

@ocaisa
Copy link
Member

ocaisa commented Apr 12, 2022

Ah, I found it https://easybuild.slack.com/archives/C34UA1HT7/p1648065346517729 . For completeness I copy the relevant parts of that discussion here


Looks like ${MKLROOT} should be $MKLROOT

cp /work/imas/opt/EasyBuild/software/imkl/2020.4.304-iompi-2020b/mkl/bin/pkgconfig/mkl-static-lp64-seq.pc test.pc
cp test.pc test2.pc; vim test2.pc # change ${MKLROOT} to $MKLROOT

(module load imkl > /dev/null 2>&1; diff test.pc test2.pc; export PKG_CONFIG_PATH=$(pwd); pkg-config test --libs; pkg-config test2 --libs)
26c26
< Libs: -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl
---
> Libs: -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_lp64.a $MKLROOT/lib/intel64/libmkl_sequential.a $MKLROOT/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl
28c28
< Cflags: -I${MKLROOT}/include
---
> Cflags: -I$MKLROOT/include
-Wl,--start-group /lib/intel64/libmkl_intel_lp64.a /lib/intel64/libmkl_sequential.a /lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl 
-Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_lp64.a $MKLROOT/lib/intel64/libmkl_sequential.a $MKLROOT/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl 

Are these .pc files coming directly from Intel, or are they made/patched by EB ?

they come directly from Intel
basically they can be patched by replacing MKLROOT by prefix (https://www.intel.com/content/www/us/en/developer/articles/technical/intel-math-kernel-library-intel-mkl-and-pkg-config-tool.html)
or you can set
PKG_CONFIG_MKL_STATIC_LP64_SEQ_MKLROOT=$MKLROOT

IntelIntel
[Intel® Math Kernel Library (Intel® MKL) and pkg-config tool](https://www.intel.com/content/www/us/en/developer/articles/technical/intel-math-kernel-library-intel-mkl-and-pkg-config-tool.html)
    The pkg-config tool[1] is a widely used tool that many users apply to their makefiles. Intel® Math Kernel Library (Intel® (5 kB)
https://www.intel.com/content/www/us/en/developer/articles/technical/intel-math-kernel-library-intel-mkl-and-pkg-config-tool.html[](https://www.intel.com/content/www/us/en/developer/articles/technical/intel-math-kernel-library-intel-mkl-and-pkg-config-tool.html)


it seems though that imkl 2021.4.0 (2021b toolchain) does it correctly. (edited) 

but the EB module for imkl 2021.4.0 doesn't set PKG_CONFIG_PATH since it moved again :disappointed:

https://github.com/easybuilders/easybuild-easyblocks/pull/2701 applies to 2021.4+

@boegel boegel modified the milestones: 4.9.2, release after 4.9.2 Jun 6, 2024
@boegel boegel modified the milestones: 4.9.3, release after 4.9.3 Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants