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

LAPACKE and CBLAS #60

Open
mohawk2 opened this issue Sep 24, 2024 · 10 comments
Open

LAPACKE and CBLAS #60

mohawk2 opened this issue Sep 24, 2024 · 10 comments

Comments

@mohawk2
Copy link
Contributor

mohawk2 commented Sep 24, 2024

Recent (and indeed for a while) LAPACKs have LAPACKE (the official C interface) and CBLAS (ditto) code routinely distributed. I see Strawberry PDL edition has BLAS and LAPACK DLLs, but it doesn't have the LAPACKE/CBLAS DLLs, nor the headers.

Are you open to adding such?

@shawnlaffan
Copy link
Contributor

We can look at adding them.

Can they enabled as part of the standard build or are they a separate build?

@mohawk2
Copy link
Contributor Author

mohawk2 commented Sep 25, 2024

As far as I can tell, very much standard build.

@shawnlaffan
Copy link
Contributor

They might need some extra flags. The lapack build and packing setups are below. There is nothing disabling lapacke.

FWIW, MSYS2 package lapacke separately. https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-lapack/PKGBUILD

build-extlibs/build.sh

Lines 1210 to 1222 in d22291c

# ----------------------------------------------------------------------------
lapack-*)
cd $WRKDIR/$PACK
mkdir MY_BUILD
cd MY_BUILD
xxrun cmake -G 'MSYS Makefiles' -DCMAKE_INSTALL_PREFIX=$OUT -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_DEPRECATED=ON ..
xxrun make
xxrun make install
###hack needed for static build
sed -i 's,-lblas,-lblas -lgfortran -lquadmath,' $OUT/lib/pkgconfig/blas.pc
sed -i 's,-llapack,-llapack -lblas -lgfortran -lquadmath,' $OUT/lib/pkgconfig/lapack.pc
;;

build-extlibs/pack.pl

Lines 854 to 868 in d22291c

'lapack-' => {
'files' => [],
'trees' => [
['bin', 'c\bin', '-config(\.bat)?$'],
['bin', 'c\bin', '\.dll$'],
['lib', 'c\lib', '\.a$'],
['lib\pkgconfig', 'c\lib\pkgconfig', '\.pc$'],
['include', 'c\include', '\.h$'],
],
'licenses' => ['LICENSE'],
'licdir' => 'licenses\liblapack',
'urls' => [
['Homepage', 'http://www.netlib.org/lapack/'],
],
},

@shawnlaffan
Copy link
Contributor

@mohawk2
Copy link
Contributor Author

mohawk2 commented Sep 25, 2024

Ah, my mistake! And there's also the matter of the headers, which I don't think we're getting yet.

@shawnlaffan
Copy link
Contributor

It's easy enough to add -DLAPACKE=ON to the cmake call. The libs and headers will be picked up once built.

Will give it a go when I next run an extlibs update.

@mohawk2
Copy link
Contributor Author

mohawk2 commented Sep 25, 2024

Great! By the way, here's a real stretch ask: what do you think of including OpenCL, along the lines of https://github.com/KhronosGroup/OpenCL-Guide/blob/main/chapters/getting_started_windows.md ? I'm having a go at it with MinGW and my place-with-space, which is blowing up cmake.

@shawnlaffan
Copy link
Contributor

If there is a clear need then we can consider other packages, especially if they come via PRs. If they are a huge amount of effort then it comes down to available time.

@mohawk2
Copy link
Contributor Author

mohawk2 commented Sep 25, 2024

Fair enough, obviously! If I were confident enough that I could get a dev environment going for this specific system, I'd have a go myself. Or even if there were CI.

@shawnlaffan
Copy link
Contributor

Do you mean the Strawberry Perl build system? It is set up to use docker - https://github.com/StrawberryPerl/spbuild

And FWIW, MSYS2 is usually a good source of patches and build steps.
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-opencl-headers/PKGBUILD

It won't fix paths with spaces, but can the build system be set up to work in a dir without spaces?

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