diff --git a/thirdparty/ffs/ffs/.github/workflows/build-and-test.yml b/thirdparty/ffs/ffs/.github/workflows/build-and-test.yml index f485641348..0b9926ae9e 100644 --- a/thirdparty/ffs/ffs/.github/workflows/build-and-test.yml +++ b/thirdparty/ffs/ffs/.github/workflows/build-and-test.yml @@ -8,6 +8,10 @@ on: branches: - master +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: linux: # The jobs should run pretty quick; anything over 30m essentially means @@ -24,17 +28,17 @@ jobs: fail-fast: false matrix: buildtype: [ release, debug ] - os: [ ubuntu1604, ubuntu1804, ubuntu2004 ] + os: [ centos7, alma8, ubuntu1604, ubuntu1804, ubuntu2004 ] compiler: [ clang, gcc, nvhpc ] exclude: - - { os: centos8, compiler: nvhpc } + - { os: alma8, compiler: nvhpc } - { os: ubuntu1604, compiler: nvhpc } - { os: ubuntu1804, compiler: nvhpc } include: - os: centos7 container: centos:7 - - os: centos8 - container: centos:8 + - os: alma8 + container: almalinux:8 - os: ubuntu1604 container: ubuntu:16.04 - os: ubuntu1804 @@ -82,14 +86,14 @@ jobs: matrix: buildtype: [ release, debug ] jobname: [ - windows-vs2019-msvc, - windows-vs2019-clang, + windows2019-vs2019-clang, + windows2022-vs2022-msvc, macos-clang ] include: - - jobname: windows-vs2019-msvc - vm: windows-latest - - jobname: windows-vs2019-clang - vm: windows-latest + - jobname: windows2019-vs2019-clang + vm: windows-2019 + - jobname: windows2022-vs2022-msvc + vm: windows-2022 - jobname: macos-clang vm: macos-latest @@ -107,6 +111,7 @@ jobs: run: | . source/scripts/ci/setup/windows.sh source/scripts/ci/setup/install-atl.sh ${{ matrix.buildtype }} + source/scripts/ci/setup/install-dill.sh ${{ matrix.buildtype }} - name: Setup if: ${{ runner.os == 'macOS' }} run: | diff --git a/thirdparty/ffs/ffs/ffs/tests/CMakeLists.txt b/thirdparty/ffs/ffs/ffs/tests/CMakeLists.txt index a498335b92..665c5e1982 100644 --- a/thirdparty/ffs/ffs/ffs/tests/CMakeLists.txt +++ b/thirdparty/ffs/ffs/ffs/tests/CMakeLists.txt @@ -1,4 +1,10 @@ -set (TESTS context_test context_test2 fortran_test get_set_test) +if (NO_CONTEXT_TESTS) + set (TESTS "") +else() + set (TESTS context_test context_test2 fortran_test) +endif() + +list (APPEND TESTS get_set_test) set (PROGS ffs_write ffs_index_test ffs_file_test test_file_unique) if (DILL_FOUND) @@ -37,11 +43,13 @@ FILE(GLOB CTOS ${FFS_SOURCE_DIR}/ffs/output_dir/context_test_output*.bin) FILE(GLOB FOS ${FFS_SOURCE_DIR}/ffs/output_dir/file_output*.bin) FILE(GLOB IOS ${FFS_SOURCE_DIR}/ffs/output_dir/index_output*.bin) -ADD_TEST(NAME write_context_output - COMMAND context_test -w ${FFS_BINARY_DIR}/ffs/tests/context_test_output.bin) -ADD_TEST(NAME context_output_unique - COMMAND test_file_unique - ${FFS_BINARY_DIR}/ffs/tests/context_test_output.bin ${CTOS}) +if (NOT NO_CONTEXT_TESTS) + ADD_TEST(NAME write_context_output + COMMAND context_test -w ${FFS_BINARY_DIR}/ffs/tests/context_test_output.bin) + ADD_TEST(NAME context_output_unique + COMMAND test_file_unique + ${FFS_BINARY_DIR}/ffs/tests/context_test_output.bin ${CTOS}) +endif() ADD_TEST(NAME write_file_output COMMAND ffs_write ${FFS_BINARY_DIR}/ffs/tests/file_output.bin) ADD_TEST(NAME file_output_unique @@ -60,11 +68,13 @@ LIST(APPEND IOS index_output.bin) LIST(APPEND IOS index_reopen_output.bin) LIST(REMOVE_DUPLICATES IOS) +if (NOT NO_CONTEXT_TESTS) foreach (CTOUT ${CTOS}) GET_FILENAME_COMPONENT(BASENAME ${CTOUT} NAME) ADD_TEST(NAME CTOUT_${BASENAME} COMMAND context_test -r ${CTOUT}) set_property(TEST CTOUT_${BASENAME} APPEND PROPERTY DEPENDS write_context_output) endforeach() +endif() foreach (FOUT ${FOS}) GET_FILENAME_COMPONENT(BASENAME ${FOUT} NAME) diff --git a/thirdparty/ffs/ffs/fm/fm_formats.c b/thirdparty/ffs/ffs/fm/fm_formats.c index 5363bbf8c7..17f01f0ddd 100755 --- a/thirdparty/ffs/ffs/fm/fm_formats.c +++ b/thirdparty/ffs/ffs/fm/fm_formats.c @@ -1693,6 +1693,10 @@ void add_format(FMFormat f, FMFormat* sorted, FMFormat *visited, FMFormat* stack /* if n has not been visited yet then */ if (!on_list(f, visited)) { FMFormat tmp[100]; + FMFormat *tmp_list = &tmp[0]; + if (f->field_count >= (sizeof(tmp)/sizeof(tmp[0]))) { + tmp_list = malloc(f->field_count * sizeof(tmp[0])); + } int count = 0; int i; /* mark n as visited */ @@ -1701,15 +1705,16 @@ void add_format(FMFormat f, FMFormat* sorted, FMFormat *visited, FMFormat* stack /* get subfields and sort them by name for predictability */ for (i=0; i < f->field_count; i++) { if (f->field_subformats[i] != NULL) { - tmp[count++] = f->field_subformats[i]; + tmp_list[count++] = f->field_subformats[i]; } } - qsort(&tmp[0], count, sizeof(tmp[0]), compare_by_name_FMFormat); + qsort(&tmp_list[0], count, sizeof(tmp_list[0]), compare_by_name_FMFormat); for (i=0; i < count; i++) { - add_format(tmp[i], sorted, visited, stack); + add_format(tmp_list[i], sorted, visited, stack); } add_to_list(f, sorted); + if (tmp_list != &tmp[0]) free(tmp_list); } } diff --git a/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-clang.cmake b/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-clang.cmake new file mode 100644 index 0000000000..6f6f2e2d40 --- /dev/null +++ b/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-clang.cmake @@ -0,0 +1,7 @@ +# Client maintainer: chuck.atkins@kitware.com + +set(ENV{CC} clang) +set(ENV{CXX} clang++) + +list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") +include(${CMAKE_CURRENT_LIST_DIR}/unix-common.cmake) diff --git a/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-gcc.cmake b/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-gcc.cmake new file mode 100644 index 0000000000..8a1c976d8f --- /dev/null +++ b/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-gcc.cmake @@ -0,0 +1,7 @@ +# Client maintainer: chuck.atkins@kitware.com + +set(ENV{CC} gcc) +set(ENV{CXX} g++) + +list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") +include(${CMAKE_CURRENT_LIST_DIR}/unix-common.cmake) diff --git a/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-intel.cmake b/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-intel.cmake new file mode 100644 index 0000000000..b173d984ec --- /dev/null +++ b/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-intel.cmake @@ -0,0 +1,7 @@ +# Client maintainer: chuck.atkins@kitware.com + +set(ENV{CC} icc) +set(ENV{CXX} icpc) + +list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") +include(${CMAKE_CURRENT_LIST_DIR}/unix-common.cmake) diff --git a/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-inteloneapi.cmake b/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-inteloneapi.cmake new file mode 100644 index 0000000000..09ca1203cd --- /dev/null +++ b/thirdparty/ffs/ffs/scripts/ci/cmake/alma8-inteloneapi.cmake @@ -0,0 +1,7 @@ +# Client maintainer: chuck.atkins@kitware.com + +set(ENV{CC} icx) +set(ENV{CXX} icpx) + +list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") +include(${CMAKE_CURRENT_LIST_DIR}/unix-common.cmake) diff --git a/thirdparty/ffs/ffs/scripts/ci/cmake/common.cmake b/thirdparty/ffs/ffs/scripts/ci/cmake/common.cmake index 0d3eed99cc..c92d25277d 100644 --- a/thirdparty/ffs/ffs/scripts/ci/cmake/common.cmake +++ b/thirdparty/ffs/ffs/scripts/ci/cmake/common.cmake @@ -1,5 +1,6 @@ string(APPEND dashboard_cache " BUILD_TESTING:BOOL=ON +NO_CONTEXT_TESTS:BOOL=ON ") if(POLICY CMP0057) diff --git a/thirdparty/ffs/ffs/scripts/ci/cmake/windows-common.cmake b/thirdparty/ffs/ffs/scripts/ci/cmake/windows-common.cmake index 2dd9a555b4..1b227e5395 100644 --- a/thirdparty/ffs/ffs/scripts/ci/cmake/windows-common.cmake +++ b/thirdparty/ffs/ffs/scripts/ci/cmake/windows-common.cmake @@ -1,10 +1,6 @@ # Client maintainer: chuck.atkins@kitware.com -set(ENV{atl_ROOT} "$ENV{CI_ROOT_DIR}/atl/install") -set(ENV{PATH} "$ENV{CI_ROOT_DIR}/atl/install/bin") - string(APPEND dashboard_cache " -FFS_USE_DILL:BOOL=OFF ") list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") diff --git a/thirdparty/ffs/ffs/scripts/ci/cmake/windows2019-vs2019-clang.cmake b/thirdparty/ffs/ffs/scripts/ci/cmake/windows2019-vs2019-clang.cmake new file mode 100644 index 0000000000..f562eccdfa --- /dev/null +++ b/thirdparty/ffs/ffs/scripts/ci/cmake/windows2019-vs2019-clang.cmake @@ -0,0 +1,8 @@ +# Client maintainer: chuck.atkins@kitware.com + +set(CTEST_CMAKE_GENERATOR "Visual Studio 16 2019") +set(CTEST_CMAKE_GENERATOR_PLATFORM x64) +set(CTEST_CMAKE_GENERATOR_TOOLSET ClangCL) + +list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") +include(${CMAKE_CURRENT_LIST_DIR}/windows-common.cmake) diff --git a/thirdparty/ffs/ffs/scripts/ci/cmake/windows2022-vs2022-msvc.cmake b/thirdparty/ffs/ffs/scripts/ci/cmake/windows2022-vs2022-msvc.cmake new file mode 100644 index 0000000000..3a9b473d57 --- /dev/null +++ b/thirdparty/ffs/ffs/scripts/ci/cmake/windows2022-vs2022-msvc.cmake @@ -0,0 +1,7 @@ +# Client maintainer: chuck.atkins@kitware.com + +set(CTEST_CMAKE_GENERATOR "Visual Studio 17 2022") +set(CTEST_CMAKE_GENERATOR_PLATFORM x64) + +list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}") +include(${CMAKE_CURRENT_LIST_DIR}/windows-common.cmake) diff --git a/thirdparty/ffs/ffs/scripts/ci/setup/linux.sh b/thirdparty/ffs/ffs/scripts/ci/setup/linux.sh index a29f61821f..46534ec1b1 100755 --- a/thirdparty/ffs/ffs/scripts/ci/setup/linux.sh +++ b/thirdparty/ffs/ffs/scripts/ci/setup/linux.sh @@ -2,7 +2,7 @@ case ${GH_YML_JOBNAME} in centos7*) PKG_CMD=yum ;; - centos8*) PKG_CMD=dnf ;; + centos8*|alma8*) PKG_CMD=dnf ;; ubuntu*) PKG_CMD=apt-get ;; esac @@ -10,7 +10,7 @@ esac # Baseline dependencies ######################################## case ${GH_YML_JOBNAME} in - centos*) PKGS="epel-release make curl perl bison flex" ;; + centos*|alma*) PKGS="epel-release make curl perl bison flex" ;; ubuntu*) export DEBIAN_FRONTEND=noninteractive apt-get update @@ -26,7 +26,7 @@ case ${GH_YML_JOBNAME} in centos7*) curl -L https://copr.fedorainfracloud.org/coprs/g/git-maint/git/repo/epel-7/group_git-maint-git-epel-7.repo > /etc/yum.repos.d/group_git-maint-git-epel-7.repo ;; - centos8*) + centos8*|alma8*) curl -L https://copr.fedorainfracloud.org/coprs/g/git-maint/git/repo/epel-8/group_git-maint-git-epel-8.repo > /etc/yum.repos.d/group_git-maint-git-epel-8.repo ;; ubuntu*) @@ -41,13 +41,13 @@ ${PKG_CMD} install -y git # Compilers ######################################## case ${GH_YML_JOBNAME} in - centos*-clang) PKGS="clang gcc gcc-c++" ;; - centos*-gcc) PKGS="gcc gcc-c++" ;; - centos*-nvhpc) PKGS="gcc gcc-c++" ;; - ubuntu*-clang) PKGS="clang gcc g++" ;; - ubuntu*-gcc) PKGS="gcc g++" ;; - ubuntu*-nvhpc) PKGS="gcc g++" ;; + centos*|alma*) PKGS="gcc gcc-c++" ;; + ubuntu*) PKGS="gcc g++" ;; esac +if [ "${GH_YML_JOBNAME##*-}" = "clang" ] +then + PKGS="clang ${PKGS}" +fi ${PKG_CMD} install -y ${PKGS}