-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add a meson build system #141
Conversation
Excellent many thanks, I think initially we just need to set in
although I would like to find a better way to detect METIS5 64bit index types (see #136). Can we autodetect the METIS header with meson and check |
We are already autodetecting the METIS header for libmetis_name = get_option('libmetis')
libmetis_path = get_option('libmetis_path')
libmetis_include = include_directories(get_option('libmetis_include'))
libmetis_version = get_option('libmetis_version')
# C and Fortran compilers
cc = meson.get_compiler('c')
fc = meson.get_compiler('fortran')
# Dependencies
libmetis = fc.find_library(libmetis_name, dirs : libmetis_path, required : false)
has_metish = cc.has_header('metis.h', include_directories : libmetis_include) We can probably check the content of
or
In the same time, we can also check if we have METIS 4 or METIS 5 with |
@jfowkes
|
17a1446
to
b267b7b
Compare
It's finally working! 🎉 🎉 🎉 Update: The logs for Windows: https://github.com/ralna/spral/suites/16773345740/artifacts/957859756 Test failure at ../tests/ssids/kernels/block_ldlt.cxx:221
ASSERT_EQ(rloc1, rloc2) failed
[(test_maxloc_torture<double, 128>(10000))[fail]] |
@amontoison excellent many thanks! We are able to reproduce #144 from @bharswami so I will now file that as a bug. Would be nice to fix this before merging the meson build system. |
@amontoison in answer to your comments:
|
A header file hwloc.h is missing if I try to compile on Mac and Windows. I compiled without hwloc just to check for other errors.
Great!
Ok, I will try to compile SPRAL on FreeBSD and Apple M1.
Ok I will add it today.
How
Let's open an issue about that and update SSMFE in another PR. |
You just need to point Meson to the directory with
It includes AC_TRY_LINK([#include <sched.h>], [sched_getcpu();], More details here: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html |
@jfowkes
I checked what we should not compile if we want to add an option I just need to add the |
@amontoison I see errors like this when using 64bit integers but METIS5 is built with 32bit integer support and vice versa. Is the FreeBSD METIS 64bit integer? Or is Meson not correctly detecting the METIS headers and the
Okay let's skip an SSIDS only build for now, seems like it's not worth it atm.
Great stuff! |
Oh, I throught that I propose to replace the line https://github.com/ralna/spral/blob/master/src/metis5_wrapper.F90#L23 with |
Yeah sure, that seems sensible to me. Why wasn't this done in the first place? We should also add some tests where we test against 64bit integer METIS so we know it woks? |
@amontoison also you will have to add CBLAS support for Meson, some of the SSMFE C examples require CBLAS functions for various matrix modification routines, eg: for(int i=0; i<rci.nx; i++) {
if( rci.kx == rci.ky ) {
double s = cblas_dnrm2(n, &W[rci.kx][rci.jx+i][0], 1);
if( s > 0 )
cblas_dscal(n, 1/s, &W[rci.kx][rci.jx+i][0], 1);
} else {
double s = sqrt(fabs(cblas_ddot(
n, &W[rci.kx][rci.jx+i][0], 1, &W[rci.ky][rci.jy+i][0], 1)
));
if ( s > 0 ) {
cblas_dscal(n, 1/s, &W[rci.kx][rci.jx+i][0], 1);
cblas_dscal(n, 1/s, &W[rci.ky][rci.jy+i][0], 1);
} else {
for(int j=0; j<n; j++)
W[rci.ky][rci.jy+i][j] = 0.0;
}
}
} |
Do you mean a specific library for cblas? |
Sorry I meant to ensure it detects the CBLAS header |
I don't know, it seems obvious to check
I added some tests with 64 bits integer METIS and it's not working. |
@jfowkes |
Indeed, I pushed the fix. |
Okay no let's not do that... |
@jfowkes |
@amontoison ah of course 🤦 Many thanks for your work on this! I guess this is ready for review then? |
Yes, It's ready now. |
Great I'll add some documentation and merge it in! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 🚀 🚀
close #129
I did the Meson build system tonight.
During the compilation I have an error because we need an header
config.h
that isgenerated from configure.ac by autoheader.
We need to solve #135.
The Meson build system will also help to solve conda-forge/spral-feedstock#2.