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

Adept with Intel MKL Blas/Lapack #26

Open
Leersmaekers opened this issue Apr 15, 2023 · 7 comments
Open

Adept with Intel MKL Blas/Lapack #26

Leersmaekers opened this issue Apr 15, 2023 · 7 comments

Comments

@Leersmaekers
Copy link

Leersmaekers commented Apr 15, 2023

Is there a way to link Adept with Intel MKL Blas and Lapack? I'm now using ./configure from msys64 on a Windows PC.

I now got the following lines at the and of ./configure:

configure: ********************* Libraries used by Adept **********************
configure: BLAS (Basic Linear Algebra Subprograms) will not be used: MATRIX MULTIPLICATION IS UNAVAILABLE
configure: LAPACK (Linear Algebra Package) will not be used: LINEAR ALGEBRA ROUTINES ARE UNAVAILABLE

Thanks in advance,
Laurent

@rjhogan
Copy link
Owner

rjhogan commented Apr 15, 2023

I don't compile things on windows myself so I'm not precisely sure. Following the info here: https://hpc.ncsu.edu/Software/Libraries.php?app=MKL, if you are using the Intel compiler you could try this:

./configure "LDFLAGS=-mkl"

If you are using the GNU compiler then you probably need this:

./configure "LDFLAGS=-lmkl_gf_lp64 -lmkl_core -lmkl_gnu_thread"

but this will assume that the MKL libraries are in the default location for DLLs. If they're somewhere else you'd need to specify the location maybe with a "-L" at the beginning of the LDFLAGS list.

If you're using the Microsoft compiler then the format of the compiler options is different and I don't know the syntax. But hopefully you can work it out.
Robin.

@Leersmaekers
Copy link
Author

I don't compile things on windows myself so I'm not precisely sure. Following the info here: https://hpc.ncsu.edu/Software/Libraries.php?app=MKL, if you are using the Intel compiler you could try this:

./configure "LDFLAGS=-mkl"

If you are using the GNU compiler then you probably need this:

./configure "LDFLAGS=-lmkl_gf_lp64 -lmkl_core -lmkl_gnu_thread"

but this will assume that the MKL libraries are in the default location for DLLs. If they're somewhere else you'd need to specify the location maybe with a "-L" at the beginning of the LDFLAGS list.

If you're using the Microsoft compiler then the format of the compiler options is different and I don't know the syntax. But hopefully you can work it out. Robin.

I have tried ./configure LDFLAGS="-mkl", with the same result I described above.

According to the Intel link advisor, I need the following line:
./configure LDFLAGS="-L${MKLROOT}/lib/intel64 -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl"

This unfortunately also leads to the same result.

Are the following lines suggesting the MKL library is not found, or is it just stating it can't find sgemm?

checking for sgemm_ in -lmkl_intel_lp64... no
checking for sgemm_ in -lmkl... no

@rjhogan
Copy link
Owner

rjhogan commented Apr 15, 2023

I think that means that it finds the library but not sgemm. Can you look in ${MKLROOT}/lib/intel64 and see if there is a dll with "bias" in the name? Then add the appropriate -l argument.

@Leersmaekers
Copy link
Author

There is indeed a lib file containing blas: mkl_blas95_ilp64.lib. Adding this file doesn't change the final outcome. The total call now is:

./configure LDFLAGS="-L${MKLROOT}/lib/intel64 -lmkl_intel_ilp64 -lmkl_blas95_ilp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl"

@rjhogan
Copy link
Owner

rjhogan commented Apr 15, 2023

I'm afraid I don' know then. You might find some clues looking in the config.log file after ./configure is run.

@Leersmaekers
Copy link
Author

I've read in a document that using "#include adept_source.h" is easier on e.g. Windows. I've followed this approach and ran the test_no_lib.cpp file without any issues. Now I'm wondering if there are any limitations using adept this way. The reasoning behind my concern is the fact it didn't need to link to blas and lapack.

@rjhogan
Copy link
Owner

rjhogan commented Apr 16, 2023

This is a separate thing - it just makes compilation a bit easier. Both compilation methods can be used with or without blas and lapack. Do you need to be able to do matrix multiplication or solving systems of linear equations? If not, you don't need blas or lapack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants