From c5641bec4bdaef5fee639cfa611bb93e01681859 Mon Sep 17 00:00:00 2001 From: jchristopherson Date: Mon, 29 Jun 2026 15:39:41 -0500 Subject: [PATCH 1/6] Update version info --- CMakeLists.txt | 2 +- fpm.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index afdef22..6b450db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.24) project( fplot LANGUAGES Fortran - VERSION 1.8.9 + VERSION 1.8.10 ) # Confgiure everything diff --git a/fpm.toml b/fpm.toml index 616944b..cba8664 100644 --- a/fpm.toml +++ b/fpm.toml @@ -1,5 +1,5 @@ name = "fplot" -version = "1.8.9" +version = "1.8.10" license = "GPL-3.0" author = "Jason Christopherson" maintainer = "Jason Christopherson" From 305b31bad941adfad8d83d5017bb5091ba653bd8 Mon Sep 17 00:00:00 2001 From: jchristopherson Date: Mon, 29 Jun 2026 15:39:52 -0500 Subject: [PATCH 2/6] Clean up --- examples/CMakeLists.txt | 5 +---- src/CMakeLists.txt | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index b05a4c1..feda836 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(fstring QUIET) - # Example 1 add_executable(generic_2d_plot generic_2d_plot.f90) target_link_libraries(generic_2d_plot fplot) @@ -131,7 +129,6 @@ target_link_libraries(arrow_example fplot) # Example 33 add_executable(custom_colormap_example custom_colormap_example.f90) target_link_libraries(custom_colormap_example fplot) -target_link_libraries(custom_colormap_example forcolormap) # Example 34 add_executable(variable_point_size_2d_example variable_point_size_2d_example.f90) @@ -151,7 +148,7 @@ target_link_libraries(margins_example fplot) # Example 38 add_executable(box_whisker_example box_whisker_example.f90) -target_link_libraries(box_whisker_example fplot fstring::fstring) +target_link_libraries(box_whisker_example fplot) # Example 39 add_executable(jitter_plot_example jitter_plot_example.f90) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0febaba..3391d04 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -125,10 +125,6 @@ target_link_libraries( ${PROJECT_NAME} PUBLIC ${FERROR_LIBRARIES} -) -target_link_libraries( - ${PROJECT_NAME} - PRIVATE ${COLLECTIONS_LIBRARIES} ${GEOMPACK_LIBRARIES} ${FSTRING_LIBRARIES} From 3bebfb6ddc3480ecd937873ceacd72d60a067d2b Mon Sep 17 00:00:00 2001 From: jchristopherson Date: Wed, 1 Jul 2026 15:32:49 -0500 Subject: [PATCH 3/6] Include dependencies for static library --- configure/template.cmake | 9 +++++++++ src/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/configure/template.cmake b/configure/template.cmake index ffdb09b..dba1f8e 100644 --- a/configure/template.cmake +++ b/configure/template.cmake @@ -1,5 +1,14 @@ @PACKAGE_INIT@ +# For static libraries, consumers need to find dependencies +if(NOT BUILD_SHARED_LIBS) + include(CMakeFindDependencyMacro) + find_dependency(ferror QUIET) + find_dependency(collections QUIET) + find_dependency(geompack QUIET) + find_dependency(fstring QUIET) +endif() + if(NOT TARGET "@PROJECT_NAME@::@PROJECT_NAME@") include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") endif() \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3391d04..6047d19 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -163,18 +163,44 @@ install( ) install(DIRECTORY ${FPLOT_MOD_DIR} DESTINATION ${CMAKE_INSTALL_MODULEDIR}) -if (${BUILD_FERROR} AND ${BUILD_SHARED_LIBS}) +# For static libraries, install dependency libraries +if(NOT BUILD_SHARED_LIBS) + # Install fetched dependency libraries if they were built + if(${BUILD_FERROR}) + install(TARGETS ${FERROR_LIBRARIES} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + if(${BUILD_COLLECTIONS}) + install(TARGETS ${COLLECTIONS_LIBRARIES} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + if(${BUILD_GEOMPACK}) + install(TARGETS ${GEOMPACK_LIBRARIES} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + if(${BUILD_FSTRING}) + install(TARGETS ${FSTRING_LIBRARIES} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() +endif() + +# For shared libraries, install runtime artifacts +if(${BUILD_FERROR} AND ${BUILD_SHARED_LIBS}) install(IMPORTED_RUNTIME_ARTIFACTS ${FERROR_LIBRARIES}) endif() -if (${BUILD_COLLECTIONS} AND ${BUILD_SHARED_LIBS}) +if(${BUILD_COLLECTIONS} AND ${BUILD_SHARED_LIBS}) install(IMPORTED_RUNTIME_ARTIFACTS ${COLLECTIONS_LIBRARIES}) endif() -if (${BUILD_GEOMPACK} AND ${BUILD_SHARED_LIBS}) +if(${BUILD_GEOMPACK} AND ${BUILD_SHARED_LIBS}) install(IMPORTED_RUNTIME_ARTIFACTS ${GEOMPACK_LIBRARIES}) endif() -if (${BUILD_FSTRING} AND ${BUILD_SHARED_LIBS}) +if(${BUILD_FSTRING} AND ${BUILD_SHARED_LIBS}) install(IMPORTED_RUNTIME_ARTIFACTS ${FSTRING_LIBRARIES}) endif() From 4ac1694515316f16ead92de60397ab380c3184c1 Mon Sep 17 00:00:00 2001 From: Jason Christopherson Date: Thu, 16 Jul 2026 14:18:47 -0500 Subject: [PATCH 4/6] Clean up --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b450db..5886a0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,12 +6,12 @@ project( VERSION 1.8.10 ) -# Confgiure everything -add_subdirectory(configure) - # Source add_subdirectory(src) +# Confgiure everything +add_subdirectory(configure) + # Install install( EXPORT ${PROJECT_NAME}-targets From 5cb885d7fa291bd375f161c313d062b69a8401a1 Mon Sep 17 00:00:00 2001 From: Jason Christopherson Date: Thu, 16 Jul 2026 14:18:51 -0500 Subject: [PATCH 5/6] Update CI --- .github/workflows/cmake.yml | 115 ++++++++++++++++++++--------- .github/workflows/fpm.yml | 142 +++++++++++++++++++----------------- 2 files changed, 157 insertions(+), 100 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 655e6ba..b584002 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -2,61 +2,110 @@ name: CMake on: push: - branches: [ "master" ] + branches: ["master"] pull_request: - branches: [ "master" ] + branches: ["master"] env: BUILD_TYPE: Release jobs: test: + name: ${{ matrix.os }} / ${{ matrix.compiler }} / shared=${{ matrix.shared }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] - toolchain: - - {compiler: gcc, version: 15} - - {compiler: gcc, version: 16} - - {compiler: intel, version: '2021.1'} - - {compiler: intel, version: '2022.0'} - - {compiler: intel, version: '2023.0'} - - {compiler: intel, version: '2024.0'} - exclude: - - os: macos-latest - toolchain: {compiler: gcc, version: 16} - - os: macos-latest - toolchain: {compiler: intel, version: '2022.0'} - - os: macos-latest - toolchain: {compiler: intel, version: '2023.0'} + include: + - os: ubuntu-latest + compiler: gcc + version: '14' + shared: false + - os: ubuntu-latest + compiler: gcc + version: '14' + shared: true + - os: ubuntu-latest + compiler: gcc + version: '15' + shared: false + - os: ubuntu-latest + compiler: gcc + version: '15' + shared: true + - os: ubuntu-latest + compiler: intel + version: '2023.2' + shared: false + - os: ubuntu-latest + compiler: intel + version: '2023.2' + shared: true - os: macos-latest - toolchain: {compiler: intel, version: '2024.0'} + compiler: gcc + version: '14' + shared: false - os: macos-latest - toolchain: {compiler: intel, version: '2025.0'} - - os: ubuntu-latest - toolchain: {compiler: intel, version: 2021.1} + compiler: gcc + version: '14' + shared: true steps: - - uses: fortran-lang/setup-fortran@v1.6.1 + - uses: actions/checkout@v4 + + - uses: fortran-lang/setup-fortran@v1 id: setup-fortran with: - compiler: ${{ matrix.toolchain.compiler }} - version: ${{ matrix.toolchain.version }} - - - run: ${{ env.FC }} --version + compiler: ${{ matrix.compiler }} + version: ${{ matrix.version }} + + - name: Show Fortran compiler version + run: ${{ env.FC }} --version env: FC: ${{ steps.setup-fortran.outputs.fc }} CC: ${{ steps.setup-fortran.outputs.cc }} - - uses: actions/checkout@v3 - - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_Fortran_COMPILER=${{ env.FC }} -DBUILD_TESTING=TRUE - + run: >- + cmake -S . -B build + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + -DCMAKE_Fortran_COMPILER=${{ env.FC }} + -DCMAKE_C_COMPILER=${{ env.CC }} + -DBUILD_TESTING=TRUE + -DBUILD_SHARED_LIBS=${{ matrix.shared && 'TRUE' || 'FALSE' }} + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + - name: Build with CMake - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + run: cmake --build build --config ${{ env.BUILD_TYPE }} - name: Test with CMake - working-directory: ${{github.workspace}}/build - run: ctest -C ${{env.BUILD_TYPE}} + working-directory: build + run: ctest --output-on-failure -C ${{ env.BUILD_TYPE }} + + - name: Install with CMake + run: cmake --install build --prefix ${{ github.workspace }}/install --config ${{ env.BUILD_TYPE }} + + - name: Verify install with CMake consumer + run: | + mkdir -p consumer + cat > consumer/CMakeLists.txt <<'EOF' + cmake_minimum_required(VERSION 3.24) + project(fplot_consumer LANGUAGES Fortran) + + find_package(fplot CONFIG REQUIRED) + + add_executable(fplot_consumer main.f90) + target_link_libraries(fplot_consumer PRIVATE fplot::fplot) + EOF + + cat > consumer/main.f90 <<'EOF' + program main + use fplot + print *, "fplot package found" + end program main + EOF + + cmake -S consumer -B consumer/build -DCMAKE_PREFIX_PATH=${{ github.workspace }}/install + cmake --build consumer/build \ No newline at end of file diff --git a/.github/workflows/fpm.yml b/.github/workflows/fpm.yml index 7b9464b..2e22d35 100644 --- a/.github/workflows/fpm.yml +++ b/.github/workflows/fpm.yml @@ -1,82 +1,90 @@ name: fpm -on: [push, pull_request] +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] jobs: - test_fpm: - if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} - name: ${{ matrix.os }}_${{ matrix.compiler }}_fpm + build-and-test: + name: ${{ matrix.os }} / ${{ matrix.compiler }} / shared=${{ matrix.shared }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - - {os: ubuntu-latest, compiler: gfortran } - - {os: ubuntu-latest, compiler: ifx } - - {os: windows-latest, compiler: gfortran } - - {os: windows-latest, compiler: ifx, fpm-version: "0.12.0"} - - {os: macos-latest, compiler: gfortran } + - os: ubuntu-latest + compiler: gcc + version: '14' + shared: false + - os: ubuntu-latest + compiler: gcc + version: '14' + shared: true + - os: ubuntu-latest + compiler: gcc + version: '15' + shared: false + - os: ubuntu-latest + compiler: gcc + version: '15' + shared: true + - os: ubuntu-latest + compiler: intel + version: '2023.2' + shared: true + steps: - - name: Setup Fortran - uses: gha3mi/setup-fortran-conda@latest + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Fortran toolchain + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran with: compiler: ${{ matrix.compiler }} - fpm-version: ${{ matrix.fpm-version }} - - - name: fpm test (debug) - if: always() - run: fpm test --profile debug --compiler ${{ matrix.compiler }} --verbose - - - name: fpm test (release) - if: always() - run: fpm test --profile release --compiler ${{ matrix.compiler }} --verbose - - - name: fpm example (debug) - if: always() - run: fpm run --example --all --profile debug --compiler ${{ matrix.compiler }} --verbose + version: ${{ matrix.version }} + + - name: Show compiler version + shell: bash + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + run: | + "$FC" --version - - name: fpm example (release) - if: always() - run: fpm run --example --all --profile release --compiler ${{ matrix.compiler }} --verbose - -# jobs: -# gcc-build: -# runs-on: ${{ matrix.os }} -# strategy: -# fail-fast: false -# matrix: -# os: [ubuntu-latest] -# gcc_v: [15] # Version of GFortran we want to use. -# include: -# - os: ubuntu-latest -# os-arch: linux-x86_64 - -# env: -# FC: gfortran -# GCC_V: ${{ matrix.gcc_v }} - -# steps: -# - name: Checkout code -# uses: actions/checkout@v1 - -# - name: Install GFortran Linux -# if: contains(matrix.os, 'ubuntu') -# run: | -# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ -# --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ -# --slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V} - -# - name: Install fpm -# uses: fortran-lang/setup-fpm@v5 -# with: -# fpm-version: 'v0.10.1' + - name: Install fpm + uses: fortran-lang/setup-fpm@v5 + with: + fpm-version: 'v0.10.1' -# - name: Build FPLOT -# run: | -# gfortran --version -# fpm build + - name: Build FPLOT + shell: bash + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + FPM_FC: ${{ steps.setup-fortran.outputs.fc }} + FPM_CC: ${{ steps.setup-fortran.outputs.cc }} + FPM_FLAGS: ${{ matrix.shared && '--flag=-fPIC' || '' }} + run: | + if [[ -n "$FPM_FLAGS" ]]; then + fpm build $FPM_FLAGS + else + fpm build + fi -# - name: Run tests -# run: | -# gfortran --version -# fpm test \ No newline at end of file + - name: Run tests + shell: bash + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + FPM_FC: ${{ steps.setup-fortran.outputs.fc }} + FPM_CC: ${{ steps.setup-fortran.outputs.cc }} + FPM_FLAGS: ${{ matrix.shared && '--flag=-fPIC' || '' }} + run: | + if [[ -n "$FPM_FLAGS" ]]; then + fpm test $FPM_FLAGS + else + fpm test + fi \ No newline at end of file From 190429515d0d17419e768c588676409b85883a8f Mon Sep 17 00:00:00 2001 From: Jason Christopherson Date: Thu, 16 Jul 2026 14:22:52 -0500 Subject: [PATCH 6/6] Update compiler versions --- .github/workflows/cmake.yml | 14 +++----------- .github/workflows/fpm.yml | 8 -------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b584002..df45bb3 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -17,14 +17,6 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-latest - compiler: gcc - version: '14' - shared: false - - os: ubuntu-latest - compiler: gcc - version: '14' - shared: true - os: ubuntu-latest compiler: gcc version: '15' @@ -43,11 +35,11 @@ jobs: shared: true - os: macos-latest compiler: gcc - version: '14' + version: '15' shared: false - os: macos-latest compiler: gcc - version: '14' + version: '15' shared: true steps: @@ -102,7 +94,7 @@ jobs: cat > consumer/main.f90 <<'EOF' program main - use fplot + use fplot_core print *, "fplot package found" end program main EOF diff --git a/.github/workflows/fpm.yml b/.github/workflows/fpm.yml index 2e22d35..9d063e9 100644 --- a/.github/workflows/fpm.yml +++ b/.github/workflows/fpm.yml @@ -14,14 +14,6 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-latest - compiler: gcc - version: '14' - shared: false - - os: ubuntu-latest - compiler: gcc - version: '14' - shared: true - os: ubuntu-latest compiler: gcc version: '15'