Skip to content

Commit

Permalink
Merge branch 'master' into discontinuous-galerkin
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Apr 10, 2024
2 parents 2f304c3 + a48c3c5 commit 1eb54a4
Show file tree
Hide file tree
Showing 304 changed files with 4,035 additions and 2,501 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build_external_lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@ jobs:

- name: Install System dependencies
shell: bash -l {0}
run: sudo apt update && sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev openmpi-bin libopenmpi-dev libnetcdf-dev libhdf5-dev libcgns-dev libmatio-dev libfmt-dev catch2
run: sudo apt update && sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev openmpi-bin libopenmpi-dev libnetcdf-dev libhdf5-dev libcgns-dev libmatio-dev

- name: Install Using linuxbrew
shell: bash -l {0}
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install fmt catch2
- name: Run cmake
shell: bash -l {0}
run: |
echo $HOME
find /usr/include -name cgnslib.h
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
mkdir build
cd build
NETCDF_PATH=/usr MODERN=YES NUMPROCS=2 COMPILER=${{ matrix.compiler }} INSTALL_PATH=${HOME} bash ../cmake-config
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/intel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,15 @@ jobs:
mkdir build
cd build
source /opt/intel/oneapi/setvars.sh
echo "------------"
ls /opt/intel/oneapi/2024.0/
echo "------------"
ls /opt/intel/oneapi/2024.0/bin/
echo "------------"
export PATH=/opt/intel/oneapi/2024.0/bin/:$PATH
export LD_LIBRARY_PATH=/opt/intel/oneapi/2024.0/lib/:$LD_LIBRARY_PATH
# echo "------------"
# ls /opt/intel/oneapi/
# echo "------------"
# ls /opt/intel/oneapi/2024.1/
# echo "------------"
# ls /opt/intel/oneapi/2024.1/bin/
# echo "------------"
export PATH=/opt/intel/oneapi/2024.1/bin/:$PATH
export LD_LIBRARY_PATH=/opt/intel/oneapi/2024.1/lib/:$LD_LIBRARY_PATH
printenv >> $GITHUB_ENV
NUMPROCS=2 COMPILER=${{ matrix.compiler }} INSTALL_PATH=${HOME}/environments/${{ matrix.compiler }}-${{ matrix.hdf5 }}-${{ matrix.netcdf }}-${{ matrix.cgns }} bash ../cmake-config
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/spack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This is a basic workflow to help you get started with Actions
name: SEACAS Spack build

# Controls when the action will run. Triggers the workflow on push
on:
push:
branches:
- master
pull_request:
branches:
- master

concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Set up Spack
uses: spack/setup-spack@v2
with:
ref: develop # Spack version (examples: develop, releases/v0.21)
buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache
color: true # Force color output (SPACK_COLOR=always)
path: spack # Where to clone Spack
- run: |
spack external find
spack compiler find
spack spec seacas~mpi
spack install seacas~mpi
spack find
# spack spec seacas+mpi
# spack install seacas+mpi
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ manually as detailed in
| KOKKOS | YES, NO | NO | Should Kokkos TPL be built. |
| GNU_PARALLEL | YES, NO | YES | Should GNU parallel script be built. |
| FMT | YES, NO | YES | Should Lib::FMT TPL be built. |
| CATCH2 | YES, NO | YES | Should Catch2 be built (used for testing). |
| H5VERSION | V114, V110, V18 | V114 | Use HDF5-1.14.X, HDF5-1.10.X or HDF5-1.8.X |
| H5CPP | YES, NO | NO | Should the HDF5 C++ library be built/installed |
| BB | YES, NO | NO | Enable Burst Buffer support in PnetCDF |
Expand Down Expand Up @@ -230,23 +231,37 @@ add_executable(ExodusReadFor ExodusRead.f)
target_link_libraries(ExodusReadFor PRIVATE SEACASExodus_for::all_libs)
```

The `cmake-use-example` directory contains this sample
`CMakeLists.txt` file and a couple C and Fortran files which provide
an example of how to build and link a C or Fortran program with the
Exodus library installed as part of a build of this package.
A similar CMakeLists.txt file for using the IOSS library would be something like:

```sh
cmake_minimum_required(VERSION 3.1...3.26)
project(IossCMakeExample VERSION 1.0 LANGUAGES CXX)

#### C++ IOSS ####
find_package(SEACASIoss CONFIG)
add_executable(IossExample IossExample.C)
target_link_libraries(IossExample PRIVATE SEACASIoss::all_libs)
```

The `cmake-use-example` directory contains Exodus example files in the
`exodus` subdirectory and Ioss example files in the `ioss` subdirectory.
These provide short examples of how to build and link a program with the
Exodus and/or Ioss libraries.

To use this, copy the contents of the directory to your own filespace
and modify the contents as needed. The example provides a C
executable and a Fortran Executable which both are linked to the
Exodus library.
and modify the contents as needed.

To configure and build, you would do something like:

```sh
mkdir build; cd build
CMAKE_PREFIX_PATH={path_to_root_of_seacas_install} cmake ..
make
```
And you would then get `ExodusWriteC` and `ExodusReadFor` compiled and linked against the Exodus library.

And you would then get an executable (`ExodusWriteC` and
`ExodusReadFor` for Exodus, `IossExample` for Ioss) compiled and linked
against the Exodus and/or Ioss libraries.

## Required Software

Expand Down Expand Up @@ -323,7 +338,6 @@ a separate license:
| [adler hash](https://en.wikipedia.org/wiki/Adler-32) | `packages/seacas/libraries/suplib_c/adler.c` | [zlib](https://opensource.org/licenses/zlib) |
| [MurmurHash](https://github.com/aappleby/smhasher) | `packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.C` | public domain |
| [json include file](http://jsoncpp.sourceforge.net) | `packages/seacas/libraries/ioss/src/visualization/` | [MIT](https://opensource.org/licenses/MIT) |
| [terminal_color](https://github.com/matovitch/trmclr) | `packages/seacas/libraries/aprepro_lib` | [zlib](https://opensource.org/licenses/zlib) |
| [Tessil Hash](https://github.com/Tessil/) | `packages/seacas/libraries/ioss/src/hash` | [MIT](https://opensource.org/licenses/MIT) |
| [pdqsort](https://github.com/orlp/pdqsort) | `packages/seacas/libraries/ioss/src` | [Zlib License](https://github.com/orlp/pdqsort/blob/master/license.txt) |
## Contact information
Expand Down
1 change: 1 addition & 0 deletions TPL/catalyst2/runcmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ${RPATH} \
-D CATALYST_BUILD_STUB_IMPLEMENTATION:BOOL=ON \
-D CATALYST_USE_MPI:BOOL=${MPI} \
-D CATALYST_BUILD_TESTING:BOOL=OFF \
-D CATALYST_WRAP_PYTHON:BOOL=OFF \
$EXTRA_ARGS \
..

Expand Down
64 changes: 64 additions & 0 deletions TPL/cgns/CGNS-Allow-more-liberal-version-matching.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
From 3c1871b84b24f14c3b5c6b99ead40c5aa2a0907e Mon Sep 17 00:00:00 2001
From: Greg Sjaardema <[email protected]>
Date: Fri, 5 Apr 2024 09:09:46 -0600
Subject: [PATCH] CGNS: Allow more liberal version matching

The main difference between CGNS-3.X and CGNS-4.X is the handling
of polyhedral elements. If the cgns file does not contain those
elements, then the library should be able to read the file correctly.

We have modified the library version from the original 4.4.X to
be 3.99 so that files written by this version of the CGNS library
(assuming they don't use polyhedral elements) will be readable by
applications that are still using CGNS-3.X

This is a kluge and not officially supported by the CGNS developers.
---
src/cgnslib.c | 11 ++++++-----
src/cgnslib.h | 5 +++++
2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/cgnslib.c b/src/cgnslib.c
index d60daf6..78bd25a 100644
--- a/src/cgnslib.c
+++ b/src/cgnslib.c
@@ -434,12 +434,13 @@ int cg_open(const char *filename, int mode, int *file_number)
/* This code allows reading version newer than the lib,
as long as the 1st digit of the versions are equal */
if ((cg->version / 1000) > (CGNSLibVersion / 1000)) {
- cgi_error("A more recent version of the CGNS library created the file. Therefore, the CGNS library needs updating before reading the file '%s'.",filename);
- return CG_ERROR;
- }
+ cgi_warning("A more recent version of the CGNS library created the file. Assuming it is OK to read, but may have problems (%d vs %d).",
+ cg->version, CGNSLibVersion);
+ }
/* warn only if different in second digit */
- if ((cg->version / 100) > (CGNSLibVersion / 100)) {
- cgi_warning("The file being read is more recent that the CGNS library used");
+ else if ((cg->version / 100) > (CGNSLibVersion / 100)) {
+ cgi_warning("The file being read is more recent than the CGNS library used (%d vs %d).",
+ cg->version, CGNSLibVersion);
}
}
#if CG_SIZEOF_SIZE == 32
diff --git a/src/cgnslib.h b/src/cgnslib.h
index 476c768..a4b66df 100644
--- a/src/cgnslib.h
+++ b/src/cgnslib.h
@@ -43,8 +43,13 @@
#ifndef CGNSLIB_H
#define CGNSLIB_H

+#if 0
#define CGNS_VERSION 4400
#define CGNS_DOTVERS 4.40
+#else
+#define CGNS_VERSION 3990
+#define CGNS_DOTVERS 3.99
+#endif

#define CGNS_COMPATVERSION 2540
#define CGNS_COMPATDOTVERS 2.54
--
2.39.3 (Apple Git-146)

1 change: 0 additions & 1 deletion cmake-config
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ ${FAODEL_SYMBOLS} \
-D ParMETIS_ROOT:PATH=${PARMETIS_PATH} \
-D PNetCDF_ROOT:PATH=${PNETCDF_PATH} \
-D fmt_ROOT:PATH=${FMT_PATH} \
-D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \
$EXTRA_ARGS \
${ACCESS}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ add_executable(ExodusWriteC ExodusWrite.c)
target_link_libraries(ExodusWriteC PRIVATE SEACASExodus::all_libs)


#### FORTRAN #####
#### FORTRAN ##### (Remove all below if only using Exodus C API)
IF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer -fdefault-real-8 -fdefault-integer-8 -fno-range-check")
ELSEIF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "XL")
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions cmake-use-example/ioss/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.1...3.26)
project(IossCMakeExample VERSION 1.0 LANGUAGES CXX)

#### C++ IOSS ####
find_package(SEACASIoss CONFIG)
add_executable(IossExample IossExample.C)
target_link_libraries(IossExample PRIVATE SEACASIoss::all_libs)
43 changes: 43 additions & 0 deletions cmake-use-example/ioss/IossExample.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <Ionit_Initializer.h>
#include <Ioss_DatabaseIO.h>
#include <Ioss_IOFactory.h>
#include <Ioss_Region.h>
#include <Ioss_Utils.h>

#include <assert.h>
#include <iostream>
#include <string>

int main(int argc, char *argv[]) {
#ifdef SEACAS_HAVE_MPI
MPI_Init(&argc, &argv);
ON_BLOCK_EXIT(MPI_Finalize);
#endif

if (argc == 1) {
std::cerr << "SYNTAX: " << argv[0]
<< " '--show-config' or 'filename'\n"
" Will either show the Ioss build configuration\n"
" Or will show a summary of the data in `filename`\n";
std::exit(EXIT_SUCCESS);
}

Ioss::Init::Initializer io;
std::string filename = argv[1];
if (filename == "--show-config") {
std::cerr << Ioss::IOFactory::show_configuration() << "\n";
} else {
auto dbtype = Ioss::Utils::get_type_from_file(filename);
auto *dbi = Ioss::IOFactory::create(dbtype, filename, Ioss::READ_RESTART,
Ioss::ParallelUtils::comm_world());

if (dbi == NULL || !dbi->ok(true)) {
std::exit(EXIT_FAILURE);
}

// NOTE: 'region' owns 'dbi' pointer at this time and will close
// and call dbi destructor.
Ioss::Region region(dbi, "example_region");
region.output_summary(std::cerr);
}
}
37 changes: 37 additions & 0 deletions cmake/tribits/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,43 @@
ChangeLog for TriBITS
----------------------------------------

## 2023-06-22:

* **Added:** Packages are now determined to be missing if their dependencies
file `<packageDir>/cmake/Dependencies.cmake` is missing. If the package
directory `<packageDir>` exists but the dependencies file is missing, the
package is determined to be missing but a warning is printed. (This expands
behavior to gracefully deal with a situation where a package source
directory is only partially removed, such as with `git rm -r <packageDir>`,
but the base directory still exists. Therefore, this allows the project to
gracefully configure with the package being considered missing and avoids a
fatal error in this case.)

## 2023-06-02:

* **Added/Deprecated:** External packages/TPLs can now be (and should be)
listed in the `[TEST|LIB]_[REQUIRED|OPTIONAL]_PACKAGES` arguments/lists in
the macro `tribits_package_define_dependencies()` and the
`[TEST|LIB]_[REQUIRED|OPTIONAL]_TPLS` arguments/lists are deprecated (but
with no deprecation warning yet). This makes it easier to write
`<packageDir>/cmake/Dependencies.cmake` files for packages where the set of
internal and external upstream dependent packages is dynamic and changes
depending on the TriBITS project where these package are configured under.
(And conceptually, a downstream package should not care if an upstream
dependent package is pulled in as an external package or built as an
internal package.)

## 2023-05-03:

* **Added:** Added support for non-fully TriBITS-compatible external packages.
Now, a `<Package>Config.cmake` file need not define
`<UpstreamPkg>::all_libs` targets for all of its upstream dependencies. The
updated macro `tribits_process_enabled_tpls()` will find any missing
upstream external packages/TPLs as needed (see updated documentation in the
section "TriBITS-Compliant External Packages" in the "TriBITS Users Guide"
and the section "Processing of external packages/TPLs and TriBITS-compliant
external packages" in the "TriBITS Maintainers Guide").

## 2023-02-24:

* **Changed:** Upgraded minimum required CMake version from 3.17 to 3.23.
Expand Down
53 changes: 50 additions & 3 deletions cmake/tribits/README.DIRECTORY_CONTENTS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ TriBITS refactorings of TriBITS.

.. _TriBITS Core:

**core/**: Core TriBITS package-based architecture for CMake projects. This
only depends on raw CMake and contains just the minimal support for building,
testing, installing, and deployment. Only depends on CMake and nothing else.
**core/**: Core TriBITS test support and package-based architecture for CMake
projects. This only depends on raw CMake and contains just the minimal support
for building, testing, installing, and deployment. This CMake code depends
only on CMake and nothing else.

**python_utils/**: Some basic Python utilities that are not specific to
TriBITS but are used in TriBITS CI and testing support software. There are
Expand Down Expand Up @@ -86,3 +87,49 @@ subdirectory. It supports the argument ``--components`` with values ``core``,
* ``examples`` => (external tribits installation)
* ``doc`` => ``core``, ``ci_support``, ``examples``
* ``devtools_install`` => ``python_utils``


TriBITS Core Directory Contents
...............................

The TriBITS ``core/`` directory is broken down into several subdirectories of
its own:

**core/utils**: General CMake utilities that are not specific to the TriBITS
system and can be reused in any CMake project.

**core/common**: As small set of common modules that the different TriBITS
Core module files in different directories depend on. These include things
like common TriBITS constants and TriBITS CMake policies.

**core/test_support**: Modules that help define CTest tests using functions
like `tribits_add_test()`_ and `tribits_add_advanced_test()`_. These can be
used in CMake projects that are not full-blown TriBITS projects.

**core/config_tests**: Some basic configure-time tests used by the TriBITS
package architecture framework.

**core/std_tpls**: Some ``Find<tplName>.cmake`` files for key external
dependencies handled as TriBITS TPLs but are more central to the TriBITS
system. (Examples include CUDA and MPI support.)

**core/installation**: A collection of ``*.cmake.in`` and related Cmake code
supporting installations.

**core/package_arch**: Modules for the full-blown TriBITS package architecture
framework including package dependency management, multi-repository support,
installations (including the generation of ``<Package>Config.cmake`` files),
etc.

The dependencies between these different TriBITS `core` subdirectories are:

* ``core/utils`` => (external CMake)
* ``core/common`` => ``core/utils``
* ``core/test_support`` => ``core/utils``, ``core/common``
* ``core/config_tests`` => (external CMake)
* ``core/std_tpls`` => (external CMake)
* ``core/installation`` <=> ``core/package_arch`` (bidirectional)
* ``core/package_arch`` => ``core/utils``, ``core/common``,
``core/test_support``, ``core/config_tests``, ``core/std_tpls``,
``core/installation``

Loading

0 comments on commit 1eb54a4

Please sign in to comment.