Skip to content

Commit 551a546

Browse files
Merge pull request DrTimothyAldenDavis#728 from DrTimothyAldenDavis/dev2
SuiteSparse 7.5.1
2 parents c992167 + 3b2647f commit 551a546

File tree

13 files changed

+340
-187
lines changed

13 files changed

+340
-187
lines changed

ChangeLog

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
Jan 12, 2024: version 7.5.1
2+
3+
* SuiteSparse_config: bug fix to SUITESPARSE__VERCODE macro.
4+
* Example 1.6.1: add tests for *__VERSION macros.
5+
16
Jan 10, 2024: version 7.5.0
27

3-
* Suitesparse_config: 7.5.0, to reflect the addition of GraphBLAS 9.0.0.
8+
* SuiteSparse_config: 7.5.0, to reflect the addition of GraphBLAS 9.0.0.
49
Minor updates to build system, including bug fixes when specifying a
510
specific BLAS/LAPACK library, and configuration of *.pc files.
611
* GraphBLAS 9.0.0: supporting the v2.1 C API;

Example/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ message ( STATUS "MY prefix path: ${CMAKE_PREFIX_PATH}" )
5353
#-------------------------------------------------------------------------------
5454

5555
# cmake inserts the date and version number into Include/my.h:
56-
set ( MY_DATE "Jan 10, 2024" )
56+
set ( MY_DATE "Jan 12, 2024" )
5757
set ( MY_VERSION_MAJOR 1 )
5858
set ( MY_VERSION_MINOR 6 )
59-
set ( MY_VERSION_PATCH 0 )
59+
set ( MY_VERSION_PATCH 1 )
6060

6161
message ( STATUS "Building MY library version: v"
6262
${MY_VERSION_MAJOR}.
@@ -87,7 +87,7 @@ project ( my
8787
#-------------------------------------------------------------------------------
8888

8989
# look for all SuiteSparse packages:
90-
find_package ( SuiteSparse_config 7.5.0 REQUIRED )
90+
find_package ( SuiteSparse_config 7.5.1 REQUIRED )
9191
find_package ( AMD 3.3.1 REQUIRED )
9292
find_package ( BTF 2.3.1 REQUIRED )
9393
find_package ( CAMD 3.3.1 REQUIRED )

Example/Config/my.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323
void my_version (int version [3], char date [128]) ;
2424
int my_function (void) ;
2525
int my_check_version (const char *package, int major, int minor, int patch,
26-
const char *date, int version [3]) ;
26+
const char *date, int version [3], long long unsigned int vercode) ;
2727

2828
#ifdef __cplusplus
2929
}

Example/Demo/mydemo.out

Lines changed: 132 additions & 97 deletions
Large diffs are not rendered by default.

Example/Include/my.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
// file, since it is constructed from Config/my.h.in by cmake.
1212

1313
// version and date for example user library
14-
#define MY_DATE "Jan 10, 2024"
14+
#define MY_DATE "Jan 12, 2024"
1515
#define MY_MAJOR_VERSION 1
1616
#define MY_MINOR_VERSION 6
17-
#define MY_PATCH_VERSION 0
17+
#define MY_PATCH_VERSION 1
1818

1919
#ifdef __cplusplus
2020
extern "C" {
@@ -23,7 +23,7 @@ extern "C" {
2323
void my_version (int version [3], char date [128]) ;
2424
int my_function (void) ;
2525
int my_check_version (const char *package, int major, int minor, int patch,
26-
const char *date, int version [3]) ;
26+
const char *date, int version [3], long long unsigned int vercode) ;
2727

2828
#ifdef __cplusplus
2929
}

Example/Include/my_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
// SuiteSparse include files for C/C++:
1616
#include "SuiteSparse_config.h"
17-
#if !defined (SUITESPARSE__VERSION) || SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,0)
18-
#error "This library requires SuiteSparse_config 7.5.0 or later"
17+
#if !defined (SUITESPARSE__VERSION) || SUITESPARSE__VERSION < SUITESPARSE__VERCODE(7,5,1)
18+
#error "This library requires SuiteSparse_config 7.5.1 or later"
1919
#endif
2020

