Skip to content
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

Fix full build #932

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/build_centos7.yml
Original file line number Diff line number Diff line change
@@ -71,6 +71,7 @@ jobs:
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools
ORTOOLS_URL: "https://github.com/rte-france/or-tools-rte/releases/download/v9.10-rte1.2/ortools_cxx_centos7_static_sirius.zip"

outputs:
TGZ_NAME: ${{ steps.export_output.outputs.TGZ_NAME }}
@@ -85,10 +86,6 @@ jobs:
id: get_release
uses: bruceadams/[email protected]

- name: Config OR-Tools URL
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools-rte/releases/download/v9.10-rte1.2-test-4/ortools_cxx_centos7_static_sirius.zip" >> $GITHUB_ENV

- uses: actions/checkout@v3 #Keep at 3
with:
submodules: true
8 changes: 1 addition & 7 deletions .github/workflows/build_oracle8.yml
Original file line number Diff line number Diff line change
@@ -41,9 +41,9 @@ jobs:
runs-on: ubuntu-latest
container: 'oraclelinux:8'
needs: [ versions ]

env:
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools
ORTOOLS_URL: "https://github.com/rte-france/or-tools-rte/releases/download/v9.10-rte1.2/ortools_cxx_oraclelinux-8_static_sirius.zip"

outputs:
zip_name: ${{ steps.zip_name.outputs.zip_name }}
@@ -58,10 +58,6 @@ jobs:
source /opt/rh/gcc-toolset-11/enable
echo $PATH >> $GITHUB_PATH

- name: Config OR-Tools URL
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools-rte/releases/download/v9.10-rte1.2-test-4/ortools_cxx_oraclelinux-8_static_sirius.zip" >> $GITHUB_ENV

- run: |
dnf module install -y nodejs:20/common

@@ -73,8 +69,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true



- name: Set up Python
run: |
7 changes: 1 addition & 6 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ jobs:
env:
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite"
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools
ORTOOLS_URL: "https://github.com/rte-france/or-tools-rte/releases/download/v9.10-rte1.2/ortools_cxx_ubuntu-20.04_static_sirius.zip"

outputs:
TGZ_NAME: ${{ steps.export_output.outputs.TGZ_NAME }}
@@ -36,8 +37,6 @@ jobs:
with:
submodules: true



- name: Install mandatory system libraries
run: |
sudo apt-get update --fix-missing
@@ -103,10 +102,6 @@ jobs:
path: 'antares-version.json'
key: 'antares_xpansion_version'

- name: Config OR-Tools URL
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools-rte/releases/download/v9.10-rte1.2-test-4/ortools_cxx_ubuntu-20.04_static_sirius.zip" >> $GITHUB_ENV

- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-tgz
with:
8 changes: 1 addition & 7 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ jobs:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite"
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools
ORTOOLS_URL: "https://github.com/rte-france/or-tools-rte/releases/download/v9.10-rte1.2/ortools_cxx_windows-latest_static.zip"

outputs:
zip_name: ${{ steps.zip_name.outputs.zip_name }}
@@ -37,8 +38,6 @@ jobs:
steps:
- uses: actions/checkout@v4



- name: Set up Python
uses: actions/setup-python@v5
with:
@@ -99,11 +98,6 @@ jobs:
# Allows to restore a cache when deps have only partially changed (like adding a dependency)
restore-keys: vcpkg-cache-windows-

- name: Config OR-Tools URL
shell: bash
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools-rte/releases/download/v9.10-rte1.2-test-4/ortools_cxx_windows-latest_static.zip" >> $GITHUB_ENV

- run: echo ${{env.ORTOOLS_URL}}
- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-zip
7 changes: 1 addition & 6 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -20,9 +20,9 @@ jobs:
env:
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite"
ORTOOLS_DIR: $GITHUB_WORKSPACE/or-tools
ORTOOLS_URL: "https://github.com/rte-france/or-tools-rte/releases/download/v9.10-rte1.2/ortools_cxx_ubuntu-20.04_static_sirius.zip"

steps:

- uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -82,11 +82,6 @@ jobs:
path: 'antares-version.json'
key: 'antares_xpansion_version'

- name: Config OR-Tools URL
shell: bash
run: |
echo "ORTOOLS_URL=https://github.com/rte-france/or-tools-rte/releases/download/v9.10-rte1.2-test-4/ortools_cxx_ubuntu-20.04_static_sirius.zip" >> $GITHUB_ENV

- name: Download pre-compiled librairies
uses: ./.github/workflows/download-extract-precompiled-libraries-tgz
with:
113 changes: 32 additions & 81 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -126,52 +126,47 @@ sbeClearJson(antares_version)
# Build dependencies not handled by antares-deps repository
option(BUILD_antares_solver "Build antares solver" ON)
message(STATUS "Build antares solver: ${BUILD_antares_solver}")
include(FetchContent)

#Log imported targets
get_property(importTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)

