diff --git a/.github/workflows/build_centos7.yml b/.github/workflows/build_centos7.yml index 6c2dde717..3e4056522 100644 --- a/.github/workflows/build_centos7.yml +++ b/.github/workflows/build_centos7.yml @@ -45,7 +45,6 @@ jobs: outputs: antares-version: ${{steps.antares-version.outputs.result}} antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}} - antares-deps-version: ${{steps.antares-deps-version.outputs.result}} steps: - uses: actions/checkout@v4 - name: Read antares-solver version @@ -62,13 +61,6 @@ jobs: path: 'antares-version.json' key: 'antares_xpansion_version' - - name: Read antares-deps version - id: antares-deps-version - uses: ./.github/actions/read-json-value - with: - path: 'antares-version.json' - key: 'antares_deps_version' - build: runs-on: ubuntu-latest needs: [ docker_publish, versions ] @@ -135,7 +127,6 @@ jobs: - name: Download pre-compiled librairies uses: ./.github/workflows/download-extract-precompiled-libraries-tgz with: - antares-deps-version: ${{needs.versions.outputs.antares-deps-version}} antares-version: ${{needs.versions.outputs.antares-version}} os: centos7 os-full-name: CentOS-7.9.2009 @@ -147,20 +138,22 @@ jobs: pip3 install -r requirements-tests.txt pip3 install -r requirements-ui.txt - - run: | - mkdir -p ${{ github.workspace }}/vcpkg_cache - - name: vcpkg install run: | + git config --global safe.directory '*' + git submodule update --remote --init vcpkg pushd vcpkg git fetch --unshallow - ./bootstrap-vcpkg.sh --disableMetrics + ./bootstrap-vcpkg.sh -disableMetrics + echo "VCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg" >> $GITHUB_ENV + echo "VCPKG_CACHE_DIR=$GITHUB_WORKSPACE/vcpkg_cache" >> $GITHUB_ENV + echo "VCPKG_BINARY_SOURCES=clear;files,$GITHUB_WORKSPACE/vcpkg_cache,readwrite" >> $GITHUB_ENV - name: Restore vcpkg binary dir from cache id: cache-vcpkg-binary uses: actions/cache/restore@v3 with: - path: ${{ github.workspace }}/vcpkg_cache + path: ${{ env.VCPKG_CACHE_DIR }} key: vcpkg-cache-centOS-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }} # Allows to restore a cache when deps have only partially changed (like adding a dependency) restore-keys: vcpkg-cache-centOS- @@ -169,8 +162,8 @@ jobs: run: | source /opt/rh/devtoolset-10/enable cmake -B _build -S . \ - -DDEPS_INSTALL_DIR=rte-antares-deps-Release \ -DBUILD_TESTING=ON \ + -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/deps \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=_install \ -DBUILD_UI=ON \ @@ -186,7 +179,7 @@ jobs: id: save-cache-vcpkg-binary uses: actions/cache/save@v3 with: - path: ${{ github.workspace }}/vcpkg_cache + path: ${{ env.VCPKG_CACHE_DIR }} key: vcpkg-cache-centOS-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }} - name: Running unit tests diff --git a/.github/workflows/build_oracle8.yml b/.github/workflows/build_oracle8.yml index 4bbea40ec..9d563a9bf 100644 --- a/.github/workflows/build_oracle8.yml +++ b/.github/workflows/build_oracle8.yml @@ -19,7 +19,6 @@ jobs: outputs: antares-version: ${{steps.antares-version.outputs.result}} antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}} - antares-deps-version: ${{steps.antares-deps-version.outputs.result}} steps: - uses: actions/checkout@v4 - name: Read antares-solver version @@ -36,13 +35,6 @@ jobs: path: 'antares-version.json' key: 'antares_xpansion_version' - - name: Read antares-deps version - id: antares-deps-version - uses: ./.github/actions/read-json-value - with: - path: 'antares-version.json' - key: 'antares_deps_version' - build: name: Build runs-on: ubuntu-latest @@ -108,25 +100,26 @@ jobs: - name: Download pre-compiled librairies uses: ./.github/workflows/download-extract-precompiled-libraries-tgz with: - antares-deps-version: ${{needs.versions.outputs.antares-deps-version}} antares-version: ${{needs.versions.outputs.antares-version}} os: Oracle8 os-full-name: OracleServer-8.10 - - run: | - mkdir -p ${{ github.workspace }}/vcpkg_cache - - name: vcpkg install run: | + git config --global safe.directory '*' + git submodule update --remote --init vcpkg pushd vcpkg git fetch --unshallow - ./bootstrap-vcpkg.sh --disableMetrics + ./bootstrap-vcpkg.sh -disableMetrics + echo "VCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg" >> $GITHUB_ENV + echo "VCPKG_CACHE_DIR=$GITHUB_WORKSPACE/vcpkg_cache" >> $GITHUB_ENV + echo "VCPKG_BINARY_SOURCES=clear;files,$GITHUB_WORKSPACE/vcpkg_cache,readwrite" >> $GITHUB_ENV - name: Restore vcpkg binary dir from cache id: cache-vcpkg-binary uses: actions/cache/restore@v4 with: - path: ${{ github.workspace }}/vcpkg_cache + path: ${{ env.VCPKG_CACHE_DIR }} key: vcpkg-cache-oracle8-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }} # Allows to restore a cache when deps have only partially changed (like adding a dependency) restore-keys: vcpkg-cache-oracle8- @@ -134,10 +127,10 @@ jobs: - name: Configure run: | cmake -B _build -S . \ - -DDEPS_INSTALL_DIR=rte-antares-deps-Release \ -DBUILD_TESTING=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=_install \ + -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/deps \ -DBUILD_UI=OFF \ -DALLOW_RUN_AS_ROOT=ON \ -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake @@ -155,13 +148,13 @@ jobs: export XPRESS=${{ env.XPRESS_CONTAINER }} cd _build ctest -C Release --output-on-failure -L "unit|benders|lpnamer|medium" - + - name: Cache vcpkg binary dir if: always() id: save-cache-vcpkg-binary uses: actions/cache/save@v4 with: - path: ${{ github.workspace }}/vcpkg_cache + path: ${{ env.VCPKG_CACHE_DIR }} key: vcpkg-cache-oracle8-${{ hashFiles('src/vcpkg.json', '.git/modules/vcpkg/HEAD') }} ####################### @@ -169,7 +162,7 @@ jobs: run: | cd _build cmake --install . - + - name: .tar.gz creation run: | cd _build diff --git a/.github/workflows/build_ubuntu.yml b/.github/workflows/build_ubuntu.yml index 3d8dd14a6..efef241b2 100644 --- a/.github/workflows/build_ubuntu.yml +++ b/.github/workflows/build_ubuntu.yml @@ -30,6 +30,7 @@ jobs: XPRESSDIR: ${{ github.workspace }}/xpress XPRESS: ${{ github.workspace }}/xpress/bin XPRS_LIB_Path: ${{ github.workspace }}/xpress/lib + VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite" outputs: TGZ_NAME: ${{ steps.export_output.outputs.TGZ_NAME }} @@ -49,6 +50,12 @@ jobs: ref: ${{ matrix.xprs.ref}} token: ${{ secrets.AS_TOKEN }} #reniew token periodically + - name: Install mandatory system libraries + run: | + sudo apt-get update --fix-missing + sudo apt-get install -y ccache + sudo apt-get install -y g++-10 gcc-10 + - name: ccache uses: hendrikmuhs/ccache-action@v1.2.3 with: @@ -66,12 +73,6 @@ jobs: pip install -r requirements-tests.txt pip install -r requirements-ui.txt - - name: Install mandatory system libraries - run: | - sudo apt-get update --fix-missing - sudo apt-get install -y ccache - sudo apt-get install -y g++-10 gcc-10 - - name: Update alternatives #mpicxx uses "g++" so we need g++ to be symbolic link to g++-10 run: | @@ -101,29 +102,19 @@ jobs: path: 'antares-version.json' key: 'antares_xpansion_version' - - name: Read antares-deps version - id: antares-deps-version - uses: ./.github/actions/read-json-value - with: - path: 'antares-version.json' - key: 'antares_deps_version' - - name: Download pre-compiled librairies uses: ./.github/workflows/download-extract-precompiled-libraries-tgz with: - antares-deps-version: ${{steps.antares-deps-version.outputs.result}} antares-version: ${{steps.antares-version.outputs.result}} os: ${{matrix.os}} os-full-name: Ubuntu-20.04 - - run: | - mkdir -p ${{ github.workspace }}/vcpkg_cache - - name: vcpkg install run: | + git submodule update --remote --init vcpkg pushd vcpkg git fetch --unshallow - ./bootstrap-vcpkg.sh --disableMetrics + ./bootstrap-vcpkg.sh -disableMetrics - name: Restore vcpkg binary dir from cache id: cache-vcpkg-binary @@ -142,10 +133,10 @@ jobs: -DCMAKE_C_COMPILER=/usr/bin/gcc-10 \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \ - -DDEPS_INSTALL_DIR=rte-antares-deps-Release \ -DBUILD_TESTING=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=_install \ + -DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps \ -DBUILD_UI=ON \ -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 2f3c6ca36..9125419af 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: os: [ windows-latest ] - triplet: [ x64-windows ] + triplet: [ x64-windows-release ] xprs: [ #{ value: XPRESS-ON, ref: 8.13a }, { value: XPRESS-ON, ref: 9.2.5 }, #{ value: XPRESS-OFF } @@ -32,6 +32,7 @@ jobs: XPRS_LIB_Path: ${{ github.workspace }}\xpress\lib # Indicates the location of the vcpkg as a Git submodule of the project repository. VCPKG_ROOT: ${{ github.workspace }}/vcpkg + VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite" outputs: zip_name: ${{ steps.zip_name.outputs.zip_name }} @@ -39,8 +40,6 @@ jobs: steps: - uses: actions/checkout@v4 - with: - submodules: true - name: Checkout xpressmp linux if: matrix.xprs.value == 'XPRESS-ON' @@ -77,12 +76,7 @@ jobs: with: path: 'antares-version.json' key: 'antares_version' - - name: Read antares-deps version - id: antares-deps-version - uses: ./.github/actions/read-json-value - with: - path: 'antares-version.json' - key: 'antares_deps_version' + - name: Read antares-xpansion version id: antares-xpansion-version uses: ./.github/actions/read-json-value @@ -93,10 +87,9 @@ jobs: - name: vcpkg install shell: bash run: | - mkdir -p ${{ github.workspace }}/vcpkg_cache + git submodule update --remote --init vcpkg pushd vcpkg - git fetch --unshallow - ./bootstrap-vcpkg.sh --disableMetrics + ./bootstrap-vcpkg.bat -disableMetrics - name: Restore vcpkg binary dir from cache id: cache-vcpkg-binary @@ -110,18 +103,18 @@ jobs: - name: Download pre-compiled librairies uses: ./.github/workflows/download-extract-precompiled-libraries-zip with: - antares-deps-version: ${{steps.antares-deps-version.outputs.result}} antares-version: ${{steps.antares-version.outputs.result}} os: ${{matrix.os}} - name: Configure run: | $pwd=Get-Location - cmake -B _build -S . -DDEPS_INSTALL_DIR=rte-antares-deps-Release -DCMAKE_PREFIX_PATH="$pwd\rte-antares-${{steps.antares-version.outputs.result}}-installer-64bits" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install -DBUILD_UI=ON + cmake -B _build -S . -DCMAKE_PREFIX_PATH="$pwd\rte-antares-${{steps.antares-version.outputs.result}}-installer-64bits" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_INSTALL_PREFIX=_install -DBUILD_UI=ON + - name: Build run: | cmake --build _build --config Release -j4 - + - name: Cache vcpkg binary dir if: always() id: save-cache-vcpkg-binary diff --git a/.github/workflows/compile-boost/action.yml b/.github/workflows/compile-boost/action.yml deleted file mode 100644 index c8f9bbe88..000000000 --- a/.github/workflows/compile-boost/action.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Download and compile boost" -description: "Download and compile boost" -inputs: - prefix: - description: 'extra qualifiers' - required: true -runs: - using: "composite" - steps: - - id: install-boost - shell: bash - run: | - source /opt/rh/gcc-toolset-10/enable || true - export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH - export PATH=/usr/lib64/openmpi/bin:$PATH - wget https://github.com/boostorg/boost/releases/download/boost-1.81.0/boost-1.81.0.tar.gz - tar xvf boost-1.81.0.tar.gz - cd boost-1.81.0 - ./bootstrap.sh --prefix=${{inputs.prefix}}/ --with-libraries=serialization,program_options,mpi - echo "using mpi ;" >> project-config.jam - ./b2 install diff --git a/.github/workflows/compile-gtest/action.yml b/.github/workflows/compile-gtest/action.yml deleted file mode 100644 index 9218e3fb6..000000000 --- a/.github/workflows/compile-gtest/action.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "Download and build gtest" -description: "build gtest for centos7" -runs: - using: "composite" - steps: - - id: build-gtest - shell: bash - run: | - source /opt/rh/devtoolset-10/enable || source /opt/rh/gcc-toolset-10/enable || true - git clone -b v1.14.0 https://github.com/google/googletest.git - cd googletest - cmake3 -G"Unix Makefiles" - make -j8 - make install \ No newline at end of file diff --git a/.github/workflows/download-extract-precompiled-libraries-tgz/action.yml b/.github/workflows/download-extract-precompiled-libraries-tgz/action.yml index f0608c3af..601033d9f 100644 --- a/.github/workflows/download-extract-precompiled-libraries-tgz/action.yml +++ b/.github/workflows/download-extract-precompiled-libraries-tgz/action.yml @@ -1,9 +1,6 @@ name: "Download extract .tgz precompiled libraries" -description: "Download and extract .tgz precompiled libraries from antares-deps and antares-simulator repository" +description: "Download and extract .tgz precompiled antares-simulator repository" inputs: - antares-deps-version: - description: 'antares-deps version' - required: true antares-version: description: 'antares-solver version' required: true @@ -23,19 +20,13 @@ inputs: default: "" runs: using: "composite" - steps: - - id: download-extract - shell: bash - run: | - export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH - export PATH=/usr/lib64/openmpi/bin:$PATH - - wget https://github.com/AntaresSimulatorTeam/antares-deps/releases/download/v${{inputs.antares-deps-version}}/rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.tar.gz - tar -xvf rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.tar.gz - rm -rf rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.tar.gz - - wget https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/v${{inputs.antares-version}}/antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz - tar -xvf antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz -C rte-antares-deps-${{inputs.buildtype}} --strip-components=1 - rm -rf antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz - - \ No newline at end of file + steps: + - id: download-extract + shell: bash + run: | + export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH + export PATH=/usr/lib64/openmpi/bin:$PATH + mkdir deps + wget https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/v${{inputs.antares-version}}/antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz + tar -xvf antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz -C deps --strip-components=1 + rm -rf antares-${{inputs.antares-version}}-${{inputs.os-full-name}}${{inputs.variant}}.tar.gz diff --git a/.github/workflows/download-extract-precompiled-libraries-zip/action.yml b/.github/workflows/download-extract-precompiled-libraries-zip/action.yml index 6b1c62c2c..e111cd45d 100644 --- a/.github/workflows/download-extract-precompiled-libraries-zip/action.yml +++ b/.github/workflows/download-extract-precompiled-libraries-zip/action.yml @@ -1,9 +1,6 @@ name: "Download extract .zip precompiled libraries" -description: "Download and extract .zip precompiled libraries from antares-deps and antares-simulator repository" +description: "Download and extract .zip precompiled antares-simulator repository" inputs: - antares-deps-version: - description: 'antares-deps version' - required: true antares-version: description: 'antares-solver version' required: true @@ -25,10 +22,6 @@ runs: - id: download-extract shell: bash run: | - wget https://github.com/AntaresSimulatorTeam/antares-deps/releases/download/v${{inputs.antares-deps-version}}/rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.zip - unzip rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.zip - rm -rf rte-antares-deps-${{inputs.os}}-${{inputs.buildtype}}.zip - wget https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/v${{inputs.antares-version}}/rte-antares-${{inputs.antares-version}}-installer-64bits.zip unzip rte-antares-${{inputs.antares-version}}-installer-64bits.zip rm -rf rte-antares-${{inputs.antares-version}}-installer-64bits.zip diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 1f3c5e07e..3e2930d09 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -17,6 +17,8 @@ jobs: strategy: matrix: os: [ ubuntu-20.04 ] + env: + VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite" steps: @@ -49,8 +51,7 @@ jobs: - name: Install libraries run: | sudo apt-get update --fix-missing - sudo apt-get install libjsoncpp-dev libgtest-dev libboost-mpi-dev libboost-program-options-dev - sudo apt-get install g++-10 gcc-10 + sudo apt-get install g++-10 gcc-10 libgtest-dev cd /usr/src/googletest/ sudo cmake . sudo cmake --build . --target install @@ -79,37 +80,21 @@ jobs: path: 'antares-version.json' key: 'antares_xpansion_version' - - name: Read antares-deps version - id: antares-deps-version - uses: ./.github/actions/read-json-value - with: - path: 'antares-version.json' - key: 'antares_deps_version' - - name: Download pre-compiled librairies uses: ./.github/workflows/download-extract-precompiled-libraries-tgz with: - antares-deps-version: ${{steps.antares-deps-version.outputs.result}} antares-version: ${{steps.antares-version.outputs.result}} os: ${{matrix.os}} os-full-name: Ubuntu-20.04 - - name: Compile Boost - uses: ./.github/workflows/compile-boost - with: - prefix: "../rte-antares-deps-Release/" - - name: Init submodule run: | git submodule update --init --recursive . - - - run: | - mkdir -p ${{ github.workspace }}/vcpkg_cache - name: vcpkg install run: | - pushd vcpkg - ./bootstrap-vcpkg.sh --disableMetrics + git submodule update --init vcpkg + ./vcpkg/bootstrap-vcpkg.sh -disableMetrics - name: Restore vcpkg binary dir from cache id: cache-vcpkg-binary @@ -128,11 +113,11 @@ jobs: -DCMAKE_C_COMPILER=/usr/bin/gcc-10 \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \ - -DDEPS_INSTALL_DIR=rte-antares-deps-Release \ -DCODE_COVERAGE=ON \ -DBUILD_TESTING=ON \ -DBUILD_antares_solver=OFF \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps \ -DCMAKE_INSTALL_PREFIX=_install \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake diff --git a/.github/workflows/ubuntu-system-deps-build.yml b/.github/workflows/ubuntu-system-deps-build.yml index 88bd3c483..cbb5ef971 100644 --- a/.github/workflows/ubuntu-system-deps-build.yml +++ b/.github/workflows/ubuntu-system-deps-build.yml @@ -16,6 +16,8 @@ jobs: strategy: matrix: os: [ ubuntu-20.04 ] + env: + VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite" steps: - uses: actions/checkout@v4 @@ -71,9 +73,10 @@ jobs: - name: vcpkg install run: | + git submodule update --remote --init vcpkg pushd vcpkg git fetch --unshallow - ./bootstrap-vcpkg.sh --disableMetrics + ./bootstrap-vcpkg.sh -disableMetrics - name: Restore vcpkg binary dir from cache id: cache-vcpkg-binary diff --git a/.github/workflows/windows-vcpkg-deps-build.yml b/.github/workflows/windows-vcpkg-deps-build.yml index 8452db4bd..b9b8c78bb 100644 --- a/.github/workflows/windows-vcpkg-deps-build.yml +++ b/.github/workflows/windows-vcpkg-deps-build.yml @@ -20,6 +20,7 @@ jobs: env: # Indicates the location of the vcpkg as a Git submodule of the project repository. VCPKG_ROOT: ${{ github.workspace }}/vcpkg + VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg_cache,readwrite" steps: - uses: actions/checkout@v4 @@ -57,10 +58,10 @@ jobs: - name: vcpkg install shell: bash run: | - mkdir -p ${{ github.workspace }}/vcpkg_cache + git submodule update --remote --init vcpkg pushd vcpkg git fetch --unshallow - ./bootstrap-vcpkg.sh --disableMetrics + ./bootstrap-vcpkg.bat -disableMetrics - name: Restore vcpkg binary dir from cache id: cache-vcpkg-binary @@ -106,5 +107,4 @@ jobs: name: Single file .zip creation uses: ./.github/workflows/single-file-creation-zip with: - antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}} - + antares-xpansion-version: ${{steps.antares-xpansion-version.outputs.result}} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3d61cc63d..b7528fe63 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,6 @@ # build _build _install -antares-deps include/google vcpkg_installed diff --git a/.gitmodules b/.gitmodules index 6049e7386..a0a57f3d7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ -[submodule "antares-deps"] - path = antares-deps - url = https://github.com/AntaresSimulatorTeam/antares-deps.git - branch = v2.0.7 [submodule "vcpkg"] path = vcpkg url = https://github.com/microsoft/vcpkg.git diff --git a/CMakeLists.txt b/CMakeLists.txt index b13d44af3..dbc2e4ab0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,16 +14,13 @@ set(ANTARES_XPANSION_RC 5) # =========================================================================== # Default parameters # =========================================================================== - if (MSVC) cmake_policy(SET CMP0111 OLD) #To remove warning for not found configuration on MSVC endif () -set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) #To force OR-Tools build and set option for antares-deps - if (CMAKE_TOOLCHAIN_FILE) if(NOT IS_ABSOLUTE ${CMAKE_TOOLCHAIN_FILE}) - SET(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_TOOLCHAIN_FILE}) + SET(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_TOOLCHAIN_FILE}) endif() endif() @@ -114,13 +111,13 @@ endif () include("cmake/utils.cmake") include("cmake/json-cmake-1.1.0/JSONParser.cmake") -#Define install directory +#Define deps install directory if (NOT DEPS_INSTALL_DIR) - SET(DEPS_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../rte-antares-deps-${CMAKE_BUILD_TYPE}) + 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() + if(NOT IS_ABSOLUTE ${DEPS_INSTALL_DIR}) + SET(DEPS_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${DEPS_INSTALL_DIR}) + endif() endif() # Build Needed dependencies @@ -132,21 +129,19 @@ 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() -message(STATUS "CMAKE_PREFIX_PATH : ${CMAKE_PREFIX_PATH}") - file(READ antares-version.json jsonContent) sbeParseJson(antares_version jsonContent) @@ -163,16 +158,18 @@ message(STATUS "Build antares solver: ${BUILD_antares_solver}") if (${BUILD_antares_solver}) #check if antares_solver available before asking for sirius and ortools build - find_package(antares-solver) + find_package(antares-solver QUIET) if (NOT antares-solver_FOUND) set(BUILD_sirius ON) set(BUILD_ortools ON) endif() endif() -add_subdirectory(antares-deps) - +message(STATUS "Build type is ${CMAKE_BUILD_TYPE}") add_subdirectory(cmake/dependencies ${CMAKE_CURRENT_BINARY_DIR}/build_deps) +find_package(antares-solver REQUIRED) +message(STATUS "Build type is ${CMAKE_BUILD_TYPE}") + find_package(minizip-ng REQUIRED) # --------------------------------------------------------------------------- # Boost @@ -222,7 +219,10 @@ if(POLICY CMP0074) endif() find_package(sirius_solver REQUIRED) - +install(FILES + $ + DESTINATION bin +) if (SOLVER) if (SOLVER STREQUAL "xpress") add_definitions (-DXPRESS_SOLVER -DUSE_XPRESS) @@ -289,6 +289,11 @@ FILE(COPY ${ANTARES_SOLVER_DIR}/ USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN "*.dll") +FILE(COPY ${ANTARES_SOLVER_DIR}/ + DESTINATION ${CURRENT_RUNTIME_OUTPUT_DIRECTORY} + USE_SOURCE_PERMISSIONS + FILES_MATCHING PATTERN "*.so") + FILE(COPY ${ANTARES_SOLVER_DIR}/../lib/ DESTINATION ${CURRENT_RUNTIME_OUTPUT_DIRECTORY} USE_SOURCE_PERMISSIONS diff --git a/antares-deps b/antares-deps deleted file mode 160000 index be4219526..000000000 --- a/antares-deps +++ /dev/null @@ -1 +0,0 @@ -Subproject commit be4219526437ea4cdbb738014ee2bedb9ff83724 diff --git a/antares-version.json b/antares-version.json index 9435244d4..63a8fb6b1 100644 --- a/antares-version.json +++ b/antares-version.json @@ -2,6 +2,5 @@ "antares_version": "9.1.0", "antares_version_executable": "9.1", "antares_xpansion_version": "1.3.0", - "antares_deps_version": "2.0.7", "minizip_ng_version": "3.0.6" } diff --git a/cmake/dependencies/CMakeLists.txt b/cmake/dependencies/CMakeLists.txt index 3f1b24972..bc36e06d2 100644 --- a/cmake/dependencies/CMakeLists.txt +++ b/cmake/dependencies/CMakeLists.txt @@ -3,13 +3,13 @@ ##################### if(BUILD_antares_solver) -find_package(antares-solver) +find_package(antares-solver QUIET) if (NOT antares-solver_FOUND) set(REPOSITORY "https://github.com/AntaresSimulatorTeam/Antares_Simulator.git") set(TAG "v${ANTARES_VERSION_TAG}") - set(CMAKE_ARGS "-DBUILD_UI=OFF -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DDEPS_INSTALL_DIR=${DEPS_INSTALL_DIR} -DBUILD_not_system=OFF -DBUILD_ortools=ON ") + set(CMAKE_ARGS "-DBUILD_UI=OFF -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DDEPS_INSTALL_DIR=${DEPS_INSTALL_DIR} -DBUILD_not_system=OFF -DBUILD_ortools=ON") if (CMAKE_BUILD_TYPE STREQUAL "Debug") set(ANTARES_BUILD_TYPE "Debug") diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 832be0094..b2a74f7ad 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -48,4 +48,108 @@ function(find_python_module module) endif() -endfunction() \ No newline at end of file +endfunction() + +# build_git_dependency() +# +# CMake function to download, build and install (in staging area) a dependency at configure +# time. +# +# Parameters: +# NAME: name of the dependency +# REPOSITORY: git url of the dependency +# TAG: tag of the dependency +# APPLY_PATCH: apply patch +# CMAKE_ARGS: List of specific CMake args to add +# CONFIGURE_COMMAND : Command used for configure (default empty and default CMake configure use) +# BUILD_COMMAND : Command used for build (default empty and default CMake build use) +# INSTALL_COMMAND : Command used for install (default empty and default CMake instal use) +# INSOURCE_BUILD : If option ON , compilation is done in source directory +# SOURCE_SUBDIR : Indicate where to find CMakeList.txt +# +# build_dependency( +# NAME +# abseil-cpp +# URL +# https://github.com/abseil/abseil-cpp.git +# TAG +# master +# APPLY_PATCH +# ${CMAKE_SOURCE_DIR}/patches/abseil-cpp.patch +# ) +function(build_git_dependency) + set(options "") + set(oneValueArgs NAME REPOSITORY TAG APPLY_PATCH CONFIGURE_COMMAND BUILD_COMMAND INSTALL_COMMAND INSOURCE_BUILD SOURCE_SUBDIR) + set(multiValueArgs CMAKE_ARGS) + cmake_parse_arguments(GIT_DEP + "${options}" + "${oneValueArgs}" + "${multiValueArgs}" + ${ARGN} + ) + message(STATUS "Building ${GIT_DEP_NAME}: ...") + + if(GIT_DEP_APPLY_PATCH) + set(PATCH_CMD "git apply \"${GIT_DEP_APPLY_PATCH}\"") + else() + set(PATCH_CMD "\"\"") + endif() + + if(GIT_DEP_CONFIGURE_COMMAND) + set(CONFIGURE_COMMAND "CONFIGURE_COMMAND ${GIT_DEP_CONFIGURE_COMMAND}") + else() + set(CONFIGURE_COMMAND "#CONFIGURE_COMMAND") + endif() + + if(GIT_DEP_BUILD_COMMAND) + set(BUILD_COMMAND "BUILD_COMMAND ${GIT_DEP_BUILD_COMMAND}") + else() + set(BUILD_COMMAND "#BUILD_COMMAND") + endif() + + if(GIT_DEP_INSTALL_COMMAND) + set(INSTALL_COMMAND "INSTALL_COMMAND ${GIT_DEP_INSTALL_COMMAND}") + else() + set(INSTALL_COMMAND "#INSTALL_COMMAND") + endif() + + if(GIT_DEP_SOURCE_SUBDIR) + set(SOURCE_SUBDIR "SOURCE_SUBDIR ${GIT_DEP_SOURCE_SUBDIR}") + else() + set(SOURCE_SUBDIR "#SOURCE_SUBDIR") + endif() + + if (GIT_DEP_INSOURCE_BUILD) + set (BINARY_DIR "BUILD_IN_SOURCE 1") + else() + set (BINARY_DIR "BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${GIT_DEP_NAME}/build") + endif() + + #use specific list separator to be able to use a list of CMAKE_PREFIX_PATH + string(REPLACE ";" "|" STR_CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}") + + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in + ${CMAKE_CURRENT_BINARY_DIR}/${GIT_DEP_NAME}/CMakeLists.txt @ONLY) + + execute_process( + COMMAND ${CMAKE_COMMAND} -H. -Bproject_build -G "${CMAKE_GENERATOR}" + RESULT_VARIABLE result + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${GIT_DEP_NAME}) + if(result) + message(FATAL_ERROR "CMake step for ${GIT_DEP_NAME} failed: ${result}") + endif() + + include(ProcessorCount) + ProcessorCount(NB_PROC) + + execute_process( + COMMAND ${CMAKE_COMMAND} --build project_build --config ${CMAKE_BUILD_TYPE} -j ${NB_PROC} + RESULT_VARIABLE result + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${GIT_DEP_NAME}) + if(result) + message(FATAL_ERROR "Build step for ${GIT_DEP_NAME} failed: ${result}") + endif() + + message(STATUS "Building ${GIT_DEP_NAME}: ...DONE") +endfunction() diff --git a/conception/Architecture_decision_records/Create_custom_vcpkg_ports_for_deps.md b/conception/Architecture_decision_records/Create_custom_vcpkg_ports_for_deps.md new file mode 100644 index 000000000..d47a75253 --- /dev/null +++ b/conception/Architecture_decision_records/Create_custom_vcpkg_ports_for_deps.md @@ -0,0 +1,31 @@ +# Manage dependencies with custom vcpkg ports + +## Status: Accepted [06/2024] + + +## Context + +The various dependencies of the application are managed through different ways: +- some are managed through the system package manager +- some are managed through vcpkg +- some are downloaded and compiled by the application itself through cmake or by the developer + +This disparity is further enhanced by the unavailability of some dependencies in packet managers for some plateforme (e.g. CentOS 7). + +## Decision + +We should strive to use only one methode to manage dependencies. We choose to use vcpkg for all dependencies. +In some cases, we will have to create custom vcpkg ports for dependencies that are not available in vcpkg. + +## Consequences + +- The dependencies will be managed in a more consistent way +- The dependencies will be centralized in one place (vcpkg manifest) +- Several dependencies moved to vcpkg via official or custom ports. + +## Limitations + +- Some dependencies (sirius) are not first degree dependencies but N-degree, mainly for simulator. + While a custom port or registry of Antares Simulator is build, +we need to manage those dependencies. +- Ortools is challenging to port to vcpkg. Work in progress. \ No newline at end of file diff --git a/conception/Architecture_decision_records/Zip_Lib.md b/conception/Architecture_decision_records/Zip_Lib.md index c374cbd74..99547620f 100644 --- a/conception/Architecture_decision_records/Zip_Lib.md +++ b/conception/Architecture_decision_records/Zip_Lib.md @@ -4,11 +4,11 @@ This ADR aims to select the library that will be used to manage MPS files in ZIP Status === -[minizip-ng](https://github.com/zlib-ng/minizip-ng): Accepted [08/2022] +[minizip-ng](https://github.com/zlib-ng/minizip-ng): Deprecated [06/2024] by [Create_custom_vcpkg_ports_for_deps.md](Create_custom_vcpkg_ports_for_deps.md) Context === -Mps files produced by both Antares Simulator and Xpansion can have a signicant weigths on disk space. It's has been proven that putting them in an archive does not alterate Antares and Xpansion algorithms and naturaly resulting zipped files has a less demand on disk space. +Mps files produced by both Antares Simulator and Xpansion can have a signicant weigths on disk space. It has been proven that putting them in an archive does not alterate Antares and Xpansion algorithms and naturaly resulting zipped files has a less demand on disk space. Decision === diff --git a/ports/coin-or-cbc/portfile.cmake b/ports/coin-or-cbc/portfile.cmake new file mode 100644 index 000000000..144f69f75 --- /dev/null +++ b/ports/coin-or-cbc/portfile.cmake @@ -0,0 +1,22 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO "Mizux/Cbc" + REF "5714054827d852fae3beb7a4065f84ea56f207bb" + SHA512 d9d563b7af6102ba29c522cabf983ebde31a38f7010f578bc0dca258e63245c92b975fd0a3d5b96c7eeba886034b1e188d1399eb0d67769e0fa560c23e088ebf + HEAD_REF master +) +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Cbc PACKAGE_NAME Cbc) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/coin-or-cbc/vcpkg.json b/ports/coin-or-cbc/vcpkg.json new file mode 100644 index 000000000..90c1e040b --- /dev/null +++ b/ports/coin-or-cbc/vcpkg.json @@ -0,0 +1,20 @@ +{ + "name": "coin-or-cbc", + "version": "2.10.7", + "port-version": 0, + "description": "Fork from CBC", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "coin-or-cgl", + "coin-or-clp", + "coin-or-osi", + "coinutils" + ] +} diff --git a/ports/coin-or-cgl/portfile.cmake b/ports/coin-or-cgl/portfile.cmake new file mode 100644 index 000000000..8bc58e0ca --- /dev/null +++ b/ports/coin-or-cgl/portfile.cmake @@ -0,0 +1,22 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO "Mizux/Cgl" + REF "925ad49fdd958ddb51f3ecfd87d222b0ea8d26a8" + SHA512 365c204272f6d20f881ce5e14cfa3c2c1d5b0aef1ff92a7f8a889c708b2d091105bc1ba2dfdee911b3cab876af677f5ee3e55657f9fdb9356915966379587261 + HEAD_REF master +) +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Cgl PACKAGE_NAME Cgl) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/coin-or-cgl/vcpkg.json b/ports/coin-or-cgl/vcpkg.json new file mode 100644 index 000000000..9c149f623 --- /dev/null +++ b/ports/coin-or-cgl/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "coin-or-cgl", + "version": "0.60.5", + "port-version": 0, + "description": "Fork from CGl", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "coin-or-clp", + "coin-or-osi", + "coinutils" + ] +} diff --git a/ports/coin-or-clp/portfile.cmake b/ports/coin-or-clp/portfile.cmake new file mode 100644 index 000000000..355bef5ec --- /dev/null +++ b/ports/coin-or-clp/portfile.cmake @@ -0,0 +1,22 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO "Mizux/Clp" + REF "d8cdeb5fd6d51ac7d0f50778d2b2feccaa716228" + SHA512 58e737deeb5276e4894fbebac0f60da13e8419b6cff531be381bc582320ceeab0f4688c8ec29d4e7248b6cc5256edb27b2e98496913262ce0f2960b6b6ab598c + HEAD_REF master +) +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Clp PACKAGE_NAME Clp) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/coin-or-clp/vcpkg.json b/ports/coin-or-clp/vcpkg.json new file mode 100644 index 000000000..bc85177d5 --- /dev/null +++ b/ports/coin-or-clp/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "coin-or-clp", + "version": "1.17", + "port-version": 0, + "description": "Fork from Clp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "coin-or-osi", + "coinutils" + ] +} diff --git a/ports/coin-or-osi/portfile.cmake b/ports/coin-or-osi/portfile.cmake new file mode 100644 index 000000000..737fbbeef --- /dev/null +++ b/ports/coin-or-osi/portfile.cmake @@ -0,0 +1,22 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO "Mizux/Osi" + REF "d724c4a5a0d87669d63e44179c468d8a02f4f69a" + SHA512 fb173c04e3920c863e4d29e202cbaf182ee21332dc05ce293ffc39ead1b124f86f9682cc12032d216a712ea9aa3d0c98176bcbcd1b217e93afc6ce5a1ced68ed + HEAD_REF master +) +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Osi PACKAGE_NAME Osi) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/coin-or-osi/vcpkg.json b/ports/coin-or-osi/vcpkg.json new file mode 100644 index 000000000..c8b1ff4b3 --- /dev/null +++ b/ports/coin-or-osi/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "coin-or-osi", + "version": "0.108.7", + "port-version": 0, + "description": "Fork from Osi", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "coinutils" + ] +} diff --git a/ports/coinutils/portfile.cmake b/ports/coinutils/portfile.cmake new file mode 100644 index 000000000..153722282 --- /dev/null +++ b/ports/coinutils/portfile.cmake @@ -0,0 +1,23 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO "Mizux/CoinUtils" + REF "d92accd9a2aa4cffe84e8f9a5a71eea06fb1ba87" + SHA512 addd95047c935fd3199f6951bf6f269887c0a66f285d4d9947b6290de24ab54867f459a340da1010451331272e4168d413ab167c52019fb4dbe486633f8b93d9 + HEAD_REF master +) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/CoinUtils) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/coinutils/vcpkg.json b/ports/coinutils/vcpkg.json new file mode 100644 index 000000000..ac011a364 --- /dev/null +++ b/ports/coinutils/vcpkg.json @@ -0,0 +1,31 @@ +{ + "name": "coinutils", + "version": "2.11.6", + "port-version": 0, + "description": "Fork from CoinUtils", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "bzip2", + "coin-or-buildtools", + "lapack", + "zlib" + ], + "features": { + "glpk": { + "description": "Build with Glpk", + "dependencies": [ + { + "name": "glpk", + "default-features": false + } + ] + } + } +} diff --git a/ports/sirius-solver/portfile.cmake b/ports/sirius-solver/portfile.cmake new file mode 100644 index 000000000..653563a75 --- /dev/null +++ b/ports/sirius-solver/portfile.cmake @@ -0,0 +1,21 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO "rte-france/sirius-solver" + REF "f1a76af11ffa36304a176f317da3c91103b9f066" + SHA512 c5ac431a8c8b4a076620ec57b6f7899d7d8e729e97fb1628cfa58dbd8313fd2252ccf63cf8797499e0f4f43b08b2974fbbbff8f2fc4f9621da973642fd0d4fbe + HEAD_REF main +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}/src" +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME sirius_solver CONFIG_PATH cmake) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/LICENSE.TXT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/sirius-solver/vcpkg.json b/ports/sirius-solver/vcpkg.json new file mode 100644 index 000000000..ded804499 --- /dev/null +++ b/ports/sirius-solver/vcpkg.json @@ -0,0 +1,16 @@ +{ + "name": "sirius-solver", + "version": "1.5", + "port-version": 0, + "description": "Sirius solver", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/src/cpp/helpers/ArchiveReader.cpp b/src/cpp/helpers/ArchiveReader.cpp index 65cd7b490..eb8491d6d 100644 --- a/src/cpp/helpers/ArchiveReader.cpp +++ b/src/cpp/helpers/ArchiveReader.cpp @@ -15,7 +15,7 @@ ArchiveReader::ArchiveReader(const std::filesystem::path& archivePath) ArchiveReader::ArchiveReader() : ArchiveIO() { Create(); } void ArchiveReader::Create() { std::unique_lock lock(mutex_); - mz_zip_reader_create(&pmz_zip_reader_instance_); + pmz_zip_reader_instance_ = mz_zip_reader_create(); } int32_t ArchiveReader::Open() { diff --git a/src/cpp/helpers/ArchiveWriter.cpp b/src/cpp/helpers/ArchiveWriter.cpp index d90619e76..23c78b5a9 100644 --- a/src/cpp/helpers/ArchiveWriter.cpp +++ b/src/cpp/helpers/ArchiveWriter.cpp @@ -18,7 +18,7 @@ ArchiveWriter::ArchiveWriter() : ArchiveIO() { void ArchiveWriter::Create() { std::unique_lock lock(mutex_); - mz_zip_writer_create(&pmz_zip_writer_instance_); + pmz_zip_writer_instance_ = mz_zip_writer_create(); } void ArchiveWriter::InitFileInfo() { fileInfo_.compression_method = MZ_COMPRESS_METHOD_DEFLATE; diff --git a/tests/cpp/zip_mps/zip_mps_lib_tests.cpp b/tests/cpp/zip_mps/zip_mps_lib_tests.cpp index 77560598b..e70c5ca33 100644 --- a/tests/cpp/zip_mps/zip_mps_lib_tests.cpp +++ b/tests/cpp/zip_mps/zip_mps_lib_tests.cpp @@ -136,7 +136,7 @@ void compareArchiveAndDir(const std::filesystem::path& archivePath, const std::filesystem::path& tmpDir) { void* reader = NULL; - mz_zip_reader_create(&reader); + reader = mz_zip_reader_create(); const auto& archive_path_str = archivePath.string(); auto archive_path_c_str = archive_path_str.c_str(); assert(mz_zip_reader_open_file(reader, archive_path_c_str) == MZ_OK); diff --git a/vcpkg b/vcpkg index db0f4e665..f7423ee18 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit db0f4e665e52834894a2e53a1c911475cb08fc96 +Subproject commit f7423ee180c4b7f40d43402c2feb3859161ef625 diff --git a/vcpkg.json b/vcpkg.json index ab04e8898..3b5659521 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,16 +2,40 @@ "name": "antares-xpansion", "version-string": "1.3.0", "builtin-baseline": "943c5ef1c8f6b5e6ced092b242c8299caae2ff01", + "vcpkg-configuration": { + "overlay-ports": [ + "./ports" + ] + }, "dependencies": [ "jsoncpp", "gtest", - "boost-mpi", - "boost-program-options", - "zlib", - "yaml-cpp" - ], - "overrides": [ - { "name": "boost-mpi", "version": "1.81.0" }, - { "name": "boost-program-options", "version": "1.81.0" } + "gflags", + "coin-or-cbc", + { + "name": "boost-mpi", + "version>=": "1.81.0" + }, + { + "name": "boost-program-options", + "version>=": "1.81.0" + }, + { + "name": "boost-algorithm", + "version>=": "1.81.0" + }, + "yaml-cpp", + { + "name": "minizip-ng", + "default-features": false, + "version>=": "4.0.0", + "features": [ + "zlib" + ] + }, + { + "name": "sirius-solver", + "version>=": "1.5" + } ] }