2121
#include "amd.h"

Example/Source/my.c

Lines changed: 75 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void my_version (int version [3], char date [128])
4646
//------------------------------------------------------------------------------
4747

4848
int my_check_version (const char *package, int major, int minor, int patch,
49-
const char *date, int version [3])
49+
const char *date, int version [3], long long unsigned int vercode)
5050
{
5151
// version and date in package header file:
5252
printf ("\n------------------------------------------------------------"
@@ -60,9 +60,19 @@ int my_check_version (const char *package, int major, int minor, int patch,
6060
int ok = (major == version [0]) &&
6161
(minor == version [1]) &&
6262
(patch == version [2]) ;
63-
if (!ok) printf ("%s: version in header (%d.%d.%d) "
63+
if (!ok)
64+
{
65+
printf ("%s: version in header (%d.%d.%d) "
6466
"does not match library (%d.%d.%d)\n", package,
6567
major, minor, patch, version [0], version [1], version [2]) ;
68+
}
69+
printf ("%s version code: %llu\n", package, vercode) ;
70+
ok = ok && (vercode == SUITESPARSE__VERCODE (major, minor, patch)) ;
71+
if (!ok)
72+
{
73+
printf ("%s: version code mismatch: %llu %llu\n", package,
74+
vercode, SUITESPARSE__VERCODE (major, minor, patch)) ;
75+
}
6676
return (ok) ;
6777
}
6878

@@ -82,7 +92,9 @@ int my_function (void) // returns 0 on success, -1 on failure
8292
char my_date [128] ;
8393
my_version (version, my_date) ;
8494
OK (my_check_version ("MY", MY_MAJOR_VERSION, MY_MINOR_VERSION,
85-
MY_PATCH_VERSION, MY_DATE, version)) ;
95+
MY_PATCH_VERSION, MY_DATE, version,
96+
SUITESPARSE__VERCODE (MY_MAJOR_VERSION, MY_MINOR_VERSION,
97+
MY_PATCH_VERSION))) ;
8698
printf ("MY date: %s\n", my_date) ;
8799
OK (strcmp (my_date, MY_DATE) == 0) ;
88100

@@ -93,15 +105,16 @@ int my_function (void) // returns 0 on success, -1 on failure
93105
int v = SuiteSparse_version (version) ;
94106
OK (my_check_version ("SuiteSparse_config",
95107
SUITESPARSE_MAIN_VERSION, SUITESPARSE_SUB_VERSION,
96-
SUITESPARSE_SUBSUB_VERSION, SUITESPARSE_DATE, version)) ;
108+
SUITESPARSE_SUBSUB_VERSION, SUITESPARSE_DATE, version,
109+
SUITESPARSE__VERSION)) ;
97110

98111
//--------------------------------------------------------------------------
99112
// CXSparse
100113
//--------------------------------------------------------------------------
101114

102115
cxsparse_version (version) ;
103116
OK (my_check_version ("CXSparse", CS_VER, CS_SUBVER, CS_SUBSUB, CS_DATE,
104-
version)) ;
117+
version, CXSPARSE__VERSION)) ;
105118

106119
cs_dl *A = NULL ;
107120

@@ -130,11 +143,14 @@ int my_function (void) // returns 0 on success, -1 on failure
130143
amd_version (version) ;
131144
OK (my_check_version ("AMD",
132145
AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION, AMD_DATE,
133-
version)) ;
146+
version, AMD__VERSION)) ;
134147

135148
int64_t P [N] ;
136149
OK (amd_l_order (n, Ap, Ai, P, NULL, NULL) == AMD_OK) ;
137-
for (int k = 0 ; k < n ; k++) printf ("P [%d] = %d\n", k, (int) P [k]) ;
150+
for (int k = 0 ; k < n ; k++)
151+
{
152+
printf ("P [%d] = %d\n", k, (int) P [k]) ;
153+
}
138154

