Skip to content

Commit e687e79

Browse files
Adding *_version functions to all packages
1 parent 12e6846 commit e687e79

File tree

105 files changed

+1664
-877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1664
-877
lines changed

AMD/Config/amd.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ void amd_l_control (double Control [ ]) ;
313313
void amd_info (double Info [ ]) ;
314314
void amd_l_info (double Info [ ]) ;
315315

316+
// amd_version: return AMD version. The version array is returned with
317+
// version [0..2] = {AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION}
318+
void amd_version (int version [3]) ;
319+
316320
#ifdef __cplusplus
317321
}
318322
#endif

AMD/Demo/amd_demo.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,17 @@ int main (void)
5252
double Control [AMD_CONTROL], Info [AMD_INFO] ;
5353
char A [24][24] ;
5454

55-
/* here is an example of how to use AMD_VERSION. This code will work in
56-
* any version of AMD. */
57-
#if defined(AMD_VERSION) && (AMD_VERSION >= AMD_VERSION_CODE(1,2))
5855
printf ("AMD version %d.%d.%d, date: %s\n",
5956
AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION, AMD_DATE) ;
60-
#else
61-
printf ("AMD version: 1.1 or earlier\n") ;
62-
#endif
57+
int version [3] ;
58+
amd_version (version) ;
59+
if ((version [0] != AMD_MAIN_VERSION) ||
60+
(version [1] != AMD_SUB_VERSION) ||
61+
(version [2] != AMD_SUBSUB_VERSION))
62+
{
63+
fprintf (stderr, "version in header does not match library\n") ;
64+
abort ( ) ;
65+
}
6366

6467
printf ("AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:\n") ;
6568

AMD/Demo/amd_l_demo.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,17 @@ int main (void)
5353
double Control [AMD_CONTROL], Info [AMD_INFO] ;
5454
char A [24][24] ;
5555

56-
/* here is an example of how to use AMD_VERSION. This code will work in
57-
* any version of AMD. */
58-
#if defined(AMD_VERSION) && (AMD_VERSION >= AMD_VERSION_CODE(1,2))
5956
printf ("AMD version %d.%d.%d, date: %s\n",
6057
AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION, AMD_DATE) ;
61-
#else
62-
printf ("AMD version: 1.1 or earlier\n") ;
63-
#endif
58+
int version [3] ;
59+
amd_version (version) ;
60+
if ((version [0] != AMD_MAIN_VERSION) ||
61+
(version [1] != AMD_SUB_VERSION) ||
62+
(version [2] != AMD_SUBSUB_VERSION))
63+
{
64+
fprintf (stderr, "version in header does not match library\n") ;
65+
abort ( ) ;
66+
}
6467

6568
printf ("AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24:\n") ;
6669

AMD/Doc/AMD_UserGuide.pdf

29.6 KB
Binary file not shown.

AMD/Doc/AMD_UserGuide.tex

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ \section{Using AMD in a C program}
202202
\label{Cversion}
203203
%------------------------------------------------------------------------------
204204

205-
The C-callable AMD library consists of seven user-callable routines and one
206-
include file. There are two versions of each of the routines, with
205+
The C-callable AMD library consists of eight user-callable routines and one
206+
include file. There are two versions of seven of the routines, with
207207
\verb'int32_t' and \verb'int64_t' integers.
208208
The routines with prefix
209209
{\tt amd\_l\_} use \verb'int64_t' integer arguments; the others use
@@ -303,6 +303,8 @@ \section{Using AMD in a C program}
303303
but it destroys the matrix on output. Additional workspace must be passed.
304304
Refer to the source file {\tt AMD/Source/amd\_2.c} for a description.
305305

306+
\item \verb'amd_version': returns the AMD version.
307+
306308
\end{itemize}
307309

308310
The nonzero pattern of the matrix $\m{A}$ is represented in compressed column
@@ -480,6 +482,16 @@ \section{Synopsis of C-callable routines}
480482
\end{verbatim}
481483
}
482484

485+
The \verb'amd_version' function uses plain \verb'int':
486+
487+
{\footnotesize
488+
\begin{verbatim}
489+
#include "amd.h"
490+
int version [3] ;
491+
amd_version (version) ;
492+
\end{verbatim}
493+
}
494+
483495
%------------------------------------------------------------------------------
484496
\section{Using AMD in a Fortran program}
485497
%------------------------------------------------------------------------------

AMD/Doc/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Dec 30, 2023: version 3.3.0
22

33
* major change to build system: by Markus Mützel
44
* revised test for integer overflow: for CHOLMOD 5.1.0 tests
5+
* amd_version: added to return version of AMD
56

67
Sept 18, 2023: version 3.2.1
78

AMD/Include/amd.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ void amd_l_control (double Control [ ]) ;
313313
void amd_info (double Info [ ]) ;
314314
void amd_l_info (double Info [ ]) ;
315315

316+
// amd_version: return AMD version. The version array is returned with
317+
// version [0..2] = {AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION}
318+
void amd_version (int version [3]) ;
319+
316320
#ifdef __cplusplus
317321
}
318322
#endif

AMD/Source/amd_version.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//------------------------------------------------------------------------------
2+
// AMD/Source/amd_version: return AMD version
3+
//------------------------------------------------------------------------------
4+
5+
// AMD, Copyright (c) 1996-2023, Timothy A. Davis, Patrick R. Amestoy, and
6+
// Iain S. Duff. All Rights Reserved.
7+
// SPDX-License-Identifier: BSD-3-clause
8+
9+
//------------------------------------------------------------------------------
10+
11+
#include "amd_internal.h"
12+
13+
void amd_version (int version [3])
14+
{
15+
version [0] = AMD_MAIN_VERSION ;
16+
version [1] = AMD_SUB_VERSION ;
17+
version [2] = AMD_SUBSUB_VERSION ;
18+
}
19+

BTF/Config/btf.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ int32_t btf_order /* returns number of blocks found */
218218
int64_t btf_l_order (int64_t, int64_t *, int64_t *, double , double *,
219219
int64_t *, int64_t *, int64_t *, int64_t *, int64_t *) ;
220220

221+
//------------------------------------------------------------------------------
222+
// btf_version: return BTF version
223+
//------------------------------------------------------------------------------
224+
225+
void btf_version (int version [3]) ;
226+
221227
#ifdef __cplusplus
222228
}
223229
#endif

BTF/Doc/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Dec 30, 2023: version 2.3.0
22

33
* major change to build system: by Markus Mützel
4+
* btf_version: added to return version of BTF
45

56
Sept 18, 2023: version 2.2.1
67

0 commit comments

Comments
 (0)