if (${BUILD_antares_solver})
#check if antares_solver available before asking for sirius and ortools build
find_package(Antares QUIET)
if (NOT Antares_FOUND)
message(WARNING "Antares solver not found, will be build")
set(BUILD_sirius ON)
set(REPOSITORY "https://github.com/AntaresSimulatorTeam/Antares_Simulator.git")
set(TAG "v${ANTARES_VERSION_TAG}")
set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE) #To avoid fetching updates everytime
#set(FETCHCONTENT_QUIET FALSE) for more log
FetchContent_Declare(
Antares
GIT_REPOSITORY ${REPOSITORY}
GIT_TAG feature/full_build_fixes
GIT_SHALLOW TRUE
SOURCE_SUBDIR src
GIT_SUBMODULES ""
#USES_TERMINAL_DOWNLOAD TRUE #For verbosity
#GIT_PROGRESS TRUE
OVERRIDE_FIND_PACKAGE
EXCLUDE_FROM_ALL
)
set(BUILD_ortools ON)
if (NOT Antares_FOUND)
message(STATUS "Antares not found, building it from source")
#Define deps install directory
if (NOT DEPS_INSTALL_DIR)
SET(DEPS_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../rte-antares-deps-${CMAKE_BUILD_TYPE})
else ()
if (NOT IS_ABSOLUTE ${DEPS_INSTALL_DIR})
SET(DEPS_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${DEPS_INSTALL_DIR})
endif ()
endif ()

# Build Needed dependencies
list(APPEND CMAKE_PREFIX_PATH ${DEPS_INSTALL_DIR})

# Add DEPS_INSTALL_DIR with antares-simulator CMAKE_BUILD_TYPE special case
if (${CMAKE_BUILD_TYPE} STREQUAL "Release")

string(REPLACE ${CMAKE_BUILD_TYPE} release
DEPS_INSTALL_DIR_ANTARES
${DEPS_INSTALL_DIR})

list(APPEND CMAKE_PREFIX_PATH ${DEPS_INSTALL_DIR_ANTARES})

elseif (${CMAKE_BUILD_TYPE} STREQUAL "Debug")

string(REPLACE ${CMAKE_BUILD_TYPE} debug
DEPS_INSTALL_DIR_ANTARES
${DEPS_INSTALL_DIR})

list(APPEND CMAKE_PREFIX_PATH ${DEPS_INSTALL_DIR_ANTARES})

endif ()
add_subdirectory(cmake/dependencies ${CMAKE_CURRENT_BINARY_DIR}/build_deps)
endif ()
set(BUILD_UI OFF)
set(BUILD_not_system OFF)
set(BUILD_TESTING OFF)
set(BUILD_TOOLS OFF)
FetchContent_MakeAvailable(Antares)
endif ()
endif ()
find_package(Antares REQUIRED)
message(STATUS "Build type is ${CMAKE_BUILD_TYPE}")
set(CMAKE_FIND_DEBUG_MODE false)
get_target_property(ANTARES_SOLVER_APP antares-solver NAME)

find_package(sirius_solver REQUIRED CONFIG)
get_target_property(sirius_lib sirius_solver LOCATION)
get_filename_component(sirius_lib_name ${sirius_lib} NAME)
configure_file(${sirius_lib} ${CMAKE_CURRENT_BINARY_DIR}/${sirius_lib_name} COPYONLY)

find_package(minizip-ng REQUIRED)
# ---------------------------------------------------------------------------
@@ -264,50 +259,6 @@ else ()
set(CURRENT_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif ()

find_package(antares-solver REQUIRED)

#Default RELEASE antares-solver use
get_target_property(ANTARES_SOLVER_PATH antares-solver IMPORTED_LOCATION_RELEASE)
if (NOT ANTARES_SOLVER_PATH)
get_target_property(ANTARES_SOLVER_PATH antares-solver IMPORTED_LOCATION_DEBUG)
endif ()

get_filename_component(ANTARES_SOLVER_DIR ${ANTARES_SOLVER_PATH} DIRECTORY)
get_filename_component(ANTARES_SOLVER_APP ${ANTARES_SOLVER_PATH} NAME)

#Copy antares-solver to build directory
FILE(COPY ${ANTARES_SOLVER_PATH}
DESTINATION ${CURRENT_RUNTIME_OUTPUT_DIRECTORY}
USE_SOURCE_PERMISSIONS)

#Copy associated .so and .dll to build directory
FILE(COPY ${ANTARES_SOLVER_DIR}/
DESTINATION ${CURRENT_RUNTIME_OUTPUT_DIRECTORY}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN "*.dll")

FILE(COPY ${ANTARES_SOLVER_DIR}/
DESTINATION ${CURRENT_RUNTIME_OUTPUT_DIRECTORY}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN "*.so")

#Glob *.so files in antares_solver_dir
file(GLOB_RECURSE ANTARES_SOLVER_LIBS ${ANTARES_SOLVER_DIR}/*.so)
INSTALL(FILES ${ANTARES_SOLVER_LIBS} DESTINATION bin)
file(GLOB_RECURSE ANTARES_SOLVER_LIBS ${ANTARES_SOLVER_DIR}/*.dll)
INSTALL(FILES ${ANTARES_SOLVER_LIBS} DESTINATION bin)


FILE(COPY ${ANTARES_SOLVER_DIR}/../lib/
DESTINATION ${CURRENT_RUNTIME_OUTPUT_DIRECTORY}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN "*.so")

FILE(COPY ${ANTARES_SOLVER_DIR}/../bin/
DESTINATION ${CURRENT_RUNTIME_OUTPUT_DIRECTORY}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN "*.so")

add_subdirectory("${PROJECT_SOURCE_DIR}/src")

if (BUILD_TESTING)
2 changes: 1 addition & 1 deletion antares-version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"antares_version": "9.2.0-rc1",
"antares_version": "9.2.0-rc3",
"antares_version_executable": "9.2",
"antares_xpansion_version": "1.3.2",
"minizip_ng_version": "3.0.6"
37 changes: 0 additions & 37 deletions cmake/dependencies/CMakeLists.txt

This file was deleted.

47 changes: 0 additions & 47 deletions cmake/dependencies/CMakeLists.txt.in

This file was deleted.