139155
//--------------------------------------------------------------------------
140156
// BTF
@@ -143,16 +159,22 @@ int my_function (void) // returns 0 on success, -1 on failure
143159
btf_version (version) ;
144160
OK (my_check_version ("BTF",
145161
BTF_MAIN_VERSION, BTF_SUB_VERSION, BTF_SUBSUB_VERSION, BTF_DATE,
146-
version)) ;
162+
version, BTF__VERSION)) ;
147163

148164
double work ;
149165
int64_t nmatch ;
150166
int64_t Q [N], R [N+1], Work [5*N] ;
151167
int64_t nblocks = btf_l_order (n, Ap, Ai, -1, &work, P, Q, R, &nmatch,
152168
Work) ;
153169
OK (nblocks > 0) ;
154-
for (int k = 0 ; k < n ; k++) printf ("P [%d] = %d\n", k, (int) P [k]) ;
155-
for (int k = 0 ; k < n ; k++) printf ("Q [%d] = %d\n", k, (int) Q [k]) ;
170+
for (int k = 0 ; k < n ; k++)
171+
{
172+
printf ("P [%d] = %d\n", k, (int) P [k]) ;
173+
}
174+
for (int k = 0 ; k < n ; k++)
175+
{
176+
printf ("Q [%d] = %d\n", k, (int) Q [k]) ;
177+
}
156178
printf ("nblocks %d\n", (int) nblocks) ;
157179

158180
//--------------------------------------------------------------------------
@@ -162,12 +184,18 @@ int my_function (void) // returns 0 on success, -1 on failure
162184
camd_version (version) ;
163185
OK (my_check_version ("CAMD",
164186
CAMD_MAIN_VERSION, CAMD_SUB_VERSION, CAMD_SUBSUB_VERSION, CAMD_DATE,
165-
version)) ;
187+
version, CAMD__VERSION)) ;
166188

167189
int64_t Cmem [N] ;
168-
for (int k = 0 ; k < n ; k++) Cmem [k] = 0 ;
190+
for (int k = 0 ; k < n ; k++)
191+
{
192+
Cmem [k] = 0 ;
193+
}
169194
OK (camd_l_order (n, Ap, Ai, P, NULL, NULL, Cmem) == CAMD_OK) ;
170-
for (int k = 0 ; k < n ; k++) printf ("P [%d] = %d\n", k, (int) P [k]) ;
195+
for (int k = 0 ; k < n ; k++)
196+
{
197+
printf ("P [%d] = %d\n", k, (int) P [k]) ;
198+
}
171199

172200
//--------------------------------------------------------------------------
173201
// CCOLAMD
@@ -176,14 +204,17 @@ int my_function (void) // returns 0 on success, -1 on failure
176204
ccolamd_version (version) ;
177205
OK (my_check_version ("CCOLAMD",
178206
CCOLAMD_MAIN_VERSION, CCOLAMD_SUB_VERSION, CCOLAMD_SUBSUB_VERSION,
179-
CCOLAMD_DATE, version)) ;
207+
CCOLAMD_DATE, version, CCOLAMD__VERSION)) ;
180208

181209
int64_t Alen = ccolamd_l_recommended (NNZ, n, n) ;
182-
int64_t *Awork = malloc (Alen * sizeof (int64_t)) ;
210+
int64_t *Awork = (int64_t *) malloc (Alen * sizeof (int64_t)) ;
183211
OK (Awork != NULL) ;
184212
memcpy (Awork, Ai, NNZ * sizeof (int64_t)) ;
185213
OK (ccolamd_l (n, n, Alen, Awork, P, NULL, NULL, Cmem) == CCOLAMD_OK) ;
186-
for (int k = 0 ; k < n ; k++) printf ("P [%d] = %d\n", k, (int) P [k]) ;
214+
for (int k = 0 ; k < n ; k++)
215+
{
216+
printf ("P [%d] = %d\n", k, (int) P [k]) ;
217+
}
187218
free (Awork) ;
188219

