Commit d2195303 authored by Nicolas Denoyelle's avatar Nicolas Denoyelle

Include all information needed for version checking

parent 41667393
Pipeline #6711 failed with stage
in 18 minutes and 42 seconds
...@@ -34,3 +34,11 @@ High-level building blocks use the low-level ones to provide fancier memory ...@@ -34,3 +34,11 @@ High-level building blocks use the low-level ones to provide fancier memory
management facilities, including: management facilities, including:
- *dmas:* moving data across areas - *dmas:* moving data across areas
- *scratchpads:* using an area as an explicitly managed cache of another one - *scratchpads:* using an area as an explicitly managed cache of another one
# Version Management
AML versionning is similar to [semantic versionning](https://semver.org/).
AML version is a string composed of 3 integers separated by a dot: "0.1.0"
The first integer is the major version and all versions with the same
major version are supposed ABI compatible except for major version 0 which is
considered unstable.
# see semver.org for version info # see semver.org for version info
AC_INIT([aml],[0.0.1],[swann@anl.gov]) AC_INIT([aml],[0.0.2],[swann@anl.gov])
# are we in the right source dir ? # are we in the right source dir ?
AC_CONFIG_SRCDIR([include/aml.h]) AC_CONFIG_SRCDIR([include/aml.h])
...@@ -67,7 +67,7 @@ ac_configure_args="$ac_configure_args \ ...@@ -67,7 +67,7 @@ ac_configure_args="$ac_configure_args \
'--with-install-suffix=-aml'" '--with-install-suffix=-aml'"
AC_CONFIG_SUBDIRS([jemalloc]) AC_CONFIG_SUBDIRS([jemalloc])
AC_CONFIG_HEADERS([src/config.h]) AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
src/Makefile src/Makefile
......
...@@ -32,6 +32,33 @@ ...@@ -32,6 +32,33 @@
#include <aml/utils/bitmap.h> #include <aml/utils/bitmap.h>
#include <aml/utils/vector.h> #include <aml/utils/vector.h>
/*
* If AML_ABI_VERSION != aml_major_version,
* the header is not the same version as linked library.
*/
#define AML_ABI_VERSION (0)
extern const char* aml_version_string;
extern int aml_major_version;
extern int aml_minor_version;
extern int aml_patch_version;
/*******************************************************************************
* General functions:
* Initialize internal structures, cleanup everything at the end.
******************************************************************************/
/*
* Initializes the library.
* "argc": pointer to the main()'s argc argument; contents can get modified.
* "argv": pointer to the main()'s argv argument; contents can get modified.
* Returns 0 if successful; an error code otherwise.
*/
int aml_init(int *argc, char **argv[]);
/*
* Terminates the library.
* Returns 0 if successful; an error code otherwise.
*/
int aml_finalize(void);
/******************************************************************************* /*******************************************************************************
* Forward Declarations: * Forward Declarations:
...@@ -1305,22 +1332,4 @@ void* aml_scratch_baseptr(const struct aml_scratch *scratch); ...@@ -1305,22 +1332,4 @@ void* aml_scratch_baseptr(const struct aml_scratch *scratch);
*/ */
int aml_scratch_release(struct aml_scratch *scratch, int scratchid); int aml_scratch_release(struct aml_scratch *scratch, int scratchid);
/*******************************************************************************
* General functions:
* Initialize internal structures, cleanup everything at the end.
******************************************************************************/
/*
* Initializes the library.
* "argc": pointer to the main()'s argc argument; contents can get modified.
* "argv": pointer to the main()'s argv argument; contents can get modified.
* Returns 0 if successful; an error code otherwise.
*/
int aml_init(int *argc, char **argv[]);
/*
* Terminates the library.
* Returns 0 if successful; an error code otherwise.
*/
int aml_finalize(void);
#endif #endif
...@@ -10,9 +10,19 @@ ...@@ -10,9 +10,19 @@
#include "config.h" #include "config.h"
#include "aml.h" #include "aml.h"
#include <string.h>
const char* aml_version_string = VERSION;
int aml_major_version = -1;
int aml_minor_version = -1;
int aml_patch_version = -1;
int aml_init(int *argc, char **argv[]) int aml_init(int *argc, char **argv[])
{ {
char * version = VERSION;
aml_major_version = atoi(strtok(version, "."));
aml_minor_version = atoi(strtok(NULL, "."));
aml_patch_version = atoi(strtok(NULL, "."));
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment