Skip to content

Commit

Permalink
IOSS: Build io_modify only if exodus enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Apr 1, 2024
1 parent ad5be41 commit 7e25df9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/seacas/libraries/ioss/src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,17 @@ TRIBITS_ADD_EXECUTABLE(
SOURCES io_info_main.C
INSTALLABLE
)

IF (${PACKAGE_NAME}_ENABLE_SEACASExodus)
TRIBITS_ADD_EXECUTABLE(
io_modify
NOEXEPREFIX
NOEXESUFFIX
SOURCES io_modify.C modify_interface.C
INSTALLABLE
)
endif()

TRIBITS_ADD_EXECUTABLE(
sphgen
NOEXEPREFIX
Expand Down
12 changes: 2 additions & 10 deletions packages/seacas/libraries/ioss/src/main/io_modify.C
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@
#include "Ioss_State.h"
#include "modify_interface.h"

#if defined(SEACAS_HAVE_EXODUS)
// `io_modify` is only built if Exodus is enabled...
#include "exodus/Ioex_Internals.h"
#include "exodus/Ioex_Utils.h"
#include <exodusII.h>
#endif

#if defined(SEACAS_HAVE_CGNS)
#include "cgns/Iocgns_Utils.h"
Expand All @@ -72,7 +71,7 @@ using real = double;

namespace {
std::string codename;
std::string version = "2.05 (2024-03-25)";
std::string version = "2.06 (2024-04-01)";

std::vector<Ioss::GroupingEntity *> attributes_modified;

Expand Down Expand Up @@ -1653,7 +1652,6 @@ namespace {
}
#endif

#if defined(SEACAS_HAVE_EXODUS)
void update_exodus_assembly_info(Ioss::Region &region, const Modify::Interface &interFace)
{
std::vector<Ioex::Assembly> ex_assemblies;
Expand Down Expand Up @@ -1716,18 +1714,13 @@ namespace {
Ioex::write_reduction_attributes(exoid, attributes_modified);
}
}
#endif

void update_assembly_info(Ioss::Region &region, const Modify::Interface &interFace)
{
// Determine type of underlying database...
const auto type = region.get_database()->get_format();
if (type == "Exodus") {
#if defined(SEACAS_HAVE_EXODUS)
update_exodus_assembly_info(region, interFace);
#else
fmt::print(stderr, fg(fmt::color::red), "ERROR: Exodus capability is not enabled.\n");
#endif
}
else if (type == "CGNS") {
#if defined(SEACAS_HAVE_CGNS)
Expand Down Expand Up @@ -1912,5 +1905,4 @@ namespace {
Ioex::update_last_time_attribute(exoid, max_time);
(void)region.get_min_time(); // Triggers reloading region stateTimes vector.
}

} // nameSpace

0 comments on commit 7e25df9

Please sign in to comment.