189220
//--------------------------------------------------------------------------
@@ -193,14 +224,17 @@ int my_function (void) // returns 0 on success, -1 on failure
193224
colamd_version (version) ;
194225
OK (my_check_version ("COLAMD",
195226
COLAMD_MAIN_VERSION, COLAMD_SUB_VERSION, COLAMD_SUBSUB_VERSION,
196-
COLAMD_DATE, version)) ;
227+
COLAMD_DATE, version, COLAMD__VERSION)) ;
197228

198229
Alen = ccolamd_l_recommended (NNZ, n, n) ;
199-
Awork = malloc (Alen * sizeof (int64_t)) ;
230+
Awork = (int64_t *) malloc (Alen * sizeof (int64_t)) ;
200231
OK (Awork != NULL) ;
201232
memcpy (Awork, Ai, NNZ * sizeof (int64_t)) ;
202233
OK (colamd_l (n, n, Alen, Awork, P, NULL, NULL) == COLAMD_OK) ;
203-
for (int k = 0 ; k < n ; k++) printf ("P [%d] = %d\n", k, (int) P [k]) ;
234+
for (int k = 0 ; k < n ; k++)
235+
{
236+
printf ("P [%d] = %d\n", k, (int) P [k]) ;
237+
}
204238
free (Awork) ;
205239

206240
//--------------------------------------------------------------------------
@@ -210,7 +244,7 @@ int my_function (void) // returns 0 on success, -1 on failure
210244
v = cholmod_l_version (version) ;
211245
OK (my_check_version ("CHOLMOD",
212246
CHOLMOD_MAIN_VERSION, CHOLMOD_SUB_VERSION, CHOLMOD_SUBSUB_VERSION,
213-
CHOLMOD_DATE, version)) ;
247+
CHOLMOD_DATE, version, CHOLMOD__VERSION)) ;
214248

215249
cholmod_common cc ;
216250
OK (cholmod_l_start (&cc)) ;
@@ -224,7 +258,8 @@ int my_function (void) // returns 0 on success, -1 on failure
224258
OK (GxB_Global_Option_get (GxB_LIBRARY_VERSION, version) == GrB_SUCCESS) ;
225259
OK (my_check_version ("GraphBLAS",
226260
GxB_IMPLEMENTATION_MAJOR, GxB_IMPLEMENTATION_MINOR,
227-
GxB_IMPLEMENTATION_SUB, GxB_IMPLEMENTATION_DATE, version)) ;
261+
GxB_IMPLEMENTATION_SUB, GxB_IMPLEMENTATION_DATE, version,
262+
GxB_IMPLEMENTATION)) ;
228263
OK (GrB_finalize ( ) == GrB_SUCCESS) ;
229264
#endif
230265

@@ -238,7 +273,8 @@ int my_function (void) // returns 0 on success, -1 on failure
238273
OK (LAGraph_Version (version, verstring, msg) == GrB_SUCCESS) ;
239274
OK (my_check_version ("LAGraph",
240275
LAGRAPH_VERSION_MAJOR, LAGRAPH_VERSION_MINOR, LAGRAPH_VERSION_UPDATE,
241-
LAGRAPH_DATE, version)) ;
276+
LAGRAPH_DATE, version, SUITESPARSE__VERCODE (LAGRAPH_VERSION_MAJOR,
277+
LAGRAPH_VERSION_MINOR, LAGRAPH_VERSION_UPDATE))) ;
242278
OK (LAGraph_Finalize (msg) == GrB_SUCCESS) ;
243279
#endif
244280

@@ -249,7 +285,7 @@ int my_function (void) // returns 0 on success, -1 on failure
249285
klu_version (version) ;
250286
OK (my_check_version ("KLU",
251287
KLU_MAIN_VERSION, KLU_SUB_VERSION, KLU_SUBSUB_VERSION,
252-
KLU_DATE, version)) ;
288+
KLU_DATE, version, KLU__VERSION)) ;
253289

254290
double b [N] = {8., 45.} ;
255291
double xgood [N] = {36.4, -32.7} ;
@@ -283,7 +319,7 @@ int my_function (void) // returns 0 on success, -1 on failure
283319
ldl_version (version) ;
284320
OK (my_check_version ("LDL",
285321
LDL_MAIN_VERSION, LDL_SUB_VERSION, LDL_SUBSUB_VERSION,
286-
LDL_DATE, version)) ;
322+
LDL_DATE, version, LDL__VERSION)) ;
287323

288324
double x2 [N] ;
289325
P [0] = 0 ;
@@ -305,7 +341,7 @@ int my_function (void) // returns 0 on success, -1 on failure
305341
RBio_version (version) ;
306342
OK (my_check_version ("RBio",
307343
RBIO_MAIN_VERSION, RBIO_SUB_VERSION, RBIO_SUBSUB_VERSION,
308-
RBIO_DATE, version)) ;
344+
RBIO_DATE, version, RBIO__VERSION)) ;
309345

310346
char mtype [4], key [8], title [80] ;
311347
strncpy (key, "simple", 8) ;
@@ -341,7 +377,7 @@ int my_function (void) // returns 0 on success, -1 on failure
341377
SPEX_version (version) ;
342378
OK (my_check_version ("SPEX",
343379
SPEX_VERSION_MAJOR, SPEX_VERSION_MINOR, SPEX_VERSION_SUB, SPEX_DATE,
344-
version)) ;
380+
version, SPEX__VERSION)) ;
345381
OK (SPEX_finalize ( ) == SPEX_OK) ;
346382

347383
//--------------------------------------------------------------------------
@@ -351,7 +387,7 @@ int my_function (void) // returns 0 on success, -1 on failure
351387
SuiteSparseQR_C_version (version) ;
352388
OK (my_check_version ("SuiteSparseQR",
353389
SPQR_MAIN_VERSION, SPQR_SUB_VERSION, SPQR_SUBSUB_VERSION, SPQR_DATE,
354-
version)) ;
390+
version, SPQR__VERSION)) ;
355391

356392
cholmod_sparse *A2, A2_struct ;
357393
cholmod_dense *B2, B2_struct ;
@@ -398,7 +434,7 @@ int my_function (void) // returns 0 on success, -1 on failure
398434
umfpack_version (version) ;
399435
OK (my_check_version ("UMFPACK",
400436
UMFPACK_MAIN_VERSION, UMFPACK_SUB_VERSION, UMFPACK_SUBSUB_VERSION,
401-
UMFPACK_DATE, version)) ;
437+
UMFPACK_DATE, version, UMFPACK__VERSION)) ;
402438

403439
printf ("%s\n", UMFPACK_VERSION) ;
404440
printf ("%s", UMFPACK_COPYRIGHT) ;
@@ -418,7 +454,10 @@ int my_function (void) // returns 0 on success, -1 on failure
418454
umfpack_dl_free_symbolic (&Sym) ;
419455
result = umfpack_dl_solve (UMFPACK_A, Ap, Ai, Ax, x, b, Num, Control, Info);
420456
umfpack_dl_free_numeric (&Num) ;
421-
for (int i = 0 ; i < n ; i++) printf ("x [%d] = %g\n", i, x [i]) ;
457+
for (int i = 0 ; i < n ; i++)
458+
{
459+
printf ("x [%d] = %g\n", i, x [i]) ;
460+
}
422461
err = 0 ;
423462
for (int i = 0 ; i < n ; i++)
424463
{
@@ -429,6 +468,13 @@ int my_function (void) // returns 0 on success, -1 on failure
429468
umfpack_dl_report_status (Control, result) ;
430469
umfpack_dl_report_info (Control, Info) ;
431470

471+
//--------------------------------------------------------------------------
472+
// not used
473+
//--------------------------------------------------------------------------
474+
475+
// printf ("version code: %llu\n", Mongoose__VERSION) ;
476+
// printf ("version code: %llu\n", PARU__VERSION) ;
477+
432478
//--------------------------------------------------------------------------
433479
// free workspace and return result
434480
//--------------------------------------------------------------------------

0 commit comments

Comments
 (0)