Skip to content
Snippets Groups Projects
Commit 28b01351 authored by Cyril Moineau's avatar Cyril Moineau Committed by Maxence Naud
Browse files

Update learning with aidge_core!277

parent cfecb654
No related branches found
No related tags found
1 merge request!33UPD: version 0.2.2 -> 0.2.3
# C++ Build # C++ Build
build*/ build*/
install*/ install*/
include/aidge/learning_version.h
# VSCode # VSCode
.vscode .vscode
...@@ -10,7 +10,6 @@ install*/ ...@@ -10,7 +10,6 @@ install*/
__pycache__ __pycache__
*.pyc *.pyc
*.egg-info *.egg-info
aidge_learning/_version.py
wheelhouse/* wheelhouse/*
# Mermaid # Mermaid
......
...@@ -3,6 +3,21 @@ set(CXX_STANDARD 14) ...@@ -3,6 +3,21 @@ set(CXX_STANDARD 14)
file(STRINGS "${CMAKE_SOURCE_DIR}/version.txt" version) file(STRINGS "${CMAKE_SOURCE_DIR}/version.txt" version)
# Parse version.txt to retrieve Major, Minor and Path
string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+)" _ MATCHES ${version})
set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1})
set(PROJECT_VERSION_MINOR ${CMAKE_MATCH_2})
set(PROJECT_VERSION_PATCH ${CMAKE_MATCH_3})
# Retrieve latest git commit
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
project(aidge_learning project(aidge_learning
VERSION ${version} VERSION ${version}
DESCRIPTION "Functions and alogrithms to train models in the AIDGE framework" DESCRIPTION "Functions and alogrithms to train models in the AIDGE framework"
...@@ -10,6 +25,7 @@ project(aidge_learning ...@@ -10,6 +25,7 @@ project(aidge_learning
message(STATUS "Project name: ${CMAKE_PROJECT_NAME}") message(STATUS "Project name: ${CMAKE_PROJECT_NAME}")
message(STATUS "Project version: ${version}") message(STATUS "Project version: ${version}")
message(STATUS "Latest git commit: ${GIT_COMMIT_HASH}")
# Note : project name is {project} and python module name is also {project} # Note : project name is {project} and python module name is also {project}
set(module_name _${CMAKE_PROJECT_NAME}) # target name set(module_name _${CMAKE_PROJECT_NAME}) # target name
...@@ -92,6 +108,13 @@ if(CMAKE_COMPILER_IS_GNUCXX AND COVERAGE) ...@@ -92,6 +108,13 @@ if(CMAKE_COMPILER_IS_GNUCXX AND COVERAGE)
append_coverage_compiler_flags() append_coverage_compiler_flags()
endif() endif()
message(STATUS "Creating ${CMAKE_CURRENT_SOURCE_DIR}/include/aidge/learning_version.h")
# Generate version.h file from config file version.h.in
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/include/aidge/version.h.in"
"${CMAKE_CURRENT_SOURCE_DIR}/include/aidge/learning_version.h"
)
############################################## ##############################################
# Installation instructions # Installation instructions
include(GNUInstallDirs) include(GNUInstallDirs)
......
#ifndef AIDGE_UTILS_SYS_INFO_LEARNING_VERSION_INFO_H
#define AIDGE_UTILS_SYS_INFO_LEARNING_VERSION_INFO_H
#include "aidge/utils/Log.hpp"
#include "aidge/learning_version.h"
namespace Aidge {
constexpr inline const char * getLearningProjectVersion(){
return PROJECT_VERSION;
}
constexpr inline const char * getLearningGitHash(){
return PROJECT_GIT_HASH;
}
void showLearningVersion() {
Log::info("Aidge Learning: {} ({}), {} {}", getLearningProjectVersion(), getLearningGitHash(), __DATE__, __TIME__);
// Compiler version
#if defined(__clang__)
/* Clang/LLVM. ---------------------------------------------- */
Log::info("Clang/LLVM compiler version: {}.{}.{}\n", __clang_major__ , __clang_minor__, __clang_patchlevel__);
#elif defined(__ICC) || defined(__INTEL_COMPILER)
/* Intel ICC/ICPC. ------------------------------------------ */
Log::info("Intel ICC/ICPC compiler version: {}\n", __INTEL_COMPILER);
#elif defined(__GNUC__) || defined(__GNUG__)
/* GNU GCC/G++. --------------------------------------------- */
Log::info("GNU GCC/G++ compiler version: {}.{}.{}", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#elif defined(_MSC_VER)
/* Microsoft Visual Studio. --------------------------------- */
Log::info("Microsoft Visual Studio compiler version: {}\n", _MSC_VER);
#else
Log::info("Unknown compiler\n");
#endif
}
} // namespace Aidge
#endif // AIDGE_UTILS_SYS_INFO_LEARNING_VERSION_INFO_H
#ifndef VERSION_H
#define VERSION_H
namespace Aidge {
static constexpr const int PROJECT_VERSION_MAJOR = @PROJECT_VERSION_MAJOR@;
static constexpr const int PROJECT_VERSION_MINOR = @PROJECT_VERSION_MINOR@;
static constexpr const int PROJECT_VERSION_PATCH = @PROJECT_VERSION_PATCH@;
static constexpr const char * PROJECT_VERSION = "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@";
static constexpr const char * PROJECT_GIT_HASH = "@GIT_COMMIT_HASH@";
}
#endif // VERSION_H
...@@ -5,18 +5,25 @@ dependencies = [] ...@@ -5,18 +5,25 @@ dependencies = []
requires-python = ">= 3.7" requires-python = ">= 3.7"
readme = "README.md" readme = "README.md"
license = { file = "LICENSE" } license = { file = "LICENSE" }
classifiers = [ classifiers = [
"Development Status :: 2 - Pre-Alpha", "Development Status :: 2 - Pre-Alpha",
"Programming Language :: Python :: 3" "Programming Language :: Python :: 3"
] ]
dynamic = ["version"] # defined in tool.setuptools_scm dynamic = ["version"] # defined in pbr
[project.urls]
Homepage = "https://www.deepgreen.ai/en/platform"
Documentation = "https://eclipse-aidge.readthedocs.io/en/latest/"
Repository = "https://gitlab.eclipse.org/eclipse/aidge/aidge_learning"
Issues = "https://gitlab.eclipse.org/eclipse/aidge/aidge_learning/-/issues/"
Changelog = "https://gitlab.eclipse.org/eclipse/aidge/aidge_learning/-/releases"
[build-system] [build-system]
requires = [ requires = [
"setuptools>=64", "setuptools>=64",
"setuptools_scm[toml]==7.1.0",
"cmake>=3.15.3.post1", "cmake>=3.15.3.post1",
"toml" "toml",
"pbr"
] ]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
...@@ -28,9 +35,6 @@ where = ["."] # list of folders that contain the packages (["."] by default) ...@@ -28,9 +35,6 @@ where = ["."] # list of folders that contain the packages (["."] by default)
include = ["aidge_learning*"] # package names should match these glob patterns (["*"] by default) include = ["aidge_learning*"] # package names should match these glob patterns (["*"] by default)
exclude = ["aidge_learning.unit_tests*"] # exclude packages matching these glob patterns (empty by default) exclude = ["aidge_learning.unit_tests*"] # exclude packages matching these glob patterns (empty by default)
namespaces = false # to disable scanning PEP 420 namespaces (true by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default)
# SETUPTOOLS_SCM
[tool.setuptools_scm]
write_to = "aidge_learning/_version.py"
##################################################### #####################################################
# CIBUILDWHEEL # CIBUILDWHEEL
......
...@@ -22,6 +22,7 @@ void init_SGD(py::module&); ...@@ -22,6 +22,7 @@ void init_SGD(py::module&);
void init_Adam(py::module&); void init_Adam(py::module&);
void init_LRScheduler(py::module&); void init_LRScheduler(py::module&);
void init_Accuracy(py::module&); void init_Accuracy(py::module&);
void init_LearningSysInfo(py::module&);
void init_Aidge(py::module& m) { void init_Aidge(py::module& m) {
init_Loss(m); init_Loss(m);
...@@ -29,7 +30,7 @@ void init_Aidge(py::module& m) { ...@@ -29,7 +30,7 @@ void init_Aidge(py::module& m) {
init_SGD(m); init_SGD(m);
init_Adam(m); init_Adam(m);
init_Accuracy(m); init_Accuracy(m);
init_LearningSysInfo(m);
init_LRScheduler(m); init_LRScheduler(m);
} }
......
#include <pybind11/pybind11.h>
#include "aidge/utils/sys_info/LearningVersionInfo.hpp"
namespace py = pybind11;
namespace Aidge {
void init_LearningSysInfo(py::module& m){
m.def("show_version", &showLearningVersion);
m.def("get_project_version", &getLearningProjectVersion);
m.def("get_git_hash", &getLearningGitHash);
}
}
# pbr file
[metadata]
version = file: version.txt
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment