From 4f5f52c0f784b3569107710bdbd4a38e2c140121 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Wed, 23 Aug 2023 12:27:31 -0400 Subject: [PATCH 01/46] Add adios2 dependency (BOUT_HAS_ADIOS flag), and starting .hxx file --- CMakeLists.txt | 1 + bout++Config.cmake.in | 1 + cmake/SetupBOUTThirdParty.cmake | 15 + cmake_build_defines.hxx.in | 1 + include/bout/options_adios.hxx | 118 +++++ src/sys/options/options_adios.cxx | 739 ++++++++++++++++++++++++++++++ 6 files changed, 875 insertions(+) create mode 100644 include/bout/options_adios.hxx create mode 100644 src/sys/options/options_adios.cxx diff --git a/CMakeLists.txt b/CMakeLists.txt index 2db9b79528..be6976a079 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,6 +147,7 @@ set(BOUT_SOURCES ./include/bout/operatorstencil.hxx ./include/bout/options.hxx ./include/bout/options_netcdf.hxx + ./include/bout/options_adios.hxx ./include/bout/optionsreader.hxx ./include/bout/output.hxx ./include/bout/output_bout_types.hxx diff --git a/bout++Config.cmake.in b/bout++Config.cmake.in index e33e950e6f..3d824e455f 100644 --- a/bout++Config.cmake.in +++ b/bout++Config.cmake.in @@ -15,6 +15,7 @@ set(BOUT_USE_METRIC_3D @BOUT_USE_METRIC_3D@) set(BOUT_HAS_PVODE @BOUT_HAS_PVODE@) set(BOUT_HAS_NETCDF @BOUT_HAS_NETCDF@) +set(BOUT_HAS_ADIOS @BOUT_HAS_ADIOS@) set(BOUT_HAS_FFTW @BOUT_HAS_FFTW@) set(BOUT_HAS_LAPACK @BOUT_HAS_LAPACK@) set(BOUT_HAS_PETSC @BOUT_HAS_PETSC@) diff --git a/cmake/SetupBOUTThirdParty.cmake b/cmake/SetupBOUTThirdParty.cmake index 55f201bdad..b5470a2f46 100644 --- a/cmake/SetupBOUTThirdParty.cmake +++ b/cmake/SetupBOUTThirdParty.cmake @@ -185,6 +185,21 @@ endif() message(STATUS "NetCDF support: ${BOUT_USE_NETCDF}") set(BOUT_HAS_NETCDF ${BOUT_USE_NETCDF}) +option(BOUT_USE_ADIOS "Enable support for ADIOS output" ON) +if (BOUT_USE_ADIOS) + find_package(ADIOS2) + if (ADIOS2_FOUND) + ENABLE_LANGUAGE(C) + find_package(MPI REQUIRED COMPONENTS C) + target_link_libraries(bout++ PUBLIC adios2::cxx11_mpi MPI::MPI_C) + else() + set(BOUT_USE_ADIOS OFF) + endif() +endif() +message(STATUS "ADIOS support: ${BOUT_USE_ADIOS}") +set(BOUT_HAS_ADIOS ${BOUT_USE_ADIOS}) + + option(BOUT_USE_FFTW "Enable support for FFTW" ON) if (BOUT_USE_FFTW) find_package(FFTW REQUIRED) diff --git a/cmake_build_defines.hxx.in b/cmake_build_defines.hxx.in index a637dbc46a..ed6e8685f6 100644 --- a/cmake_build_defines.hxx.in +++ b/cmake_build_defines.hxx.in @@ -13,6 +13,7 @@ #cmakedefine01 BOUT_HAS_IDA #cmakedefine01 BOUT_HAS_LAPACK #cmakedefine01 BOUT_HAS_NETCDF +#cmakedefine01 BOUT_HAS_ADIOS #cmakedefine01 BOUT_HAS_PETSC #cmakedefine01 BOUT_HAS_PRETTY_FUNCTION #cmakedefine01 BOUT_HAS_PVODE diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx new file mode 100644 index 0000000000..f781d504b5 --- /dev/null +++ b/include/bout/options_adios.hxx @@ -0,0 +1,118 @@ + +#pragma once + +#ifndef __OPTIONS_ADIOS_H__ +#define __OPTIONS_ADIOS_H__ + +#include "bout/build_config.hxx" + +#if !BOUT_HAS_ADIOS + +#include + +#include "bout/boutexception.hxx" +#include "bout/options.hxx" + +namespace bout { + +class OptionsADIOS { +public: + enum class FileMode { + replace, ///< Overwrite file when writing + append ///< Append to file when writing + }; + + OptionsADIOS(const std::string& filename, FileMode mode = FileMode::replace) {} + OptionsADIOS(const OptionsADIOS&) = default; + OptionsADIOS(OptionsADIOS&&) = default; + OptionsADIOS& operator=(const OptionsADIOS&) = default; + OptionsADIOS& operator=(OptionsADIOS&&) = default; + + /// Read options from file + Options read() { throw BoutException("OptionsADIOS not available\n"); } + + /// Write options to file + void write(const Options& options) { + throw BoutException("OptionsADIOS not available\n"); + } +}; + +} // namespace bout + +#else + +#include +#include + +#include "bout/options.hxx" + +/// Forward declare ADIOS file type so we don't need to depend +/// directly on ADIOS +namespace ADIOS { +class BPStream; +} + +namespace bout { + +class OptionsADIOS { +public: + enum class FileMode { + replace, ///< Overwrite file when writing + append ///< Append to file when writing + }; + + // Constructors need to be defined in implementation due to forward + // declaration of NcFile + OptionsADIOS(); + explicit OptionsADIOS(std::string filename, FileMode mode = FileMode::replace); + ~OptionsADIOS(); + OptionsADIOS(const OptionsADIOS&) = delete; + OptionsADIOS(OptionsADIOS&&) noexcept; + OptionsADIOS& operator=(const OptionsADIOS&) = delete; + OptionsADIOS& operator=(OptionsADIOS&&) noexcept; + + /// Read options from file + Options read(); + + /// Write options to file + void write(const Options& options) { write(options, "t"); } + void write(const Options& options, const std::string& time_dim); + + /// Check that all variables with the same time dimension have the + /// same size in that dimension. Throws BoutException if there are + /// any differences, otherwise is silent + void verifyTimesteps() const; + +private: + /// Name of the file on disk + std::string filename; + /// How to open the file for writing + FileMode file_mode{FileMode::replace}; + /// Pointer to ADIOS file so we don't introduce direct dependence + std::unique_ptr data_file; +}; + +} // namespace bout + +#endif + +namespace bout { +/// Name of the directory for restart files +std::string getRestartDirectoryName(Options& options); +/// Name of the restart file on this rank +std::string getRestartFilename(Options& options); +/// Name of the restart file on \p rank +std::string getRestartFilename(Options& options, int rank); +/// Name of the main output file on this rank +std::string getOutputFilename(Options& options); +/// Name of the main output file on \p rank +std::string getOutputFilename(Options& options, int rank); +/// Write `Options::root()` to the main output file, overwriting any +/// existing files +void writeDefaultOutputFile(); +/// Write \p options to the main output file, overwriting any existing +/// files +void writeDefaultOutputFile(Options& options); +} // namespace bout + +#endif // __OPTIONS_ADIOS_H__ diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx new file mode 100644 index 0000000000..6b7b3aea28 --- /dev/null +++ b/src/sys/options/options_adios.cxx @@ -0,0 +1,739 @@ +#include "bout/build_config.hxx" + +#if BOUT_HAS_ADIOS + +#include "bout/options_adios.hxx" + +#include "bout/bout.hxx" +#include "bout/globals.hxx" +#include "bout/mesh.hxx" +#include "bout/sys/timer.hxx" + +#include +#include +#include +#include + +using namespace ADIOS; + +namespace { +/// Name of the attribute used to track individual variable's time indices +constexpr auto current_time_index_name = "current_time_index"; + +/// ADIOS doesn't keep track of the current for each variable +/// (although the underlying HDF5 file does!), so we need to do it +/// ourselves. We'll use an attribute in the file to do so, which +/// means we don't need to keep track of it in the code +int getCurrentTimeIndex(const NcVar& var) { + const auto atts_map = var.getAtts(); + const auto time_index_attribute = atts_map.find(current_time_index_name); + if (time_index_attribute == atts_map.end()) { + // Attribute doesn't exist, so let's start at zero. There + // are various ways this might break, for example, if the + // variable was added to the file by a different + // program. But note, that if we use the size of the time + // dimension here, this will increase every time we add a + // new variable! So zero is probably the only sensible + // choice for this + return 0; + } + int current_time_index; + time_index_attribute->second.getValues(¤t_time_index); + return current_time_index; +} + +template +T readVariable(const NcVar& variable) { + T value; + variable.getVar(&value); + return value; +} + +template +T readAttribute(const NcAtt& attribute) { + T value; + attribute.getValues(&value); + return value; +} + +void readGroup(const std::string& filename, const NcGroup& group, Options& result) { + + // Iterate over all variables + for (const auto& varpair : group.getVars()) { + const auto& var_name = varpair.first; // Name of the variable + const auto& var = varpair.second; // The NcVar object + + auto var_type = var.getType(); // Variable type + auto ndims = var.getDimCount(); // Number of dimensions + auto dims = var.getDims(); // Vector of dimensions + + switch (ndims) { + case 0: { + // Scalar variables + if (var_type == ncDouble) { + result[var_name] = readVariable(var); + } else if (var_type == ncFloat) { + result[var_name] = readVariable(var); + } else if (var_type == ncInt or var_type == ncShort) { + result[var_name] = readVariable(var); + } else if (var_type == ncString) { + result[var_name] = std::string(readVariable(var)); + } + // Note: ADIOS does not support boolean atoms + // else ignore + break; + } + case 1: { + if (var_type == ncDouble or var_type == ncFloat) { + Array value(static_cast(dims[0].getSize())); + var.getVar(value.begin()); + result[var_name] = value; + } else if ((var_type == ncString) or (var_type == ncChar)) { + std::string value; + value.resize(dims[0].getSize()); + var.getVar(&(value[0])); + result[var_name] = value; + } + break; + } + case 2: { + if (var_type == ncDouble or var_type == ncFloat) { + Matrix value(static_cast(dims[0].getSize()), + static_cast(dims[1].getSize())); + var.getVar(value.begin()); + result[var_name] = value; + } + break; + } + case 3: { + if (var_type == ncDouble or var_type == ncFloat) { + Tensor value(static_cast(dims[0].getSize()), + static_cast(dims[1].getSize()), + static_cast(dims[2].getSize())); + var.getVar(value.begin()); + result[var_name] = value; + } + } + } + result[var_name].attributes["source"] = filename; + + // Get variable attributes + for (const auto& attpair : var.getAtts()) { + const auto& att_name = attpair.first; // Attribute name + const auto& att = attpair.second; // NcVarAtt object + + auto att_type = att.getType(); // Type of the attribute + + if (att_type == ncInt) { + result[var_name].attributes[att_name] = readAttribute(att); + } else if (att_type == ncFloat) { + result[var_name].attributes[att_name] = readAttribute(att); + } else if (att_type == ncDouble) { + result[var_name].attributes[att_name] = readAttribute(att); + } else if ((att_type == ncString) or (att_type == ncChar)) { + std::string value; + att.getValues(value); + result[var_name].attributes[att_name] = value; + } + // Else ignore + } + } + + // Iterate over groups + for (const auto& grouppair : group.getGroups()) { + const auto& name = grouppair.first; + const auto& subgroup = grouppair.second; + + readGroup(filename, subgroup, result[name]); + } +} +} // namespace + +namespace bout { + +Options OptionsADIOS::read() { + Timer timer("io"); + + // Open file + const NcFile read_file(filename, NcFile::read); + + if (read_file.isNull()) { + throw BoutException("Could not open ADIOS file '{:s}' for reading", filename); + } + + Options result; + readGroup(filename, read_file, result); + + return result; +} + +} // namespace bout + +namespace { + +/// Convert variant into NcType +/// If the type is not recognised then NcType null object is returned +struct NcTypeVisitor { + template + NcType operator()(const T& UNUSED(t)) { + return {}; // Null object by default + } +}; + +template <> +NcType NcTypeVisitor::operator()(const bool& UNUSED(t)) { + return ncInt; +} + +template <> +NcType NcTypeVisitor::operator()(const int& UNUSED(t)) { + return ncInt; +} + +template <> +NcType NcTypeVisitor::operator()(const double& UNUSED(t)) { + return ncDouble; +} + +template <> +MAYBE_UNUSED() +NcType NcTypeVisitor::operator()(const float& UNUSED(t)) { + return ncFloat; +} + +template <> +NcType NcTypeVisitor::operator()(const std::string& UNUSED(t)) { + return ncString; +} + +template <> +NcType NcTypeVisitor::operator()(const Field2D& UNUSED(t)) { + return operator()(0.0); +} + +template <> +NcType NcTypeVisitor::operator()(const Field3D& UNUSED(t)) { + return operator()(0.0); +} + +template <> +NcType NcTypeVisitor::operator()(const FieldPerp& UNUSED(t)) { + return operator()(0.0); +} + +/// Visit a variant type, returning dimensions +struct NcDimVisitor { + NcDimVisitor(NcGroup& group) : group(group) {} + template + std::vector operator()(const T& UNUSED(value)) { + return {}; + } + +private: + NcGroup& group; +}; + +NcDim findDimension(NcGroup& group, const std::string& name, unsigned int size) { + // Get the dimension + try { + auto dim = group.getDim(name, NcGroup::ParentsAndCurrent); + if (dim.isNull()) { + // Dimension doesn't yet exist + dim = group.addDim(name, size); + } else { + // Dimension exists, check it's the right size + if (dim.getSize() != size) { + // wrong size. Check this group + dim = group.getDim(name, NcGroup::Current); + if (!dim.isNull()) { + // Already defined in this group + return {}; // Return null object + } + // Define in this group + dim = group.addDim(name, size); + } + } + return dim; + } catch (const std::exception& e) { + throw BoutException("Error in findDimension('{:s}'): {:s}", name, e.what()); + } +} + +template <> +std::vector NcDimVisitor::operator()(const Field2D& value) { + auto xdim = findDimension(group, "x", value.getNx()); + ASSERT0(!xdim.isNull()); + + auto ydim = findDimension(group, "y", value.getNy()); + ASSERT0(!ydim.isNull()); + + return {xdim, ydim}; +} + +template <> +std::vector NcDimVisitor::operator()(const Field3D& value) { + auto xdim = findDimension(group, "x", value.getNx()); + ASSERT0(!xdim.isNull()); + + auto ydim = findDimension(group, "y", value.getNy()); + ASSERT0(!ydim.isNull()); + + auto zdim = findDimension(group, "z", value.getNz()); + ASSERT0(!zdim.isNull()); + + return {xdim, ydim, zdim}; +} + +template <> +std::vector NcDimVisitor::operator()(const FieldPerp& value) { + auto xdim = findDimension(group, "x", value.getNx()); + ASSERT0(!xdim.isNull()); + + auto zdim = findDimension(group, "z", value.getNz()); + ASSERT0(!zdim.isNull()); + + return {xdim, zdim}; +} + +/// Visit a variant type, and put the data into a NcVar +struct NcPutVarVisitor { + NcPutVarVisitor(NcVar& var) : var(var) {} + template + void operator()(const T& value) { + var.putVar(&value); + } + +private: + NcVar& var; +}; + +template <> +void NcPutVarVisitor::operator()(const bool& value) { + int int_val = value ? 1 : 0; + var.putVar(&int_val); +} + +template <> +void NcPutVarVisitor::operator()(const std::string& value) { + const char* cstr = value.c_str(); + var.putVar(&cstr); +} + +/// In addition to writing the data, set the "cell_location" attribute +template <> +void NcPutVarVisitor::operator()(const Field2D& value) { + // Pointer to data. Assumed to be contiguous array + var.putVar(&value(0, 0)); +} + +/// In addition to writing the data, set the "cell_location" attribute +template <> +void NcPutVarVisitor::operator()(const Field3D& value) { + // Pointer to data. Assumed to be contiguous array + var.putVar(&value(0, 0, 0)); +} + +template <> +void NcPutVarVisitor::operator()(const FieldPerp& value) { + // Pointer to data. Assumed to be contiguous array + var.putVar(&value(0, 0)); +} + +/// Visit a variant type, and put the data into a NcVar +struct NcPutVarCountVisitor { + NcPutVarCountVisitor(NcVar& var, const std::vector& start, + const std::vector& count) + : var(var), start(start), count(count) {} + template + void operator()(const T& value) { + var.putVar(start, &value); + } + +private: + NcVar& var; + const std::vector& start; ///< Starting (corner) index + const std::vector& count; ///< Index count in each dimension +}; + +template <> +void NcPutVarCountVisitor::operator()(const std::string& value) { + const char* cstr = value.c_str(); + var.putVar(start, &cstr); +} +template <> +void NcPutVarCountVisitor::operator()(const Field2D& value) { + // Pointer to data. Assumed to be contiguous array + var.putVar(start, count, &value(0, 0)); +} +template <> +void NcPutVarCountVisitor::operator()(const Field3D& value) { + // Pointer to data. Assumed to be contiguous array + var.putVar(start, count, &value(0, 0, 0)); +} +template <> +void NcPutVarCountVisitor::operator()(const FieldPerp& value) { + // Pointer to data. Assumed to be contiguous array + var.putVar(start, count, &value(0, 0)); +} + +/// Visit a variant type, and put the data into an attributute +struct NcPutAttVisitor { + NcPutAttVisitor(NcVar& var, std::string name) : var(var), name(std::move(name)) {} + template + void operator()(const T& UNUSED(value)) { + // Default is to ignore if unhandled + } + +private: + NcVar& var; + std::string name; +}; + +template <> +void NcPutAttVisitor::operator()(const bool& value) { + int ival = value ? 1 : 0; + var.putAtt(name, ncInt, ival); +} +template <> +void NcPutAttVisitor::operator()(const int& value) { + var.putAtt(name, ncInt, value); +} +template <> +void NcPutAttVisitor::operator()(const double& value) { + var.putAtt(name, ncDouble, value); +} +template <> +MAYBE_UNUSED() +void NcPutAttVisitor::operator()(const float& value) { + var.putAtt(name, ncFloat, value); +} +template <> +void NcPutAttVisitor::operator()(const std::string& value) { + var.putAtt(name, value); +} + +void writeGroup(const Options& options, NcGroup group, + const std::string& time_dimension) { + + for (const auto& childpair : options.getChildren()) { + const auto& name = childpair.first; + const auto& child = childpair.second; + + if (child.isValue()) { + try { + auto nctype = bout::utils::visit(NcTypeVisitor(), child.value); + + if (nctype.isNull()) { + continue; // Skip this value + } + + // Get spatial dimensions + auto spatial_dims = bout::utils::visit(NcDimVisitor(group), child.value); + + // Vector of all dimensions, including time + std::vector dims{spatial_dims}; + + // Get the time dimension + NcDim time_dim; ///< Time dimension (Null -> none) + auto time_it = child.attributes.find("time_dimension"); + if (time_it != child.attributes.end()) { + // Has a time dimension + + const auto& time_name = bout::utils::get(time_it->second); + + // Only write time-varying values that match current time + // dimension being written + if (time_name != time_dimension) { + continue; + } + + time_dim = group.getDim(time_name, NcGroup::ParentsAndCurrent); + if (time_dim.isNull()) { + time_dim = group.addDim(time_name); + } + + // prepend to vector of dimensions + dims.insert(dims.begin(), time_dim); + } + + // Check if the variable exists + auto var = group.getVar(name); + if (var.isNull()) { + // Variable doesn't exist yet + // Create variable + // Temporary NcType as a workaround for bug in ADIOS 4.4.0 and + // ADIOS-CXX4 4.2.0 + var = group.addVar(name, NcType{group, nctype.getId()}, dims); + if (!time_dim.isNull()) { + // Time evolving variable, so we'll need to keep track of its time index + var.putAtt(current_time_index_name, ncInt, 0); + } + } else { + // Variable does exist + + // Check types are the same + if (var.getType() != nctype) { + throw BoutException( + "Changed type of variable '{:s}'. Was '{:s}', now writing '{:s}'", name, + var.getType().getName(), nctype.getName()); + } + + // Check that the dimensions are correct + auto var_dims = var.getDims(); + + // Same number of dimensions? + if (var_dims.size() != dims.size()) { + throw BoutException( + "Changed dimensions for variable '{:s}'\nIn file has {:d} " + "dimensions, now writing {:d}\n", + name, var_dims.size(), dims.size()); + } + // Dimensions compatible? + for (std::vector::size_type i = 0; i < dims.size(); ++i) { + if (var_dims[i] == dims[i]) { + continue; // The same dimension -> ok + } + if (var_dims[i].isUnlimited() != dims[i].isUnlimited()) { + throw BoutException("Unlimited dimension changed for variable '{:s}'", + name); + } + if (var_dims[i].getSize() != dims[i].getSize()) { + throw BoutException("Dimension size changed for variable '{:s}'", name); + } + } + // All ok. Set dimensions to the variable's NcDims + dims = var_dims; + + if (!time_dim.isNull()) { + // A time dimension + time_dim = dims[0]; + } + } + + // Write the variable + + if (time_dim.isNull()) { + // No time index + + // Put the data into the variable + bout::utils::visit(NcPutVarVisitor(var), child.value); + + } else { + // Has a time index, so need the record index + + const int current_time_index = getCurrentTimeIndex(var); + + std::vector start_index; ///< Starting index where data will be inserted + std::vector count_index; ///< Size of each dimension + + // Dimensions, including time + for (const auto& dim : dims) { + start_index.push_back(0); + count_index.push_back(dim.getSize()); + } + // Time dimension + start_index[0] = current_time_index; + count_index[0] = 1; // Writing one record + + // Put the data into the variable + bout::utils::visit(NcPutVarCountVisitor(var, start_index, count_index), + child.value); + + // We've just written a new time slice, so we need to update + // the attribute to track it + var.putAtt(current_time_index_name, ncInt, current_time_index + 1); + } + + // Write attributes + for (const auto& attribute : child.attributes) { + const std::string& att_name = attribute.first; + const auto& att = attribute.second; + + bout::utils::visit(NcPutAttVisitor(var, att_name), att); + } + + } catch (const std::exception& e) { + throw BoutException("Error while writing value '{:s}' : {:s}", name, e.what()); + } + } + + if (child.isSection()) { + // Check if the group exists + TRACE("Writing group '{:s}'", name); + + auto subgroup = group.getGroup(name); + if (subgroup.isNull()) { + // Doesn't exist yet, so create it + subgroup = group.addGroup(name); + } + + writeGroup(child, subgroup, time_dimension); + } + } +} + +/// Helper struct for returning errors from verifyTimesteps(NcGroup) +struct TimeDimensionError { + std::string variable_name; + std::string time_name; + std::size_t expected_size; + std::size_t current_size; +}; + +std::vector verifyTimesteps(const NcGroup& group) { + + // Map of dimension -> size + std::map seen_time_dimensions; + // Variables with mismatched dimension sizes. Note that this might + // be a little odd: if the first variable we come across has the + // "wrong" dimension size, we will actually list all the others as + // being wrong! + std::vector errors; + + // For each variable, check its time dimension against what we've + // seen already. Note that this assumes a single time dimension per + // variable whose is in the attribute "time_dimension" + for (const auto& varpair : group.getVars()) { + const auto& var_name = varpair.first; // Name of the variable + const auto& var = varpair.second; // The NcVar object + + // Get the name of the time dimension from the attribute + const auto& attributes = var.getAtts(); + const auto time_it = attributes.find("time_dimension"); + if (time_it == attributes.end()) { + // No "time_dimension" attribute so presumably not a + // time-evolving variable + continue; + } + + // Use the attribute value to get the actual dimension + std::string time_name; + time_it->second.getValues(time_name); + const auto time_dim = group.getDim(time_name, NcGroup::ParentsAndCurrent); + + // Check if we've already seen this dimension + auto seen_it = seen_time_dimensions.find(time_dim); + if (seen_it == seen_time_dimensions.end()) { + // If we haven't, add it to the map with current time index + seen_time_dimensions[time_dim] = time_dim.getSize(); + continue; + } + + // If we have, check if the variable current time index matches time size + const auto current_time = static_cast(getCurrentTimeIndex(var)); + if (current_time == time_dim.getSize()) { + continue; + } + // If not, add to list of errors + errors.push_back({var_name, time_dim.getName(), time_dim.getSize(), current_time}); + } + + // Recurse down into subgroups, shoving any new errors into what + // we've already got. Don't bother reserving the new size, this + // shouldn't be big! + for (const auto& child : group.getGroups()) { + auto child_errors = verifyTimesteps(child.second); + errors.insert(errors.end(), child_errors.begin(), child_errors.end()); + } + + return errors; +} + +} // namespace + +namespace bout { + +OptionsADIOS::OptionsADIOS() : data_file(nullptr) {} + +OptionsADIOS::OptionsADIOS(std::string filename, FileMode mode) + : filename(std::move(filename)), file_mode(mode), data_file(nullptr) {} + +OptionsADIOS::~OptionsADIOS() = default; +OptionsADIOS::OptionsADIOS(OptionsADIOS&&) noexcept = default; +OptionsADIOS& OptionsADIOS::operator=(OptionsADIOS&&) noexcept = default; + +void OptionsADIOS::verifyTimesteps() const { + NcFile dataFile(filename, NcFile::read); + auto errors = ::verifyTimesteps(dataFile); + + if (errors.empty()) { + // No errors + return; + } + + std::string error_string; + for (const auto& error : errors) { + error_string += fmt::format( + " variable: {}; dimension: {}; expected size: {}; actual size: {}\n", + error.variable_name, error.time_name, error.expected_size, error.current_size); + } + throw BoutException("ERROR: When checking timesteps in file '{}', some ({}) variables " + "did not have the expected size(s):\n{}", + filename, errors.size(), error_string); +} + +/// Write options to file +void OptionsADIOS::write(const Options& options, const std::string& time_dim) { + Timer timer("io"); + + // Check the file mode to use + auto ncmode = NcFile::replace; + if (file_mode == FileMode::append) { + // ADIOS doesn't have a "read-write, create if exists" mode, so + // we need to check ourselves if the file already exists; if it + // doesn't, tell ADIOS to create it + std::ifstream file(filename); + ncmode = file.good() ? NcFile::FileMode::write : NcFile::FileMode::newFile; + } + + if (not data_file) { + data_file = std::make_unique(filename, ncmode); + } + + if (data_file->isNull()) { + throw BoutException("Could not open ADIOS file '{:s}' for writing", filename); + } + + writeGroup(options, *data_file, time_dim); + + data_file->sync(); +} + +std::string getRestartDirectoryName(Options& options) { + if (options["restartdir"].isSet()) { + // Solver-specific restart directory + return options["restartdir"].withDefault("data"); + } + // Use the root data directory + return options["datadir"].withDefault("data"); +} + +std::string getRestartFilename(Options& options) { + return getRestartFilename(options, BoutComm::rank()); +} + +std::string getRestartFilename(Options& options, int rank) { + return fmt::format("{}/BOUT.restart.{}.nc", bout::getRestartDirectoryName(options), + rank); +} + +std::string getOutputFilename(Options& options) { + return getOutputFilename(options, BoutComm::rank()); +} + +std::string getOutputFilename(Options& options, int rank) { + return fmt::format("{}/BOUT.dmp.{}.nc", + options["datadir"].withDefault("data"), rank); +} + +void writeDefaultOutputFile() { writeDefaultOutputFile(Options::root()); } + +void writeDefaultOutputFile(Options& options) { + bout::experimental::addBuildFlagsToOptions(options); + bout::globals::mesh->outputVars(options); + OptionsADIOS(getOutputFilename(Options::root())).write(options); +} + +} // namespace bout + +#endif // BOUT_HAS_ADIOS From 0fa73d6ec40deab6fcb1943582c1d170c06edf06 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Fri, 1 Sep 2023 15:33:27 -0400 Subject: [PATCH 02/46] Added adios_object.* files to initialize/finalize adios (in BoutInitialise/BoutFinalise) --- CMakeLists.txt | 3 ++ include/bout/adios_object.hxx | 53 ++++++++++++++++++++ include/bout/build_config.hxx | 1 + src/bout++.cxx | 18 ++++++- src/sys/adios_object.cxx | 92 +++++++++++++++++++++++++++++++++++ 5 files changed, 165 insertions(+), 2 deletions(-) create mode 100755 include/bout/adios_object.hxx create mode 100755 src/sys/adios_object.cxx diff --git a/CMakeLists.txt b/CMakeLists.txt index be6976a079..9d239afa0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,7 @@ function(bout_update_submodules) endfunction() set(BOUT_SOURCES + ./include/bout/adios_object.hxx ./include/bout/array.hxx ./include/bout/assert.hxx ./include/bout/boundary_factory.hxx @@ -326,6 +327,7 @@ set(BOUT_SOURCES ./src/solver/impls/split-rk/split-rk.cxx ./src/solver/impls/split-rk/split-rk.hxx ./src/solver/solver.cxx + ./src/sys/adios_object.cxx ./src/sys/bout_types.cxx ./src/sys/boutcomm.cxx ./src/sys/boutexception.cxx @@ -931,6 +933,7 @@ message(" SUNDIALS support : ${BOUT_HAS_SUNDIALS} HYPRE support : ${BOUT_HAS_HYPRE} NetCDF support : ${BOUT_HAS_NETCDF} + ADIOS support : ${BOUT_HAS_ADIOS} FFTW support : ${BOUT_HAS_FFTW} LAPACK support : ${BOUT_HAS_LAPACK} OpenMP support : ${BOUT_USE_OPENMP} diff --git a/include/bout/adios_object.hxx b/include/bout/adios_object.hxx new file mode 100755 index 0000000000..058aa030c3 --- /dev/null +++ b/include/bout/adios_object.hxx @@ -0,0 +1,53 @@ +#ifndef ADIOS_OBJECT_HXX +#define ADIOS_OBJECT_HXX + +#include "bout/build_config.hxx" + +#if BOUT_HAS_ADIOS + +#include +#include +#include + +namespace bout { + +void ADIOSInit(MPI_Comm comm); +void ADIOSInit(const std::string configFile, MPI_Comm comm); +void ADIOSFinalize(); + +using ADIOSPtr = std::shared_ptr; +using EnginePtr = std::shared_ptr; +using IOPtr = std::shared_ptr; + +ADIOSPtr GetADIOSPtr(); +IOPtr GetIOPtr(const std::string IOName); + +struct ADIOSStruct { + adios2::IO io; + adios2::Engine engine; + adios2::Variable vCellDim, vPhysDim, vNTotalElem, vNTotalNode; + adios2::Variable vPhysTime; + adios2::Variable vStep; + adios2::Variable vElementConnectivity, vElementRange; + adios2::Variable vXco, vYco, vZco; + std::vector> vFlowVars; + std::vector> vBoundariesConnectivity; + std::vector> vBoundariesRange; + int adiosStep = 0; +}; + +extern ADIOSStruct adios_restart; +extern ADIOSStruct adios_dump; +//extern ADIOS2Param *adios2params; + +/** return one of the extern variable based on the target file name */ +ADIOSStruct& ADIOSGetStruct(const std::string& fname); + +/** Set user parameters for an IO group */ +void ADIOSSetParameters(const std::string& input, const char delimKeyValue, + const char delimItem, adios2::IO& io); + +} // namespace bout + +#endif //BOUT_HAS_ADIOS +#endif //ADIOS_OBJECT_HXX diff --git a/include/bout/build_config.hxx b/include/bout/build_config.hxx index a98c615c77..c97962f7cf 100644 --- a/include/bout/build_config.hxx +++ b/include/bout/build_config.hxx @@ -17,6 +17,7 @@ constexpr auto has_gettext = static_cast(BOUT_HAS_GETTEXT); constexpr auto has_lapack = static_cast(BOUT_HAS_LAPACK); constexpr auto has_legacy_netcdf = static_cast(BOUT_HAS_LEGACY_NETCDF); constexpr auto has_netcdf = static_cast(BOUT_HAS_NETCDF); +constexpr auto has_adios = static_cast(BOUT_HAS_ADIOS); constexpr auto has_petsc = static_cast(BOUT_HAS_PETSC); constexpr auto has_hypre = static_cast(BOUT_HAS_HYPRE); constexpr auto has_umpire = static_cast(BOUT_HAS_UMPIRE); diff --git a/src/bout++.cxx b/src/bout++.cxx index 7d7b38b947..6de8798622 100644 --- a/src/bout++.cxx +++ b/src/bout++.cxx @@ -59,6 +59,10 @@ const char DEFAULT_DIR[] = "data"; #include "bout/bout.hxx" #undef BOUT_NO_USING_NAMESPACE_BOUTGLOBALS +#if BOUT_HAS_ADIOS +#include "bout/adios_object.hxx" +#endif + #include #include @@ -161,6 +165,10 @@ int BoutInitialise(int& argc, char**& argv) { savePIDtoFile(args.data_dir, MYPE); +#if BOUT_HAS_ADIOS + bout::ADIOSInit(BoutComm::get()); +#endif + // Print the different parts of the startup info printStartupHeader(MYPE, BoutComm::size()); printCompileTimeOptions(); @@ -564,6 +572,7 @@ void printCompileTimeOptions() { constexpr auto netcdf_flavour = has_netcdf ? (has_legacy_netcdf ? " (Legacy)" : " (NetCDF4)") : ""; output_info.write(_("\tNetCDF support {}{}\n"), is_enabled(has_netcdf), netcdf_flavour); + output_info.write(_("\tADIOS support {}\n"), is_enabled(has_adios)); output_info.write(_("\tPETSc support {}\n"), is_enabled(has_petsc)); output_info.write(_("\tPretty function name support {}\n"), is_enabled(has_pretty_function)); @@ -641,7 +650,7 @@ void setupOutput(const std::string& data_dir, const std::string& log_file, int v { Output& output = *Output::getInstance(); if (MYPE == 0) { - output.enable(); // Enable writing to stdout + output.enable(); // Enable writing to stdout } else { output.disable(); // No writing to stdout } @@ -692,6 +701,7 @@ void addBuildFlagsToOptions(Options& options) { options["has_gettext"].force(bout::build::has_gettext); options["has_lapack"].force(bout::build::has_lapack); options["has_netcdf"].force(bout::build::has_netcdf); + options["has_adios"].force(bout::build::has_adios); options["has_petsc"].force(bout::build::has_petsc); options["has_hypre"].force(bout::build::has_hypre); options["has_umpire"].force(bout::build::has_umpire); @@ -787,6 +797,10 @@ int BoutFinalise(bool write_settings) { // Call HYPER_Finalize if not already called bout::HypreLib::cleanup(); +#if BOUT_HAS_ADIOS + bout::ADIOSFinalize(); +#endif + // MPI communicator, including MPI_Finalize() BoutComm::cleanup(); @@ -1042,6 +1056,6 @@ void RunMetrics::writeProgress(BoutReal simtime, bool output_split) { 100. * wtime_comms / wtime, // Communications 100. * wtime_io / wtime, // I/O 100. * (wtime - wtime_io - wtime_rhs) - / wtime); // Everything else + / wtime); // Everything else } } diff --git a/src/sys/adios_object.cxx b/src/sys/adios_object.cxx new file mode 100755 index 0000000000..5bab7545e9 --- /dev/null +++ b/src/sys/adios_object.cxx @@ -0,0 +1,92 @@ +#include "bout/build_config.hxx" + +#if BOUT_HAS_ADIOS + +#include "bout/adios_object.hxx" + +#include +#include +#include + +namespace bout { + +static ADIOSPtr adios = nullptr; +ADIOSStruct adios_restart; +ADIOSStruct adios_dump; +//ADIOS2Param* adios2params; + +void ADIOSInit(MPI_Comm comm) { adios = std::make_shared(comm); } + +void ADIOSInit(const std::string configFile, MPI_Comm comm) { + adios = std::make_shared(configFile, comm); +} + +void ADIOSFinalize() { + if (adios == nullptr) { + throw std::runtime_error( + "ADIOS needs to be initialized first before calling ADIOSFinalize()"); + } + if (adios_dump.adiosStep > 0 && adios_dump.engine) { + adios_dump.engine.Close(); + } + adios.reset(); +} + +ADIOSPtr GetADIOSPtr() { + if (adios == nullptr) { + throw std::runtime_error( + "ADIOS needs to be initialized first before calling GetADIOSPtr()"); + } + return adios; +} + +IOPtr GetIOPtr(const std::string IOName) { + auto adios = GetADIOSPtr(); + IOPtr io = nullptr; + try { + io = std::make_shared(adios->AtIO(IOName)); + } catch (std::invalid_argument& e) { + } + return io; +} + +ADIOSStruct& ADIOSGetStruct(const std::string& fname) { + if (fname.find(".restart") != std::string::npos) + return adios_restart; + //if (fname.find(".dmp") != std::string::npos) + // return adios_dump; + return adios_dump; +} + +void ADIOSSetParameters(const std::string& input, const char delimKeyValue, + const char delimItem, adios2::IO& io) { + auto lf_Trim = [](std::string& input) { + input.erase(0, input.find_first_not_of(" \n\r\t")); // prefixing spaces + input.erase(input.find_last_not_of(" \n\r\t") + 1); // suffixing spaces + }; + + std::istringstream inputSS(input); + std::string parameter; + while (std::getline(inputSS, parameter, delimItem)) { + const size_t position = parameter.find(delimKeyValue); + if (position == parameter.npos) { + throw std::invalid_argument("ADIOSSetParameters(): wrong format for IO parameter " + + parameter + ", format must be key" + delimKeyValue + + "value for each entry"); + } + + std::string key = parameter.substr(0, position); + lf_Trim(key); + std::string value = parameter.substr(position + 1); + lf_Trim(value); + if (value.length() == 0) { + throw std::invalid_argument("ADIOS2SetParameters: empty value in IO parameter " + + parameter + ", format must be key" + delimKeyValue + + "value"); + } + io.SetParameter(key, value); + } +} + +} // namespace bout +#endif //BOUT_HAS_ADIOS From 0769805846100bd891a95bf5172cdb65f67392fc Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Tue, 5 Sep 2023 07:01:23 -0400 Subject: [PATCH 03/46] fix include of adios --- src/sys/options/options_adios.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index 6b7b3aea28..72514bc676 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -1,6 +1,6 @@ #include "bout/build_config.hxx" -#if BOUT_HAS_ADIOS +#if BOUT_HAS_ADIOS #include "bout/options_adios.hxx" @@ -9,9 +9,9 @@ #include "bout/mesh.hxx" #include "bout/sys/timer.hxx" +#include "adios2.h" #include #include -#include #include using namespace ADIOS; From 58aeacdb6040c404b174017552bffd3f306707bc Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Tue, 5 Sep 2023 13:54:20 -0400 Subject: [PATCH 04/46] Introduce OptionsIO as parent virtual class of OptionsNetCDF/OptionsADIOS. ADIOS code does not compile yet. --- CMakeLists.txt | 3 + include/bout/options_adios.hxx | 34 +- include/bout/options_io.hxx | 108 ++++++ include/bout/options_netcdf.hxx | 19 -- include/bout/physicsmodel.hxx | 6 +- src/physics/physicsmodel.cxx | 47 ++- src/sys/options/options_adios.cxx | 531 +++++++---------------------- src/sys/options/options_io.cxx | 99 ++++++ src/sys/options/options_netcdf.cxx | 35 -- 9 files changed, 365 insertions(+), 517 deletions(-) create mode 100644 include/bout/options_io.hxx create mode 100644 src/sys/options/options_io.cxx diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d239afa0e..a580aa9f6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,6 +147,7 @@ set(BOUT_SOURCES ./include/bout/openmpwrap.hxx ./include/bout/operatorstencil.hxx ./include/bout/options.hxx + ./include/bout/options_io.hxx ./include/bout/options_netcdf.hxx ./include/bout/options_adios.hxx ./include/bout/optionsreader.hxx @@ -341,7 +342,9 @@ set(BOUT_SOURCES ./src/sys/options/optionparser.hxx ./src/sys/options/options_ini.cxx ./src/sys/options/options_ini.hxx + ./src/sys/options/options_io.cxx ./src/sys/options/options_netcdf.cxx + ./src/sys/options/options_adios.cxx ./src/sys/optionsreader.cxx ./src/sys/output.cxx ./src/sys/petsclib.cxx diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx index f781d504b5..ec6c26a432 100644 --- a/include/bout/options_adios.hxx +++ b/include/bout/options_adios.hxx @@ -6,7 +6,7 @@ #include "bout/build_config.hxx" -#if !BOUT_HAS_ADIOS +#if !BOUT_HAS_ADIOS #include @@ -44,15 +44,14 @@ public: #include #include +#include "bout/adios_object.hxx" #include "bout/options.hxx" +namespace bout { + /// Forward declare ADIOS file type so we don't need to depend /// directly on ADIOS -namespace ADIOS { -class BPStream; -} - -namespace bout { +struct ADIOSStream; class OptionsADIOS { public: @@ -89,30 +88,11 @@ private: /// How to open the file for writing FileMode file_mode{FileMode::replace}; /// Pointer to ADIOS file so we don't introduce direct dependence - std::unique_ptr data_file; + std::unique_ptr data_file; }; } // namespace bout -#endif - -namespace bout { -/// Name of the directory for restart files -std::string getRestartDirectoryName(Options& options); -/// Name of the restart file on this rank -std::string getRestartFilename(Options& options); -/// Name of the restart file on \p rank -std::string getRestartFilename(Options& options, int rank); -/// Name of the main output file on this rank -std::string getOutputFilename(Options& options); -/// Name of the main output file on \p rank -std::string getOutputFilename(Options& options, int rank); -/// Write `Options::root()` to the main output file, overwriting any -/// existing files -void writeDefaultOutputFile(); -/// Write \p options to the main output file, overwriting any existing -/// files -void writeDefaultOutputFile(Options& options); -} // namespace bout +#endif // BOUT_HAS_ADIOS #endif // __OPTIONS_ADIOS_H__ diff --git a/include/bout/options_io.hxx b/include/bout/options_io.hxx new file mode 100644 index 0000000000..1a51a2bebb --- /dev/null +++ b/include/bout/options_io.hxx @@ -0,0 +1,108 @@ +/* Parent class for IO/ADIOS option classes */ + +#pragma once + +#ifndef __OPTIONS_IO_H__ +#define __OPTIONS_IO_H__ + +#include "bout/build_config.hxx" + +#include +#include + +#include "bout/options.hxx" + +#if BOUT_HAS_ADIOS +#include "bout/options_adios.hxx" +#endif +#if BOUT_HAS_NETCDF +#include "bout/options_netcdf.hxx" +#endif + +namespace bout { + +class OptionsIO { +public: + enum class FileMode { + replace, ///< Overwrite file when writing + append ///< Append to file when writing + }; + + enum class Library { +#if BOUT_HAS_ADIOS + ADIOS, +#endif +#if BOUT_HAS_NETCDF + NetCDF, +#endif + Invalid + }; + + static const Library defaultIOLibrary = +#if BOUT_HAS_ADIOS + Library::ADIOS; +#elif BOUT_HAS_NETCDF + Library::NetCDF; +#else + Library::Invalid; +#endif + + OptionsIO(); + explicit OptionsIO(std::string filename, FileMode mode = FileMode::replace); + ~OptionsIO(); + OptionsIO(const OptionsIO&) = delete; + OptionsIO(OptionsIO&&) noexcept; + OptionsIO& operator=(const OptionsIO&) = delete; + OptionsIO& operator=(OptionsIO&&) noexcept; + + /// Read options from file + virtual Options read() = 0; + + /// Write options to file + void write(const Options& options) { write(options, "t"); } + virtual void write(const Options& options, const std::string& time_dim) = 0; + + /// Check that all variables with the same time dimension have the + /// same size in that dimension. Throws BoutException if there are + /// any differences, otherwise is silent + virtual void verifyTimesteps() const = 0; + +private: + /// Name of the file on disk + std::string filename; + /// How to open the file for writing + FileMode file_mode{FileMode::replace}; + Library library = Library::Invalid; +}; + +std::shared_ptr +OptionsIOFactory(std::string filename, + OptionsIO::FileMode mode = OptionsIO::FileMode::replace, + const OptionsIO::Library library = OptionsIO::defaultIOLibrary); + +OptionsIO::Library getIOLibrary(Options& options); + +/// Name of the directory for restart files +std::string getRestartDirectoryName(Options& options); +/// Name of the restart file on this rank +std::string getRestartFilename(Options& options, const OptionsIO::Library library); +/// Name of the restart file on \p rank +std::string getRestartFilename(Options& options, int rank, + const OptionsIO::Library library); +/// Name of the main output file on this rank +std::string getOutputFilename(Options& options, const OptionsIO::Library library); +/// Name of the main output file on \p rank +std::string getOutputFilename(Options& options, int rank, + const OptionsIO::Library library); +/// Write `Options::root()` to the main output file, overwriting any +/// existing files +void writeDefaultOutputFile( + const OptionsIO::Library library = OptionsIO::defaultIOLibrary); +/// Write \p options to the main output file, overwriting any existing +/// files +void writeDefaultOutputFile( + Options& options, const OptionsIO::Library library = OptionsIO::defaultIOLibrary); + +} // namespace bout + +#endif // __OPTIONS_IO_H__ diff --git a/include/bout/options_netcdf.hxx b/include/bout/options_netcdf.hxx index 2fdb71c6d4..d633596fbd 100644 --- a/include/bout/options_netcdf.hxx +++ b/include/bout/options_netcdf.hxx @@ -96,23 +96,4 @@ private: #endif -namespace bout { -/// Name of the directory for restart files -std::string getRestartDirectoryName(Options& options); -/// Name of the restart file on this rank -std::string getRestartFilename(Options& options); -/// Name of the restart file on \p rank -std::string getRestartFilename(Options& options, int rank); -/// Name of the main output file on this rank -std::string getOutputFilename(Options& options); -/// Name of the main output file on \p rank -std::string getOutputFilename(Options& options, int rank); -/// Write `Options::root()` to the main output file, overwriting any -/// existing files -void writeDefaultOutputFile(); -/// Write \p options to the main output file, overwriting any existing -/// files -void writeDefaultOutputFile(Options& options); -} // namespace bout - #endif // __OPTIONS_NETCDF_H__ diff --git a/include/bout/physicsmodel.hxx b/include/bout/physicsmodel.hxx index a9a7d7344d..eb1bae8ae1 100644 --- a/include/bout/physicsmodel.hxx +++ b/include/bout/physicsmodel.hxx @@ -42,7 +42,7 @@ class PhysicsModel; #include "bout/macro_for_each.hxx" #include "bout/msg_stack.hxx" #include "bout/options.hxx" -#include "bout/options_netcdf.hxx" +#include "bout/options_io.hxx" #include "bout/sys/variant.hxx" #include "bout/unused.hxx" #include "bout/utils.hxx" @@ -383,13 +383,13 @@ private: /// State for outputs Options output_options; /// File to write the outputs to - bout::OptionsNetCDF output_file; + std::shared_ptr output_file; /// Should we write output files bool output_enabled{true}; /// Stores the state for restarting Options restart_options; /// File to write the restart-state to - bout::OptionsNetCDF restart_file; + std::shared_ptr restart_file; /// Should we write restart files bool restart_enabled{true}; /// Split operator model? diff --git a/src/physics/physicsmodel.cxx b/src/physics/physicsmodel.cxx index cac4bda5cc..e0658b77bb 100644 --- a/src/physics/physicsmodel.cxx +++ b/src/physics/physicsmodel.cxx @@ -73,20 +73,31 @@ bool DataFileFacade::write() { } // namespace bout PhysicsModel::PhysicsModel() - : mesh(bout::globals::mesh), - output_file(bout::getOutputFilename(Options::root()), - Options::root()["append"] - .doc("Add output data to existing (dump) files?") - .withDefault(false) - ? bout::OptionsNetCDF::FileMode::append - : bout::OptionsNetCDF::FileMode::replace), - output_enabled(Options::root()["output"]["enabled"] - .doc("Write output files") - .withDefault(true)), - restart_file(bout::getRestartFilename(Options::root())), + : mesh(bout::globals::mesh), output_enabled(Options::root()["output"]["enabled"] + .doc("Write output files") + .withDefault(true)), restart_enabled(Options::root()["restart_files"]["enabled"] .doc("Write restart files") - .withDefault(true)) {} + .withDefault(true)) + +{ + bout::OptionsIO::Library iolibrary = bout::getIOLibrary(Options::root()); + if (output_enabled) { + std::string outputFileName = bout::getOutputFilename(Options::root(), iolibrary); + auto mode = Options::root()["append"] + .doc("Add output data to existing (dump) files?") + .withDefault(false) + ? bout::OptionsIO::FileMode::append + : bout::OptionsIO::FileMode::replace; + output_file = bout::OptionsIOFactory(outputFileName, mode, iolibrary); + } + + if (restart_enabled) { + std::string restartFileName = bout::getRestartFilename(Options::root(), iolibrary); + restart_file = bout::OptionsIOFactory(restartFileName, + bout::OptionsIO::FileMode::replace, iolibrary); + } +} void PhysicsModel::initialise(Solver* s) { if (initialised) { @@ -104,7 +115,7 @@ void PhysicsModel::initialise(Solver* s) { const bool restarting = Options::root()["restart"].withDefault(false); if (restarting) { - restart_options = restart_file.read(); + restart_options = restart_file->read(); } // Call user init code to specify evolving variables @@ -187,7 +198,7 @@ int PhysicsModel::postInit(bool restarting) { restart_options["BOUT_VERSION"].force(bout::version::as_double, "PhysicsModel"); // Write _everything_ to restart file - restart_file.write(restart_options); + restart_file->write(restart_options); } // Add monitor to the solver which calls restart.write() and @@ -219,7 +230,7 @@ void PhysicsModel::restartVars(Options& options) { void PhysicsModel::writeRestartFile() { if (restart_enabled) { - restart_file.write(restart_options); + restart_file->write(restart_options); } } @@ -227,20 +238,20 @@ void PhysicsModel::writeOutputFile() { writeOutputFile(output_options); } void PhysicsModel::writeOutputFile(const Options& options) { if (output_enabled) { - output_file.write(options, "t"); + output_file->write(options, "t"); } } void PhysicsModel::writeOutputFile(const Options& options, const std::string& time_dimension) { if (output_enabled) { - output_file.write(options, time_dimension); + output_file->write(options, time_dimension); } } void PhysicsModel::finishOutputTimestep() const { if (output_enabled) { - output_file.verifyTimesteps(); + output_file->verifyTimesteps(); } } diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index 72514bc676..518a8fa7ed 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -14,402 +14,139 @@ #include #include -using namespace ADIOS; +namespace bout { + +struct ADIOSStream { + adios2::IO io; + adios2::Engine engine; + adios2::Variable vStep; + adios2::Variable vTime; + int adiosStep = 0; +}; -namespace { /// Name of the attribute used to track individual variable's time indices constexpr auto current_time_index_name = "current_time_index"; -/// ADIOS doesn't keep track of the current for each variable -/// (although the underlying HDF5 file does!), so we need to do it -/// ourselves. We'll use an attribute in the file to do so, which -/// means we don't need to keep track of it in the code -int getCurrentTimeIndex(const NcVar& var) { - const auto atts_map = var.getAtts(); - const auto time_index_attribute = atts_map.find(current_time_index_name); - if (time_index_attribute == atts_map.end()) { - // Attribute doesn't exist, so let's start at zero. There - // are various ways this might break, for example, if the - // variable was added to the file by a different - // program. But note, that if we use the size of the time - // dimension here, this will increase every time we add a - // new variable! So zero is probably the only sensible - // choice for this - return 0; +template +bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, + const std::string& type, Options& result) { + bool ret = false; + std::vector data; + adios2::Variable variable = io.InquireVariable(name); + + if (variable.ShapeID() == adios2::ShapeID::GlobalValue) { + T value; + io.Get(variable, &value, adios2::Mode::Sync); + result[name] = value; + return true; } - int current_time_index; - time_index_attribute->second.getValues(¤t_time_index); - return current_time_index; -} -template -T readVariable(const NcVar& variable) { - T value; - variable.getVar(&value); - return value; -} + if (variable.ShapeID() == adios2::ShapeID::LocalArray) { + if (!rank) + std::cout << " LocalArray not supported" << std::endl; + return ret; + } -template -T readAttribute(const NcAtt& attribute) { - T value; - attribute.getValues(&value); - return value; -} + auto dims = variable.Shape(); + auto ndim = shape.size(); -void readGroup(const std::string& filename, const NcGroup& group, Options& result) { + switch (ndims) { + case 1: { + Array value(static_cast(dims[0])); + io.Get(variable, value.data(), adios2::Mode::Sync); + result[name] = value; + } + case 2: { + Matrix value(static_cast(dims[0].getSize()), + static_cast(dims[1].getSize())); + io.Get(variable, value.data(), adios2::Mode::Sync); + result[name] = value; + } + case 3: { + Tensor value(static_cast(dims[0].getSize()), + static_cast(dims[1].getSize()), + static_cast(dims[2].getSize())); + io.Get(variable, value.data(), adios2::Mode::Sync); + result[name] = value; + } + } - // Iterate over all variables - for (const auto& varpair : group.getVars()) { - const auto& var_name = varpair.first; // Name of the variable - const auto& var = varpair.second; // The NcVar object + if (!rank) + std::cout << " array has " << variable.Steps() << " steps" << std::endl; - auto var_type = var.getType(); // Variable type - auto ndims = var.getDimCount(); // Number of dimensions - auto dims = var.getDims(); // Vector of dimensions - - switch (ndims) { - case 0: { - // Scalar variables - if (var_type == ncDouble) { - result[var_name] = readVariable(var); - } else if (var_type == ncFloat) { - result[var_name] = readVariable(var); - } else if (var_type == ncInt or var_type == ncShort) { - result[var_name] = readVariable(var); - } else if (var_type == ncString) { - result[var_name] = std::string(readVariable(var)); - } - // Note: ADIOS does not support boolean atoms - // else ignore - break; - } - case 1: { - if (var_type == ncDouble or var_type == ncFloat) { - Array value(static_cast(dims[0].getSize())); - var.getVar(value.begin()); - result[var_name] = value; - } else if ((var_type == ncString) or (var_type == ncChar)) { - std::string value; - value.resize(dims[0].getSize()); - var.getVar(&(value[0])); - result[var_name] = value; - } - break; - } - case 2: { - if (var_type == ncDouble or var_type == ncFloat) { - Matrix value(static_cast(dims[0].getSize()), - static_cast(dims[1].getSize())); - var.getVar(value.begin()); - result[var_name] = value; - } - break; - } - case 3: { - if (var_type == ncDouble or var_type == ncFloat) { - Tensor value(static_cast(dims[0].getSize()), - static_cast(dims[1].getSize()), - static_cast(dims[2].getSize())); - var.getVar(value.begin()); - result[var_name] = value; - } - } - } - result[var_name].attributes["source"] = filename; - - // Get variable attributes - for (const auto& attpair : var.getAtts()) { - const auto& att_name = attpair.first; // Attribute name - const auto& att = attpair.second; // NcVarAtt object + /* Need to read the data here */ + result[name] = data.data(); + return ret; +} - auto att_type = att.getType(); // Type of the attribute - - if (att_type == ncInt) { - result[var_name].attributes[att_name] = readAttribute(att); - } else if (att_type == ncFloat) { - result[var_name].attributes[att_name] = readAttribute(att); - } else if (att_type == ncDouble) { - result[var_name].attributes[att_name] = readAttribute(att); - } else if ((att_type == ncString) or (att_type == ncChar)) { - std::string value; - att.getValues(value); - result[var_name].attributes[att_name] = value; - } - // Else ignore - } +bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, + const std::string& type, Options& result) { + bool ret; +#define declare_template_instantiation(T) \ + if (type == adios2::GetType()) { \ + ret = readVariable(reader, io, name, type, result); \ } - - // Iterate over groups - for (const auto& grouppair : group.getGroups()) { - const auto& name = grouppair.first; - const auto& subgroup = grouppair.second; - - readGroup(filename, subgroup, result[name]); + ADIOS2_FOREACH_ATTRIBUTE_PRIMITIVE_STDTYPE_1ARG(declare_template_instantiation) +#undef declare_template_instantiation + return ret; +} + +bool readAttribute(adios2::Engine& reader, adios2::IO& io, const std::string& name, + const std::string& type, Options& result) { + bool ret; +#define declare_template_instantiation(T) \ + if (type == adios2::GetType()) { \ + adios2::Attribute a = io.InquireAtrribute(name); \ + result[name] = a.Data().data(); \ } -} -} // namespace + ADIOS2_FOREACH_ATTRIBUTE_PRIMITIVE_STDTYPE_1ARG(declare_template_instantiation) +#undef declare_template_instantiation + return ret; +} // namespace bout -namespace bout { +void readGroup(const std::string& filename, ADIOSStruct& group, Options& result) {} Options OptionsADIOS::read() { Timer timer("io"); // Open file - const NcFile read_file(filename, NcFile::read); + ADIOSPtr adiosp = GetADIOSPtr(); + adios2::IO io; + try { + io = adiosp->AtIO(filename); + } catch (const std::invalid_argument& e) { + std::cerr << e.what() << '\n'; + io = adiosp->DeclareIO(filename); + } - if (read_file.isNull()) { + adios2::Engine reader = io.Open(filename, adios2::Mode::ReadRandomAccess); + if (!reader) { throw BoutException("Could not open ADIOS file '{:s}' for reading", filename); } Options result; - readGroup(filename, read_file, result); - - return result; -} - -} // namespace bout - -namespace { - -/// Convert variant into NcType -/// If the type is not recognised then NcType null object is returned -struct NcTypeVisitor { - template - NcType operator()(const T& UNUSED(t)) { - return {}; // Null object by default - } -}; - -template <> -NcType NcTypeVisitor::operator()(const bool& UNUSED(t)) { - return ncInt; -} - -template <> -NcType NcTypeVisitor::operator()(const int& UNUSED(t)) { - return ncInt; -} -template <> -NcType NcTypeVisitor::operator()(const double& UNUSED(t)) { - return ncDouble; -} - -template <> -MAYBE_UNUSED() -NcType NcTypeVisitor::operator()(const float& UNUSED(t)) { - return ncFloat; -} - -template <> -NcType NcTypeVisitor::operator()(const std::string& UNUSED(t)) { - return ncString; -} - -template <> -NcType NcTypeVisitor::operator()(const Field2D& UNUSED(t)) { - return operator()(0.0); -} - -template <> -NcType NcTypeVisitor::operator()(const Field3D& UNUSED(t)) { - return operator()(0.0); -} - -template <> -NcType NcTypeVisitor::operator()(const FieldPerp& UNUSED(t)) { - return operator()(0.0); -} + // Iterate over all variables + for (const auto& varpair : io.AvailableVariables()) { + const auto& var_name = varpair.first; // Name of the variable -/// Visit a variant type, returning dimensions -struct NcDimVisitor { - NcDimVisitor(NcGroup& group) : group(group) {} - template - std::vector operator()(const T& UNUSED(value)) { - return {}; - } + auto it = varpair.second.find("Type"); + const std::string& var_type = it->second; + readVariable(reader, io, var_name, var_type, result); -private: - NcGroup& group; -}; + result[var_name].attributes["source"] = filename; -NcDim findDimension(NcGroup& group, const std::string& name, unsigned int size) { - // Get the dimension - try { - auto dim = group.getDim(name, NcGroup::ParentsAndCurrent); - if (dim.isNull()) { - // Dimension doesn't yet exist - dim = group.addDim(name, size); - } else { - // Dimension exists, check it's the right size - if (dim.getSize() != size) { - // wrong size. Check this group - dim = group.getDim(name, NcGroup::Current); - if (!dim.isNull()) { - // Already defined in this group - return {}; // Return null object - } - // Define in this group - dim = group.addDim(name, size); - } + // Get variable attributes + for (const auto& attpair : io.AvailableAttributes(var_name, "/", true)) { + const auto& att_name = attpair.first; // Attribute name + const auto& att = attpair.second; // NcVarAtt object + auto it = attpair.second.find("Type"); + const std::string& att_type = it->second; + readAttribute(reader, io, att_name, att_type, result); } - return dim; - } catch (const std::exception& e) { - throw BoutException("Error in findDimension('{:s}'): {:s}", name, e.what()); - } -} - -template <> -std::vector NcDimVisitor::operator()(const Field2D& value) { - auto xdim = findDimension(group, "x", value.getNx()); - ASSERT0(!xdim.isNull()); - - auto ydim = findDimension(group, "y", value.getNy()); - ASSERT0(!ydim.isNull()); - - return {xdim, ydim}; -} - -template <> -std::vector NcDimVisitor::operator()(const Field3D& value) { - auto xdim = findDimension(group, "x", value.getNx()); - ASSERT0(!xdim.isNull()); - - auto ydim = findDimension(group, "y", value.getNy()); - ASSERT0(!ydim.isNull()); - - auto zdim = findDimension(group, "z", value.getNz()); - ASSERT0(!zdim.isNull()); - - return {xdim, ydim, zdim}; -} - -template <> -std::vector NcDimVisitor::operator()(const FieldPerp& value) { - auto xdim = findDimension(group, "x", value.getNx()); - ASSERT0(!xdim.isNull()); - - auto zdim = findDimension(group, "z", value.getNz()); - ASSERT0(!zdim.isNull()); - - return {xdim, zdim}; -} - -/// Visit a variant type, and put the data into a NcVar -struct NcPutVarVisitor { - NcPutVarVisitor(NcVar& var) : var(var) {} - template - void operator()(const T& value) { - var.putVar(&value); - } - -private: - NcVar& var; -}; - -template <> -void NcPutVarVisitor::operator()(const bool& value) { - int int_val = value ? 1 : 0; - var.putVar(&int_val); -} - -template <> -void NcPutVarVisitor::operator()(const std::string& value) { - const char* cstr = value.c_str(); - var.putVar(&cstr); -} - -/// In addition to writing the data, set the "cell_location" attribute -template <> -void NcPutVarVisitor::operator()(const Field2D& value) { - // Pointer to data. Assumed to be contiguous array - var.putVar(&value(0, 0)); -} - -/// In addition to writing the data, set the "cell_location" attribute -template <> -void NcPutVarVisitor::operator()(const Field3D& value) { - // Pointer to data. Assumed to be contiguous array - var.putVar(&value(0, 0, 0)); -} - -template <> -void NcPutVarVisitor::operator()(const FieldPerp& value) { - // Pointer to data. Assumed to be contiguous array - var.putVar(&value(0, 0)); -} - -/// Visit a variant type, and put the data into a NcVar -struct NcPutVarCountVisitor { - NcPutVarCountVisitor(NcVar& var, const std::vector& start, - const std::vector& count) - : var(var), start(start), count(count) {} - template - void operator()(const T& value) { - var.putVar(start, &value); - } - -private: - NcVar& var; - const std::vector& start; ///< Starting (corner) index - const std::vector& count; ///< Index count in each dimension -}; - -template <> -void NcPutVarCountVisitor::operator()(const std::string& value) { - const char* cstr = value.c_str(); - var.putVar(start, &cstr); -} -template <> -void NcPutVarCountVisitor::operator()(const Field2D& value) { - // Pointer to data. Assumed to be contiguous array - var.putVar(start, count, &value(0, 0)); -} -template <> -void NcPutVarCountVisitor::operator()(const Field3D& value) { - // Pointer to data. Assumed to be contiguous array - var.putVar(start, count, &value(0, 0, 0)); -} -template <> -void NcPutVarCountVisitor::operator()(const FieldPerp& value) { - // Pointer to data. Assumed to be contiguous array - var.putVar(start, count, &value(0, 0)); -} - -/// Visit a variant type, and put the data into an attributute -struct NcPutAttVisitor { - NcPutAttVisitor(NcVar& var, std::string name) : var(var), name(std::move(name)) {} - template - void operator()(const T& UNUSED(value)) { - // Default is to ignore if unhandled } -private: - NcVar& var; - std::string name; -}; - -template <> -void NcPutAttVisitor::operator()(const bool& value) { - int ival = value ? 1 : 0; - var.putAtt(name, ncInt, ival); -} -template <> -void NcPutAttVisitor::operator()(const int& value) { - var.putAtt(name, ncInt, value); -} -template <> -void NcPutAttVisitor::operator()(const double& value) { - var.putAtt(name, ncDouble, value); -} -template <> -MAYBE_UNUSED() -void NcPutAttVisitor::operator()(const float& value) { - var.putAtt(name, ncFloat, value); -} -template <> -void NcPutAttVisitor::operator()(const std::string& value) { - var.putAtt(name, value); + return result; } void writeGroup(const Options& options, NcGroup group, @@ -639,10 +376,6 @@ std::vector verifyTimesteps(const NcGroup& group) { return errors; } -} // namespace - -namespace bout { - OptionsADIOS::OptionsADIOS() : data_file(nullptr) {} OptionsADIOS::OptionsADIOS(std::string filename, FileMode mode) @@ -676,21 +409,24 @@ void OptionsADIOS::verifyTimesteps() const { void OptionsADIOS::write(const Options& options, const std::string& time_dim) { Timer timer("io"); - // Check the file mode to use - auto ncmode = NcFile::replace; - if (file_mode == FileMode::append) { - // ADIOS doesn't have a "read-write, create if exists" mode, so - // we need to check ourselves if the file already exists; if it - // doesn't, tell ADIOS to create it - std::ifstream file(filename); - ncmode = file.good() ? NcFile::FileMode::write : NcFile::FileMode::newFile; - } + adios2::Mode mode = + (file_mode == FileMode::replace) ? adios2::Mode::Write : adios2::Mode::Append; if (not data_file) { - data_file = std::make_unique(filename, ncmode); + data_file = std::make_unique(); } - if (data_file->isNull()) { + // Open file + ADIOSPtr adiosp = GetADIOSPtr(); + try { + data_file->io = adiosp->AtIO(filename); + } catch (const std::invalid_argument& e) { + std::cerr << e.what() << '\n'; + data_file->io = adiosp->DeclareIO(filename); + } + + data_file->engine = data_file->io.Open(filename, mode); + if (!data_file->engine) { throw BoutException("Could not open ADIOS file '{:s}' for writing", filename); } @@ -699,41 +435,6 @@ void OptionsADIOS::write(const Options& options, const std::string& time_dim) { data_file->sync(); } -std::string getRestartDirectoryName(Options& options) { - if (options["restartdir"].isSet()) { - // Solver-specific restart directory - return options["restartdir"].withDefault("data"); - } - // Use the root data directory - return options["datadir"].withDefault("data"); -} - -std::string getRestartFilename(Options& options) { - return getRestartFilename(options, BoutComm::rank()); -} - -std::string getRestartFilename(Options& options, int rank) { - return fmt::format("{}/BOUT.restart.{}.nc", bout::getRestartDirectoryName(options), - rank); -} - -std::string getOutputFilename(Options& options) { - return getOutputFilename(options, BoutComm::rank()); -} - -std::string getOutputFilename(Options& options, int rank) { - return fmt::format("{}/BOUT.dmp.{}.nc", - options["datadir"].withDefault("data"), rank); -} - -void writeDefaultOutputFile() { writeDefaultOutputFile(Options::root()); } - -void writeDefaultOutputFile(Options& options) { - bout::experimental::addBuildFlagsToOptions(options); - bout::globals::mesh->outputVars(options); - OptionsADIOS(getOutputFilename(Options::root())).write(options); -} - } // namespace bout #endif // BOUT_HAS_ADIOS diff --git a/src/sys/options/options_io.cxx b/src/sys/options/options_io.cxx new file mode 100644 index 0000000000..f75618827e --- /dev/null +++ b/src/sys/options/options_io.cxx @@ -0,0 +1,99 @@ +#include "bout/build_config.hxx" + +#include "bout/options_io.hxx" + +#include "bout/bout.hxx" +#include "bout/globals.hxx" +#include "bout/mesh.hxx" +#include "bout/sys/timer.hxx" + +#include +#include +#include + +namespace bout { + +OptionsIO::OptionsIO() {} + +OptionsIO::OptionsIO(std::string filename, FileMode mode) + : filename(std::move(filename)), file_mode(mode) {} + +OptionsIO::~OptionsIO() = default; +OptionsIO::OptionsIO(OptionsIO&&) noexcept = default; +OptionsIO& OptionsIO::operator=(OptionsIO&&) noexcept = default; + +OptionsIO::Library getIOLibrary(Options& options) { + if (options["iolibrary"].isSet()) { + // Solver-specific IO library + std::string iolib = options["iolibrary"]; + std::transform(iolib.begin(), iolib.end(), iolib.begin(), ::tolower); + if (iolib == "adios") + return OptionsIO::Library::ADIOS; + else if (iolib == "netcdf") + return OptionsIO::Library::NetCDF; + else + return OptionsIO::Library::Invalid; + } else { + return OptionsIO::defaultIOLibrary; + } +} + +std::string getRestartDirectoryName(Options& options) { + if (options["restartdir"].isSet()) { + // Solver-specific restart directory + return options["restartdir"].withDefault("data"); + } + // Use the root data directory + return options["datadir"].withDefault("data"); +} + +std::string getRestartFilename(Options& options, const OptionsIO::Library library) { + return getRestartFilename(options, BoutComm::rank(), library); +} + +std::string getRestartFilename(Options& options, int rank, + const OptionsIO::Library library) { + if (library == OptionsIO::Library::ADIOS) + return fmt::format("{}/BOUT.restart.bp", bout::getRestartDirectoryName(options)); + else if (library == OptionsIO::Library::NetCDF) + return fmt::format("{}/BOUT.restart.{}.nc", bout::getRestartDirectoryName(options), + rank); + else + return fmt::format("{}/BOUT.restart.{}.data", bout::getRestartDirectoryName(options), + rank); +} + +std::string getOutputFilename(Options& options, const OptionsIO::Library library) { + return getOutputFilename(options, BoutComm::rank(), library); +} + +std::string getOutputFilename(Options& options, int rank, + const OptionsIO::Library library) { + if (library == OptionsIO::Library::ADIOS) + return fmt::format("{}/BOUT.dmp.bp", + options["datadir"].withDefault("data")); + else if (library == OptionsIO::Library::NetCDF) + return fmt::format("{}/BOUT.dmp.{}.nc", + options["datadir"].withDefault("data"), rank); + else + return fmt::format("{}/BOUT.dmp.{}.data", + options["datadir"].withDefault("data"), rank); +} + +void writeDefaultOutputFile(const OptionsIO::Library library) { + writeDefaultOutputFile(Options::root(), library); +} + +void writeDefaultOutputFile(Options& options, const OptionsIO::Library library) { + bout::experimental::addBuildFlagsToOptions(options); + bout::globals::mesh->outputVars(options); + auto mode = options["append"] + .doc("Add output data to existing (dump) files?") + .withDefault(false) + ? bout::OptionsIO::FileMode::append + : bout::OptionsIO::FileMode::replace; + auto io = OptionsIOFactory(getOutputFilename(options, library), mode, library); + io->write(options); +} + +} // namespace bout diff --git a/src/sys/options/options_netcdf.cxx b/src/sys/options/options_netcdf.cxx index d7ceeaea60..dba056425e 100644 --- a/src/sys/options/options_netcdf.cxx +++ b/src/sys/options/options_netcdf.cxx @@ -699,41 +699,6 @@ void OptionsNetCDF::write(const Options& options, const std::string& time_dim) { data_file->sync(); } -std::string getRestartDirectoryName(Options& options) { - if (options["restartdir"].isSet()) { - // Solver-specific restart directory - return options["restartdir"].withDefault("data"); - } - // Use the root data directory - return options["datadir"].withDefault("data"); -} - -std::string getRestartFilename(Options& options) { - return getRestartFilename(options, BoutComm::rank()); -} - -std::string getRestartFilename(Options& options, int rank) { - return fmt::format("{}/BOUT.restart.{}.nc", bout::getRestartDirectoryName(options), - rank); -} - -std::string getOutputFilename(Options& options) { - return getOutputFilename(options, BoutComm::rank()); -} - -std::string getOutputFilename(Options& options, int rank) { - return fmt::format("{}/BOUT.dmp.{}.nc", - options["datadir"].withDefault("data"), rank); -} - -void writeDefaultOutputFile() { writeDefaultOutputFile(Options::root()); } - -void writeDefaultOutputFile(Options& options) { - bout::experimental::addBuildFlagsToOptions(options); - bout::globals::mesh->outputVars(options); - OptionsNetCDF(getOutputFilename(Options::root())).write(options); -} - } // namespace bout #endif // BOUT_HAS_NETCDF From 3fd53b9ce4312f16118ffab9983e7c81bfa4e54a Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Wed, 6 Sep 2023 16:42:12 -0400 Subject: [PATCH 05/46] save daily work --- include/bout/adios_object.hxx | 17 +- include/bout/options_adios.hxx | 22 +- include/bout/options_io.hxx | 9 +- include/bout/options_netcdf.hxx | 12 +- src/sys/adios_object.cxx | 6 +- src/sys/options/options_adios.cxx | 417 +++++++++++------------------- src/sys/options/options_io.cxx | 23 ++ 7 files changed, 194 insertions(+), 312 deletions(-) diff --git a/include/bout/adios_object.hxx b/include/bout/adios_object.hxx index 058aa030c3..47232d685e 100755 --- a/include/bout/adios_object.hxx +++ b/include/bout/adios_object.hxx @@ -22,26 +22,21 @@ using IOPtr = std::shared_ptr; ADIOSPtr GetADIOSPtr(); IOPtr GetIOPtr(const std::string IOName); -struct ADIOSStruct { +class ADIOSStream { +public: adios2::IO io; adios2::Engine engine; - adios2::Variable vCellDim, vPhysDim, vNTotalElem, vNTotalNode; - adios2::Variable vPhysTime; + adios2::Variable vTime; adios2::Variable vStep; - adios2::Variable vElementConnectivity, vElementRange; - adios2::Variable vXco, vYco, vZco; - std::vector> vFlowVars; - std::vector> vBoundariesConnectivity; - std::vector> vBoundariesRange; int adiosStep = 0; }; -extern ADIOSStruct adios_restart; -extern ADIOSStruct adios_dump; +extern ADIOSStream adios_restart; +extern ADIOSStream adios_dump; //extern ADIOS2Param *adios2params; /** return one of the extern variable based on the target file name */ -ADIOSStruct& ADIOSGetStruct(const std::string& fname); +ADIOSStream& ADIOSGetStream(const std::string& fname); /** Set user parameters for an IO group */ void ADIOSSetParameters(const std::string& input, const char delimKeyValue, diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx index ec6c26a432..9457293780 100644 --- a/include/bout/options_adios.hxx +++ b/include/bout/options_adios.hxx @@ -44,10 +44,12 @@ public: #include #include -#include "bout/adios_object.hxx" #include "bout/options.hxx" +#include "bout/options_io.hxx" namespace bout { +const Options& x = Options::root(); +const bout::OptionsIO::FileMode m = OptionsIO::FileMode::replace; /// Forward declare ADIOS file type so we don't need to depend /// directly on ADIOS @@ -55,15 +57,11 @@ struct ADIOSStream; class OptionsADIOS { public: - enum class FileMode { - replace, ///< Overwrite file when writing - append ///< Append to file when writing - }; - // Constructors need to be defined in implementation due to forward - // declaration of NcFile + // declaration of ADIOSStream OptionsADIOS(); - explicit OptionsADIOS(std::string filename, FileMode mode = FileMode::replace); + explicit OptionsADIOS(std::string filename, bout::OptionsIO::FileMode mode = + bout::OptionsIO::FileMode::replace); ~OptionsADIOS(); OptionsADIOS(const OptionsADIOS&) = delete; OptionsADIOS(OptionsADIOS&&) noexcept; @@ -83,12 +81,8 @@ public: void verifyTimesteps() const; private: - /// Name of the file on disk - std::string filename; - /// How to open the file for writing - FileMode file_mode{FileMode::replace}; - /// Pointer to ADIOS file so we don't introduce direct dependence - std::unique_ptr data_file; + /// Pointer to ADIOS stream so we don't introduce direct dependence + std::unique_ptr stream; }; } // namespace bout diff --git a/include/bout/options_io.hxx b/include/bout/options_io.hxx index 1a51a2bebb..49d5d51c04 100644 --- a/include/bout/options_io.hxx +++ b/include/bout/options_io.hxx @@ -12,13 +12,6 @@ #include "bout/options.hxx" -#if BOUT_HAS_ADIOS -#include "bout/options_adios.hxx" -#endif -#if BOUT_HAS_NETCDF -#include "bout/options_netcdf.hxx" -#endif - namespace bout { class OptionsIO { @@ -67,7 +60,7 @@ public: /// any differences, otherwise is silent virtual void verifyTimesteps() const = 0; -private: +protected: /// Name of the file on disk std::string filename; /// How to open the file for writing diff --git a/include/bout/options_netcdf.hxx b/include/bout/options_netcdf.hxx index d633596fbd..2096beeba0 100644 --- a/include/bout/options_netcdf.hxx +++ b/include/bout/options_netcdf.hxx @@ -45,6 +45,7 @@ public: #include #include "bout/options.hxx" +#include "bout/options_io.hxx" /// Forward declare netCDF file type so we don't need to depend /// directly on netCDF @@ -54,13 +55,8 @@ class NcFile; namespace bout { -class OptionsNetCDF { +class OptionsNetCDF : public OptionsIO { public: - enum class FileMode { - replace, ///< Overwrite file when writing - append ///< Append to file when writing - }; - // Constructors need to be defined in implementation due to forward // declaration of NcFile OptionsNetCDF(); @@ -84,10 +80,6 @@ public: void verifyTimesteps() const; private: - /// Name of the file on disk - std::string filename; - /// How to open the file for writing - FileMode file_mode{FileMode::replace}; /// Pointer to netCDF file so we don't introduce direct dependence std::unique_ptr data_file; }; diff --git a/src/sys/adios_object.cxx b/src/sys/adios_object.cxx index 5bab7545e9..e694e483e0 100755 --- a/src/sys/adios_object.cxx +++ b/src/sys/adios_object.cxx @@ -11,8 +11,8 @@ namespace bout { static ADIOSPtr adios = nullptr; -ADIOSStruct adios_restart; -ADIOSStruct adios_dump; +ADIOSStream adios_restart; +ADIOSStream adios_dump; //ADIOS2Param* adios2params; void ADIOSInit(MPI_Comm comm) { adios = std::make_shared(comm); } @@ -50,7 +50,7 @@ IOPtr GetIOPtr(const std::string IOName) { return io; } -ADIOSStruct& ADIOSGetStruct(const std::string& fname) { +ADIOSStream& ADIOSGetStream(const std::string& fname) { if (fname.find(".restart") != std::string::npos) return adios_restart; //if (fname.find(".dmp") != std::string::npos) diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index 518a8fa7ed..1d42e30cb9 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -2,6 +2,7 @@ #if BOUT_HAS_ADIOS +#include "bout/adios_object.hxx" #include "bout/options_adios.hxx" #include "bout/bout.hxx" @@ -16,95 +17,94 @@ namespace bout { -struct ADIOSStream { - adios2::IO io; - adios2::Engine engine; - adios2::Variable vStep; - adios2::Variable vTime; - int adiosStep = 0; -}; +OptionsADIOS::OptionsADIOS() : stream(nullptr) {} + +OptionsADIOS::OptionsADIOS(std::string filename, FileMode mode) + : filename(std::move(filename)), file_mode(mode), stream(nullptr) {} + +OptionsADIOS::~OptionsADIOS() = default; +OptionsADIOS::OptionsADIOS(OptionsADIOS&&) noexcept = default; +OptionsADIOS& OptionsADIOS::operator=(OptionsADIOS&&) noexcept = default; /// Name of the attribute used to track individual variable's time indices constexpr auto current_time_index_name = "current_time_index"; template bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, - const std::string& type, Options& result) { - bool ret = false; + Options& result) { std::vector data; adios2::Variable variable = io.InquireVariable(name); if (variable.ShapeID() == adios2::ShapeID::GlobalValue) { T value; - io.Get(variable, &value, adios2::Mode::Sync); + reader.Get(variable, &value, adios2::Mode::Sync); result[name] = value; return true; } if (variable.ShapeID() == adios2::ShapeID::LocalArray) { - if (!rank) + if (!BoutComm::rank()) { std::cout << " LocalArray not supported" << std::endl; - return ret; + } + return false; } auto dims = variable.Shape(); - auto ndim = shape.size(); + auto ndims = dims.size(); switch (ndims) { case 1: { Array value(static_cast(dims[0])); - io.Get(variable, value.data(), adios2::Mode::Sync); - result[name] = value; + reader.Get(variable, value.begin(), adios2::Mode::Sync); + //result[name] = value; + break; } case 2: { - Matrix value(static_cast(dims[0].getSize()), - static_cast(dims[1].getSize())); - io.Get(variable, value.data(), adios2::Mode::Sync); - result[name] = value; + Matrix value(static_cast(dims[0]), static_cast(dims[1])); + reader.Get(variable, value.begin(), adios2::Mode::Sync); + //[name] = value; + break; } case 3: { - Tensor value(static_cast(dims[0].getSize()), - static_cast(dims[1].getSize()), - static_cast(dims[2].getSize())); - io.Get(variable, value.data(), adios2::Mode::Sync); - result[name] = value; + Tensor value(static_cast(dims[0]), static_cast(dims[1]), + static_cast(dims[2])); + reader.Get(variable, value.begin(), adios2::Mode::Sync); + //result[name] = value; + break; } } - if (!rank) + if (!BoutComm::rank()) std::cout << " array has " << variable.Steps() << " steps" << std::endl; /* Need to read the data here */ result[name] = data.data(); - return ret; + return true; } bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, const std::string& type, Options& result) { bool ret; -#define declare_template_instantiation(T) \ - if (type == adios2::GetType()) { \ - ret = readVariable(reader, io, name, type, result); \ +#define declare_template_instantiation(T) \ + if (type == adios2::GetType()) { \ + ret = readVariable(reader, io, name, result); \ } ADIOS2_FOREACH_ATTRIBUTE_PRIMITIVE_STDTYPE_1ARG(declare_template_instantiation) #undef declare_template_instantiation return ret; } -bool readAttribute(adios2::Engine& reader, adios2::IO& io, const std::string& name, - const std::string& type, Options& result) { - bool ret; +bool readAttribute(adios2::IO& io, const std::string& name, const std::string& type, + Options& result) { #define declare_template_instantiation(T) \ if (type == adios2::GetType()) { \ - adios2::Attribute a = io.InquireAtrribute(name); \ + adios2::Attribute a = io.InquireAttribute(name); \ result[name] = a.Data().data(); \ } ADIOS2_FOREACH_ATTRIBUTE_PRIMITIVE_STDTYPE_1ARG(declare_template_instantiation) #undef declare_template_instantiation - return ret; -} // namespace bout - -void readGroup(const std::string& filename, ADIOSStruct& group, Options& result) {} + return true; +} Options OptionsADIOS::read() { Timer timer("io"); @@ -139,174 +139,16 @@ Options OptionsADIOS::read() { // Get variable attributes for (const auto& attpair : io.AvailableAttributes(var_name, "/", true)) { const auto& att_name = attpair.first; // Attribute name - const auto& att = attpair.second; // NcVarAtt object - auto it = attpair.second.find("Type"); + const auto& att = attpair.second; // attribute params + auto it = att.find("Type"); const std::string& att_type = it->second; - readAttribute(reader, io, att_name, att_type, result); + readAttribute(io, att_name, att_type, result); } } - return result; -} - -void writeGroup(const Options& options, NcGroup group, - const std::string& time_dimension) { - - for (const auto& childpair : options.getChildren()) { - const auto& name = childpair.first; - const auto& child = childpair.second; - - if (child.isValue()) { - try { - auto nctype = bout::utils::visit(NcTypeVisitor(), child.value); - - if (nctype.isNull()) { - continue; // Skip this value - } - - // Get spatial dimensions - auto spatial_dims = bout::utils::visit(NcDimVisitor(group), child.value); - - // Vector of all dimensions, including time - std::vector dims{spatial_dims}; - - // Get the time dimension - NcDim time_dim; ///< Time dimension (Null -> none) - auto time_it = child.attributes.find("time_dimension"); - if (time_it != child.attributes.end()) { - // Has a time dimension - - const auto& time_name = bout::utils::get(time_it->second); - - // Only write time-varying values that match current time - // dimension being written - if (time_name != time_dimension) { - continue; - } - - time_dim = group.getDim(time_name, NcGroup::ParentsAndCurrent); - if (time_dim.isNull()) { - time_dim = group.addDim(time_name); - } - - // prepend to vector of dimensions - dims.insert(dims.begin(), time_dim); - } - - // Check if the variable exists - auto var = group.getVar(name); - if (var.isNull()) { - // Variable doesn't exist yet - // Create variable - // Temporary NcType as a workaround for bug in ADIOS 4.4.0 and - // ADIOS-CXX4 4.2.0 - var = group.addVar(name, NcType{group, nctype.getId()}, dims); - if (!time_dim.isNull()) { - // Time evolving variable, so we'll need to keep track of its time index - var.putAtt(current_time_index_name, ncInt, 0); - } - } else { - // Variable does exist - - // Check types are the same - if (var.getType() != nctype) { - throw BoutException( - "Changed type of variable '{:s}'. Was '{:s}', now writing '{:s}'", name, - var.getType().getName(), nctype.getName()); - } - - // Check that the dimensions are correct - auto var_dims = var.getDims(); - - // Same number of dimensions? - if (var_dims.size() != dims.size()) { - throw BoutException( - "Changed dimensions for variable '{:s}'\nIn file has {:d} " - "dimensions, now writing {:d}\n", - name, var_dims.size(), dims.size()); - } - // Dimensions compatible? - for (std::vector::size_type i = 0; i < dims.size(); ++i) { - if (var_dims[i] == dims[i]) { - continue; // The same dimension -> ok - } - if (var_dims[i].isUnlimited() != dims[i].isUnlimited()) { - throw BoutException("Unlimited dimension changed for variable '{:s}'", - name); - } - if (var_dims[i].getSize() != dims[i].getSize()) { - throw BoutException("Dimension size changed for variable '{:s}'", name); - } - } - // All ok. Set dimensions to the variable's NcDims - dims = var_dims; - - if (!time_dim.isNull()) { - // A time dimension - time_dim = dims[0]; - } - } - - // Write the variable - - if (time_dim.isNull()) { - // No time index - - // Put the data into the variable - bout::utils::visit(NcPutVarVisitor(var), child.value); - - } else { - // Has a time index, so need the record index - - const int current_time_index = getCurrentTimeIndex(var); - - std::vector start_index; ///< Starting index where data will be inserted - std::vector count_index; ///< Size of each dimension - - // Dimensions, including time - for (const auto& dim : dims) { - start_index.push_back(0); - count_index.push_back(dim.getSize()); - } - // Time dimension - start_index[0] = current_time_index; - count_index[0] = 1; // Writing one record - - // Put the data into the variable - bout::utils::visit(NcPutVarCountVisitor(var, start_index, count_index), - child.value); - - // We've just written a new time slice, so we need to update - // the attribute to track it - var.putAtt(current_time_index_name, ncInt, current_time_index + 1); - } - - // Write attributes - for (const auto& attribute : child.attributes) { - const std::string& att_name = attribute.first; - const auto& att = attribute.second; - - bout::utils::visit(NcPutAttVisitor(var, att_name), att); - } - - } catch (const std::exception& e) { - throw BoutException("Error while writing value '{:s}' : {:s}", name, e.what()); - } - } - - if (child.isSection()) { - // Check if the group exists - TRACE("Writing group '{:s}'", name); + reader.Close(); - auto subgroup = group.getGroup(name); - if (subgroup.isNull()) { - // Doesn't exist yet, so create it - subgroup = group.addGroup(name); - } - - writeGroup(child, subgroup, time_dimension); - } - } + return result; } /// Helper struct for returning errors from verifyTimesteps(NcGroup) @@ -317,77 +159,36 @@ struct TimeDimensionError { std::size_t current_size; }; -std::vector verifyTimesteps(const NcGroup& group) { +std::vector verifyTimesteps(adios2::Engine& reader) { + reader.CurrentStep(); // just to avoid warning on unused variable - // Map of dimension -> size - std::map seen_time_dimensions; // Variables with mismatched dimension sizes. Note that this might // be a little odd: if the first variable we come across has the // "wrong" dimension size, we will actually list all the others as // being wrong! std::vector errors; - // For each variable, check its time dimension against what we've - // seen already. Note that this assumes a single time dimension per - // variable whose is in the attribute "time_dimension" - for (const auto& varpair : group.getVars()) { - const auto& var_name = varpair.first; // Name of the variable - const auto& var = varpair.second; // The NcVar object - - // Get the name of the time dimension from the attribute - const auto& attributes = var.getAtts(); - const auto time_it = attributes.find("time_dimension"); - if (time_it == attributes.end()) { - // No "time_dimension" attribute so presumably not a - // time-evolving variable - continue; - } - - // Use the attribute value to get the actual dimension - std::string time_name; - time_it->second.getValues(time_name); - const auto time_dim = group.getDim(time_name, NcGroup::ParentsAndCurrent); - - // Check if we've already seen this dimension - auto seen_it = seen_time_dimensions.find(time_dim); - if (seen_it == seen_time_dimensions.end()) { - // If we haven't, add it to the map with current time index - seen_time_dimensions[time_dim] = time_dim.getSize(); - continue; - } - - // If we have, check if the variable current time index matches time size - const auto current_time = static_cast(getCurrentTimeIndex(var)); - if (current_time == time_dim.getSize()) { - continue; - } - // If not, add to list of errors - errors.push_back({var_name, time_dim.getName(), time_dim.getSize(), current_time}); - } - - // Recurse down into subgroups, shoving any new errors into what - // we've already got. Don't bother reserving the new size, this - // shouldn't be big! - for (const auto& child : group.getGroups()) { - auto child_errors = verifyTimesteps(child.second); - errors.insert(errors.end(), child_errors.begin(), child_errors.end()); - } - return errors; } -OptionsADIOS::OptionsADIOS() : data_file(nullptr) {} +void OptionsADIOS::verifyTimesteps() const { -OptionsADIOS::OptionsADIOS(std::string filename, FileMode mode) - : filename(std::move(filename)), file_mode(mode), data_file(nullptr) {} + // Open file + ADIOSPtr adiosp = GetADIOSPtr(); + adios2::IO io; + try { + io = adiosp->AtIO(filename); + } catch (const std::invalid_argument& e) { + std::cerr << e.what() << '\n'; + io = adiosp->DeclareIO(filename); + } -OptionsADIOS::~OptionsADIOS() = default; -OptionsADIOS::OptionsADIOS(OptionsADIOS&&) noexcept = default; -OptionsADIOS& OptionsADIOS::operator=(OptionsADIOS&&) noexcept = default; + adios2::Engine reader = io.Open(filename, adios2::Mode::ReadRandomAccess); + if (!reader) { + throw BoutException("Could not open ADIOS file '{:s}' for reading", filename); + } -void OptionsADIOS::verifyTimesteps() const { - NcFile dataFile(filename, NcFile::read); - auto errors = ::verifyTimesteps(dataFile); + auto errors = bout::verifyTimesteps(reader); if (errors.empty()) { // No errors @@ -405,6 +206,89 @@ void OptionsADIOS::verifyTimesteps() const { filename, errors.size(), error_string); } +/// Visit a variant type, and put the data into a NcVar +struct ADIOSPutVarVisitor { + ADIOSPutVarVisitor(const std::string& name, ADIOSStream& stream) + : varname(name), stream(stream) {} + template + void operator()(const T& value) { + adios2::Variable var = stream.io.DefineVariable(varname); + stream.engine.Put(var, value); + } + +private: + const std::string& varname; + ADIOSStream& stream; +}; + +//template <> +//void ADIOSPutVarVisitor::operator()(const bool& value) { +// int int_val = value ? 1 : 0; +//} + +/// Visit a variant type, and put the data into a NcVar +struct ADIOSPutAttVisitor { + ADIOSPutAttVisitor(const std::string& varname, const std::string& attrname, + ADIOSStream& stream) + : varname(varname), attrname(attrname), stream(stream) {} + template + void operator()(const T& value) { + stream.io.DefineAttribute(attrname, value, varname, "/", false); + } + +private: + const std::string& varname; + const std::string& attrname; + ADIOSStream& stream; +}; + +void writeGroup(const Options& options, ADIOSStream& stream, const std::string& groupname, + const std::string& time_dimension) { + + for (const auto& childpair : options.getChildren()) { + const auto& name = childpair.first; + const auto& child = childpair.second; + + if (child.isSection()) { + TRACE("Writing group '{:s}'", name); + writeGroup(child, stream, name, time_dimension); + continue; + } + + if (child.isValue()) { + try { + auto time_it = child.attributes.find("time_dimension"); + if (time_it != child.attributes.end()) { + // Has a time dimension + + const auto& time_name = bout::utils::get(time_it->second); + + // Only write time-varying values that match current time + // dimension being written + if (time_name != time_dimension) { + continue; + } + } + + // Write the variable + std::string varname = groupname.empty() ? name : groupname + "/" + name; + bout::utils::visit(ADIOSPutVarVisitor(varname, stream), child.value); + + // Write attributes + for (const auto& attribute : child.attributes) { + const std::string& att_name = attribute.first; + const auto& att = attribute.second; + + bout::utils::visit(ADIOSPutAttVisitor(varname, att_name, stream), att); + } + + } catch (const std::exception& e) { + throw BoutException("Error while writing value '{:s}' : {:s}", name, e.what()); + } + } + } +} + /// Write options to file void OptionsADIOS::write(const Options& options, const std::string& time_dim) { Timer timer("io"); @@ -412,27 +296,28 @@ void OptionsADIOS::write(const Options& options, const std::string& time_dim) { adios2::Mode mode = (file_mode == FileMode::replace) ? adios2::Mode::Write : adios2::Mode::Append; - if (not data_file) { - data_file = std::make_unique(); + if (not stream) { + stream = std::make_unique(); } // Open file ADIOSPtr adiosp = GetADIOSPtr(); try { - data_file->io = adiosp->AtIO(filename); + stream->io = adiosp->AtIO(filename); } catch (const std::invalid_argument& e) { std::cerr << e.what() << '\n'; - data_file->io = adiosp->DeclareIO(filename); + stream->io = adiosp->DeclareIO(filename); } - data_file->engine = data_file->io.Open(filename, mode); - if (!data_file->engine) { + stream->engine = stream->io.Open(filename, mode); + if (!stream->engine) { throw BoutException("Could not open ADIOS file '{:s}' for writing", filename); } - writeGroup(options, *data_file, time_dim); + stream->engine.BeginStep(); + writeGroup(options, *stream, "", time_dim); - data_file->sync(); + stream->engine.EndStep(); } } // namespace bout diff --git a/src/sys/options/options_io.cxx b/src/sys/options/options_io.cxx index f75618827e..32187981ba 100644 --- a/src/sys/options/options_io.cxx +++ b/src/sys/options/options_io.cxx @@ -11,6 +11,13 @@ #include #include +#if BOUT_HAS_ADIOS +#include "bout/options_adios.hxx" +#endif +#if BOUT_HAS_NETCDF +#include "bout/options_netcdf.hxx" +#endif + namespace bout { OptionsIO::OptionsIO() {} @@ -38,6 +45,22 @@ OptionsIO::Library getIOLibrary(Options& options) { } } +std::shared_ptr OptionsIOFactory(std::string filename, + OptionsIO::FileMode mode, + const OptionsIO::Library library) { + if (library == OptionsIO::Library::ADIOS) { + std::shared_ptr ptr(OptionsADIOS); + //std::shared_ptr ptr = + // std::make_shared(OptionsADIOS(filename, mode)); + //std::shared_ptr p2 = std::shared_ptr(ptr); + return ptr; + } else if (library == OptionsIO::Library::NetCDF) { + return std::make_shared(OptionsNetCDF(filename, mode)); + } else { + return nullptr; + } +} + std::string getRestartDirectoryName(Options& options) { if (options["restartdir"].isSet()) { // Solver-specific restart directory From db995f211cc6ffd937339ad446e36866e26e000f Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Mon, 11 Sep 2023 07:33:51 -0400 Subject: [PATCH 06/46] Finally compiles, but invalid type use for adios: adios2::Engine::Put --- include/bout/options_adios.hxx | 4 +--- src/sys/options/options_adios.cxx | 2 +- src/sys/options/options_io.cxx | 8 ++------ src/sys/options/options_netcdf.cxx | 2 +- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx index 9457293780..a4d5e1b6b2 100644 --- a/include/bout/options_adios.hxx +++ b/include/bout/options_adios.hxx @@ -48,14 +48,12 @@ public: #include "bout/options_io.hxx" namespace bout { -const Options& x = Options::root(); -const bout::OptionsIO::FileMode m = OptionsIO::FileMode::replace; /// Forward declare ADIOS file type so we don't need to depend /// directly on ADIOS struct ADIOSStream; -class OptionsADIOS { +class OptionsADIOS : public OptionsIO { public: // Constructors need to be defined in implementation due to forward // declaration of ADIOSStream diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index 1d42e30cb9..bbba120aae 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -20,7 +20,7 @@ namespace bout { OptionsADIOS::OptionsADIOS() : stream(nullptr) {} OptionsADIOS::OptionsADIOS(std::string filename, FileMode mode) - : filename(std::move(filename)), file_mode(mode), stream(nullptr) {} + : OptionsIO(filename, mode), stream(nullptr) {} OptionsADIOS::~OptionsADIOS() = default; OptionsADIOS::OptionsADIOS(OptionsADIOS&&) noexcept = default; diff --git a/src/sys/options/options_io.cxx b/src/sys/options/options_io.cxx index 32187981ba..8183273e7f 100644 --- a/src/sys/options/options_io.cxx +++ b/src/sys/options/options_io.cxx @@ -49,13 +49,9 @@ std::shared_ptr OptionsIOFactory(std::string filename, OptionsIO::FileMode mode, const OptionsIO::Library library) { if (library == OptionsIO::Library::ADIOS) { - std::shared_ptr ptr(OptionsADIOS); - //std::shared_ptr ptr = - // std::make_shared(OptionsADIOS(filename, mode)); - //std::shared_ptr p2 = std::shared_ptr(ptr); - return ptr; + return std::make_shared(OptionsADIOS(filename, mode)); } else if (library == OptionsIO::Library::NetCDF) { - return std::make_shared(OptionsNetCDF(filename, mode)); + return std::make_shared(OptionsNetCDF(filename, mode)); } else { return nullptr; } diff --git a/src/sys/options/options_netcdf.cxx b/src/sys/options/options_netcdf.cxx index dba056425e..8aadcd5363 100644 --- a/src/sys/options/options_netcdf.cxx +++ b/src/sys/options/options_netcdf.cxx @@ -646,7 +646,7 @@ namespace bout { OptionsNetCDF::OptionsNetCDF() : data_file(nullptr) {} OptionsNetCDF::OptionsNetCDF(std::string filename, FileMode mode) - : filename(std::move(filename)), file_mode(mode), data_file(nullptr) {} + : OptionsIO(filename, mode), data_file(nullptr) {} OptionsNetCDF::~OptionsNetCDF() = default; OptionsNetCDF::OptionsNetCDF(OptionsNetCDF&&) noexcept = default; From 93933a243d2a50c582670943d2b9c78da20780f3 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Mon, 11 Sep 2023 08:26:32 -0400 Subject: [PATCH 07/46] conduction example compiles --- src/sys/options/options_adios.cxx | 67 ++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 5 deletions(-) diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index bbba120aae..26f9b9938e 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -221,10 +221,62 @@ struct ADIOSPutVarVisitor { ADIOSStream& stream; }; -//template <> -//void ADIOSPutVarVisitor::operator()(const bool& value) { -// int int_val = value ? 1 : 0; -//} +template <> +void ADIOSPutVarVisitor::operator()(const bool& value) { + adios2::Variable var = stream.io.DefineVariable(varname); + stream.engine.Put(var, (int)value); +} + +template <> +void ADIOSPutVarVisitor::operator()(const Field2D& value) { + // Pointer to data. Assumed to be contiguous array + adios2::Dims shape = {(size_t)value.getNx(), (size_t)value.getNy()}; + adios2::Variable var = stream.io.DefineVariable(varname, shape); + stream.engine.Put(var, &value(0, 0)); +} + +template <> +void ADIOSPutVarVisitor::operator()(const Field3D& value) { + // Pointer to data. Assumed to be contiguous array + adios2::Dims shape = {(size_t)value.getNx(), (size_t)value.getNz()}; + adios2::Variable var = stream.io.DefineVariable(varname, shape); + stream.engine.Put(var, &value(0, 0, 0)); +} + +template <> +void ADIOSPutVarVisitor::operator()(const FieldPerp& value) { + // Pointer to data. Assumed to be contiguous array + adios2::Dims shape = {(size_t)value.getNx(), (size_t)value.getNz()}; + adios2::Variable var = stream.io.DefineVariable(varname, shape); + stream.engine.Put(var, &value(0, 0)); +} + +template <> +void ADIOSPutVarVisitor::operator()>(const Array& value) { + // Pointer to data. Assumed to be contiguous array + adios2::Dims shape = {(size_t)value.size()}; + adios2::Variable var = stream.io.DefineVariable(varname, shape); + stream.engine.Put(var, value.begin()); +} + +template <> +void ADIOSPutVarVisitor::operator()>(const Matrix& value) { + // Pointer to data. Assumed to be contiguous array + auto s = value.shape(); + adios2::Dims shape = {(size_t)std::get<0>(s), (size_t)std::get<1>(s)}; + adios2::Variable var = stream.io.DefineVariable(varname, shape); + stream.engine.Put(var, value.begin()); +} + +template <> +void ADIOSPutVarVisitor::operator()>(const Tensor& value) { + // Pointer to data. Assumed to be contiguous array + auto s = value.shape(); + adios2::Dims shape = {(size_t)std::get<0>(s), (size_t)std::get<1>(s), + (size_t)std::get<2>(s)}; + adios2::Variable var = stream.io.DefineVariable(varname, shape); + stream.engine.Put(var, value.begin()); +} /// Visit a variant type, and put the data into a NcVar struct ADIOSPutAttVisitor { @@ -233,7 +285,7 @@ struct ADIOSPutAttVisitor { : varname(varname), attrname(attrname), stream(stream) {} template void operator()(const T& value) { - stream.io.DefineAttribute(attrname, value, varname, "/", false); + stream.io.DefineAttribute(attrname, value, varname, "/", false); } private: @@ -242,6 +294,11 @@ struct ADIOSPutAttVisitor { ADIOSStream& stream; }; +template <> +void ADIOSPutAttVisitor::operator()(const bool& value) { + stream.io.DefineAttribute(attrname, (int)value, varname, "/", false); +} + void writeGroup(const Options& options, ADIOSStream& stream, const std::string& groupname, const std::string& time_dimension) { From 686f9e06411db3fb93006bbe159a2929b6fd48cb Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Mon, 11 Sep 2023 12:27:59 -0400 Subject: [PATCH 08/46] test-options-adios: writes correctly settings.bp and test-out.bp --- include/bout/options_adios.hxx | 15 +--- include/bout/options_netcdf.hxx | 15 ++-- src/sys/options/options_adios.cxx | 30 ++++--- tests/integrated/CMakeLists.txt | 1 + .../test-options-adios/CMakeLists.txt | 6 ++ .../test-options-adios/data/BOUT.inp | 6 ++ tests/integrated/test-options-adios/makefile | 6 ++ tests/integrated/test-options-adios/runtest | 73 ++++++++++++++++ .../test-options-adios/test-options-adios.cxx | 85 +++++++++++++++++++ .../test-options-netcdf.cxx | 3 +- 10 files changed, 208 insertions(+), 32 deletions(-) create mode 100644 tests/integrated/test-options-adios/CMakeLists.txt create mode 100644 tests/integrated/test-options-adios/data/BOUT.inp create mode 100644 tests/integrated/test-options-adios/makefile create mode 100755 tests/integrated/test-options-adios/runtest create mode 100644 tests/integrated/test-options-adios/test-options-adios.cxx diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx index a4d5e1b6b2..81c9e85d3e 100644 --- a/include/bout/options_adios.hxx +++ b/include/bout/options_adios.hxx @@ -5,24 +5,20 @@ #define __OPTIONS_ADIOS_H__ #include "bout/build_config.hxx" +#include "bout/options.hxx" +#include "bout/options_io.hxx" #if !BOUT_HAS_ADIOS #include #include "bout/boutexception.hxx" -#include "bout/options.hxx" namespace bout { -class OptionsADIOS { +class OptionsADIOS : public OptionsIO { public: - enum class FileMode { - replace, ///< Overwrite file when writing - append ///< Append to file when writing - }; - - OptionsADIOS(const std::string& filename, FileMode mode = FileMode::replace) {} + OptionsADIOS(const std::string& filename, bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace) {} OptionsADIOS(const OptionsADIOS&) = default; OptionsADIOS(OptionsADIOS&&) = default; OptionsADIOS& operator=(const OptionsADIOS&) = default; @@ -44,9 +40,6 @@ public: #include #include -#include "bout/options.hxx" -#include "bout/options_io.hxx" - namespace bout { /// Forward declare ADIOS file type so we don't need to depend diff --git a/include/bout/options_netcdf.hxx b/include/bout/options_netcdf.hxx index 2096beeba0..0d94594d9d 100644 --- a/include/bout/options_netcdf.hxx +++ b/include/bout/options_netcdf.hxx @@ -6,6 +6,9 @@ #include "bout/build_config.hxx" +#include "bout/options.hxx" +#include "bout/options_io.hxx" + #if !BOUT_HAS_NETCDF || BOUT_HAS_LEGACY_NETCDF #include @@ -15,14 +18,9 @@ namespace bout { -class OptionsNetCDF { +class OptionsNetCDF : public OptionsIO{ public: - enum class FileMode { - replace, ///< Overwrite file when writing - append ///< Append to file when writing - }; - - OptionsNetCDF(const std::string& filename, FileMode mode = FileMode::replace) {} + OptionsNetCDF(const std::string& filename, bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace) {} OptionsNetCDF(const OptionsNetCDF&) = default; OptionsNetCDF(OptionsNetCDF&&) = default; OptionsNetCDF& operator=(const OptionsNetCDF&) = default; @@ -44,9 +42,6 @@ public: #include #include -#include "bout/options.hxx" -#include "bout/options_io.hxx" - /// Forward declare netCDF file type so we don't need to depend /// directly on netCDF namespace netCDF { diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index 26f9b9938e..61ba360439 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -112,11 +112,11 @@ Options OptionsADIOS::read() { // Open file ADIOSPtr adiosp = GetADIOSPtr(); adios2::IO io; + std::string ioname = "read_"+filename; try { - io = adiosp->AtIO(filename); + io = adiosp->AtIO(ioname); } catch (const std::invalid_argument& e) { - std::cerr << e.what() << '\n'; - io = adiosp->DeclareIO(filename); + io = adiosp->DeclareIO(ioname); } adios2::Engine reader = io.Open(filename, adios2::Mode::ReadRandomAccess); @@ -227,6 +227,13 @@ void ADIOSPutVarVisitor::operator()(const bool& value) { stream.engine.Put(var, (int)value); } +template <> +void ADIOSPutVarVisitor::operator()(const std::string& value) { + adios2::Variable var = stream.io.DefineVariable(varname); + std::cout << "-- Write string variable " << var.Name() << " value = " << value << std::endl; + stream.engine.Put(var, (std::string)value, adios2::Mode::Sync); +} + template <> void ADIOSPutVarVisitor::operator()(const Field2D& value) { // Pointer to data. Assumed to be contiguous array @@ -332,11 +339,14 @@ void writeGroup(const Options& options, ADIOSStream& stream, const std::string& bout::utils::visit(ADIOSPutVarVisitor(varname, stream), child.value); // Write attributes - for (const auto& attribute : child.attributes) { - const std::string& att_name = attribute.first; - const auto& att = attribute.second; + if (!BoutComm::rank()) + { + for (const auto& attribute : child.attributes) { + const std::string& att_name = attribute.first; + const auto& att = attribute.second; - bout::utils::visit(ADIOSPutAttVisitor(varname, att_name, stream), att); + bout::utils::visit(ADIOSPutAttVisitor(varname, att_name, stream), att); + } } } catch (const std::exception& e) { @@ -359,11 +369,11 @@ void OptionsADIOS::write(const Options& options, const std::string& time_dim) { // Open file ADIOSPtr adiosp = GetADIOSPtr(); + std::string ioname = "write_"+filename; try { - stream->io = adiosp->AtIO(filename); + stream->io = adiosp->AtIO(ioname); } catch (const std::invalid_argument& e) { - std::cerr << e.what() << '\n'; - stream->io = adiosp->DeclareIO(filename); + stream->io = adiosp->DeclareIO(ioname); } stream->engine = stream->io.Open(filename, mode); diff --git a/tests/integrated/CMakeLists.txt b/tests/integrated/CMakeLists.txt index 8dd892ebad..7d3e8e81ce 100644 --- a/tests/integrated/CMakeLists.txt +++ b/tests/integrated/CMakeLists.txt @@ -30,6 +30,7 @@ add_subdirectory(test-laplacexz) add_subdirectory(test-multigrid_laplace) add_subdirectory(test-naulin-laplace) add_subdirectory(test-options-netcdf) +add_subdirectory(test-options-adios) add_subdirectory(test-petsc_laplace) add_subdirectory(test-petsc_laplace_MAST-grid) add_subdirectory(test-restart-io) diff --git a/tests/integrated/test-options-adios/CMakeLists.txt b/tests/integrated/test-options-adios/CMakeLists.txt new file mode 100644 index 0000000000..110773d6fd --- /dev/null +++ b/tests/integrated/test-options-adios/CMakeLists.txt @@ -0,0 +1,6 @@ +bout_add_integrated_test(test-options-adios + SOURCES test-options-adios.cxx + USE_RUNTEST + USE_DATA_BOUT_INP + REQUIRES BOUT_HAS_ADIOS + ) diff --git a/tests/integrated/test-options-adios/data/BOUT.inp b/tests/integrated/test-options-adios/data/BOUT.inp new file mode 100644 index 0000000000..fa0f6d3681 --- /dev/null +++ b/tests/integrated/test-options-adios/data/BOUT.inp @@ -0,0 +1,6 @@ + + +[mesh] +nx = 5 +ny = 2 +nz = 2 diff --git a/tests/integrated/test-options-adios/makefile b/tests/integrated/test-options-adios/makefile new file mode 100644 index 0000000000..7dbbce8736 --- /dev/null +++ b/tests/integrated/test-options-adios/makefile @@ -0,0 +1,6 @@ + +BOUT_TOP = ../../.. + +SOURCEC = test-options-adios.cxx + +include $(BOUT_TOP)/make.config diff --git a/tests/integrated/test-options-adios/runtest b/tests/integrated/test-options-adios/runtest new file mode 100755 index 0000000000..7a3541df2d --- /dev/null +++ b/tests/integrated/test-options-adios/runtest @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 + +# Note: This test requires NCDF4, whereas on Travis NCDF is used +# requires: netcdf +# requires: not legacy_netcdf + +from boututils.datafile import DataFile +from boututils.run_wrapper import build_and_log, shell, launch +from boutdata.data import BoutOptionsFile + +import math +import numpy as np + +build_and_log("options-netcdf test") +shell("rm -f test-out.ini") +shell("rm -f test-out.nc") + +# Create a NetCDF input file +with DataFile("test.nc", create=True, format="NETCDF4") as f: + f.write("int", 42) + f.write("real", 3.1415) + f.write("string", "hello") + +# run BOUT++ +launch("./test-options-adios", nproc=1, mthread=1) + +# Check the output INI file +result = BoutOptionsFile("test-out.ini") + +print(result) + +assert result["int"] == 42 +assert math.isclose(result["real"], 3.1415) +assert result["string"] == "hello" + +print("Checking saved ADIOS test-out file -- Not implemented") + +# Check the output NetCDF file +# with DataFile("test-out.nc") as f: +# assert f["int"] == 42 +# assert math.isclose(f["real"], 3.1415) +# assert result["string"] == "hello" + +print("Checking saved settings.ini") + +# Check the settings.ini file, coming from BOUT.inp +# which is converted to NetCDF, read in, then written again +settings = BoutOptionsFile("settings.ini") + +assert settings["mesh"]["nx"] == 5 +assert settings["mesh"]["ny"] == 2 + +print("Checking saved fields.bp -- Not implemented") + +# with DataFile("fields.nc") as f: +# assert f["f2d"].shape == (5, 6) # Field2D +# assert f["f3d"].shape == (5, 6, 2) # Field3D +# assert f["fperp"].shape == (5, 2) # FieldPerp +# assert np.allclose(f["f2d"], 1.0) +# assert np.allclose(f["f3d"], 2.0) +# assert np.allclose(f["fperp"], 3.0) + +print("Checking saved fields2.bp -- Not implemented") + +# with DataFile("fields2.nc") as f: +# assert f["f2d"].shape == (5, 6) # Field2D +# assert f["f3d"].shape == (5, 6, 2) # Field3D +# assert f["fperp"].shape == (5, 2) # FieldPerp +# assert np.allclose(f["f2d"], 1.0) +# assert np.allclose(f["f3d"], 2.0) +# assert np.allclose(f["fperp"], 3.0) + +print(" => Passed") diff --git a/tests/integrated/test-options-adios/test-options-adios.cxx b/tests/integrated/test-options-adios/test-options-adios.cxx new file mode 100644 index 0000000000..17eeb17128 --- /dev/null +++ b/tests/integrated/test-options-adios/test-options-adios.cxx @@ -0,0 +1,85 @@ + +#include "bout/bout.hxx" + +#include "bout/options_io.hxx" +#include "bout/options_netcdf.hxx" +#include "bout/options_adios.hxx" +#include "bout/optionsreader.hxx" + +using bout::OptionsADIOS; + +int main(int argc, char** argv) { + BoutInitialise(argc, argv); + + // Read values from a NetCDF file + bout::OptionsNetCDF file("test.nc"); + + auto values = file.read(); + + values.printUnused(); + + // Write to an INI text file + OptionsReader* reader = OptionsReader::getInstance(); + reader->write(&values, "test-out.ini"); + + // Write to a NetCDF file + OptionsADIOS("test-out.bp").write(values); + + /////////////////////////// + + // Write the BOUT.inp settings to NetCDF file + OptionsADIOS("settings.bp").write(Options::root()); + + // Read back in + auto settings = OptionsADIOS("settings.bp").read(); + + // Write to INI file + reader->write(&settings, "settings.ini"); + + /////////////////////////// + // Write fields + + Options fields; + fields["f2d"] = Field2D(1.0); + fields["f3d"] = Field3D(2.0); + fields["fperp"] = FieldPerp(3.0); + OptionsADIOS("fields.bp").write(fields); + + /////////////////////////// + // Read fields + + Options fields_in = OptionsADIOS("fields.bp").read(); + + auto f2d = fields_in["f2d"].as(bout::globals::mesh); + auto f3d = fields_in["f3d"].as(bout::globals::mesh); + auto fperp = fields_in["fperp"].as(bout::globals::mesh); + + Options fields2; + fields2["f2d"] = f2d; + fields2["f3d"] = f3d; + fields2["fperp"] = fperp; + + // Write out again + OptionsADIOS("fields2.bp").write(fields2); + + /////////////////////////// + // Time dependent values + + Options data; + data["scalar"] = 1.0; + data["scalar"].attributes["time_dimension"] = "t"; + + data["field"] = Field3D(2.0); + data["field"].attributes["time_dimension"] = "t"; + + OptionsADIOS("time.bp").write(data); + + // Update time-dependent values + data["scalar"] = 2.0; + data["field"] = Field3D(3.0); + + // Append data to file + OptionsADIOS("time.nc", bout::OptionsIO::FileMode::append).write(data); + + BoutFinalise(); +}; diff --git a/tests/integrated/test-options-netcdf/test-options-netcdf.cxx b/tests/integrated/test-options-netcdf/test-options-netcdf.cxx index 01c5749972..7da6199535 100644 --- a/tests/integrated/test-options-netcdf/test-options-netcdf.cxx +++ b/tests/integrated/test-options-netcdf/test-options-netcdf.cxx @@ -1,6 +1,7 @@ #include "bout/bout.hxx" +#include "bout/options_io.hxx" #include "bout/options_netcdf.hxx" #include "bout/optionsreader.hxx" @@ -77,7 +78,7 @@ int main(int argc, char** argv) { data["field"] = Field3D(3.0); // Append data to file - OptionsNetCDF("time.nc", OptionsNetCDF::FileMode::append).write(data); + OptionsNetCDF("time.nc", bout::OptionsIO::FileMode::append).write(data); BoutFinalise(); }; From 2d7078e9f09fc10a89cb6d4caa32c79304d42caa Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Mon, 11 Sep 2023 15:26:12 -0400 Subject: [PATCH 09/46] fix build errors with cmake --- include/bout/options_adios.hxx | 12 ++++-- include/bout/options_io.hxx | 6 +-- include/bout/options_netcdf.hxx | 8 +++- src/sys/options/options_adios.cxx | 37 +++++++++++++------ src/sys/options/options_io.cxx | 4 -- .../test-options-adios/test-options-adios.cxx | 2 +- 6 files changed, 42 insertions(+), 27 deletions(-) diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx index 81c9e85d3e..fe9f0f5316 100644 --- a/include/bout/options_adios.hxx +++ b/include/bout/options_adios.hxx @@ -18,7 +18,7 @@ namespace bout { class OptionsADIOS : public OptionsIO { public: - OptionsADIOS(const std::string& filename, bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace) {} + explicit OptionsADIOS(const std::string& filename, bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace) {} OptionsADIOS(const OptionsADIOS&) = default; OptionsADIOS(OptionsADIOS&&) = default; OptionsADIOS& operator=(const OptionsADIOS&) = default; @@ -28,9 +28,15 @@ public: Options read() { throw BoutException("OptionsADIOS not available\n"); } /// Write options to file - void write(const Options& options) { + void write(const Options& options, const std::string& time_dim) { throw BoutException("OptionsADIOS not available\n"); } + + void verifyTimesteps() const{ + throw BoutException("OptionsADIOS not available\n"); + } + + }; } // namespace bout @@ -51,7 +57,7 @@ public: // Constructors need to be defined in implementation due to forward // declaration of ADIOSStream OptionsADIOS(); - explicit OptionsADIOS(std::string filename, bout::OptionsIO::FileMode mode = + OptionsADIOS(std::string filename, bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace); ~OptionsADIOS(); OptionsADIOS(const OptionsADIOS&) = delete; diff --git a/include/bout/options_io.hxx b/include/bout/options_io.hxx index 49d5d51c04..553f278a01 100644 --- a/include/bout/options_io.hxx +++ b/include/bout/options_io.hxx @@ -22,12 +22,8 @@ public: }; enum class Library { -#if BOUT_HAS_ADIOS ADIOS, -#endif -#if BOUT_HAS_NETCDF NetCDF, -#endif Invalid }; @@ -41,7 +37,7 @@ public: #endif OptionsIO(); - explicit OptionsIO(std::string filename, FileMode mode = FileMode::replace); + OptionsIO(std::string filename, FileMode mode = FileMode::replace); ~OptionsIO(); OptionsIO(const OptionsIO&) = delete; OptionsIO(OptionsIO&&) noexcept; diff --git a/include/bout/options_netcdf.hxx b/include/bout/options_netcdf.hxx index 0d94594d9d..5229e8fddc 100644 --- a/include/bout/options_netcdf.hxx +++ b/include/bout/options_netcdf.hxx @@ -30,9 +30,13 @@ public: Options read() { throw BoutException("OptionsNetCDF not available\n"); } /// Write options to file - void write(const Options& options) { + void write(const Options& options, const std::string& time_dim) { throw BoutException("OptionsNetCDF not available\n"); } + + void verifyTimesteps() const{ + throw BoutException("OptionsADIOS not available\n"); + } }; } // namespace bout @@ -55,7 +59,7 @@ public: // Constructors need to be defined in implementation due to forward // declaration of NcFile OptionsNetCDF(); - explicit OptionsNetCDF(std::string filename, FileMode mode = FileMode::replace); + OptionsNetCDF(std::string filename, FileMode mode = FileMode::replace); ~OptionsNetCDF(); OptionsNetCDF(const OptionsNetCDF&) = delete; OptionsNetCDF(OptionsNetCDF&&) noexcept; diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index 61ba360439..fde7a3ad56 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -237,32 +237,41 @@ void ADIOSPutVarVisitor::operator()(const std::string& value) { template <> void ADIOSPutVarVisitor::operator()(const Field2D& value) { // Pointer to data. Assumed to be contiguous array - adios2::Dims shape = {(size_t)value.getNx(), (size_t)value.getNy()}; - adios2::Variable var = stream.io.DefineVariable(varname, shape); + auto mesh = value.getMesh(); + adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)value.getNx(), (size_t)value.getNy()}; + adios2::Dims start = {(size_t)BoutComm::rank(), 0, 0}; + adios2::Dims count = {1, shape[1], shape[2]}; + adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); stream.engine.Put(var, &value(0, 0)); } template <> void ADIOSPutVarVisitor::operator()(const Field3D& value) { // Pointer to data. Assumed to be contiguous array - adios2::Dims shape = {(size_t)value.getNx(), (size_t)value.getNz()}; - adios2::Variable var = stream.io.DefineVariable(varname, shape); + adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)value.getNx(), (size_t)value.getNy(), (size_t)value.getNz()}; + adios2::Dims start = {(size_t)BoutComm::rank(), 0, 0, 0}; + adios2::Dims count = {1, shape[1], shape[2], shape[3]}; + adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); stream.engine.Put(var, &value(0, 0, 0)); } template <> void ADIOSPutVarVisitor::operator()(const FieldPerp& value) { // Pointer to data. Assumed to be contiguous array - adios2::Dims shape = {(size_t)value.getNx(), (size_t)value.getNz()}; - adios2::Variable var = stream.io.DefineVariable(varname, shape); + adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)value.getNx(), (size_t)value.getNz()}; + adios2::Dims start = {(size_t)BoutComm::rank(), 0, 0}; + adios2::Dims count = {1, shape[1], shape[2]}; + adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); stream.engine.Put(var, &value(0, 0)); } template <> void ADIOSPutVarVisitor::operator()>(const Array& value) { // Pointer to data. Assumed to be contiguous array - adios2::Dims shape = {(size_t)value.size()}; - adios2::Variable var = stream.io.DefineVariable(varname, shape); + adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)value.size()}; + adios2::Dims start = {(size_t)BoutComm::rank(), 0}; + adios2::Dims count = {1, shape[1]}; + adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); stream.engine.Put(var, value.begin()); } @@ -270,8 +279,10 @@ template <> void ADIOSPutVarVisitor::operator()>(const Matrix& value) { // Pointer to data. Assumed to be contiguous array auto s = value.shape(); - adios2::Dims shape = {(size_t)std::get<0>(s), (size_t)std::get<1>(s)}; - adios2::Variable var = stream.io.DefineVariable(varname, shape); + adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)std::get<0>(s), (size_t)std::get<1>(s)}; + adios2::Dims start = {(size_t)BoutComm::rank(), 0, 0}; + adios2::Dims count = {1, shape[1], shape[2]}; + adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); stream.engine.Put(var, value.begin()); } @@ -279,9 +290,11 @@ template <> void ADIOSPutVarVisitor::operator()>(const Tensor& value) { // Pointer to data. Assumed to be contiguous array auto s = value.shape(); - adios2::Dims shape = {(size_t)std::get<0>(s), (size_t)std::get<1>(s), + adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)std::get<0>(s), (size_t)std::get<1>(s), (size_t)std::get<2>(s)}; - adios2::Variable var = stream.io.DefineVariable(varname, shape); + adios2::Dims start = {(size_t)BoutComm::rank(), 0, 0, 0}; + adios2::Dims count = {1, shape[1], shape[2], shape[3]}; + adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); stream.engine.Put(var, value.begin()); } diff --git a/src/sys/options/options_io.cxx b/src/sys/options/options_io.cxx index 8183273e7f..c5bdde50ea 100644 --- a/src/sys/options/options_io.cxx +++ b/src/sys/options/options_io.cxx @@ -11,12 +11,8 @@ #include #include -#if BOUT_HAS_ADIOS #include "bout/options_adios.hxx" -#endif -#if BOUT_HAS_NETCDF #include "bout/options_netcdf.hxx" -#endif namespace bout { diff --git a/tests/integrated/test-options-adios/test-options-adios.cxx b/tests/integrated/test-options-adios/test-options-adios.cxx index 17eeb17128..12b5bf034d 100644 --- a/tests/integrated/test-options-adios/test-options-adios.cxx +++ b/tests/integrated/test-options-adios/test-options-adios.cxx @@ -79,7 +79,7 @@ int main(int argc, char** argv) { data["field"] = Field3D(3.0); // Append data to file - OptionsADIOS("time.nc", bout::OptionsIO::FileMode::append).write(data); + OptionsADIOS("time.bp", bout::OptionsIO::FileMode::append).write(data); BoutFinalise(); }; From 4aba3e183595e1f88164646ea51e54f1bab15ced Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Mon, 11 Sep 2023 17:55:16 -0700 Subject: [PATCH 10/46] ADIOS2 and array index mapping In general file I/O maps a logically rectangular subset of the local (nx, ny, nz) array onto a part of a global array. That global array may be sparse i.e. there might be holes in it. The mapping does not cover the entire local array because we insert communication guard cells around the outside. To perform this mapping we use ADIOS Put() function to get a span of a buffer, and then iterate over fields to copy data into those buffers. --- include/bout/mesh.hxx | 11 +++ src/mesh/impls/bout/boutmesh.cxx | 45 +++++++++- src/sys/options/options_adios.cxx | 137 ++++++++++++++++++++++++++---- 3 files changed, 175 insertions(+), 18 deletions(-) diff --git a/include/bout/mesh.hxx b/include/bout/mesh.hxx index 45ea392482..2a336383f4 100644 --- a/include/bout/mesh.hxx +++ b/include/bout/mesh.hxx @@ -503,9 +503,20 @@ public: int GlobalNx, GlobalNy, GlobalNz; ///< Size of the global arrays. Note: can have holes /// Size of the global arrays excluding boundary points. int GlobalNxNoBoundaries, GlobalNyNoBoundaries, GlobalNzNoBoundaries; + + /// Note: These offsets only correct if Y guards are not included in the global array + /// and are corrected in gridfromfile.cxx int OffsetX, OffsetY, OffsetZ; ///< Offset of this mesh within the global array ///< so startx on this processor is OffsetX in global + /// Map between local and global indices + /// (MapGlobalX, MapGlobalY, MapGlobalZ) in the global index space maps to (MapLocalX, MapLocalY, MapLocalZ) locally. + /// Note that boundary cells are included in the global index space, but communication + /// guard cells are not. + int MapGlobalX, MapGlobalY, MapGlobalZ; ///< Start global indices + int MapLocalX, MapLocalY, MapLocalZ; ///< Start local indices + int MapCountX, MapCountY, MapCountZ; ///< Size of the mapped region + /// Returns the number of unique cells (i.e., ones not used for /// communication) on this processor for 3D fields. Boundaries /// are only included to a depth of 1. diff --git a/src/mesh/impls/bout/boutmesh.cxx b/src/mesh/impls/bout/boutmesh.cxx index a802d3f5b3..4b5164d488 100644 --- a/src/mesh/impls/bout/boutmesh.cxx +++ b/src/mesh/impls/bout/boutmesh.cxx @@ -333,7 +333,7 @@ void BoutMesh::setDerivedGridSizes() { } GlobalNx = nx; - GlobalNy = ny + 2 * MYG; + GlobalNy = ny + 2 * MYG; // Note: For double null this should be be 4 * MYG if boundary cells are stored GlobalNz = nz; // If we've got a second pair of diverator legs, we need an extra @@ -374,6 +374,7 @@ void BoutMesh::setDerivedGridSizes() { } // Set global offsets + // Note: These don't properly include guard/boundary cells OffsetX = PE_XIND * MXSUB; OffsetY = PE_YIND * MYSUB; OffsetZ = 0; @@ -392,6 +393,48 @@ void BoutMesh::setDerivedGridSizes() { zstart = MZG; zend = MZG + MZSUB - 1; + + // Mapping local to global indices + if (periodicX) { + // No boundary cells in X + MapGlobalX = PE_XIND * MXSUB; + MapLocalX = MXG; + MapCountX = MXSUB; + } else { + // X boundaries stored for firstX and lastX processors + if (firstX()) { + MapGlobalX = 0; + MapLocalX = 0; + MapCountX = MXG + MXSUB; + } else { + MapGlobalX = MXG + PE_XIND * MXSUB; + MapLocalX = MXG; // Guard cells not included + MapCountX = MXSUB; + } + if (lastX()) { + // Doesn't change the origin, but adds outer X boundary cells + MapCountX += MXG; + } + } + + if (PE_YIND == 0) { + // Include Y boundary cells + MapGlobalY = 0; + MapLocalY = 0; + MapCountY = MYG + MYSUB; + } else { + MapGlobalY = MYG + PE_YIND * MYSUB; + MapLocalY = MYG; + MapCountY = MYSUB; + } + if (PE_YIND == NYPE - 1) { + // Include Y upper boundary region. + MapCountY += MYG; + } + + MapGlobalZ = 0; + MapLocalZ = MZG; // Omit boundary cells + MapCountZ = MZSUB; } int BoutMesh::load() { diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index fde7a3ad56..1e44fff91a 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -223,46 +223,149 @@ struct ADIOSPutVarVisitor { template <> void ADIOSPutVarVisitor::operator()(const bool& value) { + // Scalars are only written from processor 0 + if (BoutComm::rank() != 0) { + return; + } + adios2::Variable var = stream.io.DefineVariable(varname); + stream.engine.Put(var, static_cast(value)); +} + +template <> +void ADIOSPutVarVisitor::operator()(const int& value) { + // Scalars are only written from processor 0 + if (BoutComm::rank() != 0) { + return; + } adios2::Variable var = stream.io.DefineVariable(varname); - stream.engine.Put(var, (int)value); + stream.engine.Put(var, value); +} + +template <> +void ADIOSPutVarVisitor::operator()(const BoutReal& value) { + // Scalars are only written from processor 0 + if (BoutComm::rank() != 0) { + return; + } + adios2::Variable var = stream.io.DefineVariable(varname); + stream.engine.Put(var, value); } template <> void ADIOSPutVarVisitor::operator()(const std::string& value) { + // Scalars are only written from processor 0 + if (BoutComm::rank() != 0) { + return; + } + adios2::Variable var = stream.io.DefineVariable(varname); std::cout << "-- Write string variable " << var.Name() << " value = " << value << std::endl; - stream.engine.Put(var, (std::string)value, adios2::Mode::Sync); + stream.engine.Put(var, value, adios2::Mode::Sync); } template <> void ADIOSPutVarVisitor::operator()(const Field2D& value) { - // Pointer to data. Assumed to be contiguous array + // Get the mesh that describes how local data relates to global arrays auto mesh = value.getMesh(); - adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)value.getNx(), (size_t)value.getNy()}; - adios2::Dims start = {(size_t)BoutComm::rank(), 0, 0}; - adios2::Dims count = {1, shape[1], shape[2]}; + + // The global size of this array includes boundary cells but not communication guard cells. + // In general this array will be sparse because it may have gaps. + adios2::Dims shape = {static_cast(mesh->GlobalNx), + static_cast(mesh->GlobalNy)}; + + // Offset of this processor's data into the global array + adios2::Dims start = {static_cast(mesh->MapGlobalX), static_cast(mesh->MapGlobalY)}; + + // The size of the mapped region + adios2::Dims count = {static_cast(mesh->MapCountX), static_cast(mesh->MapCountY)}; adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); - stream.engine.Put(var, &value(0, 0)); + + // Get a Span of an internal engine buffer that we can fill with data + auto span = stream.engine.Put(var); + + // Iterate over the span and the Field2D array + // Note: The Field2D includes communication guard cells that are not written + auto it = span.begin(); + for (int x = mesh->MapLocalX; x < (mesh->MapLocalX + mesh->MapCountX); ++x) { + for (int y = mesh->MapLocalY; y < (mesh->MapLocalY + mesh->MapCountY); ++y) { + *it = value(x, y); + ++it; + } + } + ASSERT1(it == span.end()); } template <> void ADIOSPutVarVisitor::operator()(const Field3D& value) { - // Pointer to data. Assumed to be contiguous array - adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)value.getNx(), (size_t)value.getNy(), (size_t)value.getNz()}; - adios2::Dims start = {(size_t)BoutComm::rank(), 0, 0, 0}; - adios2::Dims count = {1, shape[1], shape[2], shape[3]}; + // Get the mesh that describes how local data relates to global arrays + auto mesh = value.getMesh(); + + // The global size of this array includes boundary cells but not communication guard cells. + // In general this array will be sparse because it may have gaps. + adios2::Dims shape = {static_cast(mesh->GlobalNx), + static_cast(mesh->GlobalNy), + static_cast(mesh->GlobalNz)}; + + // Offset of this processor's data into the global array + adios2::Dims start = {static_cast(mesh->MapGlobalX), + static_cast(mesh->MapGlobalY), + static_cast(mesh->MapGlobalZ)}; + + // The size of the mapped region + adios2::Dims count = {static_cast(mesh->MapCountX), + static_cast(mesh->MapCountY), + static_cast(mesh->MapCountZ)}; adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); - stream.engine.Put(var, &value(0, 0, 0)); + + // Get a Span of an internal engine buffer. + auto span = stream.engine.Put(var); + + // Iterate over the span and the Field3D array + // Note: The Field3D includes communication guard cells that are not written + auto it = span.begin(); + for (int x = mesh->MapLocalX; x < (mesh->MapLocalX + mesh->MapCountX); ++x) { + for (int y = mesh->MapLocalY; y < (mesh->MapLocalY + mesh->MapCountY); ++y) { + for (int z = mesh->MapLocalZ; z < (mesh->MapLocalZ + mesh->MapCountZ); ++z) { + *it = value(x, y, z); + ++it; + } + } + } + ASSERT1(it == span.end()); } template <> void ADIOSPutVarVisitor::operator()(const FieldPerp& value) { - // Pointer to data. Assumed to be contiguous array - adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)value.getNx(), (size_t)value.getNz()}; - adios2::Dims start = {(size_t)BoutComm::rank(), 0, 0}; - adios2::Dims count = {1, shape[1], shape[2]}; + // Get the mesh that describes how local data relates to global arrays + auto mesh = value.getMesh(); + + // The global size of this array includes boundary cells but not communication guard cells. + // In general this array will be sparse because it may have gaps. + adios2::Dims shape = {static_cast(mesh->GlobalNx), + static_cast(mesh->GlobalNz)}; + + // Offset of this processor's data into the global array + adios2::Dims start = {static_cast(mesh->MapGlobalX), + static_cast(mesh->MapGlobalZ)}; + + // The size of the mapped region + adios2::Dims count = {static_cast(mesh->MapCountX), + static_cast(mesh->MapCountZ)}; adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); - stream.engine.Put(var, &value(0, 0)); + + // Get a Span of an internal engine buffer. + auto span = stream.engine.Put(var); + + // Iterate over the span and the Field3D array + // Note: The Field3D includes communication guard cells that are not written + auto it = span.begin(); + for (int x = mesh->MapLocalX; x < (mesh->MapLocalX + mesh->MapCountX); ++x) { + for (int z = mesh->MapLocalZ; z < (mesh->MapLocalZ + mesh->MapCountZ); ++z) { + *it = value(x, z); + ++it; + } + } + ASSERT1(it == span.end()); } template <> From eb309dc13539518e031cfa03679d9698a323c686 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Tue, 12 Sep 2023 17:42:47 -0400 Subject: [PATCH 11/46] Handle ADIOS steps boundary controlled by OptionsIO::verifyTimesteps(). Add helper functions to avoid redefining variables in an adios2::IO object. --- include/bout/adios_object.hxx | 36 +++++-- include/bout/options_adios.hxx | 16 ++- include/bout/options_io.hxx | 6 +- src/sys/adios_object.cxx | 32 +++--- src/sys/options/options_adios.cxx | 172 ++++++++++++++++-------------- 5 files changed, 150 insertions(+), 112 deletions(-) diff --git a/include/bout/adios_object.hxx b/include/bout/adios_object.hxx index 47232d685e..7568810cfd 100755 --- a/include/bout/adios_object.hxx +++ b/include/bout/adios_object.hxx @@ -29,14 +29,38 @@ public: adios2::Variable vTime; adios2::Variable vStep; int adiosStep = 0; -}; + bool isInStep = false; // true if BeginStep was called and EndStep was not yet called + + /** create or return the ADIOSStream based on the target file name */ + static ADIOSStream& ADIOSGetStream(const std::string& fname); + + ~ADIOSStream(); -extern ADIOSStream adios_restart; -extern ADIOSStream adios_dump; -//extern ADIOS2Param *adios2params; + template + adios2::Variable GetValueVariable(const std::string& varname) { + auto v = io.InquireVariable(varname); + if (!v) { + v = io.DefineVariable(varname); + } + return v; + } -/** return one of the extern variable based on the target file name */ -ADIOSStream& ADIOSGetStream(const std::string& fname); + template + adios2::Variable GetArrayVariable(const std::string& varname, adios2::Dims& shape) { + adios2::Variable v = io.InquireVariable(varname); + if (!v) { + adios2::Dims start(shape.size()); + v = io.DefineVariable(varname, shape, start, shape); + } else { + v.SetShape(shape); + } + return v; + } + +private: + ADIOSStream(const std::string fname) : fname(fname){}; + std::string fname; +}; /** Set user parameters for an IO group */ void ADIOSSetParameters(const std::string& input, const char delimKeyValue, diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx index fe9f0f5316..0b6ae3ab68 100644 --- a/include/bout/options_adios.hxx +++ b/include/bout/options_adios.hxx @@ -18,7 +18,9 @@ namespace bout { class OptionsADIOS : public OptionsIO { public: - explicit OptionsADIOS(const std::string& filename, bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace) {} + explicit OptionsADIOS( + const std::string& filename, + bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace) {} OptionsADIOS(const OptionsADIOS&) = default; OptionsADIOS(OptionsADIOS&&) = default; OptionsADIOS& operator=(const OptionsADIOS&) = default; @@ -32,11 +34,7 @@ public: throw BoutException("OptionsADIOS not available\n"); } - void verifyTimesteps() const{ - throw BoutException("OptionsADIOS not available\n"); - } - - + void verifyTimesteps() const { throw BoutException("OptionsADIOS not available\n"); } }; } // namespace bout @@ -57,8 +55,8 @@ public: // Constructors need to be defined in implementation due to forward // declaration of ADIOSStream OptionsADIOS(); - OptionsADIOS(std::string filename, bout::OptionsIO::FileMode mode = - bout::OptionsIO::FileMode::replace); + OptionsADIOS(std::string filename, + bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace); ~OptionsADIOS(); OptionsADIOS(const OptionsADIOS&) = delete; OptionsADIOS(OptionsADIOS&&) noexcept; @@ -78,8 +76,6 @@ public: void verifyTimesteps() const; private: - /// Pointer to ADIOS stream so we don't introduce direct dependence - std::unique_ptr stream; }; } // namespace bout diff --git a/include/bout/options_io.hxx b/include/bout/options_io.hxx index 553f278a01..5d71382c06 100644 --- a/include/bout/options_io.hxx +++ b/include/bout/options_io.hxx @@ -21,11 +21,7 @@ public: append ///< Append to file when writing }; - enum class Library { - ADIOS, - NetCDF, - Invalid - }; + enum class Library { ADIOS, NetCDF, Invalid }; static const Library defaultIOLibrary = #if BOUT_HAS_ADIOS diff --git a/src/sys/adios_object.cxx b/src/sys/adios_object.cxx index e694e483e0..21bbd8b855 100755 --- a/src/sys/adios_object.cxx +++ b/src/sys/adios_object.cxx @@ -11,9 +11,7 @@ namespace bout { static ADIOSPtr adios = nullptr; -ADIOSStream adios_restart; -ADIOSStream adios_dump; -//ADIOS2Param* adios2params; +static std::unordered_map adiosStreams; void ADIOSInit(MPI_Comm comm) { adios = std::make_shared(comm); } @@ -26,9 +24,7 @@ void ADIOSFinalize() { throw std::runtime_error( "ADIOS needs to be initialized first before calling ADIOSFinalize()"); } - if (adios_dump.adiosStep > 0 && adios_dump.engine) { - adios_dump.engine.Close(); - } + adiosStreams.clear(); adios.reset(); } @@ -50,12 +46,24 @@ IOPtr GetIOPtr(const std::string IOName) { return io; } -ADIOSStream& ADIOSGetStream(const std::string& fname) { - if (fname.find(".restart") != std::string::npos) - return adios_restart; - //if (fname.find(".dmp") != std::string::npos) - // return adios_dump; - return adios_dump; +ADIOSStream::~ADIOSStream() { + if (engine) { + if (isInStep) { + engine.EndStep(); + isInStep = false; + std::cout << "ADIOSStream::~ADIOSStream: END adios file = " << engine.Name() + << " step = " << engine.CurrentStep() << std::endl; + } + engine.Close(); + } +} + +ADIOSStream& ADIOSStream::ADIOSGetStream(const std::string& fname) { + auto it = adiosStreams.find(fname); + if (it == adiosStreams.end()) { + it = adiosStreams.emplace(fname, ADIOSStream(fname)).first; + } + return it->second; } void ADIOSSetParameters(const std::string& input, const char delimKeyValue, diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index 1e44fff91a..becd0f51ae 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -17,10 +17,10 @@ namespace bout { -OptionsADIOS::OptionsADIOS() : stream(nullptr) {} +OptionsADIOS::OptionsADIOS() {} OptionsADIOS::OptionsADIOS(std::string filename, FileMode mode) - : OptionsIO(filename, mode), stream(nullptr) {} + : OptionsIO(filename, mode) {} OptionsADIOS::~OptionsADIOS() = default; OptionsADIOS::OptionsADIOS(OptionsADIOS&&) noexcept = default; @@ -84,7 +84,7 @@ bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& nam bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, const std::string& type, Options& result) { - bool ret; + bool ret = false; #define declare_template_instantiation(T) \ if (type == adios2::GetType()) { \ ret = readVariable(reader, io, name, result); \ @@ -112,13 +112,14 @@ Options OptionsADIOS::read() { // Open file ADIOSPtr adiosp = GetADIOSPtr(); adios2::IO io; - std::string ioname = "read_"+filename; + std::string ioname = "read_" + filename; try { io = adiosp->AtIO(ioname); } catch (const std::invalid_argument& e) { io = adiosp->DeclareIO(ioname); } + std::cout << "OptionsADIOS::read: open " << filename << std::endl; adios2::Engine reader = io.Open(filename, adios2::Mode::ReadRandomAccess); if (!reader) { throw BoutException("Could not open ADIOS file '{:s}' for reading", filename); @@ -172,38 +173,12 @@ std::vector verifyTimesteps(adios2::Engine& reader) { } void OptionsADIOS::verifyTimesteps() const { - - // Open file - ADIOSPtr adiosp = GetADIOSPtr(); - adios2::IO io; - try { - io = adiosp->AtIO(filename); - } catch (const std::invalid_argument& e) { - std::cerr << e.what() << '\n'; - io = adiosp->DeclareIO(filename); - } - - adios2::Engine reader = io.Open(filename, adios2::Mode::ReadRandomAccess); - if (!reader) { - throw BoutException("Could not open ADIOS file '{:s}' for reading", filename); - } - - auto errors = bout::verifyTimesteps(reader); - - if (errors.empty()) { - // No errors - return; - } - - std::string error_string; - for (const auto& error : errors) { - error_string += fmt::format( - " variable: {}; dimension: {}; expected size: {}; actual size: {}\n", - error.variable_name, error.time_name, error.expected_size, error.current_size); - } - throw BoutException("ERROR: When checking timesteps in file '{}', some ({}) variables " - "did not have the expected size(s):\n{}", - filename, errors.size(), error_string); + ADIOSStream& stream = ADIOSStream::ADIOSGetStream(filename); + std::cout << "OptionsADIOS::write: END adios step = " << stream.engine.CurrentStep() + << std::endl; + stream.engine.EndStep(); + stream.isInStep = false; + return; } /// Visit a variant type, and put the data into a NcVar @@ -212,7 +187,7 @@ struct ADIOSPutVarVisitor { : varname(name), stream(stream) {} template void operator()(const T& value) { - adios2::Variable var = stream.io.DefineVariable(varname); + adios2::Variable var = stream.GetValueVariable(varname); stream.engine.Put(var, value); } @@ -227,7 +202,7 @@ void ADIOSPutVarVisitor::operator()(const bool& value) { if (BoutComm::rank() != 0) { return; } - adios2::Variable var = stream.io.DefineVariable(varname); + adios2::Variable var = stream.GetValueVariable(varname); stream.engine.Put(var, static_cast(value)); } @@ -237,7 +212,7 @@ void ADIOSPutVarVisitor::operator()(const int& value) { if (BoutComm::rank() != 0) { return; } - adios2::Variable var = stream.io.DefineVariable(varname); + adios2::Variable var = stream.GetValueVariable(varname); stream.engine.Put(var, value); } @@ -247,7 +222,7 @@ void ADIOSPutVarVisitor::operator()(const BoutReal& value) { if (BoutComm::rank() != 0) { return; } - adios2::Variable var = stream.io.DefineVariable(varname); + adios2::Variable var = stream.GetValueVariable(varname); stream.engine.Put(var, value); } @@ -257,9 +232,7 @@ void ADIOSPutVarVisitor::operator()(const std::string& value) { if (BoutComm::rank() != 0) { return; } - - adios2::Variable var = stream.io.DefineVariable(varname); - std::cout << "-- Write string variable " << var.Name() << " value = " << value << std::endl; + adios2::Variable var = stream.GetValueVariable(varname); stream.engine.Put(var, value, adios2::Mode::Sync); } @@ -274,11 +247,14 @@ void ADIOSPutVarVisitor::operator()(const Field2D& value) { static_cast(mesh->GlobalNy)}; // Offset of this processor's data into the global array - adios2::Dims start = {static_cast(mesh->MapGlobalX), static_cast(mesh->MapGlobalY)}; + adios2::Dims start = {static_cast(mesh->MapGlobalX), + static_cast(mesh->MapGlobalY)}; // The size of the mapped region - adios2::Dims count = {static_cast(mesh->MapCountX), static_cast(mesh->MapCountY)}; - adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); + adios2::Dims count = {static_cast(mesh->MapCountX), + static_cast(mesh->MapCountY)}; + adios2::Variable var = stream.GetArrayVariable(varname, shape); + var.SetSelection({start, count}); // Get a Span of an internal engine buffer that we can fill with data auto span = stream.engine.Put(var); @@ -315,8 +291,9 @@ void ADIOSPutVarVisitor::operator()(const Field3D& value) { adios2::Dims count = {static_cast(mesh->MapCountX), static_cast(mesh->MapCountY), static_cast(mesh->MapCountZ)}; - adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); + adios2::Variable var = stream.GetArrayVariable(varname, shape); + var.SetSelection({start, count}); // Get a Span of an internal engine buffer. auto span = stream.engine.Put(var); @@ -351,7 +328,9 @@ void ADIOSPutVarVisitor::operator()(const FieldPerp& value) { // The size of the mapped region adios2::Dims count = {static_cast(mesh->MapCountX), static_cast(mesh->MapCountZ)}; - adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); + + adios2::Variable var = stream.GetArrayVariable(varname, shape); + var.SetSelection({start, count}); // Get a Span of an internal engine buffer. auto span = stream.engine.Put(var); @@ -374,7 +353,8 @@ void ADIOSPutVarVisitor::operator()>(const Array& valu adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)value.size()}; adios2::Dims start = {(size_t)BoutComm::rank(), 0}; adios2::Dims count = {1, shape[1]}; - adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); + adios2::Variable var = stream.GetArrayVariable(varname, shape); + var.SetSelection({start, count}); stream.engine.Put(var, value.begin()); } @@ -382,10 +362,12 @@ template <> void ADIOSPutVarVisitor::operator()>(const Matrix& value) { // Pointer to data. Assumed to be contiguous array auto s = value.shape(); - adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)std::get<0>(s), (size_t)std::get<1>(s)}; + adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)std::get<0>(s), + (size_t)std::get<1>(s)}; adios2::Dims start = {(size_t)BoutComm::rank(), 0, 0}; adios2::Dims count = {1, shape[1], shape[2]}; - adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); + adios2::Variable var = stream.GetArrayVariable(varname, shape); + var.SetSelection({start, count}); stream.engine.Put(var, value.begin()); } @@ -393,11 +375,12 @@ template <> void ADIOSPutVarVisitor::operator()>(const Tensor& value) { // Pointer to data. Assumed to be contiguous array auto s = value.shape(); - adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)std::get<0>(s), (size_t)std::get<1>(s), - (size_t)std::get<2>(s)}; + adios2::Dims shape = {(size_t)BoutComm::size(), (size_t)std::get<0>(s), + (size_t)std::get<1>(s), (size_t)std::get<2>(s)}; adios2::Dims start = {(size_t)BoutComm::rank(), 0, 0, 0}; adios2::Dims count = {1, shape[1], shape[2], shape[3]}; - adios2::Variable var = stream.io.DefineVariable(varname, shape, start, count); + adios2::Variable var = stream.GetArrayVariable(varname, shape); + var.SetSelection({start, count}); stream.engine.Put(var, value.begin()); } @@ -438,7 +421,12 @@ void writeGroup(const Options& options, ADIOSStream& stream, const std::string& if (child.isValue()) { try { auto time_it = child.attributes.find("time_dimension"); - if (time_it != child.attributes.end()) { + if (time_it == child.attributes.end()) { + if (stream.adiosStep > 0) { + // we should only write the non-varying values in the first step + continue; + } + } else { // Has a time dimension const auto& time_name = bout::utils::get(time_it->second); @@ -455,11 +443,10 @@ void writeGroup(const Options& options, ADIOSStream& stream, const std::string& bout::utils::visit(ADIOSPutVarVisitor(varname, stream), child.value); // Write attributes - if (!BoutComm::rank()) - { + if (!BoutComm::rank()) { for (const auto& attribute : child.attributes) { - const std::string& att_name = attribute.first; - const auto& att = attribute.second; + const std::string& att_name = attribute.first; + const auto& att = attribute.second; bout::utils::visit(ADIOSPutAttVisitor(varname, att_name, stream), att); } @@ -476,31 +463,58 @@ void writeGroup(const Options& options, ADIOSStream& stream, const std::string& void OptionsADIOS::write(const Options& options, const std::string& time_dim) { Timer timer("io"); - adios2::Mode mode = - (file_mode == FileMode::replace) ? adios2::Mode::Write : adios2::Mode::Append; - - if (not stream) { - stream = std::make_unique(); + // ADIOSStream is just a BOUT++ object, it does not create anything inside ADIOS + ADIOSStream& stream = ADIOSStream::ADIOSGetStream(filename); + + // Need to have an adios2::IO object first, which can only be created once. + if (!stream.io) { + ADIOSPtr adiosp = GetADIOSPtr(); + std::string ioname = "write_" + filename; + try { + stream.io = adiosp->AtIO(ioname); + } catch (const std::invalid_argument& e) { + stream.io = adiosp->DeclareIO(ioname); + stream.io.SetEngine("BP4"); + } } - // Open file - ADIOSPtr adiosp = GetADIOSPtr(); - std::string ioname = "write_"+filename; - try { - stream->io = adiosp->AtIO(ioname); - } catch (const std::invalid_argument& e) { - stream->io = adiosp->DeclareIO(ioname); + if (file_mode == FileMode::append) { + // Open file once and keep it open, close in stream desctructor + if (!stream.engine) { + std::cout << "OptionsADIOS::write: open for append " << filename + << " timedim = " << time_dim << std::endl; + stream.engine = stream.io.Open(filename, adios2::Mode::Append); + if (!stream.engine) { + throw BoutException("Could not open ADIOS file '{:s}' for writing", filename); + } + } else { + std::cout << "OptionsADIOS::write: revisiting append " << filename + << " timedim = " << time_dim << std::endl; + } + } else { + if (!stream.engine) { + std::cout << "OptionsADIOS::write: create " << filename << " timedim = " << time_dim + << std::endl; + stream.engine = stream.io.Open(filename, adios2::Mode::Write); + } else { + std::cout << "OptionsADIOS::write: revisiting write " << filename + << " timedim = " << time_dim << std::endl; + } } - stream->engine = stream->io.Open(filename, mode); - if (!stream->engine) { - throw BoutException("Could not open ADIOS file '{:s}' for writing", filename); + std::cout << " BetweenStepPairs = " << stream.isInStep << std::endl; + + if (!stream.isInStep) { + stream.engine.BeginStep(); + stream.isInStep = true; + stream.adiosStep = stream.engine.CurrentStep(); + std::cout << "OptionsADIOS::write: BEGIN adios step = " << stream.adiosStep + << " BetweenStepPairs = " << stream.isInStep << std::endl; + } else { + std::cout << "OptionsADIOS::write: continue writing adios step = " << stream.adiosStep + << std::endl; } - - stream->engine.BeginStep(); - writeGroup(options, *stream, "", time_dim); - - stream->engine.EndStep(); + writeGroup(options, stream, "", time_dim); } } // namespace bout From 4f55840bc93053ab43a204238386b093cdf4ee90 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Wed, 13 Sep 2023 07:20:37 -0400 Subject: [PATCH 12/46] Added singleWriteFile argument to OptionsIO() which must be set true for restart files when using ADIOS. Replaced the use of Span and manual copy for memory selections to write data without ghost cells. --- include/bout/options_adios.hxx | 3 +- include/bout/options_io.hxx | 17 +- include/bout/options_netcdf.hxx | 12 +- src/physics/physicsmodel.cxx | 4 +- src/sys/options/options_adios.cxx | 171 ++++++++---------- src/sys/options/options_io.cxx | 12 +- src/sys/options/options_netcdf.cxx | 4 +- .../test-options-adios/test-options-adios.cxx | 24 ++- 8 files changed, 120 insertions(+), 127 deletions(-) diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx index 0b6ae3ab68..11e18f3a1a 100644 --- a/include/bout/options_adios.hxx +++ b/include/bout/options_adios.hxx @@ -56,7 +56,8 @@ public: // declaration of ADIOSStream OptionsADIOS(); OptionsADIOS(std::string filename, - bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace); + bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace, + bool singleWriteFile = false); ~OptionsADIOS(); OptionsADIOS(const OptionsADIOS&) = delete; OptionsADIOS(OptionsADIOS&&) noexcept; diff --git a/include/bout/options_io.hxx b/include/bout/options_io.hxx index 5d71382c06..7bb689c0b0 100644 --- a/include/bout/options_io.hxx +++ b/include/bout/options_io.hxx @@ -33,7 +33,8 @@ public: #endif OptionsIO(); - OptionsIO(std::string filename, FileMode mode = FileMode::replace); + OptionsIO(std::string filename, FileMode mode = FileMode::replace, + bool singleWriteFile = false); ~OptionsIO(); OptionsIO(const OptionsIO&) = delete; OptionsIO(OptionsIO&&) noexcept; @@ -47,23 +48,29 @@ public: void write(const Options& options) { write(options, "t"); } virtual void write(const Options& options, const std::string& time_dim) = 0; - /// Check that all variables with the same time dimension have the + /// NetCDF: Check that all variables with the same time dimension have the /// same size in that dimension. Throws BoutException if there are - /// any differences, otherwise is silent + /// any differences, otherwise is silent. + /// ADIOS: Indicate completion of an output step. virtual void verifyTimesteps() const = 0; + /// ADIOS: close file at the end of write(). NetCDF: no effect. + /// restart file must have this true if using ADIOS + //void setSingleWriteFile(const bool flag) { singleWriteFile = flag; }; + protected: /// Name of the file on disk std::string filename; /// How to open the file for writing FileMode file_mode{FileMode::replace}; - Library library = Library::Invalid; + bool singleWriteFile = false; }; std::shared_ptr OptionsIOFactory(std::string filename, OptionsIO::FileMode mode = OptionsIO::FileMode::replace, - const OptionsIO::Library library = OptionsIO::defaultIOLibrary); + const OptionsIO::Library library = OptionsIO::defaultIOLibrary, + const bool singleWriteFile = false); OptionsIO::Library getIOLibrary(Options& options); diff --git a/include/bout/options_netcdf.hxx b/include/bout/options_netcdf.hxx index 5229e8fddc..910c2423fe 100644 --- a/include/bout/options_netcdf.hxx +++ b/include/bout/options_netcdf.hxx @@ -18,9 +18,10 @@ namespace bout { -class OptionsNetCDF : public OptionsIO{ +class OptionsNetCDF : public OptionsIO { public: - OptionsNetCDF(const std::string& filename, bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace) {} + OptionsNetCDF(const std::string& filename, + bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace) {} OptionsNetCDF(const OptionsNetCDF&) = default; OptionsNetCDF(OptionsNetCDF&&) = default; OptionsNetCDF& operator=(const OptionsNetCDF&) = default; @@ -34,9 +35,7 @@ public: throw BoutException("OptionsNetCDF not available\n"); } - void verifyTimesteps() const{ - throw BoutException("OptionsADIOS not available\n"); - } + void verifyTimesteps() const { throw BoutException("OptionsADIOS not available\n"); } }; } // namespace bout @@ -59,7 +58,8 @@ public: // Constructors need to be defined in implementation due to forward // declaration of NcFile OptionsNetCDF(); - OptionsNetCDF(std::string filename, FileMode mode = FileMode::replace); + OptionsNetCDF(std::string filename, FileMode mode = FileMode::replace, + bool singleWriteFile = false); ~OptionsNetCDF(); OptionsNetCDF(const OptionsNetCDF&) = delete; OptionsNetCDF(OptionsNetCDF&&) noexcept; diff --git a/src/physics/physicsmodel.cxx b/src/physics/physicsmodel.cxx index e0658b77bb..538851f4cb 100644 --- a/src/physics/physicsmodel.cxx +++ b/src/physics/physicsmodel.cxx @@ -94,8 +94,8 @@ PhysicsModel::PhysicsModel() if (restart_enabled) { std::string restartFileName = bout::getRestartFilename(Options::root(), iolibrary); - restart_file = bout::OptionsIOFactory(restartFileName, - bout::OptionsIO::FileMode::replace, iolibrary); + restart_file = bout::OptionsIOFactory( + restartFileName, bout::OptionsIO::FileMode::replace, iolibrary, true); } } diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index becd0f51ae..10c74b119c 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -19,8 +19,8 @@ namespace bout { OptionsADIOS::OptionsADIOS() {} -OptionsADIOS::OptionsADIOS(std::string filename, FileMode mode) - : OptionsIO(filename, mode) {} +OptionsADIOS::OptionsADIOS(std::string filename, FileMode mode, bool singleWriteFile) + : OptionsIO(filename, mode, singleWriteFile) {} OptionsADIOS::~OptionsADIOS() = default; OptionsADIOS::OptionsADIOS(OptionsADIOS&&) noexcept = default; @@ -74,9 +74,6 @@ bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& nam } } - if (!BoutComm::rank()) - std::cout << " array has " << variable.Steps() << " steps" << std::endl; - /* Need to read the data here */ result[name] = data.data(); return true; @@ -119,7 +116,6 @@ Options OptionsADIOS::read() { io = adiosp->DeclareIO(ioname); } - std::cout << "OptionsADIOS::read: open " << filename << std::endl; adios2::Engine reader = io.Open(filename, adios2::Mode::ReadRandomAccess); if (!reader) { throw BoutException("Could not open ADIOS file '{:s}' for reading", filename); @@ -152,30 +148,8 @@ Options OptionsADIOS::read() { return result; } -/// Helper struct for returning errors from verifyTimesteps(NcGroup) -struct TimeDimensionError { - std::string variable_name; - std::string time_name; - std::size_t expected_size; - std::size_t current_size; -}; - -std::vector verifyTimesteps(adios2::Engine& reader) { - reader.CurrentStep(); // just to avoid warning on unused variable - - // Variables with mismatched dimension sizes. Note that this might - // be a little odd: if the first variable we come across has the - // "wrong" dimension size, we will actually list all the others as - // being wrong! - std::vector errors; - - return errors; -} - void OptionsADIOS::verifyTimesteps() const { ADIOSStream& stream = ADIOSStream::ADIOSGetStream(filename); - std::cout << "OptionsADIOS::write: END adios step = " << stream.engine.CurrentStep() - << std::endl; stream.engine.EndStep(); stream.isInStep = false; return; @@ -253,22 +227,24 @@ void ADIOSPutVarVisitor::operator()(const Field2D& value) { // The size of the mapped region adios2::Dims count = {static_cast(mesh->MapCountX), static_cast(mesh->MapCountY)}; - adios2::Variable var = stream.GetArrayVariable(varname, shape); - var.SetSelection({start, count}); - // Get a Span of an internal engine buffer that we can fill with data - auto span = stream.engine.Put(var); + // Where the actual data starts in data pointer (to exclude ghost cells) + adios2::Dims memStart = {static_cast(mesh->MapLocalX), + static_cast(mesh->MapLocalY)}; - // Iterate over the span and the Field2D array - // Note: The Field2D includes communication guard cells that are not written - auto it = span.begin(); - for (int x = mesh->MapLocalX; x < (mesh->MapLocalX + mesh->MapCountX); ++x) { - for (int y = mesh->MapLocalY; y < (mesh->MapLocalY + mesh->MapCountY); ++y) { - *it = value(x, y); - ++it; - } - } - ASSERT1(it == span.end()); + // The actual size of data pointer in memory (including ghost cells) + adios2::Dims memCount = {static_cast(value.getNx()), + static_cast(value.getNy())}; + + adios2::Variable var = stream.GetArrayVariable(varname, shape); + /* std::cout << "PutVar Field2D rank " << BoutComm::rank() << " var = " << varname + << " shape = " << shape[0] << "x" << shape[1] << " count = " << count[0] + << "x" << count[1] << " Nx*Ny = " << value.getNx() << "x" << value.getNy() + << " memStart = " << memStart[0] << "x" << memStart[1] + << " memCount = " << memCount[0] << "x" << memCount[1] << std::endl;*/ + var.SetSelection({start, count}); + var.SetMemorySelection({memStart, memCount}); + stream.engine.Put(var, &value(0, 0)); } template <> @@ -292,23 +268,27 @@ void ADIOSPutVarVisitor::operator()(const Field3D& value) { static_cast(mesh->MapCountY), static_cast(mesh->MapCountZ)}; + // Where the actual data starts in data pointer (to exclude ghost cells) + adios2::Dims memStart = {static_cast(mesh->MapLocalX), + static_cast(mesh->MapLocalY), + static_cast(mesh->MapLocalZ)}; + + // The actual size of data pointer in memory (including ghost cells) + adios2::Dims memCount = {static_cast(value.getNx()), + static_cast(value.getNy()), + static_cast(value.getNz())}; + adios2::Variable var = stream.GetArrayVariable(varname, shape); + /*std::cout << "PutVar Field3D rank " << BoutComm::rank() << " var = " << varname + << " shape = " << shape[0] << "x" << shape[1] << "x" << shape[2] + << " count = " << count[0] << "x" << count[1] << "x" << count[2] + << " Nx*Ny = " << value.getNx() << "x" << value.getNy() << "x" + << value.getNz() << " memStart = " << memStart[0] << "x" << memStart[1] << "x" + << memStart[2] << " memCount = " << memCount[0] << "x" << memCount[1] << "x" + << memCount[2] << std::endl;*/ var.SetSelection({start, count}); - // Get a Span of an internal engine buffer. - auto span = stream.engine.Put(var); - - // Iterate over the span and the Field3D array - // Note: The Field3D includes communication guard cells that are not written - auto it = span.begin(); - for (int x = mesh->MapLocalX; x < (mesh->MapLocalX + mesh->MapCountX); ++x) { - for (int y = mesh->MapLocalY; y < (mesh->MapLocalY + mesh->MapCountY); ++y) { - for (int z = mesh->MapLocalZ; z < (mesh->MapLocalZ + mesh->MapCountZ); ++z) { - *it = value(x, y, z); - ++it; - } - } - } - ASSERT1(it == span.end()); + var.SetMemorySelection({memStart, memCount}); + stream.engine.Put(var, &value(0, 0, 0)); } template <> @@ -329,22 +309,23 @@ void ADIOSPutVarVisitor::operator()(const FieldPerp& value) { adios2::Dims count = {static_cast(mesh->MapCountX), static_cast(mesh->MapCountZ)}; - adios2::Variable var = stream.GetArrayVariable(varname, shape); - var.SetSelection({start, count}); + // Where the actual data starts in data pointer (to exclude ghost cells) + adios2::Dims memStart = {static_cast(mesh->MapLocalX), + static_cast(mesh->MapLocalZ)}; - // Get a Span of an internal engine buffer. - auto span = stream.engine.Put(var); + // The actual size of data pointer in memory (including ghost cells) + adios2::Dims memCount = {static_cast(value.getNx()), + static_cast(value.getNz())}; - // Iterate over the span and the Field3D array - // Note: The Field3D includes communication guard cells that are not written - auto it = span.begin(); - for (int x = mesh->MapLocalX; x < (mesh->MapLocalX + mesh->MapCountX); ++x) { - for (int z = mesh->MapLocalZ; z < (mesh->MapLocalZ + mesh->MapCountZ); ++z) { - *it = value(x, z); - ++it; - } - } - ASSERT1(it == span.end()); + adios2::Variable var = stream.GetArrayVariable(varname, shape); + /* std::cout << "PutVar FieldPerp rank " << BoutComm::rank() << " var = " << varname + << " shape = " << shape[0] << "x" << shape[1] << " count = " << count[0] + << "x" << count[1] << " Nx*Ny = " << value.getNx() << "x" << value.getNy() + << " memStart = " << memStart[0] << "x" << memStart[1] + << " memCount = " << memCount[0] << "x" << memCount[1] << std::endl; */ + var.SetSelection({start, count}); + var.SetMemorySelection({memStart, memCount}); + stream.engine.Put(var, &value(0, 0)); } template <> @@ -474,47 +455,39 @@ void OptionsADIOS::write(const Options& options, const std::string& time_dim) { stream.io = adiosp->AtIO(ioname); } catch (const std::invalid_argument& e) { stream.io = adiosp->DeclareIO(ioname); - stream.io.SetEngine("BP4"); + stream.io.SetEngine("BP5"); } } - if (file_mode == FileMode::append) { - // Open file once and keep it open, close in stream desctructor - if (!stream.engine) { - std::cout << "OptionsADIOS::write: open for append " << filename - << " timedim = " << time_dim << std::endl; - stream.engine = stream.io.Open(filename, adios2::Mode::Append); - if (!stream.engine) { - throw BoutException("Could not open ADIOS file '{:s}' for writing", filename); - } - } else { - std::cout << "OptionsADIOS::write: revisiting append " << filename - << " timedim = " << time_dim << std::endl; - } - } else { + /* Open file once and keep it open, close in stream desctructor + or close after writing if singleWriteFile == true + */ + if (!stream.engine) { + adios2::Mode amode = + (file_mode == FileMode::append ? adios2::Mode::Append : adios2::Mode::Write); + stream.engine = stream.io.Open(filename, amode); if (!stream.engine) { - std::cout << "OptionsADIOS::write: create " << filename << " timedim = " << time_dim - << std::endl; - stream.engine = stream.io.Open(filename, adios2::Mode::Write); - } else { - std::cout << "OptionsADIOS::write: revisiting write " << filename - << " timedim = " << time_dim << std::endl; + throw BoutException("Could not open ADIOS file '{:s}' for writing", filename); } } - std::cout << " BetweenStepPairs = " << stream.isInStep << std::endl; - + /* Multiple write() calls allowed in a single adios step to output multiple + Options objects in the same step. verifyTimesteps() will indicate the + completion of the step (and adios will publish the step). + */ if (!stream.isInStep) { stream.engine.BeginStep(); stream.isInStep = true; stream.adiosStep = stream.engine.CurrentStep(); - std::cout << "OptionsADIOS::write: BEGIN adios step = " << stream.adiosStep - << " BetweenStepPairs = " << stream.isInStep << std::endl; - } else { - std::cout << "OptionsADIOS::write: continue writing adios step = " << stream.adiosStep - << std::endl; } + writeGroup(options, stream, "", time_dim); + + /* In singleWriteFile mode, we complete the step and close the file */ + if (singleWriteFile) { + stream.engine.EndStep(); + stream.engine.Close(); + } } } // namespace bout diff --git a/src/sys/options/options_io.cxx b/src/sys/options/options_io.cxx index c5bdde50ea..6bae83c4c8 100644 --- a/src/sys/options/options_io.cxx +++ b/src/sys/options/options_io.cxx @@ -18,8 +18,8 @@ namespace bout { OptionsIO::OptionsIO() {} -OptionsIO::OptionsIO(std::string filename, FileMode mode) - : filename(std::move(filename)), file_mode(mode) {} +OptionsIO::OptionsIO(std::string filename, FileMode mode, bool singleWriteFile) + : filename(std::move(filename)), file_mode(mode), singleWriteFile(singleWriteFile) {} OptionsIO::~OptionsIO() = default; OptionsIO::OptionsIO(OptionsIO&&) noexcept = default; @@ -43,11 +43,13 @@ OptionsIO::Library getIOLibrary(Options& options) { std::shared_ptr OptionsIOFactory(std::string filename, OptionsIO::FileMode mode, - const OptionsIO::Library library) { + const OptionsIO::Library library, + const bool singleWriteFile) { if (library == OptionsIO::Library::ADIOS) { - return std::make_shared(OptionsADIOS(filename, mode)); + return std::make_shared(OptionsADIOS(filename, mode, singleWriteFile)); } else if (library == OptionsIO::Library::NetCDF) { - return std::make_shared(OptionsNetCDF(filename, mode)); + return std::make_shared( + OptionsNetCDF(filename, mode, singleWriteFile)); } else { return nullptr; } diff --git a/src/sys/options/options_netcdf.cxx b/src/sys/options/options_netcdf.cxx index 8aadcd5363..0262e0cbbd 100644 --- a/src/sys/options/options_netcdf.cxx +++ b/src/sys/options/options_netcdf.cxx @@ -645,8 +645,8 @@ namespace bout { OptionsNetCDF::OptionsNetCDF() : data_file(nullptr) {} -OptionsNetCDF::OptionsNetCDF(std::string filename, FileMode mode) - : OptionsIO(filename, mode), data_file(nullptr) {} +OptionsNetCDF::OptionsNetCDF(std::string filename, FileMode mode, bool singleWriteFile) + : OptionsIO(filename, mode, singleWriteFile), data_file(nullptr) {} OptionsNetCDF::~OptionsNetCDF() = default; OptionsNetCDF::OptionsNetCDF(OptionsNetCDF&&) noexcept = default; diff --git a/tests/integrated/test-options-adios/test-options-adios.cxx b/tests/integrated/test-options-adios/test-options-adios.cxx index 12b5bf034d..a293aeafc0 100644 --- a/tests/integrated/test-options-adios/test-options-adios.cxx +++ b/tests/integrated/test-options-adios/test-options-adios.cxx @@ -1,9 +1,9 @@ #include "bout/bout.hxx" +#include "bout/options_adios.hxx" #include "bout/options_io.hxx" #include "bout/options_netcdf.hxx" -#include "bout/options_adios.hxx" #include "bout/optionsreader.hxx" using bout::OptionsADIOS; @@ -23,12 +23,13 @@ int main(int argc, char** argv) { reader->write(&values, "test-out.ini"); // Write to a NetCDF file - OptionsADIOS("test-out.bp").write(values); + OptionsADIOS("test-out.bp", bout::OptionsIO::FileMode::replace, true).write(values); /////////////////////////// // Write the BOUT.inp settings to NetCDF file - OptionsADIOS("settings.bp").write(Options::root()); + OptionsADIOS("settings.bp", bout::OptionsIO::FileMode::replace, true) + .write(Options::root()); // Read back in auto settings = OptionsADIOS("settings.bp").read(); @@ -43,7 +44,14 @@ int main(int argc, char** argv) { fields["f2d"] = Field2D(1.0); fields["f3d"] = Field3D(2.0); fields["fperp"] = FieldPerp(3.0); - OptionsADIOS("fields.bp").write(fields); + auto f = OptionsADIOS("fields.bp"); + /* + write() for adios only buffers data but does not guarantee writing to disk + unless singleWriteFile is set to true + */ + f.write(fields); + // indicate completion of step, required to get data on disk + f.verifyTimesteps(); /////////////////////////// // Read fields @@ -60,7 +68,9 @@ int main(int argc, char** argv) { fields2["fperp"] = fperp; // Write out again - OptionsADIOS("fields2.bp").write(fields2); + auto f2 = bout::OptionsIOFactory("fields2.bp", bout::OptionsIO::FileMode::replace, + bout::OptionsIO::Library::ADIOS, true); + f2->write(fields2); /////////////////////////// // Time dependent values @@ -72,14 +82,14 @@ int main(int argc, char** argv) { data["field"] = Field3D(2.0); data["field"].attributes["time_dimension"] = "t"; - OptionsADIOS("time.bp").write(data); + OptionsADIOS("time.bp", bout::OptionsIO::FileMode::replace, true).write(data); // Update time-dependent values data["scalar"] = 2.0; data["field"] = Field3D(3.0); // Append data to file - OptionsADIOS("time.bp", bout::OptionsIO::FileMode::append).write(data); + OptionsADIOS("time.bp", bout::OptionsIO::FileMode::append, true).write(data); BoutFinalise(); }; From 958b7d4feb2e6ca7358c364c74538b8f7db65d7f Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Wed, 13 Sep 2023 08:44:45 -0400 Subject: [PATCH 13/46] Implement reading arrays (BoutReal type only). --- src/sys/options/options_adios.cxx | 62 +++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index 10c74b119c..04bf242d1a 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -31,7 +31,7 @@ constexpr auto current_time_index_name = "current_time_index"; template bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, - Options& result) { + const std::string& type, Options& result) { std::vector data; adios2::Variable variable = io.InquireVariable(name); @@ -43,48 +43,70 @@ bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& nam } if (variable.ShapeID() == adios2::ShapeID::LocalArray) { - if (!BoutComm::rank()) { - std::cout << " LocalArray not supported" << std::endl; - } - return false; + throw std::invalid_argument( + "ADIOS reader did not implement reading local arrays like " + type + " " + name + + " in file " + reader.Name()); + } + + if (type != "double" && type != "float") { + throw std::invalid_argument( + "ADIOS reader did not implement reading arrays that are not double/float type. " + "Found " + + type + " " + name + " in file " + reader.Name()); + } + + if (type == "double" && sizeof(BoutReal) != sizeof(double)) { + throw std::invalid_argument( + "ADIOS does not allow for implicit type conversions. BoutReal type is " + "float but found " + + type + " " + name + " in file " + reader.Name()); + } + + if (type == "float" && sizeof(BoutReal) != sizeof(float)) { + throw std::invalid_argument( + "ADIOS reader does not allow for implicit type conversions. BoutReal type is " + "double but found " + + type + " " + name + " in file " + reader.Name()); } auto dims = variable.Shape(); auto ndims = dims.size(); + adios2::Variable variableD = io.InquireVariable(name); switch (ndims) { case 1: { - Array value(static_cast(dims[0])); - reader.Get(variable, value.begin(), adios2::Mode::Sync); - //result[name] = value; + Array value(static_cast(dims[0])); + BoutReal* data = value.begin(); + reader.Get(variableD, data, adios2::Mode::Sync); + result[name] = value; break; } case 2: { - Matrix value(static_cast(dims[0]), static_cast(dims[1])); - reader.Get(variable, value.begin(), adios2::Mode::Sync); - //[name] = value; + Matrix value(static_cast(dims[0]), static_cast(dims[1])); + BoutReal* data = value.begin(); + reader.Get(variableD, data, adios2::Mode::Sync); + result[name] = value; break; } case 3: { - Tensor value(static_cast(dims[0]), static_cast(dims[1]), - static_cast(dims[2])); - reader.Get(variable, value.begin(), adios2::Mode::Sync); - //result[name] = value; + Tensor value(static_cast(dims[0]), static_cast(dims[1]), + static_cast(dims[2])); + BoutReal* data = value.begin(); + reader.Get(variableD, data, adios2::Mode::Sync); + result[name] = value; break; } } - /* Need to read the data here */ - result[name] = data.data(); return true; } bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, const std::string& type, Options& result) { bool ret = false; -#define declare_template_instantiation(T) \ - if (type == adios2::GetType()) { \ - ret = readVariable(reader, io, name, result); \ +#define declare_template_instantiation(T) \ + if (type == adios2::GetType()) { \ + ret = readVariable(reader, io, name, type, result); \ } ADIOS2_FOREACH_ATTRIBUTE_PRIMITIVE_STDTYPE_1ARG(declare_template_instantiation) #undef declare_template_instantiation From 54d4d139eadc6ce0baf758a7181194e567cea664 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Wed, 13 Sep 2023 09:27:15 -0400 Subject: [PATCH 14/46] Fix function signature for when ADIOS/NetCDF is not used --- include/bout/options_adios.hxx | 3 ++- include/bout/options_io.hxx | 2 +- include/bout/options_netcdf.hxx | 3 ++- src/sys/adios_object.cxx | 2 -- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx index 11e18f3a1a..0c4853bc38 100644 --- a/include/bout/options_adios.hxx +++ b/include/bout/options_adios.hxx @@ -20,7 +20,8 @@ class OptionsADIOS : public OptionsIO { public: explicit OptionsADIOS( const std::string& filename, - bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace) {} + bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace, + bool singleWriteFile = false) {} OptionsADIOS(const OptionsADIOS&) = default; OptionsADIOS(OptionsADIOS&&) = default; OptionsADIOS& operator=(const OptionsADIOS&) = default; diff --git a/include/bout/options_io.hxx b/include/bout/options_io.hxx index 7bb689c0b0..b0ffdb5bb1 100644 --- a/include/bout/options_io.hxx +++ b/include/bout/options_io.hxx @@ -25,7 +25,7 @@ public: static const Library defaultIOLibrary = #if BOUT_HAS_ADIOS - Library::ADIOS; + Library::NetCDF; #elif BOUT_HAS_NETCDF Library::NetCDF; #else diff --git a/include/bout/options_netcdf.hxx b/include/bout/options_netcdf.hxx index 910c2423fe..5cbbf7e5fc 100644 --- a/include/bout/options_netcdf.hxx +++ b/include/bout/options_netcdf.hxx @@ -21,7 +21,8 @@ namespace bout { class OptionsNetCDF : public OptionsIO { public: OptionsNetCDF(const std::string& filename, - bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace) {} + bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace, + bool singleWriteFile = false) {} OptionsNetCDF(const OptionsNetCDF&) = default; OptionsNetCDF(OptionsNetCDF&&) = default; OptionsNetCDF& operator=(const OptionsNetCDF&) = default; diff --git a/src/sys/adios_object.cxx b/src/sys/adios_object.cxx index 21bbd8b855..35126090f8 100755 --- a/src/sys/adios_object.cxx +++ b/src/sys/adios_object.cxx @@ -51,8 +51,6 @@ ADIOSStream::~ADIOSStream() { if (isInStep) { engine.EndStep(); isInStep = false; - std::cout << "ADIOSStream::~ADIOSStream: END adios file = " << engine.Name() - << " step = " << engine.CurrentStep() << std::endl; } engine.Close(); } From c0759ed8d421a9e9eff8b46d82da3a30c9710ced Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Mon, 2 Oct 2023 16:40:37 -0700 Subject: [PATCH 15/46] fix writeDefaultOutputFile The Options tree passed to this function contains the data to be written to file, not necessarily the input settings. The output file name should be set from the Options::root() input options, not the input options tree. --- src/sys/options/options_io.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sys/options/options_io.cxx b/src/sys/options/options_io.cxx index 6bae83c4c8..514307ec59 100644 --- a/src/sys/options/options_io.cxx +++ b/src/sys/options/options_io.cxx @@ -109,7 +109,9 @@ void writeDefaultOutputFile(Options& options, const OptionsIO::Library library) .withDefault(false) ? bout::OptionsIO::FileMode::append : bout::OptionsIO::FileMode::replace; - auto io = OptionsIOFactory(getOutputFilename(options, library), mode, library); + // Note: `options` contains the data to write. + // Get the output file from the `Options::root()` input settings. + auto io = OptionsIOFactory(getOutputFilename(Options::root(), library), mode, library); io->write(options); } From 85aea5a31a88837b80cb7e068513965997a3b4af Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Mon, 2 Oct 2023 17:07:55 -0700 Subject: [PATCH 16/46] configure.ac: Add BOUT_HAS_ADIOS Using autoconf this should be defined, but is always "no" Haven't yet regenerated configure script --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index 0bacd1097a..9fd1a6a945 100644 --- a/configure.ac +++ b/configure.ac @@ -1350,11 +1350,13 @@ BOUT_HAS_CUDA="no" BOUT_HAS_RAJA="no" BOUT_HAS_UMPIRE="no" BOUT_HAS_CALIPER="no" +BOUT_HAS_ADIOS="no" BOUT_DEFINE_SUBST(BOUT_HAS_CUDA, [Enable CUDA]) BOUT_DEFINE_SUBST(BOUT_HAS_RAJA, [RAJA support]) BOUT_DEFINE_SUBST(BOUT_HAS_UMPIRE, [Umpire support]) BOUT_DEFINE_SUBST(BOUT_HAS_CALIPER, [Caliper support]) +BOUT_DEFINE_SUBST(BOUT_HAS_ADIOS, [ADIOS support]) ############################################################# # Write configuration to bout-config From 115ed0ac58afeb44acacb8e70516f607834c246a Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Mon, 2 Oct 2023 17:42:21 -0700 Subject: [PATCH 17/46] Update configure script --- autoconf_build_defines.hxx.in | 123 ++++++++++++++++++++++++++++++++-- configure | 40 +++++++---- 2 files changed, 147 insertions(+), 16 deletions(-) diff --git a/autoconf_build_defines.hxx.in b/autoconf_build_defines.hxx.in index a1f23082a1..7dc2daf5d2 100644 --- a/autoconf_build_defines.hxx.in +++ b/autoconf_build_defines.hxx.in @@ -3,12 +3,18 @@ /* Runtime error checking level */ #undef BOUT_CHECK_LEVEL +/* ADIOS support */ +#undef BOUT_HAS_ADIOS + /* ARKODE support */ #undef BOUT_HAS_ARKODE /* Caliper support */ #undef BOUT_HAS_CALIPER +/* Enable CUDA */ +#undef BOUT_HAS_CUDA + /* CVODE support */ #undef BOUT_HAS_CVODE @@ -75,9 +81,6 @@ /* Enable color logs option */ #undef BOUT_USE_COLOR -/* Enable CUDA */ -#undef BOUT_HAS_CUDA - /* Is the metric field 3D */ #undef BOUT_USE_METRIC_3D @@ -99,4 +102,116 @@ /* Enable field name tracking */ #undef BOUT_USE_TRACK -// NOTE TO DEVELOPERS: PLEASE KEEP THIS LINE AND DELETE AUTOGENERATED CONTENT BELOW! +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* Define to 1 if you have the `backtrace' function. */ +#undef HAVE_BACKTRACE + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYCURRENT + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#undef HAVE_CFPREFERENCESCOPYAPPVALUE + +/* define if the compiler supports basic C++14 syntax */ +#undef HAVE_CXX14 + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define if you have the iconv() function and it works. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the MPI library. */ +#undef HAVE_MPI + +/* Define to 1 if you have the `popen' function. */ +#undef HAVE_POPEN + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#undef HAVE_REALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to rpl_realloc if the replacement function should be used. */ +#undef realloc diff --git a/configure b/configure index 359fd6d7a9..e2af9bd42f 100755 --- a/configure +++ b/configure @@ -677,6 +677,7 @@ BOUT_INCLUDE_PATH BOUT_LIB_PATH CONFIG_LDFLAGS CONFIG_CFLAGS +BOUT_HAS_ADIOS BOUT_HAS_CALIPER BOUT_HAS_UMPIRE BOUT_HAS_RAJA @@ -2402,6 +2403,8 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ./configure is deprecated and will be removed in a future version, please use CMake instead" >&5 $as_echo "$as_me: WARNING: ./configure is deprecated and will be removed in a future version, please use CMake instead" >&2;} @@ -7909,8 +7912,8 @@ else pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PETSc >= 3.4.0 " >&5 -$as_echo_n "checking for PETSc >= 3.4.0 ... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PETSC" >&5 +$as_echo_n "checking for PETSC... " >&6; } if test -n "$PETSC_CFLAGS"; then pkg_cv_PETSC_CFLAGS="$PETSC_CFLAGS" @@ -7950,7 +7953,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -7969,8 +7972,8 @@ fi pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for petsc >= 3.4.0 " >&5 -$as_echo_n "checking for petsc >= 3.4.0 ... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PETSC" >&5 +$as_echo_n "checking for PETSC... " >&6; } if test -n "$PETSC_CFLAGS"; then pkg_cv_PETSC_CFLAGS="$PETSC_CFLAGS" @@ -8010,7 +8013,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -8035,7 +8038,7 @@ fi " "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "--with-petsc was specified but could not find PETSc distribution. @@ -8054,13 +8057,13 @@ $as_echo "yes" >&6; } fi elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for petsc >= 3.4.0 " >&5 -$as_echo_n "checking for petsc >= 3.4.0 ... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PETSC" >&5 +$as_echo_n "checking for PETSC... " >&6; } if test -n "$PETSC_CFLAGS"; then pkg_cv_PETSC_CFLAGS="$PETSC_CFLAGS" @@ -8100,7 +8103,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -8125,7 +8128,7 @@ fi " "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "--with-petsc was specified but could not find PETSc distribution. @@ -15268,6 +15271,7 @@ BOUT_HAS_CUDA="no" BOUT_HAS_RAJA="no" BOUT_HAS_UMPIRE="no" BOUT_HAS_CALIPER="no" +BOUT_HAS_ADIOS="no" if test "x$BOUT_HAS_CUDA" = "xyes"; then : @@ -15318,6 +15322,18 @@ fi +if test "x$BOUT_HAS_ADIOS" = "xyes"; then : + +$as_echo "#define BOUT_HAS_ADIOS 1" >>confdefs.h + +else + +$as_echo "#define BOUT_HAS_ADIOS 0" >>confdefs.h + +fi + + + ############################################################# # Write configuration to bout-config ############################################################# From 0db37d650ac4706583e53f57a2cb1ff6feda3fbf Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Mon, 2 Oct 2023 17:54:28 -0700 Subject: [PATCH 18/46] Trying again with autoreconf Generated new configure script, updated autoconf_build_defines.hxx.in --- configure | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/configure b/configure index e2af9bd42f..7944667781 100755 --- a/configure +++ b/configure @@ -1,6 +1,10 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. +<<<<<<< HEAD # Generated by GNU Autoconf 2.69 for BOUT++ 5.1.0. +======= +# Generated by GNU Autoconf 2.69 for BOUT++ 5.0.0. +>>>>>>> a889598fd (Trying again with autoreconf) # # Report bugs to . # @@ -681,7 +685,11 @@ BOUT_HAS_ADIOS BOUT_HAS_CALIPER BOUT_HAS_UMPIRE BOUT_HAS_RAJA +<<<<<<< HEAD BOUT_HAS_CUDA +======= +BOUT_USE_CUDA +>>>>>>> a889598fd (Trying again with autoreconf) LTLIBOBJS POSUB LTLIBINTL @@ -1618,7 +1626,11 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +<<<<<<< HEAD BOUT++ configure 5.1.0 +======= +BOUT++ configure 5.0.0 +>>>>>>> a889598fd (Trying again with autoreconf) generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2025,7 +2037,11 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. +<<<<<<< HEAD It was created by BOUT++ $as_me 5.1.0, which was +======= +It was created by BOUT++ $as_me 5.0.0, which was +>>>>>>> a889598fd (Trying again with autoreconf) generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -14453,7 +14469,11 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" +<<<<<<< HEAD This file was extended by BOUT++ $as_me 5.1.0, which was +======= +This file was extended by BOUT++ $as_me 5.0.0, which was +>>>>>>> a889598fd (Trying again with autoreconf) generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14514,7 +14534,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ +<<<<<<< HEAD BOUT++ config.status 5.1.0 +======= +BOUT++ config.status 5.0.0 +>>>>>>> a889598fd (Trying again with autoreconf) configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -15274,6 +15298,7 @@ BOUT_HAS_CALIPER="no" BOUT_HAS_ADIOS="no" +<<<<<<< HEAD if test "x$BOUT_HAS_CUDA" = "xyes"; then : $as_echo "#define BOUT_HAS_CUDA 1" >>confdefs.h @@ -15281,6 +15306,15 @@ $as_echo "#define BOUT_HAS_CUDA 1" >>confdefs.h else $as_echo "#define BOUT_HAS_CUDA 0" >>confdefs.h +======= +if test "x$BOUT_USE_CUDA" = "xyes"; then : + +$as_echo "#define BOUT_USE_CUDA 1" >>confdefs.h + +else + +$as_echo "#define BOUT_USE_CUDA 0" >>confdefs.h +>>>>>>> a889598fd (Trying again with autoreconf) fi @@ -16225,7 +16259,11 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" +<<<<<<< HEAD This file was extended by BOUT++ $as_me 5.1.0, which was +======= +This file was extended by BOUT++ $as_me 5.0.0, which was +>>>>>>> a889598fd (Trying again with autoreconf) generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16295,7 +16333,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ +<<<<<<< HEAD BOUT++ config.status 5.1.0 +======= +BOUT++ config.status 5.0.0 +>>>>>>> a889598fd (Trying again with autoreconf) configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" From 88eb401a825d54ab868c03acf2fb901876eb8865 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Tue, 3 Oct 2023 15:38:04 -0700 Subject: [PATCH 19/46] Autoconf build: Add options_io.cxx Needs to be added to the makefile to be built. --- src/sys/options/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sys/options/makefile b/src/sys/options/makefile index e38608b68c..f8f0c76f69 100644 --- a/src/sys/options/makefile +++ b/src/sys/options/makefile @@ -1,5 +1,5 @@ BOUT_TOP = ../../.. -SOURCEC = options_ini.cxx options_netcdf.cxx +SOURCEC = options_ini.cxx options_netcdf.cxx options_io.cxx SOURCEH = $(SOURCEC:%.cxx=%.hxx) globals.hxx bout_types.hxx multiostream.hxx TARGET = lib From 37fbcd4881cbd9970b9a6cc02f3bc2e6b3f2d2e6 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Tue, 3 Oct 2023 18:27:37 -0700 Subject: [PATCH 20/46] test-options-adios requires ADIOS Add --has-adios option to bout-config, and require in test-options-adios integrated test. --- bin/bout-config.in | 7 +++++++ tests/integrated/test-options-adios/runtest | 1 + tests/integrated/test-options-adios/test-options-adios.cxx | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/bout-config.in b/bin/bout-config.in index 697d3ddc71..a9045fff39 100755 --- a/bin/bout-config.in +++ b/bin/bout-config.in @@ -29,6 +29,7 @@ idlpath="@IDLCONFIGPATH@" pythonpath="@PYTHONCONFIGPATH@" has_netcdf="@BOUT_HAS_NETCDF@" +has_adios="@BOUT_HAS_ADIOS@" has_legacy_netcdf="@BOUT_HAS_LEGACY_NETCDF@" has_pnetcdf="@BOUT_HAS_PNETCDF@" has_pvode="@BOUT_HAS_PVODE@" @@ -71,6 +72,7 @@ Available values for OPTION include: --python Python path --has-netcdf NetCDF file support + --has-adios ADIOS file support --has-legacy-netcdf Legacy NetCDF file support --has-pnetcdf Parallel NetCDF file support --has-pvode PVODE solver support @@ -109,6 +111,7 @@ all() echo " --python -> $pythonpath" echo echo " --has-netcdf -> $has_netcdf" + echo " --has-adios -> $has_adios" echo " --has-legacy-netcdf -> $has_legacy_netcdf" echo " --has-pnetcdf -> $has_pnetcdf" echo " --has-pvode -> $has_pvode" @@ -197,6 +200,10 @@ while test $# -gt 0; do echo $has_netcdf ;; + --has-adios) + echo $has_adios + ;; + --has-legacy-netcdf) echo $has_legacy_netcdf ;; diff --git a/tests/integrated/test-options-adios/runtest b/tests/integrated/test-options-adios/runtest index 7a3541df2d..1621c686a3 100755 --- a/tests/integrated/test-options-adios/runtest +++ b/tests/integrated/test-options-adios/runtest @@ -2,6 +2,7 @@ # Note: This test requires NCDF4, whereas on Travis NCDF is used # requires: netcdf +# requires: adios # requires: not legacy_netcdf from boututils.datafile import DataFile diff --git a/tests/integrated/test-options-adios/test-options-adios.cxx b/tests/integrated/test-options-adios/test-options-adios.cxx index a293aeafc0..efd74344c0 100644 --- a/tests/integrated/test-options-adios/test-options-adios.cxx +++ b/tests/integrated/test-options-adios/test-options-adios.cxx @@ -22,7 +22,7 @@ int main(int argc, char** argv) { OptionsReader* reader = OptionsReader::getInstance(); reader->write(&values, "test-out.ini"); - // Write to a NetCDF file + // Write to ADIOS file OptionsADIOS("test-out.bp", bout::OptionsIO::FileMode::replace, true).write(values); /////////////////////////// From 59492bea2ca36214e6cb0256954fa811a5004fcd Mon Sep 17 00:00:00 2001 From: bendudson Date: Thu, 12 Oct 2023 14:41:14 +0000 Subject: [PATCH 21/46] Apply clang-format changes --- src/bout++.cxx | 6 +++--- src/mesh/impls/bout/boutmesh.cxx | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bout++.cxx b/src/bout++.cxx index 6de8798622..369497a154 100644 --- a/src/bout++.cxx +++ b/src/bout++.cxx @@ -650,7 +650,7 @@ void setupOutput(const std::string& data_dir, const std::string& log_file, int v { Output& output = *Output::getInstance(); if (MYPE == 0) { - output.enable(); // Enable writing to stdout + output.enable(); // Enable writing to stdout } else { output.disable(); // No writing to stdout } @@ -798,7 +798,7 @@ int BoutFinalise(bool write_settings) { bout::HypreLib::cleanup(); #if BOUT_HAS_ADIOS - bout::ADIOSFinalize(); + bout::ADIOSFinalize(); #endif // MPI communicator, including MPI_Finalize() @@ -1056,6 +1056,6 @@ void RunMetrics::writeProgress(BoutReal simtime, bool output_split) { 100. * wtime_comms / wtime, // Communications 100. * wtime_io / wtime, // I/O 100. * (wtime - wtime_io - wtime_rhs) - / wtime); // Everything else + / wtime); // Everything else } } diff --git a/src/mesh/impls/bout/boutmesh.cxx b/src/mesh/impls/bout/boutmesh.cxx index 4b5164d488..956aba0f79 100644 --- a/src/mesh/impls/bout/boutmesh.cxx +++ b/src/mesh/impls/bout/boutmesh.cxx @@ -333,7 +333,9 @@ void BoutMesh::setDerivedGridSizes() { } GlobalNx = nx; - GlobalNy = ny + 2 * MYG; // Note: For double null this should be be 4 * MYG if boundary cells are stored + GlobalNy = + ny + + 2 * MYG; // Note: For double null this should be be 4 * MYG if boundary cells are stored GlobalNz = nz; // If we've got a second pair of diverator legs, we need an extra From e444b86254c426e7b42d1bf2016719cfc0c433da Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Wed, 25 Oct 2023 15:07:18 -0700 Subject: [PATCH 22/46] hypre3d: Remove reference to datafile Removed, replaced with OptionsNetCDF method. --- src/invert/laplace/impls/hypre3d/hypre3d_laplace.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/invert/laplace/impls/hypre3d/hypre3d_laplace.cxx b/src/invert/laplace/impls/hypre3d/hypre3d_laplace.cxx index f99a8a8020..c3e9c5b90c 100644 --- a/src/invert/laplace/impls/hypre3d/hypre3d_laplace.cxx +++ b/src/invert/laplace/impls/hypre3d/hypre3d_laplace.cxx @@ -39,7 +39,6 @@ #include #include #include -#include LaplaceHypre3d::LaplaceHypre3d(Options* opt, const CELL_LOC loc, Mesh* mesh_in, Solver* solver) @@ -146,14 +145,12 @@ LaplaceHypre3d::LaplaceHypre3d(Options* opt, const CELL_LOC loc, Mesh* mesh_in, } // FIXME: This needs to be converted to outputVars - if (solver == nullptr or dump == nullptr) { - output_warn << "Warning: Need to pass both a Solver and a Datafile to " + if (solver == nullptr) { + output_warn << "Warning: Need to pass a Solver to " "Laplacian::create() to get iteration counts in the output." << endl; } else { solver->addMonitor(&monitor); - auto name = opt->name(); - dump->addRepeat(average_iterations, name + "_average_iterations"); } } From 546fbb6601e020d305133fdb3476be929526bb97 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Wed, 25 Oct 2023 15:11:38 -0700 Subject: [PATCH 23/46] hypre3d: Replace finite() with std::isfinite() Deprecated, Clang prints warnings on MacOS --- .../laplace/impls/hypre3d/hypre3d_laplace.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/invert/laplace/impls/hypre3d/hypre3d_laplace.cxx b/src/invert/laplace/impls/hypre3d/hypre3d_laplace.cxx index c3e9c5b90c..c74e184be3 100644 --- a/src/invert/laplace/impls/hypre3d/hypre3d_laplace.cxx +++ b/src/invert/laplace/impls/hypre3d/hypre3d_laplace.cxx @@ -40,6 +40,8 @@ #include #include +#include + LaplaceHypre3d::LaplaceHypre3d(Options* opt, const CELL_LOC loc, Mesh* mesh_in, Solver* solver) : Laplacian(opt, loc, mesh_in), A(0.0), C1(1.0), C2(1.0), D(1.0), Ex(0.0), Ez(0.0), @@ -179,41 +181,41 @@ Field3D LaplaceHypre3d::solve(const Field3D& b_in, const Field3D& x0) { // boundary cells are finite BOUT_FOR_SERIAL(i, indexer->getRegionInnerX()) { const BoutReal val = (inner_boundary_flags & INVERT_SET) ? x0[i] : 0.; - ASSERT1(finite(val)); + ASSERT1(std::isfinite(val)); if (!(inner_boundary_flags & INVERT_RHS)) { b[i] = val; } else { - ASSERT1(finite(b[i])); + ASSERT1(std::isfinite(b[i])); } } BOUT_FOR_SERIAL(i, indexer->getRegionOuterX()) { const BoutReal val = (outer_boundary_flags & INVERT_SET) ? x0[i] : 0.; - ASSERT1(finite(val)); + ASSERT1(std::isfinite(val)); if (!(outer_boundary_flags & INVERT_RHS)) { b[i] = val; } else { - ASSERT1(finite(b[i])); + ASSERT1(std::isfinite(b[i])); } } BOUT_FOR_SERIAL(i, indexer->getRegionLowerY()) { const BoutReal val = (lower_boundary_flags & INVERT_SET) ? x0[i] : 0.; - ASSERT1(finite(val)); + ASSERT1(std::isfinite(val)); if (!(lower_boundary_flags & INVERT_RHS)) { b[i] = val; } else { - ASSERT1(finite(b[i])); + ASSERT1(std::isfinite(b[i])); } } BOUT_FOR_SERIAL(i, indexer->getRegionUpperY()) { const BoutReal val = (upper_boundary_flags & INVERT_SET) ? x0[i] : 0.; - ASSERT1(finite(val)); + ASSERT1(std::isfinite(val)); if (!(upper_boundary_flags & INVERT_RHS)) { b[i] = val; } else { - ASSERT1(finite(b[i])); + ASSERT1(std::isfinite(b[i])); } } CALI_MARK_END("LaplaceHypre3d_solve:AdjustBoundary"); From 78919ecca10ed317aadeb74601adb2d0976fb9fc Mon Sep 17 00:00:00 2001 From: Giorgis Georgakoudis Date: Wed, 8 Nov 2023 12:56:59 -0800 Subject: [PATCH 24/46] Add BOUT_HOST_DEVICE to accessor operators for GPU --- include/bout/field_accessor.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/bout/field_accessor.hxx b/include/bout/field_accessor.hxx index 16661a0e75..69b58da979 100644 --- a/include/bout/field_accessor.hxx +++ b/include/bout/field_accessor.hxx @@ -39,9 +39,9 @@ struct BoutRealArray { /// Cast operators, so can be assigned to a raw pointer /// Note: Not explicit, so can be cast implicitly - operator BoutReal*() { return data; } + BOUT_HOST_DEVICE operator BoutReal*() { return data; } - operator const BoutReal*() const { return data; } + BOUT_HOST_DEVICE operator const BoutReal*() const { return data; } }; /// Thin wrapper around field data, for fast but unsafe access From 6b47853d8884fd5865eb798bef6994ca88cb28f8 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Mon, 30 Oct 2023 09:39:22 +0000 Subject: [PATCH 25/46] CI: Replace pip script with requirements.txt - Don't pin pip and setuptools versions - Bump netcdf4 and Cython - Install boututils and boutdata --- .github/workflows/tests.yml | 5 ++--- .pip_install_for_ci.sh | 20 -------------------- requirements.txt | 6 ++++-- 3 files changed, 6 insertions(+), 25 deletions(-) delete mode 100755 .pip_install_for_ci.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6aaedb5804..148b6e17db 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -185,9 +185,8 @@ jobs: - name: Install pip packages run: | - ./.pip_install_for_ci.sh 'cython~=0.29' 'netcdf4~=1.5' 'sympy~=1.5' 'gcovr' 'cmake' zoidberg fastcov - # Add the pip install location to the runner's PATH - echo ~/.local/bin >> $GITHUB_PATH + python -m pip install --upgrade pip setuptools + python -m pip install -r requirements.txt - name: Cache SUNDIALS build uses: actions/cache@v3 diff --git a/.pip_install_for_ci.sh b/.pip_install_for_ci.sh deleted file mode 100755 index 4a5258cc2d..0000000000 --- a/.pip_install_for_ci.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -set -e - -export PATH=${HOME}/.local/bin:${PATH} -pip3 install --user --upgrade pip~=20.0 setuptools~=46.1 -pip3 install --user --upgrade scipy~=1.4 numpy~=1.18 natsort~=8.1.0 -for package in $@ -do - if test $package == "cython" - then - # fast install Cython - pip3 install --user Cython --install-option="--no-cython-compile" - elif test $package == "something_else" - then - pip3 install what_we_need - else - pip3 install --user $package - fi -done diff --git a/requirements.txt b/requirements.txt index 03f43a92d2..75358b10db 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,8 @@ Jinja2>=2.11.3 numpy>=1.14.1 scipy>=1.0.0 -netcdf4>=1.3.1 +netcdf4~=1.6.0 matplotlib>=2.0.0 -Cython>=0.29.0 +Cython~=3.0.0 +boututils~=0.2.1 +boutdata~=0.2.1 From 8ce97599c34edd77659455e731c027b0748ce42c Mon Sep 17 00:00:00 2001 From: David Bold Date: Mon, 6 Nov 2023 17:04:13 +0100 Subject: [PATCH 26/46] Set oversubscribe flags for openmpi 5 --- .ci_fedora.sh | 1 + .github/workflows/tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.ci_fedora.sh b/.ci_fedora.sh index 0774000b9c..452afb4b7e 100755 --- a/.ci_fedora.sh +++ b/.ci_fedora.sh @@ -56,6 +56,7 @@ else . /etc/profile.d/modules.sh module load mpi/${1}-x86_64 export OMPI_MCA_rmaps_base_oversubscribe=yes + export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe export TRAVIS=true export FLEXIBLAS=NETLIB cd diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 148b6e17db..1083c5e059 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,6 +28,7 @@ jobs: OMP_NUM_THREADS: ${{ matrix.config.omp_num_threads }} PYTHONPATH: ${{ github.workspace }}/tools/pylib OMPI_MCA_rmaps_base_oversubscribe: yes + PRTE_MCA_rmaps_default_mapping_policy: ":oversubscribe" MPIRUN: mpiexec -np strategy: fail-fast: true From ec60cd5ffa945dd2b3f382986fcca8b7441a8636 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Tue, 5 Dec 2023 11:33:38 -0500 Subject: [PATCH 27/46] remove files that are removed in next --- autoconf_build_defines.hxx.in | 217 - configure | 17331 -------------------------------- configure.ac | 1501 --- src/sys/options/makefile | 7 - 4 files changed, 19056 deletions(-) delete mode 100644 autoconf_build_defines.hxx.in delete mode 100755 configure delete mode 100644 configure.ac delete mode 100644 src/sys/options/makefile diff --git a/autoconf_build_defines.hxx.in b/autoconf_build_defines.hxx.in deleted file mode 100644 index 7dc2daf5d2..0000000000 --- a/autoconf_build_defines.hxx.in +++ /dev/null @@ -1,217 +0,0 @@ -/* autoconf_build_defines.hxx.in. Generated from configure.ac by autoheader. */ - -/* Runtime error checking level */ -#undef BOUT_CHECK_LEVEL - -/* ADIOS support */ -#undef BOUT_HAS_ADIOS - -/* ARKODE support */ -#undef BOUT_HAS_ARKODE - -/* Caliper support */ -#undef BOUT_HAS_CALIPER - -/* Enable CUDA */ -#undef BOUT_HAS_CUDA - -/* CVODE support */ -#undef BOUT_HAS_CVODE - -/* FFTW support */ -#undef BOUT_HAS_FFTW - -/* NLS support */ -#undef BOUT_HAS_GETTEXT - -/* Hypre support */ -#undef BOUT_HAS_HYPRE - -/* IDA support */ -#undef BOUT_HAS_IDA - -/* LAPACK support */ -#undef BOUT_HAS_LAPACK - -/* NETCDF support */ -#undef BOUT_HAS_LEGACY_NETCDF - -/* NETCDF support */ -#undef BOUT_HAS_NETCDF - -/* PETSc support */ -#undef BOUT_HAS_PETSC - -/* PNETCDF support */ -#undef BOUT_HAS_PNETCDF - -/* Compiler PRETTYFUNCTION support */ -#undef BOUT_HAS_PRETTY_FUNCTION - -/* PVODE support */ -#undef BOUT_HAS_PVODE - -/* RAJA support */ -#undef BOUT_HAS_RAJA - -/* Score-P support */ -#undef BOUT_HAS_SCOREP - -/* SLEPc support */ -#undef BOUT_HAS_SLEPC - -/* SUNDIALS support */ -#undef BOUT_HAS_SUNDIALS - -/* Umpire support */ -#undef BOUT_HAS_UMPIRE - -/* Use libuuid for UUID generation */ -#undef BOUT_HAS_UUID_SYSTEM_GENERATOR - -/* Type of the metric fields */ -#undef BOUT_METRIC_TYPE - -/* OpenMP schedule */ -#undef BOUT_OPENMP_SCHEDULE - -/* Enable backtrace in exceptions */ -#undef BOUT_USE_BACKTRACE - -/* Enable color logs option */ -#undef BOUT_USE_COLOR - -/* Is the metric field 3D */ -#undef BOUT_USE_METRIC_3D - -/* Enable MsgStack for traces */ -#undef BOUT_USE_MSGSTACK - -/* Enable OpenMP */ -#undef BOUT_USE_OPENMP - -/* Enabled extra debug output */ -#undef BOUT_USE_OUTPUT_DEBUG - -/* Enable floating point exceptions */ -#undef BOUT_USE_SIGFPE - -/* Enable signal handlers */ -#undef BOUT_USE_SIGNAL - -/* Enable field name tracking */ -#undef BOUT_USE_TRACK - -/* Define to 1 if translation of program messages to the user's native - language is requested. */ -#undef ENABLE_NLS - -/* Define to 1 if you have the `backtrace' function. */ -#undef HAVE_BACKTRACE - -/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -#undef HAVE_CFLOCALECOPYCURRENT - -/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in - the CoreFoundation framework. */ -#undef HAVE_CFPREFERENCESCOPYAPPVALUE - -/* define if the compiler supports basic C++14 syntax */ -#undef HAVE_CXX14 - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -#undef HAVE_DCGETTEXT - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the header file. */ -#undef HAVE_EXECINFO_H - -/* Define if the GNU gettext() function is already present or preinstalled. */ -#undef HAVE_GETTEXT - -/* Define if you have the iconv() function and it works. */ -#undef HAVE_ICONV - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the MPI library. */ -#undef HAVE_MPI - -/* Define to 1 if you have the `popen' function. */ -#undef HAVE_POPEN - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#undef HAVE_REALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc diff --git a/configure b/configure deleted file mode 100755 index 7944667781..0000000000 --- a/configure +++ /dev/null @@ -1,17331 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -<<<<<<< HEAD -# Generated by GNU Autoconf 2.69 for BOUT++ 5.1.0. -======= -# Generated by GNU Autoconf 2.69 for BOUT++ 5.0.0. ->>>>>>> a889598fd (Trying again with autoreconf) -# -# Report bugs to . -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org and bd512@york.ac.uk -$0: about your system, including any error possibly output -$0: before this message. Then install a modern shell, or -$0: manually run the script under such a shell if you do -$0: have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='BOUT++' -PACKAGE_TARNAME='bout--' -PACKAGE_VERSION='5.1.0' -PACKAGE_STRING='BOUT++ 5.1.0' -PACKAGE_BUGREPORT='bd512@york.ac.uk' -PACKAGE_URL='' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -gt_needs= -ac_subst_vars='SLEPC_ARCH -SLEPC_DIR -SLEPC_MAKE_INCLUDE -PETSC_ARCH -PETSC_DIR -PETSC_MAKE_INCLUDE -PETSC_HAS_SUNDIALS -BOUT_METRIC_TYPE -BOUT_USE_MSGSTACK -BOUT_USE_TRACK -BOUT_USE_SIGNAL -BOUT_USE_SIGFPE -BOUT_USE_OPENMP -BOUT_USE_OUTPUT_DEBUG -BOUT_USE_COLOR -BOUT_USE_BACKTRACE -BOUT_HAS_UUID_SYSTEM_GENERATOR -BOUT_HAS_SUNDIALS -BOUT_HAS_SLEPC -BOUT_HAS_SCOREP -BOUT_HAS_PVODE -BOUT_HAS_PRETTY_FUNCTION -BOUT_HAS_PNETCDF -BOUT_HAS_HYPRE -BOUT_HAS_PETSC -BOUT_HAS_LEGACY_NETCDF -BOUT_HAS_NETCDF -BOUT_HAS_LAPACK -BOUT_HAS_IDA -BOUT_HAS_GETTEXT -BOUT_HAS_FFTW -BOUT_HAS_CVODE -BOUT_HAS_ARKODE -BOUT_OPENMP_SCHEDULE -BOUT_CHECK_LEVEL -BOUT_REVISION -BOUT_VERSION_TAG -BOUT_VERSION_PATCH -BOUT_VERSION_MINOR -BOUT_VERSION_MAJOR -BOUT_VERSION -SHARED_EXTRA -STATIC_EXTRA -LIB_TO_BUILD -PYTHONCONFIGPATH -IDLCONFIGPATH -PREFIX -OWN_MPARK -MPARK_INCLUDE -MPARK_VARIANT_INCLUDE_PATH -FMT_INCLUDE_PATH -BOUT_INCLUDE_PATH -BOUT_LIB_PATH -CONFIG_LDFLAGS -CONFIG_CFLAGS -BOUT_HAS_ADIOS -BOUT_HAS_CALIPER -BOUT_HAS_UMPIRE -BOUT_HAS_RAJA -<<<<<<< HEAD -BOUT_HAS_CUDA -======= -BOUT_USE_CUDA ->>>>>>> a889598fd (Trying again with autoreconf) -LTLIBOBJS -POSUB -LTLIBINTL -LIBINTL -INTLLIBS -LTLIBICONV -LIBICONV -INTL_MACOSX_LIBS -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -ac_ct_CC -CFLAGS -CC -XGETTEXT_EXTRA_OPTIONS -MSGMERGE -XGETTEXT_015 -XGETTEXT -GMSGFMT_015 -MSGFMT_015 -GMSGFMT -MSGFMT -GETTEXT_MACRO_VERSION -USE_NLS -SCOREPPATH -sundials_config -PETSC_LIBS -PETSC_CFLAGS -PKG_CONFIG_LIBDIR -PKG_CONFIG_PATH -PKG_CONFIG -NCMPIDUMP_PATH -NCCONF -fftw_path -works -COVERAGE_FLAGS -CODE_COVERAGE_RULES -CODE_COVERAGE_LDFLAGS -CODE_COVERAGE_LIBS -CODE_COVERAGE_CXXFLAGS -CODE_COVERAGE_CFLAGS -CODE_COVERAGE_CPPFLAGS -GENHTML -LCOV -GCOV -CODE_COVERAGE_ENABLED -CODE_COVERAGE_ENABLED_FALSE -CODE_COVERAGE_ENABLED_TRUE -SED -OPENMP_CXXFLAGS -LIBOBJS -EGREP -GREP -CXXCPP -HAVE_CXX14 -ARFLAGS -RANLIB -MAKE -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -SET_MAKE -LN_S -OBJEXT -EXEEXT -ac_ct_CXX -CPPFLAGS -CXX -ac_ct_MPICXX -MPICXX -PRECON_SOURCE -MKDIR_P -LDFLAGS -CXXFLAGS -EXTRA_LIBS -EXTRA_INCS -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_netcdf -with_pnetcdf -with_ida -with_cvode -with_sundials -with_fftw -with_lapack -with_petsc -with_slepc -with_pvode -with_arkode -with_scorep -with_hypre -with_system_mpark -with_system_uuid -enable_warnings -enable_checks -enable_msgstack -enable_signal -enable_color -enable_track -enable_debug -enable_output_debug -enable_optimize -enable_sigfpe -enable_backtrace -enable_shared -enable_static -enable_openmp -with_openmp_schedule -enable_pvode_openmp -enable_metric_3d -with_gcov -enable_code_coverage -enable_nls -with_gnu_ld -enable_rpath -with_libiconv_prefix -with_libintl_prefix -' - ac_precious_vars='build_alias -host_alias -target_alias -EXTRA_INCS -EXTRA_LIBS -CXXFLAGS -LDFLAGS -LIBS -MPICXX -CXX -CPPFLAGS -CCC -CXXCPP -PKG_CONFIG -PKG_CONFIG_PATH -PKG_CONFIG_LIBDIR -PETSC_CFLAGS -PETSC_LIBS -CC -CFLAGS' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures BOUT++ 5.1.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/bout--] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of BOUT++ 5.1.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-warnings Disable compiler warnings - --enable-checks=no/1/2/3 - Set run-time checking level - --enable-msgstack=no/yes - Enable MstStack for backtrace. Default based on - check level. - --disable-signal Disable SEGFAULT handling - --disable-color Disable -c option to color output - --enable-track Enable variable tracking - --enable-debug Enable all debugging flags - --enable-output-debug Enable some extra debugging output - --enable-optimize=no/1/2/3/4 - Enable optimization - --enable-sigfpe Enable FloatingPointExceptions - --disable-backtrace Disable function backtrace - --enable-shared Enable building bout++ into an shared object - --enable-static Enable building bout++ into an static library - --enable-openmp Enable building with OpenMP support - --enable-pvode-openmp Enable building PVODE with OpenMP support - --enable-metric-3d Use Field3D to store coordinates metric data - --disable-openmp do not use OpenMP - --enable-code-coverage Whether to enable code coverage support - --disable-nls do not use Native Language Support - --disable-rpath do not hardcode runtime library paths - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-netcdf Enable support for netCDF files - --with-pnetcdf Set path to Parallel NetCDF library - --with-ida=/path/to/ida Use the SUNDIALS IDA solver - --with-cvode Use the SUNDIALS CVODE solver - --with-sundials Use CVODE and IDA - --with-fftw Set directory of FFTW3 library - --with-lapack Use the LAPACK library - --with-petsc Enable PETSc interface - --with-slepc Enable SLEPc interface - --with-pvode Build and enable PVODE 98 (DEFAULT) - --with-arkode Use the SUNDIALS ARKODE solver - --with-scorep Enable support for scorep based instrumentation - --with-hypre Enable support for HYPRE - --with-system-mpark Use mpark.variant already installed rather then the - bundled one - --with-system-uuid Use libuuid to generate UUIDs - --with-openmp-schedule=static/dynamic/guided/auto - Set OpenMP schedule (default: static) - --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib - --without-libiconv-prefix don't search for libiconv in includedir and libdir - --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib - --without-libintl-prefix don't search for libintl in includedir and libdir - -Some influential environment variables: - EXTRA_INCS Extra compile flags - EXTRA_LIBS Extra linking flags - CXXFLAGS Extra compile flags - LDFLAGS Extra linking flags - LIBS Extra linking libraries - MPICXX MPI C++ compiler command - CXX C++ compiler command - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CXXCPP C++ preprocessor - PKG_CONFIG path to pkg-config utility - PKG_CONFIG_PATH - directories to add to pkg-config's search path - PKG_CONFIG_LIBDIR - path overriding pkg-config's built-in search path - PETSC_CFLAGS - C compiler flags for PETSC, overriding pkg-config - PETSC_LIBS linker flags for PETSC, overriding pkg-config - CC C compiler command - CFLAGS C compiler flags - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -<<<<<<< HEAD -BOUT++ configure 5.1.0 -======= -BOUT++ configure 5.0.0 ->>>>>>> a889598fd (Trying again with autoreconf) -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_link - -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_cpp - -# ac_fn_cxx_try_run LINENO -# ------------------------ -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_cxx_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_run - -# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES -# --------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_cxx_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------- ## -## Report this to bd512@york.ac.uk ## -## ------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_header_mongrel - -# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES -# --------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_cxx_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_header_compile - -# ac_fn_cxx_check_func LINENO FUNC VAR -# ------------------------------------ -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_cxx_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_cxx_check_func - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -<<<<<<< HEAD -It was created by BOUT++ $as_me 5.1.0, which was -======= -It was created by BOUT++ $as_me 5.0.0, which was ->>>>>>> a889598fd (Trying again with autoreconf) -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -gt_needs="$gt_needs " -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_aux_dir= -for ac_dir in build-aux "$srcdir"/build-aux; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ./configure is deprecated and will be removed in a future version, please use CMake instead" >&5 -$as_echo "$as_me: WARNING: ./configure is deprecated and will be removed in a future version, please use CMake instead" >&2;} - - -# Check whether --with-netcdf was given. -if test "${with_netcdf+set}" = set; then : - withval=$with_netcdf; -fi - - -# Check whether --with-pnetcdf was given. -if test "${with_pnetcdf+set}" = set; then : - withval=$with_pnetcdf; -fi - - -# Check whether --with-ida was given. -if test "${with_ida+set}" = set; then : - withval=$with_ida; -fi - - -# Check whether --with-cvode was given. -if test "${with_cvode+set}" = set; then : - withval=$with_cvode; -fi - - -# Check whether --with-sundials was given. -if test "${with_sundials+set}" = set; then : - withval=$with_sundials; -fi - - -# Check whether --with-fftw was given. -if test "${with_fftw+set}" = set; then : - withval=$with_fftw; -fi - - -# Check whether --with-lapack was given. -if test "${with_lapack+set}" = set; then : - withval=$with_lapack; -else - with_lapack=guess -fi - - -# Check whether --with-petsc was given. -if test "${with_petsc+set}" = set; then : - withval=$with_petsc; -else - with_petsc=no -fi - - -# Check whether --with-slepc was given. -if test "${with_slepc+set}" = set; then : - withval=$with_slepc; -else - with_slepc=no -fi - - -# Check whether --with-pvode was given. -if test "${with_pvode+set}" = set; then : - withval=$with_pvode; -fi - - -# Check whether --with-arkode was given. -if test "${with_arkode+set}" = set; then : - withval=$with_arkode; -fi - - -# Check whether --with-scorep was given. -if test "${with_scorep+set}" = set; then : - withval=$with_scorep; -else - with_scorep=no -fi - - -# Check whether --with-hypre was given. -if test "${with_hypre+set}" = set; then : - withval=$with_hypre; -else - with_hypre=no -fi - - - -# Check whether --with-system_mpark was given. -if test "${with_system_mpark+set}" = set; then : - withval=$with_system_mpark; -else - with_system_mpark=auto -fi - - -# Check whether --with-system_uuid was given. -if test "${with_system_uuid+set}" = set; then : - withval=$with_system_uuid; -else - with_system_uuid=auto -fi - - -# Check whether --enable-warnings was given. -if test "${enable_warnings+set}" = set; then : - enableval=$enable_warnings; -fi - -# Check whether --enable-checks was given. -if test "${enable_checks+set}" = set; then : - enableval=$enable_checks; -else - enable_checks=default -fi - -# Check whether --enable-msgstack was given. -if test "${enable_msgstack+set}" = set; then : - enableval=$enable_msgstack; -else - enable_msgstack=maybe -fi - -# Check whether --enable-signal was given. -if test "${enable_signal+set}" = set; then : - enableval=$enable_signal; -fi - -# Check whether --enable-color was given. -if test "${enable_color+set}" = set; then : - enableval=$enable_color; -fi - -# Check whether --enable-track was given. -if test "${enable_track+set}" = set; then : - enableval=$enable_track; -fi - -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : - enableval=$enable_debug; -fi - -# Check whether --enable-output_debug was given. -if test "${enable_output_debug+set}" = set; then : - enableval=$enable_output_debug; -fi - -# Check whether --enable-optimize was given. -if test "${enable_optimize+set}" = set; then : - enableval=$enable_optimize; -fi - -# Check whether --enable-sigfpe was given. -if test "${enable_sigfpe+set}" = set; then : - enableval=$enable_sigfpe; -fi - -# Check whether --enable-backtrace was given. -if test "${enable_backtrace+set}" = set; then : - enableval=$enable_backtrace; -else - enable_backtrace=maybe -fi - -# Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; -else - enable_shared=no -fi - -# Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; -else - enable_static=auto -fi - -# Check whether --enable-openmp was given. -if test "${enable_openmp+set}" = set; then : - enableval=$enable_openmp; -else - enable_openmp=no -fi - - -# Check whether --with-openmp_schedule was given. -if test "${with_openmp_schedule+set}" = set; then : - withval=$with_openmp_schedule; -else - with_openmp_schedule=static -fi - -# Check whether --enable-pvode_openmp was given. -if test "${enable_pvode_openmp+set}" = set; then : - enableval=$enable_pvode_openmp; -else - enable_pvode_openmp=no -fi - -# Check whether --enable-metric_3d was given. -if test "${enable_metric_3d+set}" = set; then : - enableval=$enable_metric_3d; -else - enable_metric_3d=no -fi - - - - - -file_formats="" # Record which file formats are being supported - -# Delete the build log from last time -rm -f config-build.log - -# only keep BOUT related undefs -if ! grep -q 'NOTE TO DEVEL' autoconf_build_defines.hxx.in ; then - grep 'undef BOUT' -B 4 -A 1 autoconf_build_defines.hxx.in > autoconf_build_defines.hxx.in.tmp - echo '// NOTE TO DEVELOPERS: PLEASE KEEP THIS LINE AND DELETE AUTOGENERATED CONTENT BELOW!' >> autoconf_build_defines.hxx.in.tmp - mv autoconf_build_defines.hxx.in.tmp autoconf_build_defines.hxx.in -fi - - - - - -LIBS="$LIBS $LDLIBS" - - - - - -# Adding variables for additional sources - - -# We're using C++ -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -############################################################# -# Checks for programs -############################################################# - -# Autoconf inserts "-g -O2" into flags by default -# Set them to be just "-g", but only if the user hasn't already set CXXFLAGS -# We then put "-O2" back in later, assuming optimisations aren't explicitly disabled -: ${CXXFLAGS="-g"} - -# Search for MPI compiler; fail if not found - - - _ax_prog_cxx_mpi_mpi_wanted=yes - if test x"$_ax_prog_cxx_mpi_mpi_wanted" = xyes; then - if test -n "$ac_tool_prefix"; then - for ac_prog in mpic++ mpicxx mpiCC sxmpic++ hcp mpxlC_r mpxlC mpixlcxx_r mpixlcxx mpg++ mpc++ mpCC cmpic++ mpiFCC CCicpc pgCC pathCC sxc++ xlC_r xlC bgxlC_r bgxlC openCC sunCC crayCC aCC CC g++ c++ gpp cxx cc++ cl.exe FCC KCC RCC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MPICXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MPICXX"; then - ac_cv_prog_MPICXX="$MPICXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MPICXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MPICXX=$ac_cv_prog_MPICXX -if test -n "$MPICXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPICXX" >&5 -$as_echo "$MPICXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MPICXX" && break - done -fi -if test -z "$MPICXX"; then - ac_ct_MPICXX=$MPICXX - for ac_prog in mpic++ mpicxx mpiCC sxmpic++ hcp mpxlC_r mpxlC mpixlcxx_r mpixlcxx mpg++ mpc++ mpCC cmpic++ mpiFCC CCicpc pgCC pathCC sxc++ xlC_r xlC bgxlC_r bgxlC openCC sunCC crayCC aCC CC g++ c++ gpp cxx cc++ cl.exe FCC KCC RCC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MPICXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MPICXX"; then - ac_cv_prog_ac_ct_MPICXX="$ac_ct_MPICXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MPICXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MPICXX=$ac_cv_prog_ac_ct_MPICXX -if test -n "$ac_ct_MPICXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MPICXX" >&5 -$as_echo "$ac_ct_MPICXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_MPICXX" && break -done - - if test "x$ac_ct_MPICXX" = x; then - MPICXX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MPICXX=$ac_ct_MPICXX - fi -fi - - CXX="$MPICXX" - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 -$as_echo_n "checking whether the C++ compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C++ compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 -$as_echo_n "checking for C++ compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C++ compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - - - -# Check for compiler -# Needs to be split off into an extra macro to ensure right expansion -# order. - - -if test x"$_ax_prog_cxx_mpi_mpi_wanted" = xno; then : - _ax_prog_cxx_mpi_mpi_found=no -else - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - # test whether MPI_Init() is available - # We do not use AC_SEARCH_LIBS here, as it caches its outcome and - # thus disallows corresponding calls in the other AX_PROG_*_MPI - # macros. - for lib in NONE mpi mpich; do - save_LIBS=$LIBS - if test x"$lib" = xNONE; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for function MPI_Init" >&5 -$as_echo_n "checking for function MPI_Init... " >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for function MPI_Init in -l$lib" >&5 -$as_echo_n "checking for function MPI_Init in -l$lib... " >&6; } - LIBS="-l$lib $LIBS" - fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -extern "C" { void MPI_Init(); } - -int -main () -{ -MPI_Init(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - _ax_prog_cxx_mpi_mpi_found=yes -else - _ax_prog_cxx_mpi_mpi_found=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_ax_prog_cxx_mpi_mpi_found" >&5 -$as_echo "$_ax_prog_cxx_mpi_mpi_found" >&6; } - if test "x$_ax_prog_cxx_mpi_mpi_found" = "xyes"; then - break; - fi - LIBS=$save_LIBS - done - - # Check for header - if test x"$_ax_prog_cxx_mpi_mpi_found" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpi.h" >&5 -$as_echo_n "checking for mpi.h... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - _ax_prog_cxx_mpi_mpi_found=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -fi - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$_ax_prog_cxx_mpi_mpi_found" = xyes; then : - - -$as_echo "#define HAVE_MPI 1" >>confdefs.h - - : - -else - - - as_fn_error $? "*** An MPI compiler is required. You might need to set MPICXX correctly." "$LINENO" 5 - - : - -fi - - - -# Utility programs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -# Set MAKE to gmake if possible, otherwise make -# Extract the first word of "gmake", so it can be a program name with args. -set dummy gmake; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MAKE+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MAKE"; then - ac_cv_prog_MAKE="$MAKE" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MAKE="gmake" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_MAKE" && ac_cv_prog_MAKE="make" -fi -fi -MAKE=$ac_cv_prog_MAKE -if test -n "$MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 -$as_echo "$MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - - - - -ARFLAGS='' -for flag in cruU cru -do - echo 1 > artest1 - ar $flag artest artest1 &&ar $flag artest artest1 - arexit=$? - rm -f artest1 artest - if test $arexit -eq 0 - then - ARFLAGS="$flag" - break; - fi -done -test -z $ARFLAGS && as_fn_error $? "Failed to find suitable flags for ar" "$LINENO" 5 - -# Check for and enable C++14 support -# Error if not supported - ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=true - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_success=no - - - - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do - cachevar=`$as_echo "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 -$as_echo_n "checking whether $CXX supports C++14 features with $switch... " >&6; } -if eval \${$cachevar+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; - - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - - - - -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201402L - -#error "This is not a C++14 compiler" - -#else - -namespace cxx14 -{ - - namespace test_polymorphic_lambdas - { - - int - test() - { - const auto lambda = [](auto&&... args){ - const auto istiny = [](auto x){ - return (sizeof(x) == 1UL) ? 1 : 0; - }; - const int aretiny[] = { istiny(args)... }; - return aretiny[0]; - }; - return lambda(1, 1L, 1.0f, '1'); - } - - } - - namespace test_binary_literals - { - - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); - - } - - namespace test_generalized_constexpr - { - - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept - { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); - - } - - namespace test_lambda_init_capture - { - - int - test() - { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); - } - - } - - namespace test_digit_separators - { - - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); - - } - - namespace test_return_type_deduction - { - - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } - - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; - - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; - - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } - - } - -} // namespace cxx14 - -#endif // __cplusplus >= 201402L - - - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - eval $cachevar=yes -else - eval $cachevar=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXX="$ac_save_CXX" -fi -eval ac_res=\$$cachevar - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - if test x$ax_cxx_compile_cxx14_required = xtrue; then - if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5 - fi - fi - if test x$ac_success = xno; then - HAVE_CXX14=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5 -$as_echo "$as_me: No compiler with C++14 support was found" >&6;} - else - HAVE_CXX14=1 - -$as_echo "#define HAVE_CXX14 1" >>confdefs.h - - fi - - - -############################################################# -# STD Library functions -############################################################# - -# Checks for libraries. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 -$as_echo_n "checking for sqrt in -lm... " >&6; } -if ${ac_cv_lib_m_sqrt+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char sqrt (); -int -main () -{ -return sqrt (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_m_sqrt=yes -else - ac_cv_lib_m_sqrt=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5 -$as_echo "$ac_cv_lib_m_sqrt" >&6; } -if test "x$ac_cv_lib_m_sqrt" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF - - LIBS="-lm $LIBS" - -fi - - -# Checks for header files. -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in malloc.h stdlib.h string.h strings.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for library functions. -for ac_header in stdlib.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -$as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if ${ac_cv_func_malloc_0_nonnull+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_malloc_0_nonnull=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif - -int -main () -{ -return ! malloc (0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - ac_cv_func_malloc_0_nonnull=yes -else - ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then : - -$as_echo "#define HAVE_MALLOC 1" >>confdefs.h - -else - $as_echo "#define HAVE_MALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac - - -$as_echo "#define malloc rpl_malloc" >>confdefs.h - -fi - - -for ac_header in stdlib.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 -$as_echo_n "checking for GNU libc compatible realloc... " >&6; } -if ${ac_cv_func_realloc_0_nonnull+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_realloc_0_nonnull=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *realloc (); -#endif - -int -main () -{ -return ! realloc (0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - ac_cv_func_realloc_0_nonnull=yes -else - ac_cv_func_realloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } -if test $ac_cv_func_realloc_0_nonnull = yes; then : - -$as_echo "#define HAVE_REALLOC 1" >>confdefs.h - -else - $as_echo "#define HAVE_REALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" realloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS realloc.$ac_objext" - ;; -esac - - -$as_echo "#define realloc rpl_realloc" >>confdefs.h - -fi - - -for ac_func in vprintf -do : - ac_fn_cxx_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" -if test "x$ac_cv_func_vprintf" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VPRINTF 1 -_ACEOF - -ac_fn_cxx_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" -if test "x$ac_cv_func__doprnt" = xyes; then : - -$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h - -fi - -fi -done - - - -# Check for OpenMP support -: ${enable_openmp=no} # Disable by default - - OPENMP_CXXFLAGS= - # Check whether --enable-openmp was given. -if test "${enable_openmp+set}" = set; then : - enableval=$enable_openmp; -fi - - if test "$enable_openmp" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CXX option to support OpenMP" >&5 -$as_echo_n "checking for $CXX option to support OpenMP... " >&6; } -if ${ac_cv_prog_cxx_openmp+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifndef _OPENMP - choke me -#endif -#include -int main () { return omp_get_num_threads (); } - -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_prog_cxx_openmp='none needed' -else - ac_cv_prog_cxx_openmp='unsupported' - for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \ - -Popenmp --openmp; do - ac_save_CXXFLAGS=$CXXFLAGS - CXXFLAGS="$CXXFLAGS $ac_option" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifndef _OPENMP - choke me -#endif -#include -int main () { return omp_get_num_threads (); } - -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_prog_cxx_openmp=$ac_option -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CXXFLAGS=$ac_save_CXXFLAGS - if test "$ac_cv_prog_cxx_openmp" != unsupported; then - break - fi - done -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_openmp" >&5 -$as_echo "$ac_cv_prog_cxx_openmp" >&6; } - case $ac_cv_prog_cxx_openmp in #( - "none needed" | unsupported) - ;; #( - *) - OPENMP_CXXFLAGS=$ac_cv_prog_cxx_openmp ;; - esac - fi - - -BOUT_USE_OPENMP=$enable_openmp - -BOUT_OPENMP_SCHEDULE=$with_openmp_schedule - -# Check if we have access to __PRETTY_FUNCTION__ - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking does C++ compiler support __PRETTY_FUNCTION__" >&5 -$as_echo_n "checking does C++ compiler support __PRETTY_FUNCTION__... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -const char* name = __PRETTY_FUNCTION__; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - BOUT_HAS_PRETTY_FUNCTION=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - BOUT_HAS_PRETTY_FUNCTION=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - -############################################################# -# Code coverage using gcov -# -# Mutally exclusive with optimisation, therefore needs to come first -# so we can turn off optimisation if coverage is enabled -############################################################# - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - - - - - # allow to override gcov location - -# Check whether --with-gcov was given. -if test "${with_gcov+set}" = set; then : - withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov -else - _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 -$as_echo_n "checking whether to build with code coverage support... " >&6; } - # Check whether --enable-code-coverage was given. -if test "${enable_code_coverage+set}" = set; then : - enableval=$enable_code_coverage; -else - enable_code_coverage=no -fi - - - if test x$enable_code_coverage = xyes; then - CODE_COVERAGE_ENABLED_TRUE= - CODE_COVERAGE_ENABLED_FALSE='#' -else - CODE_COVERAGE_ENABLED_TRUE='#' - CODE_COVERAGE_ENABLED_FALSE= -fi - - CODE_COVERAGE_ENABLED=$enable_code_coverage - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 -$as_echo "$enable_code_coverage" >&6; } - - if test "$enable_code_coverage" = "yes" ; then : - - # check for gcov - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. -set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GCOV+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$GCOV"; then - ac_cv_prog_GCOV="$GCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -GCOV=$ac_cv_prog_GCOV -if test -n "$GCOV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 -$as_echo "$GCOV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_GCOV"; then - ac_ct_GCOV=$GCOV - # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. -set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_GCOV+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_GCOV"; then - ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV -if test -n "$ac_ct_GCOV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 -$as_echo "$ac_ct_GCOV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_GCOV" = x; then - GCOV=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - GCOV=$ac_ct_GCOV - fi -else - GCOV="$ac_cv_prog_GCOV" -fi - - if test "X$GCOV" = "X:"; then : - as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5 -fi - - - if test "$GCC" = "no" ; then : - - as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5 - -fi - - # Extract the first word of "lcov", so it can be a program name with args. -set dummy lcov; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LCOV+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LCOV"; then - ac_cv_prog_LCOV="$LCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LCOV="lcov" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LCOV=$ac_cv_prog_LCOV -if test -n "$LCOV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 -$as_echo "$LCOV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - # Extract the first word of "genhtml", so it can be a program name with args. -set dummy genhtml; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GENHTML+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$GENHTML"; then - ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GENHTML="genhtml" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -GENHTML=$ac_cv_prog_GENHTML -if test -n "$GENHTML"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 -$as_echo "$GENHTML" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - if test -z "$LCOV" ; then : - - as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5 - -fi - - if test -z "$GENHTML" ; then : - - as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 - -fi - - CODE_COVERAGE_CPPFLAGS="-DNDEBUG" - CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_LIBS="-lgcov" - CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" - - - - - - - - CODE_COVERAGE_RULES_CAPTURE=' - @$(LCOV) --quiet $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --no-external --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --no-checksum $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) - @$(LCOV) --quiet $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) - -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - @LANG=C $(GENHTML) --quiet $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --demangle-cpp --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "BOUT++ Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) - @$(LCOV) --summary $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_LCOV_OPTIONS) - @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" -' - CODE_COVERAGE_RULES_CLEAN=' -clean:: code-coverage-clean -distclean:: code-coverage-clean -code-coverage-clean: - -@$(LCOV) --directory $(abs_builddir) -z --quiet - -@$(RM) -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -@find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete -' - -else - - CODE_COVERAGE_RULES_CHECK=' - @echo "Need to reconfigure with --enable-code-coverage" -' - CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" - CODE_COVERAGE_RULES_CLEAN='' - -fi - -CODE_COVERAGE_RULES=' -# Code coverage -# -# Optional: -# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. -# Multiple directories may be specified, separated by whitespace. -# (Default: $(top_builddir)) -# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated -# by lcov for code coverage. (Default: -# bout-coverage.info) -# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage -# reports to be created. (Default: -# bout-coverage) -# - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, -# set to 0 to disable it and leave empty to stay with the default. -# (Default: empty) -# - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov -# instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) -# - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov -# instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) -# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov -# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the -# collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov -# instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -# - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering -# lcov instance. (Default: empty) -# - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov -# instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) -# - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the -# genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) -# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml -# instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) -# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore -# -# The generated report will be titled using the $(PACKAGE_NAME) and -# $(PACKAGE_VERSION). In order to add the current git hash to the title, -# use the git-version-gen script, available online. - -# Optional variables -CODE_COVERAGE_DIRECTORY ?= $(abs_builddir) -CODE_COVERAGE_OUTPUT_FILE ?= bout-coverage.info -CODE_COVERAGE_OUTPUT_DIRECTORY ?= bout-coverage -CODE_COVERAGE_BRANCH_COVERAGE ?= -CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ ---rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) -CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" -CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= -CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) -CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ -$(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ ---rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) -CODE_COVERAGE_IGNORE_PATTERN ?= "*test*/*" - -# Use recursive makes in order to ignore errors during check -check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' - -# Capture code coverage data -code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' - -# Hook rule executed before code-coverage-capture, overridable by the user -code-coverage-capture-hook: - -'"$CODE_COVERAGE_RULES_CLEAN"' - -GITIGNOREFILES ?= -GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean -' - - - -if test "x$enable_code_coverage" = "xyes"; then : - - if test "x$enable_optimize"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Code coverage clashes with optimisations, disabling optimisations" >&5 -$as_echo "$as_me: WARNING: Code coverage clashes with optimisations, disabling optimisations" >&2;} - enable_optimize="no" - -fi - COVERAGE_FLAGS="--coverage --no-inline" - LDFLAGS="$LDFLAGS --coverage" - -else - - COVERAGE_FLAGS= - -fi - - -############################################################# -# General Options -############################################################# - -# Always pass -Werror=unknown-warning-option to get Clang to fail on bad -# flags, otherwise they are always appended to the warn_cxxflags variable, -# and Clang warns on them for every compilation unit. -# If this is passed to GCC, it will explode, so the flag must be enabled -# conditionally. -# This check taken from AX_COMPILER_FLAGS_CXXFLAGS -extra_compiler_flags_test="" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Werror=unknown-warning-option" >&5 -$as_echo_n "checking whether C++ compiler accepts -Werror=unknown-warning-option... " >&6; } -if ${ax_cv_check_cxxflags___Werror_unknown_warning_option+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_check_save_flags=$CXXFLAGS - CXXFLAGS="$CXXFLAGS -Werror=unknown-warning-option" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ax_cv_check_cxxflags___Werror_unknown_warning_option=yes -else - ax_cv_check_cxxflags___Werror_unknown_warning_option=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXXFLAGS=$ax_check_save_flags -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Werror_unknown_warning_option" >&5 -$as_echo "$ax_cv_check_cxxflags___Werror_unknown_warning_option" >&6; } -if test "x$ax_cv_check_cxxflags___Werror_unknown_warning_option" = xyes; then : - - extra_compiler_flags_test="-Werror=unknown-warning-option" - -else - : -fi - -# A similar check to above, but for Intel. -we is undocumented, but -# the equivalent (?) -diag-error gets accepted by GCC. 10006 is -# "unknown option", and 10148 is the more recent "unknown warning -# option" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -we10006,10148" >&5 -$as_echo_n "checking whether C++ compiler accepts -we10006,10148... " >&6; } -if ${ax_cv_check_cxxflags___we10006_10148+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_check_save_flags=$CXXFLAGS - CXXFLAGS="$CXXFLAGS -we10006,10148" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ax_cv_check_cxxflags___we10006_10148=yes -else - ax_cv_check_cxxflags___we10006_10148=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXXFLAGS=$ax_check_save_flags -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___we10006_10148" >&5 -$as_echo "$ax_cv_check_cxxflags___we10006_10148" >&6; } -if test "x$ax_cv_check_cxxflags___we10006_10148" = xyes; then : - - extra_compiler_flags_test="-we10006,10148" - -else - : -fi - - -if test "x$enable_warnings" != "xno"; then : - -# Some hopefully sensible default compiler warning flags - - - - - -for flag in -Wall -Wextra -Wnull-dereference ; do - as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags_$extra_compiler_flags_test_$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_check_save_flags=$CXXFLAGS - CXXFLAGS="$CXXFLAGS $extra_compiler_flags_test $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - eval "$as_CACHEVAR=yes" -else - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXXFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : - -if ${CXXFLAGS+:} false; then : - - case " $CXXFLAGS " in #( - *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains \$flag"; } >&5 - (: CXXFLAGS already contains $flag) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append CXXFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS\""; } >&5 - (: CXXFLAGS="$CXXFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else - - CXXFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS\""; } >&5 - (: CXXFLAGS="$CXXFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else - : -fi - -done - - -# Note we explicitly turn off -Wcast-function-type as PETSc *requires* -# we cast a function to the wrong type in MatFDColoringSetFunction - -# Also note that gcc ignores unknown flags of the form "-Wno-warning" -# for backwards compatibility. Therefore we need to add the positive -# form as an additional flag which it will choke on (if it doesn't -# exist). See: https://gcc.gnu.org/wiki/FAQ#wnowarning - - - - - -for flag in -Wno-cast-function-type ; do - as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags_$extra_compiler_flags_test "-Wcast-function-type"_$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_check_save_flags=$CXXFLAGS - CXXFLAGS="$CXXFLAGS $extra_compiler_flags_test "-Wcast-function-type" $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - eval "$as_CACHEVAR=yes" -else - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXXFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : - -if ${CXXFLAGS+:} false; then : - - case " $CXXFLAGS " in #( - *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains \$flag"; } >&5 - (: CXXFLAGS already contains $flag) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append CXXFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS\""; } >&5 - (: CXXFLAGS="$CXXFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else - - CXXFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS\""; } >&5 - (: CXXFLAGS="$CXXFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else - : -fi - -done - - - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Compiler warnings disabled" >&5 -$as_echo "$as_me: Compiler warnings disabled" >&6;} - -fi - -OPT_FLAGS="" -enable_checks_def=2 -if test "$enable_debug" != ""; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling all debug options" >&5 -$as_echo "$as_me: Enabling all debug options" >&6;} - enable_checks_def=3 - # use -Og with available, otherwise fall back to -O0 - OPT_FLAGS="-g -O0 -Og -fno-inline -hipa1" - -else - - if test "x$enable_optimize" != "xno"; then : - - case "$enable_optimize" in #( - "default" | "yes" | "") : - { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling default optimisations" >&5 -$as_echo "$as_me: Enabling default optimisations" >&6;} - OPT_FLAGS="-O2" ;; #( - "fast" | "4") : - { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling level 4 optimisations" >&5 -$as_echo "$as_me: Enabling level 4 optimisations" >&6;} - OPT_FLAGS="-Ofast -fno-finite-math-only -march=native -funroll-loops" - enable_checks_def=0 ;; #( - "3") : - { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling level 3 optimisations" >&5 -$as_echo "$as_me: Enabling level 3 optimisations" >&6;} - OPT_FLAGS="-O3 -march=native -funroll-loops" - enable_checks_def=0 ;; #( - "2") : - { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling level 2 optimisations" >&5 -$as_echo "$as_me: Enabling level 2 optimisations" >&6;} - OPT_FLAGS="-O2 -march=native" - enable_checks_def=1 ;; #( - "1" | "0") : - { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling level $enable_optimize optimisations" >&5 -$as_echo "$as_me: Enabling level $enable_optimize optimisations" >&6;} - OPT_FLAGS="-O$enable_optimize" ;; #( - *) : - - as_fn_error $? "unrecognized option: --enable-optimize=$enable_optimize" "$LINENO" 5 - ;; -esac - -else - OPT_FLAGS="" -fi - -fi - -# Append optimisation/debug flags if they work with this compiler - - - - -for flag in $OPT_FLAGS ; do - as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags_$extra_compiler_flags_test_$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_check_save_flags=$CXXFLAGS - CXXFLAGS="$CXXFLAGS $extra_compiler_flags_test $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - eval "$as_CACHEVAR=yes" -else - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXXFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : - -if ${CXXFLAGS+:} false; then : - - case " $CXXFLAGS " in #( - *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains \$flag"; } >&5 - (: CXXFLAGS already contains $flag) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append CXXFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS\""; } >&5 - (: CXXFLAGS="$CXXFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else - - CXXFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS\""; } >&5 - (: CXXFLAGS="$CXXFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else - : -fi - -done - - -# Disable checks if optimization > 2 is used -if test "x$enable_checks" = "xdefault" ; then : - - enable_checks=$enable_checks_def - -fi - -BOUT_CHECK_LEVEL=0 -if test "x$enable_checks" != "xno" && test "x$enable_checks" != "x0"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Run-time checking enabled" >&5 -$as_echo "$as_me: Run-time checking enabled" >&6;} - case $enable_checks in #( - 1) : - { $as_echo "$as_me:${as_lineno-$LINENO}: -> Level 1 (Basic checking)" >&5 -$as_echo "$as_me: -> Level 1 (Basic checking)" >&6;} - CXXFLAGS="$CXXFLAGS -DCHECK=1" - BOUT_CHECK_LEVEL=1 ;; #( - 3) : - { $as_echo "$as_me:${as_lineno-$LINENO}: -> Level 3 (Full checking)" >&5 -$as_echo "$as_me: -> Level 3 (Full checking)" >&6;} - enable_output_debug=yes - CXXFLAGS="$CXXFLAGS -DCHECK=3" - BOUT_CHECK_LEVEL=3 ;; #( - *) : - { $as_echo "$as_me:${as_lineno-$LINENO}: -> Level 2 (Enhanced checking)" >&5 -$as_echo "$as_me: -> Level 2 (Enhanced checking)" >&6;} - CXXFLAGS="$CXXFLAGS -DCHECK=2" - BOUT_CHECK_LEVEL=2 ;; -esac - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Run-time checking disabled" >&5 -$as_echo "$as_me: Run-time checking disabled" >&6;} - -fi - -BOUT_USE_MSGSTACK=$(test $BOUT_CHECK_LEVEL -gt 1 && echo yes || echo no) -if test "x$enable_msgstack" = "xyes" ; then : - - BOUT_USE_MSGSTACK=yes - -else - - if test "x$enable_msgstack" = "xno" ; then : - - BOUT_USE_MSGSTACK=no - -fi - -fi -if test $BOUT_USE_MSGSTACK = no ; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Stack tracing disabled" >&5 -$as_echo "$as_me: Stack tracing disabled" >&6;} - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Stack tracing enabled" >&5 -$as_echo "$as_me: Stack tracing enabled" >&6;} - -fi - -BOUT_USE_SIGNAL=no -if test "x$enable_signal" != "xno"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Segmentation fault handling enabled" >&5 -$as_echo "$as_me: Segmentation fault handling enabled" >&6;} - BOUT_USE_SIGNAL=yes - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Segmentation fault handling disabled" >&5 -$as_echo "$as_me: Segmentation fault handling disabled" >&6;} - -fi - -BOUT_USE_COLOR=no -if test "x$enable_color" != "xno"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Output coloring enabled" >&5 -$as_echo "$as_me: Output coloring enabled" >&6;} - BOUT_USE_COLOR=yes - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Output coloring disabled" >&5 -$as_echo "$as_me: Output coloring disabled" >&6;} - -fi - -BOUT_USE_TRACK=no -if test "x$enable_track" = "xyes"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Field name tracking enabled" >&5 -$as_echo "$as_me: Field name tracking enabled" >&6;} - BOUT_USE_TRACK=yes - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Field name tracking disabled" >&5 -$as_echo "$as_me: Field name tracking disabled" >&6;} - -fi - -BOUT_USE_SIGFPE=no -if test "x$enable_sigfpe" = "xyes"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Signaling floating point exceptions enabled" >&5 -$as_echo "$as_me: Signaling floating point exceptions enabled" >&6;} - BOUT_USE_SIGFPE=yes - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Signaling floating point exceptions disabled" >&5 -$as_echo "$as_me: Signaling floating point exceptions disabled" >&6;} - -fi - -BOUT_USE_OUTPUT_DEBUG=no -if test "x$enable_output_debug" = "xyes"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Extra debug output enabled" >&5 -$as_echo "$as_me: Extra debug output enabled" >&6;} - BOUT_USE_OUTPUT_DEBUG=yes - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Extra debug output disabled" >&5 -$as_echo "$as_me: Extra debug output disabled" >&6;} - -fi - -BOUT_VERSION=$PACKAGE_VERSION -BOUT_VERSION_MAJOR=$(echo $PACKAGE_VERSION | cut -d. -f1) -BOUT_VERSION_MINOR=$(echo $PACKAGE_VERSION | cut -d. -f2) -BOUT_VERSION_PATCH=$(echo ${PACKAGE_VERSION%-*} | cut -d. -f3) -BOUT_VERSION_TAG=$(echo $PACKAGE_VERSION | cut -d- -f2) - -############################################################# -# Enable Backtrace if possible -############################################################# - -BOUT_USE_BACKTRACE=no -if test "x$enable_backtrace" = "xyes" || test "x$enable_backtrace" = "xmaybe"; then : - - # Extract the first word of "addr2line", so it can be a program name with args. -set dummy addr2line; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$works"; then - ac_cv_prog_works="$works" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_works="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_works" && ac_cv_prog_works="no" -fi -fi -works=$ac_cv_prog_works -if test -n "$works"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $works" >&5 -$as_echo "$works" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - if test $works = yes; then : - - for ac_func in popen backtrace -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - works=yes -else - works=no; break -fi -done - - -fi - - if test $works = yes; then : - - for ac_header in execinfo.h dlfcn.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - works=yes -else - works=no; break -fi - -done - - -fi - - if test $works = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dladdr" >&5 -$as_echo_n "checking for library containing dladdr... " >&6; } -if ${ac_cv_search_dladdr+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dladdr (); -int -main () -{ -return dladdr (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_search_dladdr=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_dladdr+:} false; then : - break -fi -done -if ${ac_cv_search_dladdr+:} false; then : - -else - ac_cv_search_dladdr=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dladdr" >&5 -$as_echo "$ac_cv_search_dladdr" >&6; } -ac_res=$ac_cv_search_dladdr -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - works=yes -else - works=no; break -fi - - -fi - - if test $works = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Native backtrace enabled" >&5 -$as_echo "$as_me: Native backtrace enabled" >&6;} - BOUT_USE_BACKTRACE=yes - -else - - if test "x$enable_backtrace" = "xyes"; then : - - as_fn_error $? "backtrace requested, but cannot be enabled" "$LINENO" 5 - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Native backtrace disabled" >&5 -$as_echo "$as_me: WARNING: Native backtrace disabled" >&2;} - -fi - -fi - -fi - -if test "x$enable_metric_3d" != "xno"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Using Field3D to store coordinates data, this is experimental." >&5 -$as_echo "$as_me: WARNING: Using Field3D to store coordinates data, this is experimental." >&2;} - BOUT_METRIC_TYPE="3D" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using Field2D to store coordinates data" >&5 -$as_echo "$as_me: Using Field2D to store coordinates data" >&6;} - BOUT_METRIC_TYPE="2D" - -fi - -############################################################# -# Build into shared object (pic) -############################################################# - -LIB_TO_BUILD='' -if test "x$enable_shared" = "xyes"; then : - - # compile as position independent code. - # -fpic is apparently faster then -fPIC, but -fPIC works always. - # From a SO comment (https://stackoverflow.com/a/3544211/3384414): - # What's more: I did a little experiment here (on x86_64 - # platform), -fPIC and -fpic appears to have generated the same - # code. It seems they generate a different code only on m68k, - # PowerPC and SPARC. - # Therfore use -fPIC for now - CXXFLAGS="$CXXFLAGS -fPIC" - LIB_TO_BUILD="$LIB_TO_BUILD"' $(BOUT_LIB_PATH)/libbout++.so' - if test "x$enable_static" = "xauto"; then : - - enable_static=no - -fi - SHARED_EXTRA=':' - if test "x$enable_static" = "xno"; then : - - SHARED_EXTRA='$(RM) -f $(BOUT_LIB_PATH)/libbout++.a' - -fi - -else - - if test "x$enable_static" = "xauto"; then : - - enable_static=yes - -fi - -fi - -if test "x$enable_static" = "xyes"; then : - - LIB_TO_BUILD="$LIB_TO_BUILD"' $(BOUT_LIB_PATH)/libbout++.a' - STATIC_EXTRA=':' - # In case we only build static, make sure shared libs are removed - if ! test "x$enable_shared" = "xyes"; then : - - STATIC_EXTRA='$(RM) -f $(BOUT_LIB_PATH)/*.so*' - -fi - -fi - -if test "x$LIB_TO_BUILD" = x ; then : - - as_fn_error $? "Need to enable at least one of static or shared!" "$LINENO" 5 - -fi - -############################################################# -# Git revision number -############################################################# - -rev=`git rev-parse HEAD` -if test $? = 0; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Git revision: $rev" >&5 -$as_echo "$as_me: Git revision: $rev" >&6;} - BOUT_REVISION=$rev - -else - - BOUT_REVISION= - -fi - -############################################################# -# FFT routines -############################################################# - -if test "x$with_fftw" != "xno"; then : - -# Extract the first word of "fftw-wisdom", so it can be a program name with args. -set dummy fftw-wisdom; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_fftw_path+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $fftw_path in - [\\/]* | ?:[\\/]*) - ac_cv_path_fftw_path="$fftw_path" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $with_fftw$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_fftw_path="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_fftw_path" && ac_cv_path_fftw_path="no" - ;; -esac -fi -fftw_path=$ac_cv_path_fftw_path -if test -n "$fftw_path"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fftw_path" >&5 -$as_echo "$fftw_path" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - if test "x$fftw_path" != "xno"; then : - - fftw_wisdom0=`$as_dirname -- "$fftw_path" || -$as_expr X"$fftw_path" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$fftw_path" : 'X\(//\)[^/]' \| \ - X"$fftw_path" : 'X\(//\)$' \| \ - X"$fftw_path" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$fftw_path" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - fftw_wisdom=`$as_dirname -- "$fftw_wisdom0" || -$as_expr X"$fftw_wisdom0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$fftw_wisdom0" : 'X\(//\)[^/]' \| \ - X"$fftw_wisdom0" : 'X\(//\)$' \| \ - X"$fftw_wisdom0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$fftw_wisdom0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - with_fftw="$with_fftw $fftw_wisdom" - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: FFTW3 requested but fftw-wisdom not found" >&5 -$as_echo "$as_me: FFTW3 requested but fftw-wisdom not found" >&6;} -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw3.h" >&5 -$as_echo_n "checking for fftw3.h... " >&6; } - - save_CPPFLAGS=$CPPFLAGS - BACH_found=no - - if test ."$with_fftw" != .yes; then : - extra_prefix="$with_fftw" -else - extra_prefix="" -fi - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - BACH_found=yes - - - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - if test $BACH_found != yes; then : - - for search_prefix in $extra_prefix /usr /opt $HOME $HOME/local /usr/local - do - for path in $search_prefix $search_prefix/include - do - if test -d $path; then : - - CPPFLAGS="$save_CPPFLAGS -I$path" - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - BACH_found=yes - EXTRA_INCS="$EXTRA_INCS -I$path" - - - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi - done - if test .$BACH_found = .yes; then : - break; -fi - done - -fi - - if test $BACH_found = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CPPFLAGS=$save_CPPFLAGS - -fi - if test .$BACH_found = .yes; then : - -else - as_fn_error $? "FFTW3 requested but header not found" "$LINENO" 5 -fi - - - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CPPFLAGS=$CPPFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfftw3" >&5 -$as_echo_n "checking for libfftw3... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - BACL_found=no - - # Try with no extra libraries first - if test ."$with_fftw" = .yes; then : - extra_prefix="" -else - extra_prefix="$with_fftw" -fi - LIBS="$save_LIBS $EXTRA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char fftw_plan_dft_r2c_1d(); - -int -main () -{ -return fftw_plan_dft_r2c_1d(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$save_LIBS - - # Now try with explicitly linking library - if test $BACL_found != yes; then : - - LIBS="$save_LIBS $EXTRA_LIBS -lfftw3" - if test ."$with_fftw" = .yes; then : - extra_prefix="" -else - extra_prefix="$with_fftw" -fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char fftw_plan_dft_r2c_1d(); - -int -main () -{ -return fftw_plan_dft_r2c_1d(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -lfftw3" - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - - if test $BACL_found != yes; then : - - for search_prefix in $extra_prefix /usr /opt $HOME $HOME/local /usr/local ; do - for path in $search_prefix $search_prefix/lib $search_prefix/lib64 $search_prefix/x86_64-linux-gnu - do - if test -d $path; then : - - LIBS="$save_LIBS $EXTRA_LIBS -lfftw3" - LDFLAGS="$save_LDFLAGS -L$path" - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char fftw_plan_dft_r2c_1d(); - -int -main () -{ -return fftw_plan_dft_r2c_1d(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -L$path -lfftw3" - - - break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - done - if test .$BACL_found = .yes; then : - break; -fi - done - -fi - - if test $BACL_found = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - if test $BACL_found = yes; then : - -else - as_fn_error $? "FFTW3 requested but library not found" "$LINENO" 5 -fi - - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CPPFLAGS=$save_CPPFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - BOUT_HAS_FFTW="yes" - -else - -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring without FFTW3 is not recommended" >&5 -$as_echo "$as_me: Configuring without FFTW3 is not recommended" >&6;} -BOUT_HAS_FFTW="no" - -fi - -############################################################# -# netCDF support -############################################################# - -NCCONF="" # Configuration script - -BOUT_HAS_NETCDF=no -BOUT_HAS_LEGACY_NETCDF=no -if test "x$with_netcdf" != "xno"; then : - - ########################################## - # Try to find a valid NetCDF configuration - # - # at first, try to find ncconf script - - # Search for NetCDF config scripts, prefer ncxx4-config over nc-config - # Check if the path to the config script has been supplied directly, otherwise - # check the path provided by --with-netcdf, appending "/bin" if need - # be, then check system path - # Set NCCONF to the full path of the found scropt - case `basename $with_netcdf 2> /dev/null` in #( - "ncxx4-config") : - NCCONF=$with_netcdf ;; #( - "nc-config") : - NCCONF=$with_netcdf ;; #( - *) : - for ac_prog in ncxx4-config nc-config -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NCCONF+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NCCONF in - [\\/]* | ?:[\\/]*) - ac_cv_path_NCCONF="$NCCONF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $with_netcdf$PATH_SEPARATOR$with_netcdf/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NCCONF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NCCONF=$ac_cv_path_NCCONF -if test -n "$NCCONF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NCCONF" >&5 -$as_echo "$NCCONF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NCCONF" && break -done - ;; -esac - - ########################################## - # Get configuration - if test "x$NCCONF" != "x" ; then : - - # If we found nc-config rather than ncxx4-config, we need to check if it supports C++ - if test `basename $NCCONF` = 'nc-config'; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $NCCONF has C++4 support" >&5 -$as_echo_n "checking if $NCCONF has C++4 support... " >&6; } - nc_has_cpp4=`$NCCONF --has-c++4` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $nc_has_cpp4" >&5 -$as_echo "$nc_has_cpp4" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $NCCONF has C++ support" >&5 -$as_echo_n "checking if $NCCONF has C++ support... " >&6; } - nc_has_cpp=`$NCCONF --has-c++` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $nc_has_cpp" >&5 -$as_echo "$nc_has_cpp" >&6; } - -else - - nc_has_cpp4="yes" - -fi - - NCINC=`$NCCONF --cflags` - EXTRA_INCS="$EXTRA_INCS $NCINC" - if test "x$nc_has_cpp4" = "xyes"; then : - - NCLIB=`$NCCONF --libs` - BOUT_HAS_NETCDF=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: -> NetCDF-4 support enabled" >&5 -$as_echo "$as_me: -> NetCDF-4 support enabled" >&6;} - -else - - # nc-config might not *say* it has C++ support, but we can try anyway - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can compile NetCDF with C++" >&5 -$as_echo_n "checking if we can compile NetCDF with C++... " >&6; } - # Note netcdf_c++ needed - NCLIB=`$NCCONF --libs | sed s/-lnetcdf/-lnetcdf_c++\ -lnetcdf/` - - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CXXFLAGS=$CXXFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - LIBS="$save_LIBS $NCLIB" - LDFLAGS="$save_LDFLAGS $NCLIB" - CXXFLAGS="$save_CXXFLAGS $NCINC" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ -NcFile file("foo.nc"); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: -> Legacy NetCDF support enabled" >&5 -$as_echo "$as_me: -> Legacy NetCDF support enabled" >&6;} -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "*** Could not compile NetCDF C++ program! -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CXXFLAGS="$save_CXXFLAGS" - BOUT_HAS_NETCDF=yes - BOUT_HAS_LEGACY_NETCDF=yes - -fi - EXTRA_LIBS="$EXTRA_LIBS $NCLIB" - - file_formats="$file_formats netCDF" - NCPATH="found" - NCFOUND=yes - -else - - # if nc-config / ncxx4-config is not found, try to find library directly - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for netcdfcpp.h" >&5 -$as_echo_n "checking for netcdfcpp.h... " >&6; } - - save_CPPFLAGS=$CPPFLAGS - BACH_found=no - - if test ."$with_netcdf" != .yes; then : - extra_prefix="$with_netcdf" -else - extra_prefix="" -fi - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - BACH_found=yes - - - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - if test $BACH_found != yes; then : - - for search_prefix in $extra_prefix /usr /opt $HOME $HOME/local /usr/local - do - for path in $search_prefix $search_prefix/include - do - if test -d $path; then : - - CPPFLAGS="$save_CPPFLAGS -I$path" - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - BACH_found=yes - EXTRA_INCS="$EXTRA_INCS -I$path" - - - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi - done - if test .$BACH_found = .yes; then : - break; -fi - done - -fi - - if test $BACH_found = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CPPFLAGS=$save_CPPFLAGS - -fi - if test .$BACH_found = .yes; then : - - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CPPFLAGS=$CPPFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnetcdf" >&5 -$as_echo_n "checking for libnetcdf... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - BACL_found=no - - # Try with no extra libraries first - if test ."$with_netcdf" = .yes; then : - extra_prefix="" -else - extra_prefix="$with_netcdf" -fi - LIBS="$save_LIBS $EXTRA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char nc_get_att(); - -int -main () -{ -return nc_get_att(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$save_LIBS - - # Now try with explicitly linking library - if test $BACL_found != yes; then : - - LIBS="$save_LIBS $EXTRA_LIBS -lnetcdf" - if test ."$with_netcdf" = .yes; then : - extra_prefix="" -else - extra_prefix="$with_netcdf" -fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char nc_get_att(); - -int -main () -{ -return nc_get_att(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -lnetcdf" - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - - if test $BACL_found != yes; then : - - for search_prefix in $extra_prefix /usr /opt $HOME $HOME/local /usr/local ; do - for path in $search_prefix $search_prefix/lib $search_prefix/lib64 $search_prefix/x86_64-linux-gnu - do - if test -d $path; then : - - LIBS="$save_LIBS $EXTRA_LIBS -lnetcdf" - LDFLAGS="$save_LDFLAGS -L$path" - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char nc_get_att(); - -int -main () -{ -return nc_get_att(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -L$path -lnetcdf" - - - break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - done - if test .$BACL_found = .yes; then : - break; -fi - done - -fi - - if test $BACL_found = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - if test $BACL_found = yes; then : - - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CPPFLAGS=$CPPFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnetcdf_c++" >&5 -$as_echo_n "checking for libnetcdf_c++... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - BACL_found=no - - # Try with no extra libraries first - if test ."$with_netcdf" = .yes; then : - extra_prefix="" -else - extra_prefix="$with_netcdf" -fi - LIBS="$save_LIBS $EXTRA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char nc_close(); - -int -main () -{ -return nc_close(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$save_LIBS - - # Now try with explicitly linking library - if test $BACL_found != yes; then : - - LIBS="$save_LIBS $EXTRA_LIBS -lnetcdf_c++" - if test ."$with_netcdf" = .yes; then : - extra_prefix="" -else - extra_prefix="$with_netcdf" -fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char nc_close(); - -int -main () -{ -return nc_close(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -lnetcdf_c++" - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - - if test $BACL_found != yes; then : - - for search_prefix in $extra_prefix /usr /opt $HOME $HOME/local /usr/local ; do - for path in $search_prefix $search_prefix/lib $search_prefix/lib64 $search_prefix/x86_64-linux-gnu - do - if test -d $path; then : - - LIBS="$save_LIBS $EXTRA_LIBS -lnetcdf_c++" - LDFLAGS="$save_LDFLAGS -L$path" - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char nc_close(); - -int -main () -{ -return nc_close(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -L$path -lnetcdf_c++" - - - break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - done - if test .$BACL_found = .yes; then : - break; -fi - done - -fi - - if test $BACL_found = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - if test $BACL_found = yes; then : - NCFOUND=yes -else - NCFOUND=no -fi - - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CPPFLAGS=$save_CPPFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -else - NCFOUND=no -fi - - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CPPFLAGS=$save_CPPFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -else - NCFOUND=no -fi - - - if test "x$NCFOUND" = "xyes"; then : - - file_formats="$file_formats netCDF" - { $as_echo "$as_me:${as_lineno-$LINENO}: -> Legacy NetCDF support enabled" >&5 -$as_echo "$as_me: -> Legacy NetCDF support enabled" >&6;} - NCPATH="found" - BOUT_HAS_NETCDF=yes - BOUT_HAS_LEGACY_NETCDF=yes - -fi - -fi - - if test $with_netcdf && test "x$NCFOUND" != "xyes" ; then : - as_fn_error $? "NetCDF requested but not found" "$LINENO" 5 -fi - if test "x$NCFOUND" != "xyes"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: -> NetCDF support disabled" >&5 -$as_echo "$as_me: -> NetCDF support disabled" >&6;} -fi - -fi - -############################################################# -# Parallel NetCDF support -############################################################# - -PNCPATH="" -if test "$with_pnetcdf" != "no" && test "x$with_pnetcdf" != "x" ; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Searching for Parallel-NetCDF library" >&5 -$as_echo "$as_me: Searching for Parallel-NetCDF library" >&6;} - - if test "x$with_pnetcdf" != "xyes"; then : - - # Given a path to the library - as_ac_File=`$as_echo "ac_cv_file_$with_pnetcdf/include/pnetcdf.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_pnetcdf/include/pnetcdf.h" >&5 -$as_echo_n "checking for $with_pnetcdf/include/pnetcdf.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_pnetcdf/include/pnetcdf.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_pnetcdf/include/pnetcdf.h" | $as_tr_cpp` 1 -_ACEOF -PNCPATH=$with_pnetcdf -else - { $as_echo "$as_me:${as_lineno-$LINENO}: parallel-netcdf not found in given directory" >&5 -$as_echo "$as_me: parallel-netcdf not found in given directory" >&6;} - -fi - - -fi - - # Find the utilities included with pnetcdf - if test "x$PNCPATH" = "x"; then : - - if test "x$with_pnetcdf" = "xyes"; then : - - # Extract the first word of "ncmpidump", so it can be a program name with args. -set dummy ncmpidump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NCMPIDUMP_PATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NCMPIDUMP_PATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_NCMPIDUMP_PATH="$NCMPIDUMP_PATH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NCMPIDUMP_PATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -NCMPIDUMP_PATH=$ac_cv_path_NCMPIDUMP_PATH -if test -n "$NCMPIDUMP_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NCMPIDUMP_PATH" >&5 -$as_echo "$NCMPIDUMP_PATH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -else - - # Extract the first word of "ncmpidump", so it can be a program name with args. -set dummy ncmpidump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NCMPIDUMP_PATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NCMPIDUMP_PATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_NCMPIDUMP_PATH="$NCMPIDUMP_PATH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NCMPIDUMP_PATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_NCMPIDUMP_PATH" && ac_cv_path_NCMPIDUMP_PATH="$with_pnetcdf$PATH_SEPARATOR$PATH" - ;; -esac -fi -NCMPIDUMP_PATH=$ac_cv_path_NCMPIDUMP_PATH -if test -n "$NCMPIDUMP_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NCMPIDUMP_PATH" >&5 -$as_echo "$NCMPIDUMP_PATH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -fi - if test "$NCMPIDUMP_PATH" != ""; then : - - as_ac_File=`$as_echo "ac_cv_file_$NCMPIDUMP_PATH/../include/pnetcdf.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $NCMPIDUMP_PATH/../include/pnetcdf.h" >&5 -$as_echo_n "checking for $NCMPIDUMP_PATH/../include/pnetcdf.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$NCMPIDUMP_PATH/../include/pnetcdf.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$NCMPIDUMP_PATH/../include/pnetcdf.h" | $as_tr_cpp` 1 -_ACEOF -PNCPATH=$NCMPIDUMP_PATH/../ -fi - - -fi - -fi - - if test "x$PNCPATH" != "x"; then : - - as_ac_File=`$as_echo "ac_cv_file_$path/lib/libpnetcdf.a" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $path/lib/libpnetcdf.a" >&5 -$as_echo_n "checking for $path/lib/libpnetcdf.a... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$path/lib/libpnetcdf.a"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$path/lib/libpnetcdf.a" | $as_tr_cpp` 1 -_ACEOF -PNCPATHLIB='lib' -else - as_ac_File=`$as_echo "ac_cv_file_$path/lib64/libpnetcdf.a" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $path/lib64/libpnetcdf.a" >&5 -$as_echo_n "checking for $path/lib64/libpnetcdf.a... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$path/lib64/libpnetcdf.a"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$path/lib64/libpnetcdf.a" | $as_tr_cpp` 1 -_ACEOF -PNCPATHLIB='lib64' -else - PNCPATH='' -fi - -fi - - -fi - - if test "x$PNCPATH" = "x" && test "x$with_pnetcdf" != "x"; then : - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "*** Parallel-NetCDF requested but not found -See \`config.log' for more details" "$LINENO" 5; } - -fi - -fi - -if test "x$PNCPATH" = "x"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Parallel-NetCDF support disabled" >&5 -$as_echo "$as_me: Parallel-NetCDF support disabled" >&6;} - -else - - # Set a compile-time flag - CXXFLAGS="$CXXFLAGS -DPNCDF" - EXTRA_INCS="$EXTRA_INCS -I$PNCPATH/include" - EXTRA_LIBS="$EXTRA_LIBS -L$PNCPATH/$PNCPATHLIB -lpnetcdf" - - file_formats="$file_formats Parallel-NetCDF" - { $as_echo "$as_me:${as_lineno-$LINENO}: Parallel-NetCDF support enabled" >&5 -$as_echo "$as_me: Parallel-NetCDF support enabled" >&6;} - -fi - -############################################################# -# Check file formats -############################################################# - -if test "x$file_formats" = "x"; then : - - as_fn_error $? "*** At least one file format must be supported" "$LINENO" 5 - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Supported file formats:$file_formats" >&5 -$as_echo "$as_me: Supported file formats:$file_formats" >&6;} - -fi - -############################################################# -# LAPACK routines (Used for tri- and band-diagonal solvers) -############################################################# - -BOUT_HAS_LAPACK="no" -if test "x$with_lapack" != "xno"; then : - - if test "x$with_lapack" = "xguess" || test "x$with_lapack" = "x" ; then : - lapack_path="" -else - if test "x$with_lapack" != xyes; then : - lapack_path=$with_lapack - with_lapack=yes -else - lapack_path="" -fi - -fi - - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CPPFLAGS=$CPPFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libblas" >&5 -$as_echo_n "checking for libblas... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - BACL_found=no - - # Try with no extra libraries first - if test ."$lapack_path" = .yes; then : - extra_prefix="" -else - extra_prefix="$lapack_path" -fi - LIBS="$save_LIBS $EXTRA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char zgemm_(); - -int -main () -{ -return zgemm_(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$save_LIBS - - # Now try with explicitly linking library - if test $BACL_found != yes; then : - - LIBS="$save_LIBS $EXTRA_LIBS -lblas" - if test ."$lapack_path" = .yes; then : - extra_prefix="" -else - extra_prefix="$lapack_path" -fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char zgemm_(); - -int -main () -{ -return zgemm_(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -lblas" - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - - if test $BACL_found != yes; then : - - for search_prefix in $extra_prefix /usr /opt $HOME $HOME/local /usr/local ; do - for path in $search_prefix $search_prefix/lib $search_prefix/lib64 $search_prefix/x86_64-linux-gnu - do - if test -d $path; then : - - LIBS="$save_LIBS $EXTRA_LIBS -lblas" - LDFLAGS="$save_LDFLAGS -L$path" - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char zgemm_(); - -int -main () -{ -return zgemm_(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -L$path -lblas" - - - break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - done - if test .$BACL_found = .yes; then : - break; -fi - done - -fi - - if test $BACL_found = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - if test $BACL_found = yes; then : - BOUT_HAS_BLAS=yes -else - if test "x$with_lapack" = "xyes"; then : - as_fn_error $? "LAPACK requested but couldn't find BLAS" "$LINENO" 5 -fi -fi - - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CPPFLAGS=$save_CPPFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CPPFLAGS=$CPPFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for liblapack" >&5 -$as_echo_n "checking for liblapack... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - BACL_found=no - - # Try with no extra libraries first - if test ."$lapack_path" = .yes; then : - extra_prefix="" -else - extra_prefix="$lapack_path" -fi - LIBS="$save_LIBS $EXTRA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char zgbsv_(); - -int -main () -{ -return zgbsv_(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$save_LIBS - - # Now try with explicitly linking library - if test $BACL_found != yes; then : - - LIBS="$save_LIBS $EXTRA_LIBS -llapack" - if test ."$lapack_path" = .yes; then : - extra_prefix="" -else - extra_prefix="$lapack_path" -fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char zgbsv_(); - -int -main () -{ -return zgbsv_(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -llapack" - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - - if test $BACL_found != yes; then : - - for search_prefix in $extra_prefix /usr /opt $HOME $HOME/local /usr/local ; do - for path in $search_prefix $search_prefix/lib $search_prefix/lib64 $search_prefix/x86_64-linux-gnu - do - if test -d $path; then : - - LIBS="$save_LIBS $EXTRA_LIBS -llapack" - LDFLAGS="$save_LDFLAGS -L$path" - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char zgbsv_(); - -int -main () -{ -return zgbsv_(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -L$path -llapack" - - - break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - done - if test .$BACL_found = .yes; then : - break; -fi - done - -fi - - if test $BACL_found = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - if test $BACL_found = yes; then : - BOUT_HAS_LAPACK=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: Using LAPACK" >&5 -$as_echo "$as_me: Using LAPACK" >&6;} - -else - if test "x$with_lapack" = "xyes"; then : - as_fn_error $? "LAPACK requested but not found" "$LINENO" 5 -fi -fi - - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CPPFLAGS=$save_CPPFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - -fi - -############################################################# -# PETSc library -############################################################# - - - - - - - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi -fi -if test "x$with_petsc" != "x" && test "$with_petsc" != "no"; then : - - -# Supplying an argument to "--with-petsc" only works if PETSC_ARCH -# *should* be empty. If it should be non-empty, THIS WILL NOT WORK - if test "$with_petsc" != "yes"; then : - - PETSC_DIR="$with_petsc" - PETSC_ARCH= - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using PETSC_DIR=$PETSC_DIR, PETSC_ARCH=$PETSC_ARCH" >&5 -$as_echo "$as_me: Using PETSC_DIR=$PETSC_DIR, PETSC_ARCH=$PETSC_ARCH" >&6;} - -# Define a macro for a nice error message that preserves the -# formatting. Use like: -# -# PETSC_ERROR_MESSAGE -# -# with no identation - - -# PETSc changed the location of the conf directory in 3.5, so we -# need to check both locations -# If we find nether, try to fall back to pkg-conf - PETSC_PKGCONF=no - as_ac_File=`$as_echo "ac_cv_file_$PETSC_DIR/$PETSC_ARCH/conf" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PETSC_DIR/$PETSC_ARCH/conf" >&5 -$as_echo_n "checking for $PETSC_DIR/$PETSC_ARCH/conf... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$PETSC_DIR/$PETSC_ARCH/conf"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - - PETSC_CONFDIR=${PETSC_DIR}/conf - -else - - as_ac_File=`$as_echo "ac_cv_file_$PETSC_DIR/$PETSC_ARCH/lib/petsc/conf" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PETSC_DIR/$PETSC_ARCH/lib/petsc/conf" >&5 -$as_echo_n "checking for $PETSC_DIR/$PETSC_ARCH/lib/petsc/conf... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$PETSC_DIR/$PETSC_ARCH/lib/petsc/conf"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - - PETSC_CONFDIR=${PETSC_DIR}/lib/petsc/conf - -else - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PETSC" >&5 -$as_echo_n "checking for PETSC... " >&6; } - -if test -n "$PETSC_CFLAGS"; then - pkg_cv_PETSC_CFLAGS="$PETSC_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"PETSc >= 3.4.0 \""; } >&5 - ($PKG_CONFIG --exists --print-errors "PETSc >= 3.4.0 ") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PETSC_CFLAGS=`$PKG_CONFIG --cflags "PETSc >= 3.4.0 " 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$PETSC_LIBS"; then - pkg_cv_PETSC_LIBS="$PETSC_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"PETSc >= 3.4.0 \""; } >&5 - ($PKG_CONFIG --exists --print-errors "PETSc >= 3.4.0 ") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PETSC_LIBS=`$PKG_CONFIG --libs "PETSc >= 3.4.0 " 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - PETSC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "PETSc >= 3.4.0 " 2>&1` - else - PETSC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "PETSc >= 3.4.0 " 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$PETSC_PKG_ERRORS" >&5 - - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PETSC" >&5 -$as_echo_n "checking for PETSC... " >&6; } - -if test -n "$PETSC_CFLAGS"; then - pkg_cv_PETSC_CFLAGS="$PETSC_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"petsc >= 3.4.0 \""; } >&5 - ($PKG_CONFIG --exists --print-errors "petsc >= 3.4.0 ") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PETSC_CFLAGS=`$PKG_CONFIG --cflags "petsc >= 3.4.0 " 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$PETSC_LIBS"; then - pkg_cv_PETSC_LIBS="$PETSC_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"petsc >= 3.4.0 \""; } >&5 - ($PKG_CONFIG --exists --print-errors "petsc >= 3.4.0 ") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PETSC_LIBS=`$PKG_CONFIG --libs "petsc >= 3.4.0 " 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - PETSC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "petsc >= 3.4.0 " 2>&1` - else - PETSC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "petsc >= 3.4.0 " 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$PETSC_PKG_ERRORS" >&5 - - - as_fn_error $? "--with-petsc was specified but could not find PETSc distribution. - You may need to specify PETSC_DIR and PETSC_ARCH like so: - --with-petsc PETSC_DIR=\$PETSC_DIR PETSC_ARCH=\$PETSC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#petsc - " "$LINENO" 5 - -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - as_fn_error $? "--with-petsc was specified but could not find PETSc distribution. - You may need to specify PETSC_DIR and PETSC_ARCH like so: - --with-petsc PETSC_DIR=\$PETSC_DIR PETSC_ARCH=\$PETSC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#petsc - " "$LINENO" 5 - -else - PETSC_CFLAGS=$pkg_cv_PETSC_CFLAGS - PETSC_LIBS=$pkg_cv_PETSC_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - PETSC_PKGCONF=yes -fi - -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PETSC" >&5 -$as_echo_n "checking for PETSC... " >&6; } - -if test -n "$PETSC_CFLAGS"; then - pkg_cv_PETSC_CFLAGS="$PETSC_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"petsc >= 3.4.0 \""; } >&5 - ($PKG_CONFIG --exists --print-errors "petsc >= 3.4.0 ") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PETSC_CFLAGS=`$PKG_CONFIG --cflags "petsc >= 3.4.0 " 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$PETSC_LIBS"; then - pkg_cv_PETSC_LIBS="$PETSC_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"petsc >= 3.4.0 \""; } >&5 - ($PKG_CONFIG --exists --print-errors "petsc >= 3.4.0 ") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PETSC_LIBS=`$PKG_CONFIG --libs "petsc >= 3.4.0 " 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - PETSC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "petsc >= 3.4.0 " 2>&1` - else - PETSC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "petsc >= 3.4.0 " 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$PETSC_PKG_ERRORS" >&5 - - - as_fn_error $? "--with-petsc was specified but could not find PETSc distribution. - You may need to specify PETSC_DIR and PETSC_ARCH like so: - --with-petsc PETSC_DIR=\$PETSC_DIR PETSC_ARCH=\$PETSC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#petsc - " "$LINENO" 5 - -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - - as_fn_error $? "--with-petsc was specified but could not find PETSc distribution. - You may need to specify PETSC_DIR and PETSC_ARCH like so: - --with-petsc PETSC_DIR=\$PETSC_DIR PETSC_ARCH=\$PETSC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#petsc - " "$LINENO" 5 - -else - PETSC_CFLAGS=$pkg_cv_PETSC_CFLAGS - PETSC_LIBS=$pkg_cv_PETSC_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - PETSC_PKGCONF=yes -fi - -else - PETSC_CFLAGS=$pkg_cv_PETSC_CFLAGS - PETSC_LIBS=$pkg_cv_PETSC_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - PETSC_PKGCONF=yes -fi - -fi - - -fi - - - if test $PETSC_PKGCONF = no ; then : - -# We've found an installation, need to check we can use it. First we -# need to be able to check the version number, for which we need -# petscverion.h - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$PETSC_DIR/include" - ac_fn_cxx_check_header_mongrel "$LINENO" "petscversion.h" "ac_cv_header_petscversion_h" "$ac_includes_default" -if test "x$ac_cv_header_petscversion_h" = xyes; then : - FOUND_PETSC_HEADER=yes -else - FOUND_PETSC_HEADER=no - -fi - - - -# This is a terrible hack for some Linux distributions (Fedora) that -# install PETSc in a non-supported fashion. This is really the fault -# of PETSc for their weird method of installation - if test $FOUND_PETSC_HEADER = no; then : - - as_ac_File=`$as_echo "ac_cv_file_${PETSC_CONFDIR}/petscvariables" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${PETSC_CONFDIR}/petscvariables" >&5 -$as_echo_n "checking for ${PETSC_CONFDIR}/petscvariables... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "${PETSC_CONFDIR}/petscvariables"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -else - - as_fn_error $? "Unable to find either petscversion.h or petscvariables - You may need to specify PETSC_DIR and PETSC_ARCH like so: - --with-petsc PETSC_DIR=\$PETSC_DIR PETSC_ARCH=\$PETSC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#petsc - " "$LINENO" 5 - -fi - - -# This relies on the assumption that PETSC_ARCH is empty - PETSC_CC_INCLUDES=$(grep ^PETSC_CC_INCLUDES ${PETSC_CONFDIR}/petscvariables | cut -d= -f 2-) - - { $as_echo "$as_me:${as_lineno-$LINENO}: Looking for petscverion.h using $PETSC_CC_INCLUDES from ${PETSC_CONFDIR}/petscvariables" >&5 -$as_echo "$as_me: Looking for petscverion.h using $PETSC_CC_INCLUDES from ${PETSC_CONFDIR}/petscvariables" >&6;} - - # This is the cache variable set by the previous call to - # AC_CHECK_HEADER. We need to unset it so we can call the macro - # again, but now with different CPPFLAGS - { ac_cv_header_petscversion_h=; unset ac_cv_header_petscversion_h;} - - CPPFLAGS="$CPPFLAGS $PETSC_CC_INCLUDES" - ac_fn_cxx_check_header_mongrel "$LINENO" "petscversion.h" "ac_cv_header_petscversion_h" "$ac_includes_default" -if test "x$ac_cv_header_petscversion_h" = xyes; then : - -else - - as_fn_error $? "Couldn't find or include petscversion.h. - You may need to specify PETSC_DIR and PETSC_ARCH like so: - --with-petsc PETSC_DIR=\$PETSC_DIR PETSC_ARCH=\$PETSC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#petsc - " "$LINENO" 5 - -fi - - - -fi - -# Now we have the header we want, we can check the version number - { $as_echo "$as_me:${as_lineno-$LINENO}: checking PETSc is at least 3.4.0" >&5 -$as_echo_n "checking PETSc is at least 3.4.0... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #if PETSC_VERSION_GE(3, 4, 0) - yes - #endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - PETSC_VERSION_OK="yes" -else - PETSC_VERSION_OK="no" -fi -rm -f conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PETSC_VERSION_OK" >&5 -$as_echo "$PETSC_VERSION_OK" >&6; } - CPPFLAGS="$save_CPPFLAGS" - - if test $PETSC_VERSION_OK = no; then : - - as_fn_error $? "PETSc version must be at least 3.4.0" "$LINENO" 5 - -fi - -# Check if PETSc was compiled with SUNDIALS - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$PETSC_DIR/$PETSC_ARCH/include" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking PETSc has SUNDIALS support" >&5 -$as_echo_n "checking PETSc has SUNDIALS support... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #ifdef PETSC_HAVE_SUNDIALS - yes - #endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - PETSC_HAS_SUNDIALS="yes" -else - PETSC_HAS_SUNDIALS="no" -fi -rm -f conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PETSC_HAS_SUNDIALS" >&5 -$as_echo "$PETSC_HAS_SUNDIALS" >&6; } - CPPFLAGS="$save_CPPFLAGS" - - if test "$PETSC_HAS_SUNDIALS" = "yes"; then : - - CXXFLAGS="$CXXFLAGS -DPETSC_HAS_SUNDIALS " - -fi - - # Set the line to be included in the make.conf file - PETSC_MAKE_INCLUDE="include ${PETSC_CONFDIR}/variables" - - BOUT_HAS_PETSC="yes" - - EXTRA_INCS="$EXTRA_INCS \$(PETSC_CC_INCLUDES)" - EXTRA_LIBS="$EXTRA_LIBS \$(PETSC_LIB)" - -else - - # Check if PETSc was compiled with SUNDIALS - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $PETSC_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking PETSc has SUNDIALS support" >&5 -$as_echo_n "checking PETSc has SUNDIALS support... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #ifdef PETSC_HAVE_SUNDIALS - yes - #endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - PETSC_HAS_SUNDIALS="yes" -else - PETSC_HAS_SUNDIALS="no" -fi -rm -f conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PETSC_HAS_SUNDIALS" >&5 -$as_echo "$PETSC_HAS_SUNDIALS" >&6; } - CPPFLAGS="$save_CPPFLAGS" - - if test "$PETSC_HAS_SUNDIALS" = "yes"; then : - - CXXFLAGS="$CXXFLAGS -DPETSC_HAS_SUNDIALS " - -fi - PETSC_MAKE_INCLUDE= - BOUT_HAS_PETSC="yes" - - EXTRA_INCS="$EXTRA_INCS $PETSC_CFLAGS" - EXTRA_LIBS="$PETSC_LIBS $EXTRA_LIBS" - -fi - -else - - PETSC_MAKE_INCLUDE= - BOUT_HAS_PETSC="no" - PETSC_HAS_SUNDIALS="no" - -fi - -############################################################# -# SLEPc library -############################################################# - -if test "x$with_slepc" != "x" && test "$with_slepc" != "no"; then : - - - if test $BOUT_HAS_PETSC = "no"; then : - - as_fn_error $? "--with-slepc specified, but no PETSc detected. Please reconfigure and specify --with-petsc - You may need to specify PETSC_DIR and PETSC_ARCH like so: - --with-petsc PETSC_DIR=\$PETSC_DIR PETSC_ARCH=\$PETSC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#petsc - " "$LINENO" 5 - -fi - -# Supplying an argument to "--with-slepc" only works if SLEPC_ARCH -# *should* be empty. If it should be non-empty, THIS WILL NOT WORK - if test "$with_slepc" != "yes"; then : - - SLEPC_DIR="$with_slepc" - SLEPC_ARCH= - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using SLEPC_DIR=$SLEPC_DIR, SLEPC_ARCH=$SLEPC_ARCH" >&5 -$as_echo "$as_me: Using SLEPC_DIR=$SLEPC_DIR, SLEPC_ARCH=$SLEPC_ARCH" >&6;} - -# Define a macro for a nice error message that preserves the -# formatting. Use like: -# -# SLEPC_ERROR_MESSAGE -# -# with no identation - - -# Slepc changed the location of the conf directory in 3.5, so we -# need to check both locations - as_ac_File=`$as_echo "ac_cv_file_$SLEPC_DIR/$SLEPC_ARCH/conf" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SLEPC_DIR/$SLEPC_ARCH/conf" >&5 -$as_echo_n "checking for $SLEPC_DIR/$SLEPC_ARCH/conf... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$SLEPC_DIR/$SLEPC_ARCH/conf"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - - SLEPC_CONFDIR=${SLEPC_DIR}/conf - -else - - as_ac_File=`$as_echo "ac_cv_file_$SLEPC_DIR/$SLEPC_ARCH/lib/slepc/conf" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SLEPC_DIR/$SLEPC_ARCH/lib/slepc/conf" >&5 -$as_echo_n "checking for $SLEPC_DIR/$SLEPC_ARCH/lib/slepc/conf... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$SLEPC_DIR/$SLEPC_ARCH/lib/slepc/conf"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - - SLEPC_CONFDIR=${SLEPC_DIR}/lib/slepc/conf - -else - - as_fn_error $? "--with-slepc was specified but could not find Slepc distribution. - You may need to specify SLEPC_DIR and SLEPC_ARCH like so: - --with-slepc SLEPC_DIR=\$SLEPC_DIR SLEPC_ARCH=\$SLEPC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#slepc - " "$LINENO" 5 - -fi - - -fi - - -# We've found an installation, need to check we can use it. First we -# need to be able to check the version number, for which we need -# slepcverion.h - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$SLEPC_DIR/include" - ac_fn_cxx_check_header_mongrel "$LINENO" "slepcversion.h" "ac_cv_header_slepcversion_h" "$ac_includes_default" -if test "x$ac_cv_header_slepcversion_h" = xyes; then : - FOUND_SLEPC_HEADER=yes -else - FOUND_SLEPC_HEADER=no - -fi - - - -# This is a terrible hack for some Linux distributions (Fedora) that -# install Slepc in a non-supported fashion. This is really the fault -# of Slepc for their weird method of installation - if test $FOUND_SLEPC_HEADER = no; then : - - as_ac_File=`$as_echo "ac_cv_file_${SLEPC_CONFDIR}/slepc_variables" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${SLEPC_CONFDIR}/slepc_variables" >&5 -$as_echo_n "checking for ${SLEPC_CONFDIR}/slepc_variables... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "${SLEPC_CONFDIR}/slepc_variables"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -else - - as_fn_error $? "Unable to find either slepcversion.h or slepc_variables - You may need to specify SLEPC_DIR and SLEPC_ARCH like so: - --with-slepc SLEPC_DIR=\$SLEPC_DIR SLEPC_ARCH=\$SLEPC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#slepc - " "$LINENO" 5 - -fi - - -# This relies on the assumption that SLEPC_ARCH is empty - SLEPC_CC_INCLUDES=$(grep ^SLEPC_CC_INCLUDES ${SLEPC_CONFDIR}/slepc_variables | cut -d= -f 2-) - - { $as_echo "$as_me:${as_lineno-$LINENO}: Looking for slepcverion.h using $SLEPC_CC_INCLUDES from ${SLEPC_CONFDIR}/slepc_variables" >&5 -$as_echo "$as_me: Looking for slepcverion.h using $SLEPC_CC_INCLUDES from ${SLEPC_CONFDIR}/slepc_variables" >&6;} - - # This is the cache variable set by the previous call to - # AC_CHECK_HEADER. We need to unset it so we can call the macro - # again, but now with different CPPFLAGS - { ac_cv_header_slepcversion_h=; unset ac_cv_header_slepcversion_h;} - - CPPFLAGS="$CPPFLAGS $SLEPC_CC_INCLUDES" - ac_fn_cxx_check_header_mongrel "$LINENO" "slepcversion.h" "ac_cv_header_slepcversion_h" "$ac_includes_default" -if test "x$ac_cv_header_slepcversion_h" = xyes; then : - -else - - as_fn_error $? "Couldn't find or include slepcversion.h. - You may need to specify SLEPC_DIR and SLEPC_ARCH like so: - --with-slepc SLEPC_DIR=\$SLEPC_DIR SLEPC_ARCH=\$SLEPC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#slepc - " "$LINENO" 5 - -fi - - - -fi - -# Now we have the header we want, we can check the version number - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Slepc is at least 3.4.0" >&5 -$as_echo_n "checking Slepc is at least 3.4.0... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #if SLEPC_VERSION_GE(3, 4, 0) - yes - #endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - SLEPC_VERSION_OK="yes" -else - SLEPC_VERSION_OK="no" -fi -rm -f conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SLEPC_VERSION_OK" >&5 -$as_echo "$SLEPC_VERSION_OK" >&6; } - CPPFLAGS="$save_CPPFLAGS" - - if test $SLEPC_VERSION_OK = no; then : - - as_fn_error $? "Slepc version must be at least 3.4.0" "$LINENO" 5 - -fi - -# Check if Slepc was compiled with SUNDIALS - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$SLEPC_DIR/$SLEPC_ARCH/include" - - # Set the line to be included in the make.conf file - SLEPC_MAKE_INCLUDE="include ${SLEPC_CONFDIR}/slepc_variables" - - BOUT_HAS_SLEPC="yes" - - EXTRA_INCS="$EXTRA_INCS \$(SLEPC_INCLUDE)" - EXTRA_LIBS="$EXTRA_LIBS \$(SLEPC_LIB)" - - -else - - SLEPC_MAKE_INCLUDE= - BOUT_HAS_SLEPC="no" - -fi - -############################################################# -# Solver choice: SUNDIALS' IDA, SUNDIALS' CVODE, PVODE -############################################################# - -BOUT_HAS_SUNDIALS=no -if test "x$with_sundials" != "x" && test "x$with_sundials" != "xno"; then : - - - # Now follows a few different checks for the version of SUNDIALS. - # We need the sundials_config.h header, which comes with all the - # versions we care about - - # If we've been given a path, look in there first - if test "x$with_sundials" != "xyes"; then : - - as_ac_File=`$as_echo "ac_cv_file_$with_sundials/include/sundials/sundials_config.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_sundials/include/sundials/sundials_config.h" >&5 -$as_echo_n "checking for $with_sundials/include/sundials/sundials_config.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_sundials/include/sundials/sundials_config.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - SUNDIALS_INC=$with_sundials/include -else - SUNDIALS_INC="" -fi - - -fi - - # If we've got one, add the include dir to the preprocessor flags - save_CPPFLAGS=$CPPFLAGS - if test "x$SUNDIALS_INC" != "x"; then : - CPPFLAGS="-I$SUNDIALS_INC" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SUNDIALS config header" >&5 -$as_echo_n "checking for SUNDIALS config header... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include "sundials/sundials_config.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "*** Could not determine SUNDIALS version -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SUNDIALS minor version" >&5 -$as_echo_n "checking for SUNDIALS minor version... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include "sundials/sundials_config.h" - #ifdef SUNDIALS_PACKAGE_VERSION - SUNDIALS_PACKAGE_VERSION - #endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "^ *\"? *[12]\.[0-5]\." >/dev/null 2>&1; then : - sundials_minor_ver="too low" -else - sundials_minor_ver=ok -fi -rm -f conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sundials_minor_ver" >&5 -$as_echo "$sundials_minor_ver" >&6; } - - CPPFLAGS=$save_CPPFLAGS - - if test "$sundials_minor_ver" = "too low"; then : - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "*** Unsupported SUNDIALS version: Requires at least 2.6 -See \`config.log' for more details" "$LINENO" 5; } - -fi - - # Set both IDA and CVODE if not set already - if test "x$with_ida" = "x"; then : - - with_ida=$with_sundials - -fi - - if test "x$with_cvode" = "x"; then : - - with_cvode=$with_sundials - -fi - - if test "x$with_arkode" = "x"; then : - - with_arkode=$with_sundials - -fi - BOUT_HAS_SUNDIALS=yes - -fi - -if test "x$with_ida" != "x" && test "x$with_ida" != "xno"; then : - - - - with_module=$with_ida - module_upper=IDA - - { $as_echo "$as_me:${as_lineno-$LINENO}: Searching for SUNDIALS $module_upper library" >&5 -$as_echo "$as_me: Searching for SUNDIALS $module_upper library" >&6;} - if test "$with_module" = "yes"; then : - - # No path specified. Try using sundials-config - # Extract the first word of "sundials-config", so it can be a program name with args. -set dummy sundials-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_sundials_config+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $sundials_config in - [\\/]* | ?:[\\/]*) - ac_cv_path_sundials_config="$sundials_config" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $with_sundials$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_sundials_config="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_sundials_config" && ac_cv_path_sundials_config="no" - ;; -esac -fi -sundials_config=$ac_cv_path_sundials_config -if test -n "$sundials_config"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sundials_config" >&5 -$as_echo "$sundials_config" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$sundials_config" != xno; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found sundials-config, this means your version of SUNDIALS is < 2.6, and probably won't work" >&5 -$as_echo "$as_me: WARNING: Found sundials-config, this means your version of SUNDIALS is < 2.6, and probably won't work" >&2;} - sundials_module_includes=`$sundials_config -m ida -t p -l c -s cppflags` - sundials_module_libs=`$sundials_config -m ida -t p -l c -s libs` - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No sundials-config available, no path given, will try compiling with $module_upper anyway" >&5 -$as_echo "$as_me: WARNING: No sundials-config available, no path given, will try compiling with $module_upper anyway" >&2;} - sundials_module_includes="" - # Need to link to libsundials_ida, libsundials_cvode or libsundials_arkode - sundials_module_libs="-lsundials_ida -lsundials_nvecparallel $SUNDIALS_EXTRA_LIBS" - -fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can compile with SUNDIALS $module_upper" >&5 -$as_echo_n "checking if we can compile with SUNDIALS $module_upper... " >&6; } - save_LIBS=$LIBS - save_CXXFLAGS=$CXXFLAGS - LIBS="$save_LIBS $sundials_module_libs" - CXXFLAGS="$save_CXXFLAGS $sundials_module_includes" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #include - extern void foo(N_Vector); - - -int -main () -{ -IDACreate(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - sundials_config_worked=yes -else - sundials_config_worked=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sundials_config_worked" >&5 -$as_echo "$sundials_config_worked" >&6; } - if test $sundials_config_worked = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using SUNDIALS $module_upper solver" >&5 -$as_echo "$as_me: Using SUNDIALS $module_upper solver" >&6;} - -else - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Could not compile SUNDIALS $module_upper program, check your SUNDIALS version -See \`config.log' for more details" "$LINENO" 5; } - -fi - LIBS=$save_LIBS - CXXFLAGS="$save_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -else - - # Specified with path - { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for $module_upper header files" >&5 -$as_echo "$as_me: Checking for $module_upper header files" >&6;} - - # Check whether user supplied path to $module_upper install dir... - as_ac_File=`$as_echo "ac_cv_file_$with_module/include/ida/ida.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/ida/ida.h" >&5 -$as_echo_n "checking for $with_module/include/ida/ida.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/ida/ida.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/ida/ida.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/ida/ida_spgmr.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/ida/ida_spgmr.h" >&5 -$as_echo_n "checking for $with_module/include/ida/ida_spgmr.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/ida/ida_spgmr.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/ida/ida_spgmr.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/ida/ida_bbdpre.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/ida/ida_bbdpre.h" >&5 -$as_echo_n "checking for $with_module/include/ida/ida_bbdpre.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/ida/ida_bbdpre.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/ida/ida_bbdpre.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/nvector/nvector_parallel.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/nvector/nvector_parallel.h" >&5 -$as_echo_n "checking for $with_module/include/nvector/nvector_parallel.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/nvector/nvector_parallel.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/nvector/nvector_parallel.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/sundials/sundials_types.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/sundials/sundials_types.h" >&5 -$as_echo_n "checking for $with_module/include/sundials/sundials_types.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/sundials/sundials_types.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/sundials/sundials_types.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi - - if test $sundials_module_includes_found = no; then : - - # ...or path to $module_upper lib dir - as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/ida/ida.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/ida/ida.h" >&5 -$as_echo_n "checking for $with_module/../include/ida/ida.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/ida/ida.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/ida/ida.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/ida/ida_spgmr.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/ida/ida_spgmr.h" >&5 -$as_echo_n "checking for $with_module/../include/ida/ida_spgmr.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/ida/ida_spgmr.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/ida/ida_spgmr.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/ida/ida_bbdpre.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/ida/ida_bbdpre.h" >&5 -$as_echo_n "checking for $with_module/../include/ida/ida_bbdpre.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/ida/ida_bbdpre.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/ida/ida_bbdpre.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/nvector/nvector_parallel.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/nvector/nvector_parallel.h" >&5 -$as_echo_n "checking for $with_module/../include/nvector/nvector_parallel.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/nvector/nvector_parallel.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/nvector/nvector_parallel.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/sundials/sundials_types.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/sundials/sundials_types.h" >&5 -$as_echo_n "checking for $with_module/../include/sundials/sundials_types.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/sundials/sundials_types.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/sundials/sundials_types.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi - - -fi - - if test $sundials_module_includes_found = no; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Missing one or more $module_upper headers -See \`config.log' for more details" "$LINENO" 5; } -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $module_upper include path: $sundials_module_includes_path" >&5 -$as_echo "$as_me: Found $module_upper include path: $sundials_module_includes_path" >&6;} - - # We've now got the include directory and can specify what libraries we need - sundials_module_includes="-I$sundials_module_includes_path" - sundials_module_libs="-lsundials_ida -lsundials_nvecparallel $SUNDIALS_EXTRA_LIBS" - - # Try compiling something simple with a few different common paths - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CPPFLAGS=$CPPFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - for sundials_module_lib_path in "$with_module" "$with_module/lib" "$with_module/lib64" - do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if SUNDIALS $module_upper library path is $sundials_module_lib_path" >&5 -$as_echo_n "checking if SUNDIALS $module_upper library path is $sundials_module_lib_path... " >&6; } - LIBS="$save_LIBS $sundials_module_libs" - LDFLAGS="$save_LDFLAGS -L$sundials_module_lib_path" - CPPFLAGS="$save_CPPFLAGS $sundials_module_includes" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #include - extern void foo(N_Vector); - - -int -main () -{ -IDACreate(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - sundials_module_lib_path_found=yes -else - sundials_module_lib_path_found=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sundials_module_lib_path_found" >&5 -$as_echo "$sundials_module_lib_path_found" >&6; } - if test "x$sundials_module_lib_path_found" = "xyes"; then : - break -fi - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CPPFLAGS="$save_CPPFLAGS" - done - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - SUNDIALS_MODULE_LDFLAGS="-L$sundials_module_lib_path" - -fi - - if test "x$sundials_module_lib_path_found" = "xno"; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Cannot compile $module_upper program -See \`config.log' for more details" "$LINENO" 5; } -fi - - # Compile in the $module_upper solver - { $as_echo "$as_me:${as_lineno-$LINENO}: => $module_upper solver enabled" >&5 -$as_echo "$as_me: => $module_upper solver enabled" >&6;} - EXTRA_LIBS="$EXTRA_LIBS $SUNDIALS_MODULE_LDFLAGS $sundials_module_libs" - EXTRA_INCS="$EXTRA_INCS $sundials_module_includes" - - eval "`$as_echo "BOUT_HAS_$module_upper" | $as_tr_sh`=yes" - eval "`$as_echo "${module_upper}LIBS" | $as_tr_sh`=\"\$SUNDIALS_MODULE_LDFLAGS \$sundials_module_libs\"" - eval "`$as_echo "${module_upper}INCS" | $as_tr_sh`=\"\$sundials_module_includes\"" - - -fi - -if test "x$with_cvode" != "x" && test "x$with_cvode" != "xno"; then : - - - - with_module=$with_cvode - module_upper=CVODE - - { $as_echo "$as_me:${as_lineno-$LINENO}: Searching for SUNDIALS $module_upper library" >&5 -$as_echo "$as_me: Searching for SUNDIALS $module_upper library" >&6;} - if test "$with_module" = "yes"; then : - - # No path specified. Try using sundials-config - # Extract the first word of "sundials-config", so it can be a program name with args. -set dummy sundials-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_sundials_config+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $sundials_config in - [\\/]* | ?:[\\/]*) - ac_cv_path_sundials_config="$sundials_config" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $with_sundials$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_sundials_config="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_sundials_config" && ac_cv_path_sundials_config="no" - ;; -esac -fi -sundials_config=$ac_cv_path_sundials_config -if test -n "$sundials_config"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sundials_config" >&5 -$as_echo "$sundials_config" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$sundials_config" != xno; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found sundials-config, this means your version of SUNDIALS is < 2.6, and probably won't work" >&5 -$as_echo "$as_me: WARNING: Found sundials-config, this means your version of SUNDIALS is < 2.6, and probably won't work" >&2;} - sundials_module_includes=`$sundials_config -m cvode -t p -l c -s cppflags` - sundials_module_libs=`$sundials_config -m cvode -t p -l c -s libs` - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No sundials-config available, no path given, will try compiling with $module_upper anyway" >&5 -$as_echo "$as_me: WARNING: No sundials-config available, no path given, will try compiling with $module_upper anyway" >&2;} - sundials_module_includes="" - # Need to link to libsundials_ida, libsundials_cvode or libsundials_arkode - sundials_module_libs="-lsundials_cvode -lsundials_nvecparallel $SUNDIALS_EXTRA_LIBS" - -fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can compile with SUNDIALS $module_upper" >&5 -$as_echo_n "checking if we can compile with SUNDIALS $module_upper... " >&6; } - save_LIBS=$LIBS - save_CXXFLAGS=$CXXFLAGS - LIBS="$save_LIBS $sundials_module_libs" - CXXFLAGS="$save_CXXFLAGS $sundials_module_includes" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #include - extern void foo(N_Vector); - - -int -main () -{ - - #if SUNDIALS_VERSION_MAJOR >= 4 - CVodeCreate(0); - #else - CVodeCreate(0, 0); - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - sundials_config_worked=yes -else - sundials_config_worked=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sundials_config_worked" >&5 -$as_echo "$sundials_config_worked" >&6; } - if test $sundials_config_worked = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using SUNDIALS $module_upper solver" >&5 -$as_echo "$as_me: Using SUNDIALS $module_upper solver" >&6;} - -else - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Could not compile SUNDIALS $module_upper program, check your SUNDIALS version -See \`config.log' for more details" "$LINENO" 5; } - -fi - LIBS=$save_LIBS - CXXFLAGS="$save_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -else - - # Specified with path - { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for $module_upper header files" >&5 -$as_echo "$as_me: Checking for $module_upper header files" >&6;} - - # Check whether user supplied path to $module_upper install dir... - as_ac_File=`$as_echo "ac_cv_file_$with_module/include/cvode/cvode.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/cvode/cvode.h" >&5 -$as_echo_n "checking for $with_module/include/cvode/cvode.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/cvode/cvode.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/cvode/cvode.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/cvode/cvode_spgmr.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/cvode/cvode_spgmr.h" >&5 -$as_echo_n "checking for $with_module/include/cvode/cvode_spgmr.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/cvode/cvode_spgmr.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/cvode/cvode_spgmr.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/cvode/cvode_bbdpre.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/cvode/cvode_bbdpre.h" >&5 -$as_echo_n "checking for $with_module/include/cvode/cvode_bbdpre.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/cvode/cvode_bbdpre.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/cvode/cvode_bbdpre.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/nvector/nvector_parallel.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/nvector/nvector_parallel.h" >&5 -$as_echo_n "checking for $with_module/include/nvector/nvector_parallel.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/nvector/nvector_parallel.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/nvector/nvector_parallel.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/sundials/sundials_types.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/sundials/sundials_types.h" >&5 -$as_echo_n "checking for $with_module/include/sundials/sundials_types.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/sundials/sundials_types.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/sundials/sundials_types.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi - - if test $sundials_module_includes_found = no; then : - - # ...or path to $module_upper lib dir - as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/cvode/cvode.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/cvode/cvode.h" >&5 -$as_echo_n "checking for $with_module/../include/cvode/cvode.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/cvode/cvode.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/cvode/cvode.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/cvode/cvode_spgmr.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/cvode/cvode_spgmr.h" >&5 -$as_echo_n "checking for $with_module/../include/cvode/cvode_spgmr.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/cvode/cvode_spgmr.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/cvode/cvode_spgmr.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/cvode/cvode_bbdpre.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/cvode/cvode_bbdpre.h" >&5 -$as_echo_n "checking for $with_module/../include/cvode/cvode_bbdpre.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/cvode/cvode_bbdpre.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/cvode/cvode_bbdpre.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/nvector/nvector_parallel.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/nvector/nvector_parallel.h" >&5 -$as_echo_n "checking for $with_module/../include/nvector/nvector_parallel.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/nvector/nvector_parallel.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/nvector/nvector_parallel.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/sundials/sundials_types.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/sundials/sundials_types.h" >&5 -$as_echo_n "checking for $with_module/../include/sundials/sundials_types.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/sundials/sundials_types.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/sundials/sundials_types.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi - - -fi - - if test $sundials_module_includes_found = no; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Missing one or more $module_upper headers -See \`config.log' for more details" "$LINENO" 5; } -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $module_upper include path: $sundials_module_includes_path" >&5 -$as_echo "$as_me: Found $module_upper include path: $sundials_module_includes_path" >&6;} - - # We've now got the include directory and can specify what libraries we need - sundials_module_includes="-I$sundials_module_includes_path" - sundials_module_libs="-lsundials_cvode -lsundials_nvecparallel $SUNDIALS_EXTRA_LIBS" - - # Try compiling something simple with a few different common paths - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CPPFLAGS=$CPPFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - for sundials_module_lib_path in "$with_module" "$with_module/lib" "$with_module/lib64" - do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if SUNDIALS $module_upper library path is $sundials_module_lib_path" >&5 -$as_echo_n "checking if SUNDIALS $module_upper library path is $sundials_module_lib_path... " >&6; } - LIBS="$save_LIBS $sundials_module_libs" - LDFLAGS="$save_LDFLAGS -L$sundials_module_lib_path" - CPPFLAGS="$save_CPPFLAGS $sundials_module_includes" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #include - extern void foo(N_Vector); - - -int -main () -{ - - #if SUNDIALS_VERSION_MAJOR >= 4 - CVodeCreate(0); - #else - CVodeCreate(0, 0); - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - sundials_module_lib_path_found=yes -else - sundials_module_lib_path_found=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sundials_module_lib_path_found" >&5 -$as_echo "$sundials_module_lib_path_found" >&6; } - if test "x$sundials_module_lib_path_found" = "xyes"; then : - break -fi - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CPPFLAGS="$save_CPPFLAGS" - done - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - SUNDIALS_MODULE_LDFLAGS="-L$sundials_module_lib_path" - -fi - - if test "x$sundials_module_lib_path_found" = "xno"; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Cannot compile $module_upper program -See \`config.log' for more details" "$LINENO" 5; } -fi - - # Compile in the $module_upper solver - { $as_echo "$as_me:${as_lineno-$LINENO}: => $module_upper solver enabled" >&5 -$as_echo "$as_me: => $module_upper solver enabled" >&6;} - EXTRA_LIBS="$EXTRA_LIBS $SUNDIALS_MODULE_LDFLAGS $sundials_module_libs" - EXTRA_INCS="$EXTRA_INCS $sundials_module_includes" - - eval "`$as_echo "BOUT_HAS_$module_upper" | $as_tr_sh`=yes" - eval "`$as_echo "${module_upper}LIBS" | $as_tr_sh`=\"\$SUNDIALS_MODULE_LDFLAGS \$sundials_module_libs\"" - eval "`$as_echo "${module_upper}INCS" | $as_tr_sh`=\"\$sundials_module_includes\"" - - -fi - -if test "x$with_arkode" != "x" && test "x$with_arkode" != "xno"; then : - - - - with_module=$with_arkode - module_upper=ARKODE - - { $as_echo "$as_me:${as_lineno-$LINENO}: Searching for SUNDIALS $module_upper library" >&5 -$as_echo "$as_me: Searching for SUNDIALS $module_upper library" >&6;} - if test "$with_module" = "yes"; then : - - # No path specified. Try using sundials-config - # Extract the first word of "sundials-config", so it can be a program name with args. -set dummy sundials-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_sundials_config+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $sundials_config in - [\\/]* | ?:[\\/]*) - ac_cv_path_sundials_config="$sundials_config" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $with_sundials$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_sundials_config="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_sundials_config" && ac_cv_path_sundials_config="no" - ;; -esac -fi -sundials_config=$ac_cv_path_sundials_config -if test -n "$sundials_config"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sundials_config" >&5 -$as_echo "$sundials_config" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$sundials_config" != xno; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found sundials-config, this means your version of SUNDIALS is < 2.6, and probably won't work" >&5 -$as_echo "$as_me: WARNING: Found sundials-config, this means your version of SUNDIALS is < 2.6, and probably won't work" >&2;} - sundials_module_includes=`$sundials_config -m arkode -t p -l c -s cppflags` - sundials_module_libs=`$sundials_config -m arkode -t p -l c -s libs` - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No sundials-config available, no path given, will try compiling with $module_upper anyway" >&5 -$as_echo "$as_me: WARNING: No sundials-config available, no path given, will try compiling with $module_upper anyway" >&2;} - sundials_module_includes="" - # Need to link to libsundials_ida, libsundials_cvode or libsundials_arkode - sundials_module_libs="-lsundials_arkode -lsundials_nvecparallel $SUNDIALS_EXTRA_LIBS" - -fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can compile with SUNDIALS $module_upper" >&5 -$as_echo_n "checking if we can compile with SUNDIALS $module_upper... " >&6; } - save_LIBS=$LIBS - save_CXXFLAGS=$CXXFLAGS - LIBS="$save_LIBS $sundials_module_libs" - CXXFLAGS="$save_CXXFLAGS $sundials_module_includes" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #if SUNDIALS_VERSION_MAJOR >= 4 - #include - #else - #include - #endif - extern void foo(N_Vector); - - -int -main () -{ - - #if SUNDIALS_VERSION_MAJOR >= 4 - ARKStepCreate(0, 0, 0, 0); - #else - ARKodeCreate(); - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - sundials_config_worked=yes -else - sundials_config_worked=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sundials_config_worked" >&5 -$as_echo "$sundials_config_worked" >&6; } - if test $sundials_config_worked = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using SUNDIALS $module_upper solver" >&5 -$as_echo "$as_me: Using SUNDIALS $module_upper solver" >&6;} - -else - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Could not compile SUNDIALS $module_upper program, check your SUNDIALS version -See \`config.log' for more details" "$LINENO" 5; } - -fi - LIBS=$save_LIBS - CXXFLAGS="$save_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -else - - # Specified with path - { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for $module_upper header files" >&5 -$as_echo "$as_me: Checking for $module_upper header files" >&6;} - - # Check whether user supplied path to $module_upper install dir... - as_ac_File=`$as_echo "ac_cv_file_$with_module/include/arkode/arkode.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/arkode/arkode.h" >&5 -$as_echo_n "checking for $with_module/include/arkode/arkode.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/arkode/arkode.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/arkode/arkode.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/arkode/arkode_spgmr.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/arkode/arkode_spgmr.h" >&5 -$as_echo_n "checking for $with_module/include/arkode/arkode_spgmr.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/arkode/arkode_spgmr.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/arkode/arkode_spgmr.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/arkode/arkode_bbdpre.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/arkode/arkode_bbdpre.h" >&5 -$as_echo_n "checking for $with_module/include/arkode/arkode_bbdpre.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/arkode/arkode_bbdpre.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/arkode/arkode_bbdpre.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/nvector/nvector_parallel.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/nvector/nvector_parallel.h" >&5 -$as_echo_n "checking for $with_module/include/nvector/nvector_parallel.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/nvector/nvector_parallel.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/nvector/nvector_parallel.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/include/sundials/sundials_types.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/include/sundials/sundials_types.h" >&5 -$as_echo_n "checking for $with_module/include/sundials/sundials_types.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/include/sundials/sundials_types.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/include/sundials/sundials_types.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/include -else - sundials_module_includes_found=no -fi - - if test $sundials_module_includes_found = no; then : - - # ...or path to $module_upper lib dir - as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/arkode/arkode.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/arkode/arkode.h" >&5 -$as_echo_n "checking for $with_module/../include/arkode/arkode.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/arkode/arkode.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/arkode/arkode.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/arkode/arkode_spgmr.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/arkode/arkode_spgmr.h" >&5 -$as_echo_n "checking for $with_module/../include/arkode/arkode_spgmr.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/arkode/arkode_spgmr.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/arkode/arkode_spgmr.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/arkode/arkode_bbdpre.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/arkode/arkode_bbdpre.h" >&5 -$as_echo_n "checking for $with_module/../include/arkode/arkode_bbdpre.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/arkode/arkode_bbdpre.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/arkode/arkode_bbdpre.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/nvector/nvector_parallel.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/nvector/nvector_parallel.h" >&5 -$as_echo_n "checking for $with_module/../include/nvector/nvector_parallel.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/nvector/nvector_parallel.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/nvector/nvector_parallel.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi -as_ac_File=`$as_echo "ac_cv_file_$with_module/../include/sundials/sundials_types.h" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_module/../include/sundials/sundials_types.h" >&5 -$as_echo_n "checking for $with_module/../include/sundials/sundials_types.h... " >&6; } -if eval \${$as_ac_File+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$with_module/../include/sundials/sundials_types.h"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$with_module/../include/sundials/sundials_types.h" | $as_tr_cpp` 1 -_ACEOF -sundials_module_includes_found=yes - sundials_module_includes_path=$with_module/../include -else - sundials_module_includes_found=no -fi - - -fi - - if test $sundials_module_includes_found = no; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Missing one or more $module_upper headers -See \`config.log' for more details" "$LINENO" 5; } -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: Found $module_upper include path: $sundials_module_includes_path" >&5 -$as_echo "$as_me: Found $module_upper include path: $sundials_module_includes_path" >&6;} - - # We've now got the include directory and can specify what libraries we need - sundials_module_includes="-I$sundials_module_includes_path" - sundials_module_libs="-lsundials_arkode -lsundials_nvecparallel $SUNDIALS_EXTRA_LIBS" - - # Try compiling something simple with a few different common paths - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CPPFLAGS=$CPPFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - for sundials_module_lib_path in "$with_module" "$with_module/lib" "$with_module/lib64" - do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if SUNDIALS $module_upper library path is $sundials_module_lib_path" >&5 -$as_echo_n "checking if SUNDIALS $module_upper library path is $sundials_module_lib_path... " >&6; } - LIBS="$save_LIBS $sundials_module_libs" - LDFLAGS="$save_LDFLAGS -L$sundials_module_lib_path" - CPPFLAGS="$save_CPPFLAGS $sundials_module_includes" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - #if SUNDIALS_VERSION_MAJOR >= 4 - #include - #else - #include - #endif - extern void foo(N_Vector); - - -int -main () -{ - - #if SUNDIALS_VERSION_MAJOR >= 4 - ARKStepCreate(0, 0, 0, 0); - #else - ARKodeCreate(); - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - sundials_module_lib_path_found=yes -else - sundials_module_lib_path_found=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sundials_module_lib_path_found" >&5 -$as_echo "$sundials_module_lib_path_found" >&6; } - if test "x$sundials_module_lib_path_found" = "xyes"; then : - break -fi - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CPPFLAGS="$save_CPPFLAGS" - done - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - SUNDIALS_MODULE_LDFLAGS="-L$sundials_module_lib_path" - -fi - - if test "x$sundials_module_lib_path_found" = "xno"; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Cannot compile $module_upper program -See \`config.log' for more details" "$LINENO" 5; } -fi - - # Compile in the $module_upper solver - { $as_echo "$as_me:${as_lineno-$LINENO}: => $module_upper solver enabled" >&5 -$as_echo "$as_me: => $module_upper solver enabled" >&6;} - EXTRA_LIBS="$EXTRA_LIBS $SUNDIALS_MODULE_LDFLAGS $sundials_module_libs" - EXTRA_INCS="$EXTRA_INCS $sundials_module_includes" - - eval "`$as_echo "BOUT_HAS_$module_upper" | $as_tr_sh`=yes" - eval "`$as_echo "${module_upper}LIBS" | $as_tr_sh`=\"\$SUNDIALS_MODULE_LDFLAGS \$sundials_module_libs\"" - eval "`$as_echo "${module_upper}INCS" | $as_tr_sh`=\"\$sundials_module_includes\"" - - -fi - -############################################################# -# HYPRE -############################################################# - -BOUT_HAS_HYPRE="no" -if test "$with_hypre" != "no"; then : - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HYPRE.h" >&5 -$as_echo_n "checking for HYPRE.h... " >&6; } - - save_CPPFLAGS=$CPPFLAGS - BACH_found=no - - if test ."$with_hypre - " != .yes; then : - extra_prefix="$with_hypre - " -else - extra_prefix="" -fi - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - BACH_found=yes - - - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - if test $BACH_found != yes; then : - - for search_prefix in $extra_prefix /usr /opt $HOME $HOME/local /usr/local - do - for path in $search_prefix $search_prefix/include - do - if test -d $path; then : - - CPPFLAGS="$save_CPPFLAGS -I$path" - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - BACH_found=yes - EXTRA_INCS="$EXTRA_INCS -I$path" - - - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi - done - if test .$BACH_found = .yes; then : - break; -fi - done - -fi - - if test $BACH_found = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CPPFLAGS=$save_CPPFLAGS - -fi - if test .$BACH_found = .yes; then : - - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CPPFLAGS=$CPPFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libHYPRE" >&5 -$as_echo_n "checking for libHYPRE... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - BACL_found=no - - # Try with no extra libraries first - if test ."$with_hypre" = .yes; then : - extra_prefix="" -else - extra_prefix="$with_hypre" -fi - LIBS="$save_LIBS $EXTRA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char HYPRE_IJVectorCreate(); - -int -main () -{ -return HYPRE_IJVectorCreate(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$save_LIBS - - # Now try with explicitly linking library - if test $BACL_found != yes; then : - - LIBS="$save_LIBS $EXTRA_LIBS -lHYPRE" - if test ."$with_hypre" = .yes; then : - extra_prefix="" -else - extra_prefix="$with_hypre" -fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char HYPRE_IJVectorCreate(); - -int -main () -{ -return HYPRE_IJVectorCreate(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -lHYPRE" - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - - if test $BACL_found != yes; then : - - for search_prefix in $extra_prefix /usr /opt $HOME $HOME/local /usr/local ; do - for path in $search_prefix $search_prefix/lib $search_prefix/lib64 $search_prefix/x86_64-linux-gnu - do - if test -d $path; then : - - LIBS="$save_LIBS $EXTRA_LIBS -lHYPRE" - LDFLAGS="$save_LDFLAGS -L$path" - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char HYPRE_IJVectorCreate(); - -int -main () -{ -return HYPRE_IJVectorCreate(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -L$path -lHYPRE" - - - break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - done - if test .$BACL_found = .yes; then : - break; -fi - done - -fi - - if test $BACL_found = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - if test $BACL_found = yes; then : - - BOUT_HAS_HYPRE="yes" - -else - as_fn_error $? "HYPRE requested but not found" "$LINENO" 5 -fi - - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CPPFLAGS=$save_CPPFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -else - as_fn_error $? "HYPRE requested but not found" "$LINENO" 5 -fi - - -fi - -############################################################# -# Scorep setup -############################################################# - -BOUT_HAS_SCOREP="no" -if test "$with_scorep" != "no"; then : - - - if test "$with_scorep" != "yes"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Searching for Scorep executable in $with_scorep" >&5 -$as_echo "$as_me: Searching for Scorep executable in $with_scorep" >&6;} - # Extract the first word of "scorep", so it can be a program name with args. -set dummy scorep; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SCOREPPATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SCOREPPATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_SCOREPPATH="$SCOREPPATH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $with_scorep -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SCOREPPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SCOREPPATH=$ac_cv_path_SCOREPPATH -if test -n "$SCOREPPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SCOREPPATH" >&5 -$as_echo "$SCOREPPATH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Searching for Scorep executable" >&5 -$as_echo "$as_me: Searching for Scorep executable" >&6;} - # Extract the first word of "scorep", so it can be a program name with args. -set dummy scorep; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_SCOREPPATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $SCOREPPATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_SCOREPPATH="$SCOREPPATH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SCOREPPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -SCOREPPATH=$ac_cv_path_SCOREPPATH -if test -n "$SCOREPPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SCOREPPATH" >&5 -$as_echo "$SCOREPPATH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -fi - - if test "$SCOREPPATH" = ""; then : - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "*** Scorep requested, but executable not found. -Please supply the path using --with-scorep=/path/to/scorep -See \`config.log' for more details" "$LINENO" 5; } - -else - - CXX="$SCOREPPATH --user --nocompiler $CXX" - BOUT_HAS_SCOREP="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: Scorep support enabled" >&5 -$as_echo "$as_me: Scorep support enabled" >&6;} - -fi - - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Scorep support disabled" >&5 -$as_echo "$as_me: Scorep support disabled" >&6;} - -fi - -############################################################# -# Check for mpark.variant -############################################################# - -if test ".$with_system_mpark" = "no"; then : - - SYSTEM_HAS_MPARK=no - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpark.variant" >&5 -$as_echo_n "checking for mpark.variant... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include "mpark/variant.hpp" - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SYSTEM_HAS_MPARK=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SYSTEM_HAS_MPARK=no - if test "$with_system_mpark" = "yes"; then : - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "*** System mpark.variant not found - but requested to use -See \`config.log' for more details" "$LINENO" 5; } - -fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi - -if test "$SYSTEM_HAS_MPARK" = "yes"; then : - - MPARK_VARIANT_INCLUDE_PATH= - MPARK_INCLUDE= - OWN_MPARK= - -else - - if test -d externalpackages/mpark.variant/include; then : - -else - if test -d .git && which git; then : - - make -f makefile.submodules mpark_submodule || \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "*** Could not download mpark.variant -See \`config.log' for more details" "$LINENO" 5; } - -else - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "mpark.variant not found. Please install mpark.variant or use the official releases. -See \`config.log' for more details" "$LINENO" 5; } - -fi - -fi - - MPARK_VARIANT_INCLUDE_PATH="$PWD/externalpackages/mpark.variant/include" - MPARK_INCLUDE="-I$MPARK_VARIANT_INCLUDE_PATH" - OWN_MPARK=yes - -fi - -############################################################# -# Check for libuuid -############################################################# - -if test ".$with_system_uuid" = "no"; then : - - BOUT_HAS_UUID_SYSTEM_GENERATOR=no - -else - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid/uuid.h" >&5 -$as_echo_n "checking for uuid/uuid.h... " >&6; } - - save_CPPFLAGS=$CPPFLAGS - BACH_found=no - - if test ."$with_system_uuid" != .yes; then : - extra_prefix="$with_system_uuid" -else - extra_prefix="" -fi - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - BACH_found=yes - - - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - if test $BACH_found != yes; then : - - for search_prefix in $extra_prefix /usr /opt $HOME $HOME/local /usr/local - do - for path in $search_prefix $search_prefix/include - do - if test -d $path; then : - - CPPFLAGS="$save_CPPFLAGS -I$path" - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - BACH_found=yes - EXTRA_INCS="$EXTRA_INCS -I$path" - - - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi - done - if test .$BACH_found = .yes; then : - break; -fi - done - -fi - - if test $BACH_found = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CPPFLAGS=$save_CPPFLAGS - -fi - if test .$BACH_found = .yes; then : - - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CPPFLAGS=$CPPFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuuid" >&5 -$as_echo_n "checking for libuuid... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - BACL_found=no - - # Try with no extra libraries first - if test ."$with_system_uuid" = .yes; then : - extra_prefix="" -else - extra_prefix="$with_system_uuid" -fi - LIBS="$save_LIBS $EXTRA_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char uuid_generate(); - -int -main () -{ -return uuid_generate(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$save_LIBS - - # Now try with explicitly linking library - if test $BACL_found != yes; then : - - LIBS="$save_LIBS $EXTRA_LIBS -luuid" - if test ."$with_system_uuid" = .yes; then : - extra_prefix="" -else - extra_prefix="$with_system_uuid" -fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char uuid_generate(); - -int -main () -{ -return uuid_generate(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -luuid" - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - - if test $BACL_found != yes; then : - - for search_prefix in $extra_prefix /usr /opt $HOME $HOME/local /usr/local ; do - for path in $search_prefix $search_prefix/lib $search_prefix/lib64 $search_prefix/x86_64-linux-gnu - do - if test -d $path; then : - - LIBS="$save_LIBS $EXTRA_LIBS -luuid" - LDFLAGS="$save_LDFLAGS -L$path" - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - extern "C" - char uuid_generate(); - -int -main () -{ -return uuid_generate(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - BACL_found=yes - EXTRA_LIBS="$EXTRA_LIBS -L$path -luuid" - - - break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - done - if test .$BACL_found = .yes; then : - break; -fi - done - -fi - - if test $BACL_found = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi - - if test $BACL_found = yes; then : - BOUT_HAS_UUID_SYSTEM_GENERATOR=yes -else - BOUT_HAS_UUID_SYSTEM_GENERATOR=no -fi - - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CPPFLAGS=$save_CPPFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -else - BOUT_HAS_UUID_SYSTEM_GENERATOR=no -fi - - if test "$with_system_uuid" = "yes"; then : - - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "*** System UUID generator not found, but explicitly requested -See \`config.log' for more details" "$LINENO" 5; } - -fi - -fi - -############################################################# -# Download + Build PVODE '98 -############################################################# - -as_dir=externalpackages; as_fn_mkdir_p -as_dir=lib; as_fn_mkdir_p -as_dir=include; as_fn_mkdir_p - -BOUT_HAS_PVODE="no" -if test "$with_pvode" != "no"; then : - - if test "$enable_pvode_openmp" != "no" ; then : - - if test "$enable_openmp" != "no" ; then : - - PVODE_FLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: PVODE being built with OpenMP support" >&5 -$as_echo "$as_me: PVODE being built with OpenMP support" >&6;} - -else - - as_fn_error $? "Cannot enable openmp in PVODE as configuring with OpenMP disabled" "$LINENO" 5 - -fi - -else - - PVODE_FLAGS="$CXXFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: PVODE being built without OpenMP support" >&5 -$as_echo "$as_me: PVODE being built without OpenMP support" >&6;} - -fi - # Clean PVODE - CXX="$CXX" CXXFLAGS=$PVODE_FLAGS MKDIR="$MKDIR_P" RANLIB="$RANLIB" $MAKE clean -C externalpackages/PVODE/precon/ >> config-build.log 2>&1 - CXX="$CXX" CXXFLAGS=$PVODE_FLAGS MKDIR="$MKDIR_P" RANLIB="$RANLIB" $MAKE clean -C externalpackages/PVODE/source/ >> config-build.log 2>&1 - - { $as_echo "$as_me:${as_lineno-$LINENO}: Building PVODE" >&5 -$as_echo "$as_me: Building PVODE" >&6;} - echo "* Building PVODE" >> config-build.log - echo "*************************************************************" >> config-build.log - - CXX="$CXX" CXXFLAGS=$PVODE_FLAGS MKDIR="$MKDIR_P" RANLIB="$RANLIB" $MAKE -C externalpackages/PVODE/precon/ >> config-build.log 2>&1 - CXX="$CXX" CXXFLAGS=$PVODE_FLAGS MKDIR="$MKDIR_P" RANLIB="$RANLIB" $MAKE -C externalpackages/PVODE/source/ >> config-build.log 2>&1 - - if test -f externalpackages/PVODE/lib/libpvode.a && test -f externalpackages/PVODE/lib/libpvpre.a; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Successfully built PVODE" >&5 -$as_echo "$as_me: Successfully built PVODE" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Installing PVODE into BOUT++ sourcetree" >&5 -$as_echo "$as_me: Installing PVODE into BOUT++ sourcetree" >&6;} - - echo "*************************************************************" >> config-build.log - echo "* Successfully built PVODE" >> config-build.log - echo "*************************************************************" >> config-build.log - echo "* Installing PVODE into BOUT++ sourcetree" >> config-build.log - echo "*************************************************************" >> config-build.log - -else - - as_fn_error $? "Could not build PVODE. See config-build.log for errors" "$LINENO" 5 - -fi - - # Set the correct libraries and copy them to bout - as_dir=include/pvode; as_fn_mkdir_p - cp -r externalpackages/PVODE/include/pvode include - cp externalpackages/PVODE/lib/*.a lib/ - EXTRA_LIBS="$EXTRA_LIBS -L\$(BOUT_LIB_PATH) -lpvode -lpvpre" - BOUT_HAS_PVODE="yes" - -fi - -############################################################# -# Localisation (i18n) with gettext -############################################################# - -BOUT_HAS_GETTEXT="no" -# Use macro to test if Natural Language Support (gettext) is available. -# If available sets: -# - USE_NLS to "yes" -# - LIBINTL to the linker options -# - Modifies CPPFLAGS if needed - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 -$as_echo_n "checking whether NLS is requested... " >&6; } - # Check whether --enable-nls was given. -if test "${enable_nls+set}" = set; then : - enableval=$enable_nls; USE_NLS=$enableval -else - USE_NLS=yes -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 -$as_echo "$USE_NLS" >&6; } - - - - - GETTEXT_MACRO_VERSION=0.19 - - - - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which - # contains only /bin. Note that ksh looks also at the FPATH variable, - # so we have to set that as well for the test. - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ - && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ - || PATH_SEPARATOR=';' - } -fi - -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file - -# Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MSGFMT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case "$MSGFMT" in - [\\/]* | ?:[\\/]*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && - (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" - ;; -esac -fi -MSGFMT="$ac_cv_path_MSGFMT" -if test "$MSGFMT" != ":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 -$as_echo "$MSGFMT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GMSGFMT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GMSGFMT in - [\\/]* | ?:[\\/]*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac -fi -GMSGFMT=$ac_cv_path_GMSGFMT -if test -n "$GMSGFMT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 -$as_echo "$GMSGFMT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; - *) MSGFMT_015=$MSGFMT ;; - esac - - case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; - *) GMSGFMT_015=$GMSGFMT ;; - esac - - - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which - # contains only /bin. Note that ksh looks also at the FPATH variable, - # so we have to set that as well for the test. - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ - && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ - || PATH_SEPARATOR=';' - } -fi - -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file - -# Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XGETTEXT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case "$XGETTEXT" in - [\\/]* | ?:[\\/]*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && - (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test "$XGETTEXT" != ":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 -$as_echo "$XGETTEXT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - rm -f messages.po - - case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; - *) XGETTEXT_015=$XGETTEXT ;; - esac - - - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which - # contains only /bin. Note that ksh looks also at the FPATH variable, - # so we have to set that as well for the test. - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ - && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ - || PATH_SEPARATOR=';' - } -fi - -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file - -# Extract the first word of "msgmerge", so it can be a program name with args. -set dummy msgmerge; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MSGMERGE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case "$MSGMERGE" in - [\\/]* | ?:[\\/]*) - ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then - ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" - ;; -esac -fi -MSGMERGE="$ac_cv_path_MSGMERGE" -if test "$MSGMERGE" != ":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 -$as_echo "$MSGMERGE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$localedir" || localedir='${datadir}/locale' - - - test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= - - - ac_config_commands="$ac_config_commands po-directories" - - - - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which - # contains only /bin. Note that ksh looks also at the FPATH variable, - # so we have to set that as well for the test. - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ - && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ - || PATH_SEPARATOR=';' - } -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` - while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${acl_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$acl_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${acl_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$acl_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$acl_cv_prog_gnu_ld - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 -$as_echo_n "checking for shared library run path origin... " >&6; } -if ${acl_cv_rpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 -$as_echo "$acl_cv_rpath" >&6; } - wl="$acl_cv_wl" - acl_libext="$acl_cv_libext" - acl_shlibext="$acl_cv_shlibext" - acl_libname_spec="$acl_cv_libname_spec" - acl_library_names_spec="$acl_cv_library_names_spec" - acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - acl_hardcode_direct="$acl_cv_hardcode_direct" - acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" - # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then : - enableval=$enable_rpath; : -else - enable_rpath=yes -fi - - - - - acl_libdirstem=lib - acl_libdirstem2= - case "$host_os" in - solaris*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 -$as_echo_n "checking for 64-bit host... " >&6; } -if ${gl_cv_solaris_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef _LP64 -sixtyfour bits -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "sixtyfour bits" >/dev/null 2>&1; then : - gl_cv_solaris_64bit=yes -else - gl_cv_solaris_64bit=no -fi -rm -f conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 -$as_echo "$gl_cv_solaris_64bit" >&6; } - if test $gl_cv_solaris_64bit = yes; then - acl_libdirstem=lib/64 - case "$host_cpu" in - sparc*) acl_libdirstem2=lib/sparcv9 ;; - i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; - esac - fi - ;; - *) - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - */../ | */.. ) - # Better ignore directories of this form. They are misleading. - ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; - esac - fi - done - IFS="$acl_save_IFS" - fi - ;; - esac - test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" - - - - - - - - - - - - - use_additional=yes - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - -# Check whether --with-libiconv-prefix was given. -if test "${with_libiconv_prefix+set}" = set; then : - withval=$with_libiconv_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi - fi - fi - -fi - - LIBICONV= - LTLIBICONV= - INCICONV= - LIBICONV_PREFIX= - HAVE_LIBICONV= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='iconv ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no \ - || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$acl_hardcode_direct" = yes; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - if test "$name" = 'iconv'; then - LIBICONV_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - */$acl_libdirstem2 | */$acl_libdirstem2/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - if test "$name" = 'iconv'; then - LIBICONV_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" - ;; - esac - done - fi - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" - done - fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 -$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } -if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : - $as_echo_n "(cached) " >&6 -else - gt_save_LIBS="$LIBS" - LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -CFPreferencesCopyAppValue(NULL, NULL) - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - gt_cv_func_CFPreferencesCopyAppValue=yes -else - gt_cv_func_CFPreferencesCopyAppValue=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$gt_save_LIBS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 -$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } - if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then - -$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 -$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } -if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : - $as_echo_n "(cached) " >&6 -else - gt_save_LIBS="$LIBS" - LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -CFLocaleCopyCurrent(); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - gt_cv_func_CFLocaleCopyCurrent=yes -else - gt_cv_func_CFLocaleCopyCurrent=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$gt_save_LIBS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 -$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } - if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - -$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h - - fi - INTL_MACOSX_LIBS= - if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then - INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" - fi - - - - - - - LIBINTL= - LTLIBINTL= - POSUB= - - case " $gt_needs " in - *" need-formatstring-macros "*) gt_api_version=3 ;; - *" need-ngettext "*) gt_api_version=2 ;; - *) gt_api_version=1 ;; - esac - gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" - gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" - - if test "$USE_NLS" = "yes"; then - gt_use_preinstalled_gnugettext=no - - - if test $gt_api_version -ge 3; then - gt_revision_test_code=' -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) -#endif -typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -' - else - gt_revision_test_code= - fi - if test $gt_api_version -ge 2; then - gt_expression_test_code=' + * ngettext ("", "", 0)' - else - gt_expression_test_code= - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 -$as_echo_n "checking for GNU gettext in libc... " >&6; } -if eval \${$gt_func_gnugettext_libc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings; -#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) -#else -#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 -#endif -$gt_revision_test_code - -int -main () -{ - -bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$gt_func_gnugettext_libc=yes" -else - eval "$gt_func_gnugettext_libc=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$gt_func_gnugettext_libc - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - - if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then - - - - - - am_save_CPPFLAGS="$CPPFLAGS" - - for element in $INCICONV; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 -$as_echo_n "checking for iconv... " >&6; } -if ${am_cv_func_iconv+:} false; then : - $as_echo_n "(cached) " >&6 -else - - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - am_cv_func_iconv=yes -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - am_cv_lib_iconv=yes - am_cv_func_iconv=yes -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" - fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 -$as_echo "$am_cv_func_iconv" >&6; } - if test "$am_cv_func_iconv" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 -$as_echo_n "checking for working iconv... " >&6; } -if ${am_cv_func_iconv_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - - am_save_LIBS="$LIBS" - if test $am_cv_lib_iconv = yes; then - LIBS="$LIBS $LIBICONV" - fi - am_cv_func_iconv_works=no - for ac_iconv_const in '' 'const'; do - if test "$cross_compiling" = yes; then : - case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -#ifndef ICONV_CONST -# define ICONV_CONST $ac_iconv_const -#endif - -int -main () -{ -int result = 0; - /* Test against AIX 5.1 bug: Failures are not distinguishable from successful - returns. */ - { - iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); - if (cd_utf8_to_88591 != (iconv_t)(-1)) - { - static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ - char buf[10]; - ICONV_CONST char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_utf8_to_88591, - &inptr, &inbytesleft, - &outptr, &outbytesleft); - if (res == 0) - result |= 1; - iconv_close (cd_utf8_to_88591); - } - } - /* Test against Solaris 10 bug: Failures are not distinguishable from - successful returns. */ - { - iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); - if (cd_ascii_to_88591 != (iconv_t)(-1)) - { - static ICONV_CONST char input[] = "\263"; - char buf[10]; - ICONV_CONST char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_ascii_to_88591, - &inptr, &inbytesleft, - &outptr, &outbytesleft); - if (res == 0) - result |= 2; - iconv_close (cd_ascii_to_88591); - } - } - /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ - { - iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); - if (cd_88591_to_utf8 != (iconv_t)(-1)) - { - static ICONV_CONST char input[] = "\304"; - static char buf[2] = { (char)0xDE, (char)0xAD }; - ICONV_CONST char *inptr = input; - size_t inbytesleft = 1; - char *outptr = buf; - size_t outbytesleft = 1; - size_t res = iconv (cd_88591_to_utf8, - &inptr, &inbytesleft, - &outptr, &outbytesleft); - if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) - result |= 4; - iconv_close (cd_88591_to_utf8); - } - } -#if 0 /* This bug could be worked around by the caller. */ - /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ - { - iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); - if (cd_88591_to_utf8 != (iconv_t)(-1)) - { - static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; - char buf[50]; - ICONV_CONST char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_88591_to_utf8, - &inptr, &inbytesleft, - &outptr, &outbytesleft); - if ((int)res > 0) - result |= 8; - iconv_close (cd_88591_to_utf8); - } - } -#endif - /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is - provided. */ - if (/* Try standardized names. */ - iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) - /* Try IRIX, OSF/1 names. */ - && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) - /* Try AIX names. */ - && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) - /* Try HP-UX names. */ - && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - result |= 16; - return result; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - am_cv_func_iconv_works=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - test "$am_cv_func_iconv_works" = no || break - done - LIBS="$am_save_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 -$as_echo "$am_cv_func_iconv_works" >&6; } - case "$am_cv_func_iconv_works" in - *no) am_func_iconv=no am_cv_lib_iconv=no ;; - *) am_func_iconv=yes ;; - esac - else - am_func_iconv=no am_cv_lib_iconv=no - fi - if test "$am_func_iconv" = yes; then - -$as_echo "#define HAVE_ICONV 1" >>confdefs.h - - fi - if test "$am_cv_lib_iconv" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 -$as_echo_n "checking how to link with libiconv... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 -$as_echo "$LIBICONV" >&6; } - else - CPPFLAGS="$am_save_CPPFLAGS" - LIBICONV= - LTLIBICONV= - fi - - - - - - - - - - - - use_additional=yes - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - -# Check whether --with-libintl-prefix was given. -if test "${with_libintl_prefix+set}" = set; then : - withval=$with_libintl_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi - fi - fi - -fi - - LIBINTL= - LTLIBINTL= - INCINTL= - LIBINTL_PREFIX= - HAVE_LIBINTL= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='intl ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no \ - || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$acl_hardcode_direct" = yes; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - if test "$name" = 'intl'; then - LIBINTL_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - */$acl_libdirstem2 | */$acl_libdirstem2/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - if test "$name" = 'intl'; then - LIBINTL_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" - ;; - esac - done - fi - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" - done - fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 -$as_echo_n "checking for GNU gettext in libintl... " >&6; } -if eval \${$gt_func_gnugettext_libintl+:} false; then : - $as_echo_n "(cached) " >&6 -else - gt_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $INCINTL" - gt_save_LIBS="$LIBS" - LIBS="$LIBS $LIBINTL" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -extern int _nl_msg_cat_cntr; -extern -#ifdef __cplusplus -"C" -#endif -const char *_nl_expand_alias (const char *); -#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) -#else -#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 -#endif -$gt_revision_test_code - -int -main () -{ - -bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$gt_func_gnugettext_libintl=yes" -else - eval "$gt_func_gnugettext_libintl=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then - LIBS="$LIBS $LIBICONV" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -extern int _nl_msg_cat_cntr; -extern -#ifdef __cplusplus -"C" -#endif -const char *_nl_expand_alias (const char *); -#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) -#else -#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 -#endif -$gt_revision_test_code - -int -main () -{ - -bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - eval "$gt_func_gnugettext_libintl=yes" - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - fi - CPPFLAGS="$gt_save_CPPFLAGS" - LIBS="$gt_save_LIBS" -fi -eval ac_res=\$$gt_func_gnugettext_libintl - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - fi - - if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ - || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ - && test "$PACKAGE" != gettext-runtime \ - && test "$PACKAGE" != gettext-tools; }; then - gt_use_preinstalled_gnugettext=yes - else - LIBINTL= - LTLIBINTL= - INCINTL= - fi - - - - if test -n "$INTL_MACOSX_LIBS"; then - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" - LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" - fi - fi - - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - -$as_echo "#define ENABLE_NLS 1" >>confdefs.h - - else - USE_NLS=no - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 -$as_echo_n "checking whether to use NLS... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 -$as_echo "$USE_NLS" >&6; } - if test "$USE_NLS" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 -$as_echo_n "checking where the gettext function comes from... " >&6; } - if test "$gt_use_preinstalled_gnugettext" = "yes"; then - if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then - gt_source="external libintl" - else - gt_source="libc" - fi - else - gt_source="included intl directory" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 -$as_echo "$gt_source" >&6; } - fi - - if test "$USE_NLS" = "yes"; then - - if test "$gt_use_preinstalled_gnugettext" = "yes"; then - if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 -$as_echo_n "checking how to link with libintl... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 -$as_echo "$LIBINTL" >&6; } - - for element in $INCINTL; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - - fi - - -$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h - - -$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h - - fi - - POSUB=po - fi - - - - INTLLIBS="$LIBINTL" - - - - - - -if test "$USE_NLS" = "yes"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: Enabling language support with gettext" >&5 -$as_echo "$as_me: Enabling language support with gettext" >&6;} - # Turn the .po files into .mo files - $MAKE -C locale | tee -a config-build.log 2>&1 - - # Note: BOUT_LOCALE_PATH is defined in make.config, and may be changed by `make install`. - CXXFLAGS="$CXXFLAGS -DBOUT_LOCALE_PATH=\$(BOUT_LOCALE_PATH)" - - EXTRA_LIBS="$EXTRA_LIBS $LIBINTL" - - # Set variable substituted into bout-config - BOUT_HAS_GETTEXT="yes" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: Language support with gettext not available" >&5 -$as_echo "$as_me: Language support with gettext not available" >&6;} - -fi - -############################################################# -# Sort out fmt -############################################################# - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for .git" >&5 -$as_echo_n "checking for .git... " >&6; } -if ${ac_cv_file__git+:} false; then : - $as_echo_n "(cached) " >&6 -else - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r ".git"; then - ac_cv_file__git=yes -else - ac_cv_file__git=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__git" >&5 -$as_echo "$ac_cv_file__git" >&6; } -if test "x$ac_cv_file__git" = xyes; then : - - if test "x$BOUT_DONT_UPDATE_GIT_SUBMODULE" == "x"; then : - - git submodule update --init externalpackages/fmt - -fi - -fi - - -ac_config_links="$ac_config_links src/fmt/format.cxx:externalpackages/fmt/src/format.cc" - - -############################################################# -# Check environment -############################################################# - -if test "$CXXINCLUDE" != ""; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: ================================================" >&5 -$as_echo "$as_me: ================================================" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: CXXINCLUDE environment variable set to:" >&5 -$as_echo "$as_me: WARNING: CXXINCLUDE environment variable set to:" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: $CXXINCLUDE" >&5 -$as_echo "$as_me: $CXXINCLUDE" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: => This will be added to compile commands" >&5 -$as_echo "$as_me: => This will be added to compile commands" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: If this is not intended, then run" >&5 -$as_echo "$as_me: If this is not intended, then run" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: export CXXINCLUDE=''" >&5 -$as_echo "$as_me: export CXXINCLUDE=''" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: before making BOUT++" >&5 -$as_echo "$as_me: before making BOUT++" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: ================================================" >&5 -$as_echo "$as_me: ================================================" >&6;} - -fi - -############################################################# -# Gather configuration info for bout-config -############################################################# - -EXTRA_INCS="${EXTRA_INCS} ${CPPFLAGS}" - -PREFIX=$PWD -IDLCONFIGPATH=$PWD/tools/idllib -PYTHONCONFIGPATH=$PWD/tools/pylib - -BOUT_HAS_IDA="yes" -if test "$IDALIBS" = "" -then - BOUT_HAS_IDA="no" -fi - -BOUT_HAS_CVODE="yes" -if test "$CVODELIBS" = "" -then - BOUT_HAS_CVODE="no" -fi - -BOUT_HAS_ARKODE="yes" -if test "$ARKODELIBS" = "" -then - BOUT_HAS_ARKODE="no" -fi - -BOUT_HAS_PNETCDF="yes" -if test "$PNCPATH" = "" -then - BOUT_HAS_PNETCDF="no" -fi - -# Only make.config is altered by configure -ac_config_files="$ac_config_files make.config" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` - - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_FALSE}"; then - as_fn_error $? "conditional \"CODE_COVERAGE_ENABLED\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -<<<<<<< HEAD -This file was extended by BOUT++ $as_me 5.1.0, which was -======= -This file was extended by BOUT++ $as_me 5.0.0, which was ->>>>>>> a889598fd (Trying again with autoreconf) -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_links="$ac_config_links" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Configuration links: -$config_links - -Configuration commands: -$config_commands - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -<<<<<<< HEAD -BOUT++ config.status 5.1.0 -======= -BOUT++ config.status 5.0.0 ->>>>>>> a889598fd (Trying again with autoreconf) -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -# Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake < 1.5. - eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' - # Capture the value of LINGUAS because we need it to compute CATALOGS. - LINGUAS="${LINGUAS-%UNSET%}" - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; - "src/fmt/format.cxx") CONFIG_LINKS="$CONFIG_LINKS src/fmt/format.cxx:externalpackages/fmt/src/format.cc" ;; - "make.config") CONFIG_FILES="$CONFIG_FILES make.config" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - - -eval set X " :F $CONFIG_FILES :L $CONFIG_LINKS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - - :L) - # - # CONFIG_LINK - # - - if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then - : - else - # Prefer the file from the source tree if names are identical. - if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then - ac_source=$srcdir/$ac_source - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 -$as_echo "$as_me: linking $ac_source to $ac_file" >&6;} - - if test ! -r "$ac_source"; then - as_fn_error $? "$ac_source: file not found" "$LINENO" 5 - fi - rm -f "$ac_file" - - # Try a relative symlink, then a hard link, then a copy. - case $ac_source in - [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; - *) ac_rel_source=$ac_top_build_prefix$ac_source ;; - esac - ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || - ln "$ac_source" "$ac_file" 2>/dev/null || - cp -p "$ac_source" "$ac_file" || - as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 - fi - ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "po-directories":C) - for ac_file in $CONFIG_FILES; do - # Support "outfile[:infile[:infile...]]" - case "$ac_file" in - *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - esac - # PO directories have a Makefile.in generated from Makefile.in.in. - case "$ac_file" in */Makefile.in) - # Adjust a relative srcdir. - ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - # In autoconf-2.13 it is called $ac_given_srcdir. - # In autoconf-2.50 it is called $srcdir. - test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - # Treat a directory as a PO directory if and only if it has a - # POTFILES.in file. This allows packages to have multiple PO - # directories under different names or in different locations. - if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then - rm -f "$ac_dir/POTFILES" - test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - gt_tab=`printf '\t'` - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" - POMAKEFILEDEPS="POTFILES.in" - # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend - # on $ac_dir but don't depend on user-specified configuration - # parameters. - if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then - # The LINGUAS file contains the set of available languages. - if test -n "$OBSOLETE_ALL_LINGUAS"; then - test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" - fi - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' - POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" - else - # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' - fi - # Compute POFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) - # Compute UPDATEPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) - # Compute DUMMYPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) - # Compute GMOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) - case "$ac_given_srcdir" in - .) srcdirpre= ;; - *) srcdirpre='$(srcdir)/' ;; - esac - POFILES= - UPDATEPOFILES= - DUMMYPOFILES= - GMOFILES= - for lang in $ALL_LINGUAS; do - POFILES="$POFILES $srcdirpre$lang.po" - UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" - DUMMYPOFILES="$DUMMYPOFILES $lang.nop" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - done - # CATALOGS depends on both $ac_dir and the user's LINGUAS - # environment variable. - INST_LINGUAS= - if test -n "$ALL_LINGUAS"; then - for presentlang in $ALL_LINGUAS; do - useit=no - if test "%UNSET%" != "$LINGUAS"; then - desiredlanguages="$LINGUAS" - else - desiredlanguages="$ALL_LINGUAS" - fi - for desiredlang in $desiredlanguages; do - # Use the presentlang catalog if desiredlang is - # a. equal to presentlang, or - # b. a variant of presentlang (because in this case, - # presentlang can be used as a fallback for messages - # which are not translated in the desiredlang catalog). - case "$desiredlang" in - "$presentlang"*) useit=yes;; - esac - done - if test $useit = yes; then - INST_LINGUAS="$INST_LINGUAS $presentlang" - fi - done - fi - CATALOGS= - if test -n "$INST_LINGUAS"; then - for lang in $INST_LINGUAS; do - CATALOGS="$CATALOGS $lang.gmo" - done - fi - test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" - sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" - for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do - if test -f "$f"; then - case "$f" in - *.orig | *.bak | *~) ;; - *) cat "$f" >> "$ac_dir/Makefile" ;; - esac - fi - done - fi - ;; - esac - done ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - -############################################################# -# Use a dummy Makefile to get the cflags and ldflags -# -# This is to capture flags from external libraries such -# as PETSc -############################################################# - -CONFIG_CFLAGS=`$MAKE cflags -f output.make` -CONFIG_LDFLAGS=`$MAKE ldflags -f output.make` - -############################################################# -# Defines which are supported by CMake build but not autoconf - -BOUT_HAS_CUDA="no" -BOUT_HAS_RAJA="no" -BOUT_HAS_UMPIRE="no" -BOUT_HAS_CALIPER="no" -BOUT_HAS_ADIOS="no" - - -<<<<<<< HEAD -if test "x$BOUT_HAS_CUDA" = "xyes"; then : - -$as_echo "#define BOUT_HAS_CUDA 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_CUDA 0" >>confdefs.h -======= -if test "x$BOUT_USE_CUDA" = "xyes"; then : - -$as_echo "#define BOUT_USE_CUDA 1" >>confdefs.h - -else - -$as_echo "#define BOUT_USE_CUDA 0" >>confdefs.h ->>>>>>> a889598fd (Trying again with autoreconf) - -fi - - - -if test "x$BOUT_HAS_RAJA" = "xyes"; then : - -$as_echo "#define BOUT_HAS_RAJA 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_RAJA 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_UMPIRE" = "xyes"; then : - -$as_echo "#define BOUT_HAS_UMPIRE 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_UMPIRE 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_CALIPER" = "xyes"; then : - -$as_echo "#define BOUT_HAS_CALIPER 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_CALIPER 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_ADIOS" = "xyes"; then : - -$as_echo "#define BOUT_HAS_ADIOS 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_ADIOS 0" >>confdefs.h - -fi - - - -############################################################# -# Write configuration to bout-config -############################################################# - - - - -# Set path to lib and include here. -# If make install is run then that replaces these paths -BOUT_LIB_PATH=$PWD/lib -BOUT_INCLUDE_PATH=$PWD/include -FMT_INCLUDE_PATH=$PWD/externalpackages/fmt/include - - - - - - - - - - - - - - - - - - - - - - - -cat >>confdefs.h <<_ACEOF -#define BOUT_CHECK_LEVEL $BOUT_CHECK_LEVEL -_ACEOF - - - - -cat >>confdefs.h <<_ACEOF -#define BOUT_OPENMP_SCHEDULE $BOUT_OPENMP_SCHEDULE -_ACEOF - - - -if test "x$BOUT_HAS_ARKODE" = "xyes"; then : - -$as_echo "#define BOUT_HAS_ARKODE 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_ARKODE 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_CVODE" = "xyes"; then : - -$as_echo "#define BOUT_HAS_CVODE 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_CVODE 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_FFTW" = "xyes"; then : - -$as_echo "#define BOUT_HAS_FFTW 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_FFTW 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_GETTEXT" = "xyes"; then : - -$as_echo "#define BOUT_HAS_GETTEXT 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_GETTEXT 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_IDA" = "xyes"; then : - -$as_echo "#define BOUT_HAS_IDA 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_IDA 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_LAPACK" = "xyes"; then : - -$as_echo "#define BOUT_HAS_LAPACK 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_LAPACK 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_NETCDF" = "xyes"; then : - -$as_echo "#define BOUT_HAS_NETCDF 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_NETCDF 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_LEGACY_NETCDF" = "xyes"; then : - -$as_echo "#define BOUT_HAS_LEGACY_NETCDF 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_LEGACY_NETCDF 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_PETSC" = "xyes"; then : - -$as_echo "#define BOUT_HAS_PETSC 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_PETSC 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_HYPRE" = "xyes"; then : - -$as_echo "#define BOUT_HAS_HYPRE 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_HYPRE 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_PNETCDF" = "xyes"; then : - -$as_echo "#define BOUT_HAS_PNETCDF 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_PNETCDF 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_PRETTY_FUNCTION" = "xyes"; then : - -$as_echo "#define BOUT_HAS_PRETTY_FUNCTION 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_PRETTY_FUNCTION 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_PVODE" = "xyes"; then : - -$as_echo "#define BOUT_HAS_PVODE 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_PVODE 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_SCOREP" = "xyes"; then : - -$as_echo "#define BOUT_HAS_SCOREP 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_SCOREP 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_SLEPC" = "xyes"; then : - -$as_echo "#define BOUT_HAS_SLEPC 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_SLEPC 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_SUNDIALS" = "xyes"; then : - -$as_echo "#define BOUT_HAS_SUNDIALS 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_SUNDIALS 0" >>confdefs.h - -fi - - - -if test "x$BOUT_HAS_UUID_SYSTEM_GENERATOR" = "xyes"; then : - -$as_echo "#define BOUT_HAS_UUID_SYSTEM_GENERATOR 1" >>confdefs.h - -else - -$as_echo "#define BOUT_HAS_UUID_SYSTEM_GENERATOR 0" >>confdefs.h - -fi - - - -if test "x$BOUT_USE_BACKTRACE" = "xyes"; then : - -$as_echo "#define BOUT_USE_BACKTRACE 1" >>confdefs.h - -else - -$as_echo "#define BOUT_USE_BACKTRACE 0" >>confdefs.h - -fi - - - -if test "x$BOUT_USE_COLOR" = "xyes"; then : - -$as_echo "#define BOUT_USE_COLOR 1" >>confdefs.h - -else - -$as_echo "#define BOUT_USE_COLOR 0" >>confdefs.h - -fi - - - -if test "x$BOUT_USE_OUTPUT_DEBUG" = "xyes"; then : - -$as_echo "#define BOUT_USE_OUTPUT_DEBUG 1" >>confdefs.h - -else - -$as_echo "#define BOUT_USE_OUTPUT_DEBUG 0" >>confdefs.h - -fi - - - -if test "x$BOUT_USE_OPENMP" = "xyes"; then : - -$as_echo "#define BOUT_USE_OPENMP 1" >>confdefs.h - -else - -$as_echo "#define BOUT_USE_OPENMP 0" >>confdefs.h - -fi - - - -if test "x$BOUT_USE_SIGFPE" = "xyes"; then : - -$as_echo "#define BOUT_USE_SIGFPE 1" >>confdefs.h - -else - -$as_echo "#define BOUT_USE_SIGFPE 0" >>confdefs.h - -fi - - - -if test "x$BOUT_USE_SIGNAL" = "xyes"; then : - -$as_echo "#define BOUT_USE_SIGNAL 1" >>confdefs.h - -else - -$as_echo "#define BOUT_USE_SIGNAL 0" >>confdefs.h - -fi - - - -if test "x$BOUT_USE_TRACK" = "xyes"; then : - -$as_echo "#define BOUT_USE_TRACK 1" >>confdefs.h - -else - -$as_echo "#define BOUT_USE_TRACK 0" >>confdefs.h - -fi - - - -if test "x$BOUT_USE_MSGSTACK" = "xyes"; then : - -$as_echo "#define BOUT_USE_MSGSTACK 1" >>confdefs.h - -else - -$as_echo "#define BOUT_USE_MSGSTACK 0" >>confdefs.h - -fi - - - -cat >>confdefs.h <<_ACEOF -#define BOUT_METRIC_TYPE $BOUT_METRIC_TYPE -_ACEOF - -BOUT_METRIC_3D=$(test $BOUT_METRIC_TYPE != 3D ; echo $?) - -cat >>confdefs.h <<_ACEOF -#define BOUT_USE_METRIC_3D $BOUT_METRIC_3D -_ACEOF - - - - - - - - - - - - -ac_config_headers="$ac_config_headers include/bout/build_defines.hxx:autoconf_build_defines.hxx.in" - -ac_config_files="$ac_config_files include/bout/version.hxx" - -ac_config_files="$ac_config_files include/bout/revision.hxx" - -ac_config_files="$ac_config_files bin/bout-config" - -ac_config_files="$ac_config_files src/makefile" - -ac_config_files="$ac_config_files tools/pylib/boutconfig/__init__.py" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_FALSE}"; then - as_fn_error $? "conditional \"CODE_COVERAGE_ENABLED\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -<<<<<<< HEAD -This file was extended by BOUT++ $as_me 5.1.0, which was -======= -This file was extended by BOUT++ $as_me 5.0.0, which was ->>>>>>> a889598fd (Trying again with autoreconf) -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_links="$ac_config_links" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration links: -$config_links - -Configuration commands: -$config_commands - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -<<<<<<< HEAD -BOUT++ config.status 5.1.0 -======= -BOUT++ config.status 5.0.0 ->>>>>>> a889598fd (Trying again with autoreconf) -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -# Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake < 1.5. - eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' - # Capture the value of LINGUAS because we need it to compute CATALOGS. - LINGUAS="${LINGUAS-%UNSET%}" - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; - "src/fmt/format.cxx") CONFIG_LINKS="$CONFIG_LINKS src/fmt/format.cxx:externalpackages/fmt/src/format.cc" ;; - "make.config") CONFIG_FILES="$CONFIG_FILES make.config" ;; - "include/bout/build_defines.hxx") CONFIG_HEADERS="$CONFIG_HEADERS include/bout/build_defines.hxx:autoconf_build_defines.hxx.in" ;; - "include/bout/version.hxx") CONFIG_FILES="$CONFIG_FILES include/bout/version.hxx" ;; - "include/bout/revision.hxx") CONFIG_FILES="$CONFIG_FILES include/bout/revision.hxx" ;; - "bin/bout-config") CONFIG_FILES="$CONFIG_FILES bin/bout-config" ;; - "src/makefile") CONFIG_FILES="$CONFIG_FILES src/makefile" ;; - "tools/pylib/boutconfig/__init__.py") CONFIG_FILES="$CONFIG_FILES tools/pylib/boutconfig/__init__.py" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi - ;; - :L) - # - # CONFIG_LINK - # - - if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then - : - else - # Prefer the file from the source tree if names are identical. - if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then - ac_source=$srcdir/$ac_source - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 -$as_echo "$as_me: linking $ac_source to $ac_file" >&6;} - - if test ! -r "$ac_source"; then - as_fn_error $? "$ac_source: file not found" "$LINENO" 5 - fi - rm -f "$ac_file" - - # Try a relative symlink, then a hard link, then a copy. - case $ac_source in - [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; - *) ac_rel_source=$ac_top_build_prefix$ac_source ;; - esac - ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || - ln "$ac_source" "$ac_file" 2>/dev/null || - cp -p "$ac_source" "$ac_file" || - as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 - fi - ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "po-directories":C) - for ac_file in $CONFIG_FILES; do - # Support "outfile[:infile[:infile...]]" - case "$ac_file" in - *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - esac - # PO directories have a Makefile.in generated from Makefile.in.in. - case "$ac_file" in */Makefile.in) - # Adjust a relative srcdir. - ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - # In autoconf-2.13 it is called $ac_given_srcdir. - # In autoconf-2.50 it is called $srcdir. - test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - # Treat a directory as a PO directory if and only if it has a - # POTFILES.in file. This allows packages to have multiple PO - # directories under different names or in different locations. - if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then - rm -f "$ac_dir/POTFILES" - test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - gt_tab=`printf '\t'` - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" - POMAKEFILEDEPS="POTFILES.in" - # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend - # on $ac_dir but don't depend on user-specified configuration - # parameters. - if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then - # The LINGUAS file contains the set of available languages. - if test -n "$OBSOLETE_ALL_LINGUAS"; then - test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" - fi - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' - POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" - else - # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' - fi - # Compute POFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) - # Compute UPDATEPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) - # Compute DUMMYPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) - # Compute GMOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) - case "$ac_given_srcdir" in - .) srcdirpre= ;; - *) srcdirpre='$(srcdir)/' ;; - esac - POFILES= - UPDATEPOFILES= - DUMMYPOFILES= - GMOFILES= - for lang in $ALL_LINGUAS; do - POFILES="$POFILES $srcdirpre$lang.po" - UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" - DUMMYPOFILES="$DUMMYPOFILES $lang.nop" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - done - # CATALOGS depends on both $ac_dir and the user's LINGUAS - # environment variable. - INST_LINGUAS= - if test -n "$ALL_LINGUAS"; then - for presentlang in $ALL_LINGUAS; do - useit=no - if test "%UNSET%" != "$LINGUAS"; then - desiredlanguages="$LINGUAS" - else - desiredlanguages="$ALL_LINGUAS" - fi - for desiredlang in $desiredlanguages; do - # Use the presentlang catalog if desiredlang is - # a. equal to presentlang, or - # b. a variant of presentlang (because in this case, - # presentlang can be used as a fallback for messages - # which are not translated in the desiredlang catalog). - case "$desiredlang" in - "$presentlang"*) useit=yes;; - esac - done - if test $useit = yes; then - INST_LINGUAS="$INST_LINGUAS $presentlang" - fi - done - fi - CATALOGS= - if test -n "$INST_LINGUAS"; then - for lang in $INST_LINGUAS; do - CATALOGS="$CATALOGS $lang.gmo" - done - fi - test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" - sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" - for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do - if test -f "$f"; then - case "$f" in - *.orig | *.bak | *~) ;; - *) cat "$f" >> "$ac_dir/Makefile" ;; - esac - fi - done - fi - ;; - esac - done ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - -chmod a+x bin/bout-config - -############################################################# -# Print configuration info -############################################################# - -{ $as_echo "$as_me:${as_lineno-$LINENO}: -------------------------" >&5 -$as_echo "$as_me: -------------------------" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuration summary " >&5 -$as_echo "$as_me: Configuration summary " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: -------------------------" >&5 -$as_echo "$as_me: -------------------------" >&6;} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: PETSc support : $BOUT_HAS_PETSC (has SUNDIALS: $PETSC_HAS_SUNDIALS)" >&5 -$as_echo "$as_me: PETSc support : $BOUT_HAS_PETSC (has SUNDIALS: $PETSC_HAS_SUNDIALS)" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: SLEPc support : $BOUT_HAS_SLEPC" >&5 -$as_echo "$as_me: SLEPc support : $BOUT_HAS_SLEPC" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: IDA support : $BOUT_HAS_IDA" >&5 -$as_echo "$as_me: IDA support : $BOUT_HAS_IDA" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: CVODE support : $BOUT_HAS_CVODE" >&5 -$as_echo "$as_me: CVODE support : $BOUT_HAS_CVODE" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: ARKODE support : $BOUT_HAS_ARKODE" >&5 -$as_echo "$as_me: ARKODE support : $BOUT_HAS_ARKODE" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: FFTW support : $BOUT_HAS_FFTW" >&5 -$as_echo "$as_me: FFTW support : $BOUT_HAS_FFTW" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: NetCDF support : $BOUT_HAS_NETCDF (legacy: $BOUT_HAS_LEGACY_NETCDF)" >&5 -$as_echo "$as_me: NetCDF support : $BOUT_HAS_NETCDF (legacy: $BOUT_HAS_LEGACY_NETCDF)" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Parallel-NetCDF support : $BOUT_HAS_PNETCDF" >&5 -$as_echo "$as_me: Parallel-NetCDF support : $BOUT_HAS_PNETCDF" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Lapack support : $BOUT_HAS_LAPACK" >&5 -$as_echo "$as_me: Lapack support : $BOUT_HAS_LAPACK" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Scorep support : $BOUT_HAS_SCOREP" >&5 -$as_echo "$as_me: Scorep support : $BOUT_HAS_SCOREP" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: OpenMP support : $BOUT_USE_OPENMP (schedule: $OPENMP_SCHEDULE)" >&5 -$as_echo "$as_me: OpenMP support : $BOUT_USE_OPENMP (schedule: $OPENMP_SCHEDULE)" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Natural language support: $BOUT_HAS_GETTEXT (path: $localedir)" >&5 -$as_echo "$as_me: Natural language support: $BOUT_HAS_GETTEXT (path: $localedir)" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: HYPRE support : $BOUT_HAS_HYPRE" >&5 -$as_echo "$as_me: HYPRE support : $BOUT_HAS_HYPRE" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: System UUID generator : $BOUT_HAS_UUID_SYSTEM_GENERATOR" >&5 -$as_echo "$as_me: System UUID generator : $BOUT_HAS_UUID_SYSTEM_GENERATOR" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 -$as_echo "$as_me: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Enable backtrace : $BOUT_USE_BACKTRACE" >&5 -$as_echo "$as_me: Enable backtrace : $BOUT_USE_BACKTRACE" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Enable color logs : $BOUT_USE_COLOR" >&5 -$as_echo "$as_me: Enable color logs : $BOUT_USE_COLOR" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Enable more debug output: $BOUT_USE_OUTPUT_DEBUG" >&5 -$as_echo "$as_me: Enable more debug output: $BOUT_USE_OUTPUT_DEBUG" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Enable OpenMP : $BOUT_USE_OPENMP" >&5 -$as_echo "$as_me: Enable OpenMP : $BOUT_USE_OPENMP" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Enable FP exceptions : $BOUT_USE_SIGFPE" >&5 -$as_echo "$as_me: Enable FP exceptions : $BOUT_USE_SIGFPE" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Enable signal handlers : $BOUT_USE_SIGNAL" >&5 -$as_echo "$as_me: Enable signal handlers : $BOUT_USE_SIGNAL" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Enable field names : $BOUT_USE_TRACK" >&5 -$as_echo "$as_me: Enable field names : $BOUT_USE_TRACK" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Metric type : $BOUT_METRIC_TYPE" >&5 -$as_echo "$as_me: Metric type : $BOUT_METRIC_TYPE" >&6;} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 -$as_echo "$as_me: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: -------------------------------" >&5 -$as_echo "$as_me: -------------------------------" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Data analysis configuration " >&5 -$as_echo "$as_me: Data analysis configuration " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: -------------------------------" >&5 -$as_echo "$as_me: -------------------------------" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 -$as_echo "$as_me: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: === IDL ===" >&5 -$as_echo "$as_me: === IDL ===" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 -$as_echo "$as_me: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Make sure that the tools/idllib directory is in your IDL_PATH" >&5 -$as_echo "$as_me: Make sure that the tools/idllib directory is in your IDL_PATH" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: e.g. by adding to your ~/.bashrc file" >&5 -$as_echo "$as_me: e.g. by adding to your ~/.bashrc file" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 -$as_echo "$as_me: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: export IDL_PATH=+$PWD/tools/idllib:'':\$IDL_PATH" >&5 -$as_echo "$as_me: export IDL_PATH=+$PWD/tools/idllib:'':\$IDL_PATH" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 -$as_echo "$as_me: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: === Python ===" >&5 -$as_echo "$as_me: === Python ===" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 -$as_echo "$as_me: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: Make sure that the tools/pylib directory is in your PYTHONPATH" >&5 -$as_echo "$as_me: Make sure that the tools/pylib directory is in your PYTHONPATH" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: e.g. by adding to your ~/.bashrc file" >&5 -$as_echo "$as_me: e.g. by adding to your ~/.bashrc file" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 -$as_echo "$as_me: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: export PYTHONPATH=$PWD/tools/pylib/:\$PYTHONPATH" >&5 -$as_echo "$as_me: export PYTHONPATH=$PWD/tools/pylib/:\$PYTHONPATH" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 -$as_echo "$as_me: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: *** Now run '$MAKE' to compile BOUT++ ***" >&5 -$as_echo "$as_me: *** Now run '$MAKE' to compile BOUT++ ***" >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5 -$as_echo "$as_me: " >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ./configure is deprecated and will be removed in a future version, please use CMake instead" >&5 -$as_echo "$as_me: WARNING: ./configure is deprecated and will be removed in a future version, please use CMake instead" >&2;} diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 9fd1a6a945..0000000000 --- a/configure.ac +++ /dev/null @@ -1,1501 +0,0 @@ -# Copyright 2010 B D Dudson, S Farley -# -# Contact Ben Dudson, bd512@york.ac.uk -# -# This file is part of BOUT++. -# -# BOUT++ is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# BOUT++ is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with BOUT++. If not, see . -# -##################################################################### -# -# Process this file with autoreconf to produce a configure script. -# -# $ autoreconf -if -# -# Changelog: -# -# 2010-03-09 Ben Dudson -# * Changing to always require FFTW (removing NR routines) -# 2015-08-08 David Schwörer -# * Searching for libs in lib and lib64 -# - -AC_PREREQ([2.69]) -AC_INIT([BOUT++],[5.1.0],[bd512@york.ac.uk]) -AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_MACRO_DIR([m4]) - -AC_MSG_WARN([./configure is deprecated and will be removed in a future version, please use CMake instead]) - -AC_ARG_WITH(netcdf, [AS_HELP_STRING([--with-netcdf], - [Enable support for netCDF files])],,[]) -AC_ARG_WITH(pnetcdf, [AS_HELP_STRING([--with-pnetcdf], - [Set path to Parallel NetCDF library])],,[]) -AC_ARG_WITH(ida, [AS_HELP_STRING([--with-ida=/path/to/ida], - [Use the SUNDIALS IDA solver])],,[]) -AC_ARG_WITH(cvode, [AS_HELP_STRING([--with-cvode], - [Use the SUNDIALS CVODE solver])],,[]) -AC_ARG_WITH(sundials, [AS_HELP_STRING([--with-sundials], - [Use CVODE and IDA])],,[]) -AC_ARG_WITH(fftw, [AS_HELP_STRING([--with-fftw], - [Set directory of FFTW3 library])],,[]) -AC_ARG_WITH(lapack, [AS_HELP_STRING([--with-lapack], - [Use the LAPACK library])],,[with_lapack=guess]) -AC_ARG_WITH(petsc, [AS_HELP_STRING([--with-petsc], - [Enable PETSc interface])],,[with_petsc=no]) -AC_ARG_WITH(slepc, [AS_HELP_STRING([--with-slepc], - [Enable SLEPc interface])],,[with_slepc=no]) -AC_ARG_WITH(pvode, [AS_HELP_STRING([--with-pvode], - [Build and enable PVODE 98 (DEFAULT)])],,[]) -AC_ARG_WITH(arkode, [AS_HELP_STRING([--with-arkode], - [Use the SUNDIALS ARKODE solver])],,[]) -AC_ARG_WITH(scorep, [AS_HELP_STRING([--with-scorep], - [Enable support for scorep based instrumentation])],,[with_scorep=no]) -AC_ARG_WITH(hypre, [AS_HELP_STRING([--with-hypre], - [Enable support for HYPRE])],,[with_hypre=no]) - -dnl --with-hdf5 flags are set in AX_LIB_{PARALLEL}HDF5 -AC_ARG_WITH(system_mpark, [AS_HELP_STRING([--with-system-mpark], - [Use mpark.variant already installed rather then the bundled one])],,[with_system_mpark=auto]) -AC_ARG_WITH(system_uuid, [AS_HELP_STRING([--with-system-uuid], - [Use libuuid to generate UUIDs])],,[with_system_uuid=auto]) - -AC_ARG_ENABLE(warnings, [AS_HELP_STRING([--disable-warnings], - [Disable compiler warnings])],,[]) -AC_ARG_ENABLE(checks, [AS_HELP_STRING([--enable-checks=no/1/2/3], - [Set run-time checking level])],,[enable_checks=default]) -AC_ARG_ENABLE(msgstack, [AS_HELP_STRING([--enable-msgstack=no/yes], - [Enable MstStack for backtrace. Default based on check level.])],,[enable_msgstack=maybe]) -AC_ARG_ENABLE(signal, [AS_HELP_STRING([--disable-signal], - [Disable SEGFAULT handling])],,[]) -AC_ARG_ENABLE(color, [AS_HELP_STRING([--disable-color], - [Disable -c option to color output])],,[]) -AC_ARG_ENABLE(track, [AS_HELP_STRING([--enable-track], - [Enable variable tracking])],,[]) -AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], - [Enable all debugging flags])],,[]) -AC_ARG_ENABLE(output_debug, [AS_HELP_STRING([--enable-output-debug], - [Enable some extra debugging output])],,[]) -AC_ARG_ENABLE(optimize, [AS_HELP_STRING([--enable-optimize=no/1/2/3/4], - [Enable optimization])],,[]) -AC_ARG_ENABLE(sigfpe, [AS_HELP_STRING([--enable-sigfpe], - [Enable FloatingPointExceptions])],,[]) -AC_ARG_ENABLE(backtrace, [AS_HELP_STRING([--disable-backtrace], - [Disable function backtrace])],,[enable_backtrace=maybe]) -AC_ARG_ENABLE(shared, [AS_HELP_STRING([--enable-shared], - [Enable building bout++ into an shared object])],,[enable_shared=no]) -AC_ARG_ENABLE(static, [AS_HELP_STRING([--enable-static], - [Enable building bout++ into an static library])],,[enable_static=auto]) -AC_ARG_ENABLE(openmp, [AS_HELP_STRING([--enable-openmp], - [Enable building with OpenMP support])],,[enable_openmp=no]) -AC_ARG_WITH(openmp_schedule,[AS_HELP_STRING([--with-openmp-schedule=static/dynamic/guided/auto], - [Set OpenMP schedule (default: static)])],,[with_openmp_schedule=static]) -AC_ARG_ENABLE(pvode_openmp, [AS_HELP_STRING([--enable-pvode-openmp], - [Enable building PVODE with OpenMP support])],,[enable_pvode_openmp=no]) -AC_ARG_ENABLE(metric_3d, [AS_HELP_STRING([--enable-metric-3d], - [Use Field3D to store coordinates metric data])],,[enable_metric_3d=no]) - -AC_ARG_VAR(EXTRA_INCS,[Extra compile flags]) -AC_ARG_VAR(EXTRA_LIBS,[Extra linking flags]) - -file_formats="" # Record which file formats are being supported - -# Delete the build log from last time -rm -f config-build.log - -# only keep BOUT related undefs -if ! grep -q 'NOTE TO DEVEL' autoconf_build_defines.hxx.in ; then - grep 'undef BOUT' -B 4 -A 1 autoconf_build_defines.hxx.in > autoconf_build_defines.hxx.in.tmp - echo '// NOTE TO DEVELOPERS: PLEASE KEEP THIS LINE AND DELETE AUTOGENERATED CONTENT BELOW!' >> autoconf_build_defines.hxx.in.tmp - mv autoconf_build_defines.hxx.in.tmp autoconf_build_defines.hxx.in -fi - - -AC_ARG_VAR(CXXFLAGS,[Extra compile flags]) -AC_ARG_VAR(LDFLAGS,[Extra linking flags]) -AC_ARG_VAR(LIBS,[Extra linking libraries]) -LIBS="$LIBS $LDLIBS" - -AC_SUBST(MKDIR_P) -AC_SUBST(EXTRA_INCS) -AC_SUBST(EXTRA_LIBS) - -# Adding variables for additional sources -AC_SUBST(PRECON_SOURCE) - -# We're using C++ -AC_LANG(C++) - -############################################################# -# Checks for programs -############################################################# - -# Autoconf inserts "-g -O2" into flags by default -# Set them to be just "-g", but only if the user hasn't already set CXXFLAGS -# We then put "-O2" back in later, assuming optimisations aren't explicitly disabled -: ${CXXFLAGS="-g"} - -# Search for MPI compiler; fail if not found -AX_PROG_CXX_MPI([], [], [ - AC_MSG_ERROR([*** An MPI compiler is required. You might need to set MPICXX correctly.]) -]) - -# Utility programs -AC_PROG_MKDIR_P -AC_PROG_LN_S -AC_PROG_MAKE_SET -AC_PROG_INSTALL - -# Set MAKE to gmake if possible, otherwise make -AC_CHECK_PROG(MAKE, gmake, gmake, make) - -AC_PROG_RANLIB - -AC_SUBST(ARFLAGS) - -ARFLAGS='' -for flag in cruU cru -do - echo 1 > artest1 - ar $flag artest artest1 &&ar $flag artest artest1 - arexit=$? - rm -f artest1 artest - if test $arexit -eq 0 - then - ARFLAGS="$flag" - break; - fi -done -test -z $ARFLAGS && AC_MSG_ERROR([Failed to find suitable flags for ar]) - -# Check for and enable C++14 support -# Error if not supported -AX_CXX_COMPILE_STDCXX([14], [noext], [mandatory]) - -############################################################# -# STD Library functions -############################################################# - -# Checks for libraries. -AC_CHECK_LIB([m], [sqrt]) - -# Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h]) - -# Checks for library functions. -AC_FUNC_MALLOC -AC_FUNC_REALLOC -AC_FUNC_VPRINTF - -# Check for OpenMP support -: ${enable_openmp=no} # Disable by default -AC_OPENMP -BOUT_USE_OPENMP=$enable_openmp - -BOUT_OPENMP_SCHEDULE=$with_openmp_schedule - -# Check if we have access to __PRETTY_FUNCTION__ -BOUT_CHECK_PRETTYFUNCTION - -############################################################# -# Code coverage using gcov -# -# Mutally exclusive with optimisation, therefore needs to come first -# so we can turn off optimisation if coverage is enabled -############################################################# - -AX_CODE_COVERAGE() -AS_IF([test "x$enable_code_coverage" = "xyes"], -[ - AS_IF([test "x$enable_optimize"], [ - AC_MSG_WARN([Code coverage clashes with optimisations, disabling optimisations]) - enable_optimize="no" - ]) - COVERAGE_FLAGS="--coverage --no-inline" - LDFLAGS="$LDFLAGS --coverage" -], [ - COVERAGE_FLAGS= -]) -AC_SUBST([COVERAGE_FLAGS]) - -############################################################# -# General Options -############################################################# - -# Always pass -Werror=unknown-warning-option to get Clang to fail on bad -# flags, otherwise they are always appended to the warn_cxxflags variable, -# and Clang warns on them for every compilation unit. -# If this is passed to GCC, it will explode, so the flag must be enabled -# conditionally. -# This check taken from AX_COMPILER_FLAGS_CXXFLAGS -extra_compiler_flags_test="" -AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[ - extra_compiler_flags_test="-Werror=unknown-warning-option" -]) -# A similar check to above, but for Intel. -we is undocumented, but -# the equivalent (?) -diag-error gets accepted by GCC. 10006 is -# "unknown option", and 10148 is the more recent "unknown warning -# option" -AX_CHECK_COMPILE_FLAG([-we10006,10148],[ - extra_compiler_flags_test="-we10006,10148" -]) - -AS_IF([test "x$enable_warnings" != "xno"], [ -# Some hopefully sensible default compiler warning flags - - AX_APPEND_COMPILE_FLAGS([ dnl - -Wall dnl - -Wextra dnl - -Wnull-dereference dnl - ], [CXXFLAGS], [$extra_compiler_flags_test]) - -# Note we explicitly turn off -Wcast-function-type as PETSc *requires* -# we cast a function to the wrong type in MatFDColoringSetFunction - -# Also note that gcc ignores unknown flags of the form "-Wno-warning" -# for backwards compatibility. Therefore we need to add the positive -# form as an additional flag which it will choke on (if it doesn't -# exist). See: https://gcc.gnu.org/wiki/FAQ#wnowarning - - AX_APPEND_COMPILE_FLAGS([ dnl - -Wno-cast-function-type dnl - ], [CXXFLAGS], [$extra_compiler_flags_test "-Wcast-function-type"]) - -], [ - AC_MSG_NOTICE([Compiler warnings disabled]) -]) - -OPT_FLAGS="" -enable_checks_def=2 -AS_IF([test "$enable_debug" != ""], [ - AC_MSG_NOTICE([Enabling all debug options]) - enable_checks_def=3 - # use -Og with available, otherwise fall back to -O0 - OPT_FLAGS="-g -O0 -Og -fno-inline -hipa1" -], [ - AS_IF([test "x$enable_optimize" != "xno"], [ - AS_CASE(["$enable_optimize"], - ["default" | "yes" | ""], - [AC_MSG_NOTICE([Enabling default optimisations]) - OPT_FLAGS="-O2"], - ["fast" | "4"], - [AC_MSG_NOTICE([Enabling level 4 optimisations]) - OPT_FLAGS="-Ofast -fno-finite-math-only -march=native -funroll-loops" - enable_checks_def=0], - ["3"], - [AC_MSG_NOTICE([Enabling level 3 optimisations]) - OPT_FLAGS="-O3 -march=native -funroll-loops" - enable_checks_def=0], - ["2"], - [AC_MSG_NOTICE([Enabling level 2 optimisations]) - OPT_FLAGS="-O2 -march=native" - enable_checks_def=1], - ["1" | "0"], - [AC_MSG_NOTICE([Enabling level $enable_optimize optimisations]) - OPT_FLAGS="-O$enable_optimize"], - [ - AC_MSG_ERROR([unrecognized option: --enable-optimize=$enable_optimize]) - ]) - ], [OPT_FLAGS=""]) -]) - -# Append optimisation/debug flags if they work with this compiler -AX_APPEND_COMPILE_FLAGS([ dnl - $OPT_FLAGS dnl -], [CXXFLAGS], [$extra_compiler_flags_test]) - -# Disable checks if optimization > 2 is used -AS_IF([test "x$enable_checks" = "xdefault" ], [ - enable_checks=$enable_checks_def -]) - -BOUT_CHECK_LEVEL=0 -AS_IF([test "x$enable_checks" != "xno" && test "x$enable_checks" != "x0"], [ - AC_MSG_NOTICE([Run-time checking enabled]) - AS_CASE([$enable_checks], - [1], [AC_MSG_NOTICE([ -> Level 1 (Basic checking)]) - CXXFLAGS="$CXXFLAGS -DCHECK=1" - BOUT_CHECK_LEVEL=1], - [3], [AC_MSG_NOTICE([ -> Level 3 (Full checking)]) - enable_output_debug=yes - CXXFLAGS="$CXXFLAGS -DCHECK=3" - BOUT_CHECK_LEVEL=3], - [AC_MSG_NOTICE([ -> Level 2 (Enhanced checking)]) - CXXFLAGS="$CXXFLAGS -DCHECK=2" - BOUT_CHECK_LEVEL=2]) -], [ - AC_MSG_NOTICE([Run-time checking disabled]) -]) - -BOUT_USE_MSGSTACK=$(test $BOUT_CHECK_LEVEL -gt 1 && echo yes || echo no) -AS_IF([test "x$enable_msgstack" = "xyes" ], [ - BOUT_USE_MSGSTACK=yes -], [ - AS_IF([test "x$enable_msgstack" = "xno" ], [ - BOUT_USE_MSGSTACK=no - ], []) -]) -AS_IF([test $BOUT_USE_MSGSTACK = no ], [ - AC_MSG_NOTICE([Stack tracing disabled]) -], [ - AC_MSG_NOTICE([Stack tracing enabled]) -]) - -BOUT_USE_SIGNAL=no -AS_IF([test "x$enable_signal" != "xno"], [ - AC_MSG_NOTICE([Segmentation fault handling enabled]) - BOUT_USE_SIGNAL=yes -], [ - AC_MSG_NOTICE([Segmentation fault handling disabled]) -]) - -BOUT_USE_COLOR=no -AS_IF([test "x$enable_color" != "xno"], [ - AC_MSG_NOTICE([Output coloring enabled]) - BOUT_USE_COLOR=yes -], [ - AC_MSG_NOTICE([Output coloring disabled]) -]) - -BOUT_USE_TRACK=no -AS_IF([test "x$enable_track" = "xyes"], [ - AC_MSG_NOTICE([Field name tracking enabled]) - BOUT_USE_TRACK=yes -], [ - AC_MSG_NOTICE([Field name tracking disabled]) -]) - -BOUT_USE_SIGFPE=no -AS_IF([test "x$enable_sigfpe" = "xyes"], [ - AC_MSG_NOTICE([Signaling floating point exceptions enabled]) - BOUT_USE_SIGFPE=yes -], [ - AC_MSG_NOTICE([Signaling floating point exceptions disabled]) -]) - -BOUT_USE_OUTPUT_DEBUG=no -AS_IF([test "x$enable_output_debug" = "xyes"], [ - AC_MSG_NOTICE([Extra debug output enabled]) - BOUT_USE_OUTPUT_DEBUG=yes -], [ - AC_MSG_NOTICE([Extra debug output disabled]) -]) - -BOUT_VERSION=$PACKAGE_VERSION -BOUT_VERSION_MAJOR=$(echo $PACKAGE_VERSION | cut -d. -f1) -BOUT_VERSION_MINOR=$(echo $PACKAGE_VERSION | cut -d. -f2) -BOUT_VERSION_PATCH=$(echo ${PACKAGE_VERSION%-*} | cut -d. -f3) -BOUT_VERSION_TAG=$(echo $PACKAGE_VERSION | cut -d- -f2) - -############################################################# -# Enable Backtrace if possible -############################################################# - -BOUT_USE_BACKTRACE=no -AS_IF([test "x$enable_backtrace" = "xyes" || test "x$enable_backtrace" = "xmaybe"], [ - AC_CHECK_PROG([works], [addr2line], [yes], [no]) - - AS_IF([test $works = yes], [ - AC_CHECK_FUNCS([popen backtrace], [works=yes], [works=no; break]) - ]) - - AS_IF([test $works = yes], [ - AC_CHECK_HEADERS([execinfo.h dlfcn.h], [works=yes], [works=no; break]) - ]) - - AS_IF([test $works = yes], [ - AC_SEARCH_LIBS([dladdr], [dl], [works=yes], [works=no; break]) - ]) - - AS_IF([test $works = yes], [ - AC_MSG_NOTICE([Native backtrace enabled]) - BOUT_USE_BACKTRACE=yes - ], [ - AS_IF([test "x$enable_backtrace" = "xyes"], [ - AC_MSG_ERROR([backtrace requested, but cannot be enabled]) - ], [ - AC_MSG_WARN([Native backtrace disabled]) - ]) - ]) -]) - -AS_IF([test "x$enable_metric_3d" != "xno"], [ - AC_MSG_WARN([Using Field3D to store coordinates data, this is experimental.]) - BOUT_METRIC_TYPE="3D" -], [ - AC_MSG_NOTICE([Using Field2D to store coordinates data]) - BOUT_METRIC_TYPE="2D" -]) - -############################################################# -# Build into shared object (pic) -############################################################# - -LIB_TO_BUILD='' -AS_IF([test "x$enable_shared" = "xyes"], [ - # compile as position independent code. - # -fpic is apparently faster then -fPIC, but -fPIC works always. - # From a SO comment (https://stackoverflow.com/a/3544211/3384414): - # What's more: I did a little experiment here (on x86_64 - # platform), -fPIC and -fpic appears to have generated the same - # code. It seems they generate a different code only on m68k, - # PowerPC and SPARC. - # Therfore use -fPIC for now - CXXFLAGS="$CXXFLAGS -fPIC" - LIB_TO_BUILD="$LIB_TO_BUILD"' $(BOUT_LIB_PATH)/libbout++.so' - AS_IF([test "x$enable_static" = "xauto"], [ - enable_static=no - ]) - SHARED_EXTRA=':' - AS_IF([test "x$enable_static" = "xno"], [ - SHARED_EXTRA='$(RM) -f $(BOUT_LIB_PATH)/libbout++.a' - ]) -], [ - AS_IF([test "x$enable_static" = "xauto"], [ - enable_static=yes - ]) -]) - -AS_IF([test "x$enable_static" = "xyes"], [ - LIB_TO_BUILD="$LIB_TO_BUILD"' $(BOUT_LIB_PATH)/libbout++.a' - STATIC_EXTRA=':' - # In case we only build static, make sure shared libs are removed - AS_IF([! test "x$enable_shared" = "xyes"], [ - STATIC_EXTRA='$(RM) -f $(BOUT_LIB_PATH)/*.so*' - ]) -]) - -AS_IF([test "x$LIB_TO_BUILD" = x ], [ - AC_MSG_ERROR([Need to enable at least one of static or shared!]) -]) - -############################################################# -# Git revision number -############################################################# - -rev=`git rev-parse HEAD` -AS_IF([test $? = 0], [ - AC_MSG_NOTICE([Git revision: $rev]) - BOUT_REVISION=$rev -], [ - BOUT_REVISION= -]) - -############################################################# -# FFT routines -############################################################# - -AS_IF([test "x$with_fftw" != "xno"], [ -AC_PATH_PROG([fftw_path], [fftw-wisdom], [no], [$with_fftw$PATH_SEPARATOR$PATH]) - - AS_IF([test "x$fftw_path" != "xno"], [ - fftw_wisdom0=`AS_DIRNAME(["$fftw_path"])` - fftw_wisdom=`AS_DIRNAME(["$fftw_wisdom0"])` - with_fftw="$with_fftw $fftw_wisdom" - ], AC_MSG_NOTICE([FFTW3 requested but fftw-wisdom not found])) - - BOUT_ADDPATH_CHECK_HEADER(fftw3.h, ,AC_MSG_ERROR([FFTW3 requested but header not found]), $with_fftw) - BOUT_ADDPATH_CHECK_LIB(fftw3, fftw_plan_dft_r2c_1d, ,AC_MSG_ERROR([FFTW3 requested but library not found]), $with_fftw) - - BOUT_HAS_FFTW="yes" -], -[ -AC_MSG_NOTICE([Configuring without FFTW3 is not recommended]) -BOUT_HAS_FFTW="no" -]) - -############################################################# -# netCDF support -############################################################# - -NCCONF="" # Configuration script - -BOUT_HAS_NETCDF=no -BOUT_HAS_LEGACY_NETCDF=no -AS_IF([test "x$with_netcdf" != "xno"], -[ - ########################################## - # Try to find a valid NetCDF configuration - # - # at first, try to find ncconf script - - # Search for NetCDF config scripts, prefer ncxx4-config over nc-config - # Check if the path to the config script has been supplied directly, otherwise - # check the path provided by --with-netcdf, appending "/bin" if need - # be, then check system path - # Set NCCONF to the full path of the found scropt - AS_CASE([`basename $with_netcdf 2> /dev/null`], - ["ncxx4-config"], [NCCONF=$with_netcdf], - ["nc-config"], [NCCONF=$with_netcdf], - [AC_PATH_PROGS([NCCONF], [ncxx4-config nc-config], [], - [$with_netcdf$PATH_SEPARATOR$with_netcdf/bin$PATH_SEPARATOR$PATH])]) - - ########################################## - # Get configuration - AS_IF([test "x$NCCONF" != "x" ], - [ - # If we found nc-config rather than ncxx4-config, we need to check if it supports C++ - AS_IF([test `basename $NCCONF` = 'nc-config'], - [AC_MSG_CHECKING([if $NCCONF has C++4 support]) - nc_has_cpp4=`$NCCONF --has-c++4` - AC_MSG_RESULT([$nc_has_cpp4]) - AC_MSG_CHECKING([if $NCCONF has C++ support]) - nc_has_cpp=`$NCCONF --has-c++` - AC_MSG_RESULT([$nc_has_cpp]) - ], [ - nc_has_cpp4="yes" - ]) - - NCINC=`$NCCONF --cflags` - EXTRA_INCS="$EXTRA_INCS $NCINC" - AS_IF([test "x$nc_has_cpp4" = "xyes"], - [ - NCLIB=`$NCCONF --libs` - BOUT_HAS_NETCDF=yes - AC_MSG_NOTICE([ -> NetCDF-4 support enabled]) - ], [ - # nc-config might not *say* it has C++ support, but we can try anyway - AC_MSG_CHECKING([if we can compile NetCDF with C++]) - # Note netcdf_c++ needed - NCLIB=`$NCCONF --libs | sed s/-lnetcdf/-lnetcdf_c++\ -lnetcdf/` - - save_LIBS=$LIBS - save_LDFLAGS=$LDFLAGS - save_CXXFLAGS=$CXXFLAGS - AC_LANG_PUSH([C++]) - LIBS="$save_LIBS $NCLIB" - LDFLAGS="$save_LDFLAGS $NCLIB" - CXXFLAGS="$save_CXXFLAGS $NCINC" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([ - #include - ], [NcFile file("foo.nc");])], - [AC_MSG_RESULT([yes]) - AC_MSG_NOTICE([ -> Legacy NetCDF support enabled])], - [AC_MSG_RESULT([no]) - AC_MSG_FAILURE([*** Could not compile NetCDF C++ program!])]) - AC_LANG_POP([C++]) - LIBS=$save_LIBS - LDFLAGS=$save_LDFLAGS - CXXFLAGS="$save_CXXFLAGS" - BOUT_HAS_NETCDF=yes - BOUT_HAS_LEGACY_NETCDF=yes - ]) - EXTRA_LIBS="$EXTRA_LIBS $NCLIB" - - file_formats="$file_formats netCDF" - NCPATH="found" - NCFOUND=yes - ], [ - # if nc-config / ncxx4-config is not found, try to find library directly - BOUT_MSG_DEBUG([calling bout addpath]) - BOUT_ADDPATH_CHECK_HEADER(netcdfcpp.h, - BOUT_ADDPATH_CHECK_LIB(netcdf, nc_get_att, - BOUT_ADDPATH_CHECK_LIB(netcdf_c++, nc_close, NCFOUND=yes, NCFOUND=no, [$with_netcdf]), - NCFOUND=no, [$with_netcdf]), - NCFOUND=no, [$with_netcdf]) - - AS_IF([test "x$NCFOUND" = "xyes"], - [ - file_formats="$file_formats netCDF" - AC_MSG_NOTICE([ -> Legacy NetCDF support enabled]) - NCPATH="found" - BOUT_HAS_NETCDF=yes - BOUT_HAS_LEGACY_NETCDF=yes - ], []) - ]) - - AS_IF([test $with_netcdf && test "x$NCFOUND" != "xyes" ], AC_MSG_ERROR([NetCDF requested but not found]), []) - AS_IF([test "x$NCFOUND" != "xyes"], [AC_MSG_NOTICE([ -> NetCDF support disabled])], []) -], []) - -############################################################# -# Parallel NetCDF support -############################################################# - -PNCPATH="" -AS_IF([test "$with_pnetcdf" != "no" && test "x$with_pnetcdf" != "x" ], [ - AC_MSG_NOTICE([Searching for Parallel-NetCDF library]) - - AS_IF([test "x$with_pnetcdf" != "xyes"], [ - # Given a path to the library - AC_CHECK_FILES([$with_pnetcdf/include/pnetcdf.h], [PNCPATH=$with_pnetcdf], - AC_MSG_NOTICE([parallel-netcdf not found in given directory]) - ) - ]) - - # Find the utilities included with pnetcdf - AS_IF([test "x$PNCPATH" = "x"], [ - AS_IF([test "x$with_pnetcdf" = "xyes"], [ - AC_PATH_PROG([NCMPIDUMP_PATH], [ncmpidump]) - ], [ - AC_PATH_PROG([NCMPIDUMP_PATH], [ncmpidump], [$with_pnetcdf$PATH_SEPARATOR$PATH]) - ]) - AS_IF([test "$NCMPIDUMP_PATH" != ""], [ - AC_CHECK_FILES([$NCMPIDUMP_PATH/../include/pnetcdf.h], [PNCPATH=$NCMPIDUMP_PATH/../]) - ]) - ]) - - AS_IF([test "x$PNCPATH" != "x"], [ - AC_CHECK_FILES($path/lib/libpnetcdf.a, PNCPATHLIB='lib', - AC_CHECK_FILES($path/lib64/libpnetcdf.a, PNCPATHLIB='lib64', PNCPATH='')) - ]) - - AS_IF([test "x$PNCPATH" = "x" && test "x$with_pnetcdf" != "x"], [ - AC_MSG_FAILURE([*** Parallel-NetCDF requested but not found]) - ]) -]) - -AS_IF([test "x$PNCPATH" = "x"], [ - AC_MSG_NOTICE([Parallel-NetCDF support disabled]) -], [ - # Set a compile-time flag - CXXFLAGS="$CXXFLAGS -DPNCDF" - EXTRA_INCS="$EXTRA_INCS -I$PNCPATH/include" - EXTRA_LIBS="$EXTRA_LIBS -L$PNCPATH/$PNCPATHLIB -lpnetcdf" - - file_formats="$file_formats Parallel-NetCDF" - AC_MSG_NOTICE([Parallel-NetCDF support enabled]) -]) - -############################################################# -# Check file formats -############################################################# - -AS_IF([test "x$file_formats" = "x"], [ - AC_MSG_ERROR([*** At least one file format must be supported]) -], [ - AC_MSG_NOTICE([Supported file formats:$file_formats]) -]) - -############################################################# -# LAPACK routines (Used for tri- and band-diagonal solvers) -############################################################# - -BOUT_HAS_LAPACK="no" -AS_IF([test "x$with_lapack" != "xno"], [ - AS_IF([test "x$with_lapack" = "xguess" || test "x$with_lapack" = "x" ], - [lapack_path=""], - [AS_IF([test "x$with_lapack" != xyes], - [lapack_path=$with_lapack - with_lapack=yes], - [lapack_path=""]) - ]) - BOUT_ADDPATH_CHECK_LIB(blas, zgemm_, - [BOUT_HAS_BLAS=yes], - [AS_IF([test "x$with_lapack" = "xyes"], - AC_MSG_ERROR([LAPACK requested but couldn't find BLAS]))], - $lapack_path) - BOUT_ADDPATH_CHECK_LIB(lapack, zgbsv_, - [BOUT_HAS_LAPACK=yes - AC_MSG_NOTICE([Using LAPACK]) - ], - [AS_IF([test "x$with_lapack" = "xyes"], - AC_MSG_ERROR([LAPACK requested but not found]))], - $lapack_path) -]) - -############################################################# -# PETSc library -############################################################# - -AS_IF([test "x$with_petsc" != "x" && test "$with_petsc" != "no"], [ - -# Supplying an argument to "--with-petsc" only works if PETSC_ARCH -# *should* be empty. If it should be non-empty, THIS WILL NOT WORK - AS_IF([test "$with_petsc" != "yes"], [ - PETSC_DIR="$with_petsc" - PETSC_ARCH= - ]) - - AC_MSG_NOTICE([Using PETSC_DIR=$PETSC_DIR, PETSC_ARCH=$PETSC_ARCH]) - -# Define a macro for a nice error message that preserves the -# formatting. Use like: -# -# PETSC_ERROR_MESSAGE -# -# with no identation - m4_define(PETSC_ERROR_MESSAGE, - [ You may need to specify PETSC_DIR and PETSC_ARCH like so: - --with-petsc PETSC_DIR=\$PETSC_DIR PETSC_ARCH=\$PETSC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#petsc - ]) - -# PETSc changed the location of the conf directory in 3.5, so we -# need to check both locations -# If we find nether, try to fall back to pkg-conf - PETSC_PKGCONF=no - AC_CHECK_FILE($PETSC_DIR/$PETSC_ARCH/conf, [ - PETSC_CONFDIR=${PETSC_DIR}/conf - ], [ - AC_CHECK_FILE($PETSC_DIR/$PETSC_ARCH/lib/petsc/conf, [ - PETSC_CONFDIR=${PETSC_DIR}/lib/petsc/conf - ], [ - PKG_CHECK_MODULES(PETSC, PETSc >= 3.4.0 , - PETSC_PKGCONF=yes, [ - PKG_CHECK_MODULES(PETSC, petsc >= 3.4.0 , - PETSC_PKGCONF=yes, [ - AC_MSG_ERROR([--with-petsc was specified but could not find PETSc distribution. -PETSC_ERROR_MESSAGE]) - ]) - ]) - ]) - ]) - - AS_IF([test $PETSC_PKGCONF = no] , - [ -# We've found an installation, need to check we can use it. First we -# need to be able to check the version number, for which we need -# petscverion.h - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$PETSC_DIR/include" - AC_CHECK_HEADER([petscversion.h], - [FOUND_PETSC_HEADER=yes], - [FOUND_PETSC_HEADER=no] - ) - -# This is a terrible hack for some Linux distributions (Fedora) that -# install PETSc in a non-supported fashion. This is really the fault -# of PETSc for their weird method of installation - AS_IF([test $FOUND_PETSC_HEADER = no], [ - AC_CHECK_FILE([${PETSC_CONFDIR}/petscvariables], [], [ - AC_MSG_ERROR([Unable to find either petscversion.h or petscvariables -PETSC_ERROR_MESSAGE]) - ]) - -# This relies on the assumption that PETSC_ARCH is empty - PETSC_CC_INCLUDES=$(grep ^PETSC_CC_INCLUDES ${PETSC_CONFDIR}/petscvariables | cut -d= -f 2-) - - AC_MSG_NOTICE([Looking for petscverion.h using $PETSC_CC_INCLUDES from ${PETSC_CONFDIR}/petscvariables]) - - # This is the cache variable set by the previous call to - # AC_CHECK_HEADER. We need to unset it so we can call the macro - # again, but now with different CPPFLAGS - AS_UNSET([ac_cv_header_petscversion_h]) - - CPPFLAGS="$CPPFLAGS $PETSC_CC_INCLUDES" - AC_CHECK_HEADER([petscversion.h], [], [ - AC_MSG_ERROR([Couldn't find or include petscversion.h. -PETSC_ERROR_MESSAGE]) - ]) - ], []) - -# Now we have the header we want, we can check the version number - AC_MSG_CHECKING([PETSc is at least 3.4.0]) - AC_EGREP_CPP([yes], [ - #include - #if PETSC_VERSION_GE(3, 4, 0) - yes - #endif - ], [PETSC_VERSION_OK="yes"], - [PETSC_VERSION_OK="no"]) - AC_MSG_RESULT([$PETSC_VERSION_OK]) - CPPFLAGS="$save_CPPFLAGS" - - AS_IF([test $PETSC_VERSION_OK = no], [ - AC_MSG_ERROR([PETSc version must be at least 3.4.0]) - ]) - -# Check if PETSc was compiled with SUNDIALS - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$PETSC_DIR/$PETSC_ARCH/include" - AC_MSG_CHECKING([PETSc has SUNDIALS support]) - AC_EGREP_CPP([yes], [ - #include - #ifdef PETSC_HAVE_SUNDIALS - yes - #endif - ], [PETSC_HAS_SUNDIALS="yes"], - [PETSC_HAS_SUNDIALS="no"]) - AC_MSG_RESULT([$PETSC_HAS_SUNDIALS]) - CPPFLAGS="$save_CPPFLAGS" - - AS_IF([test "$PETSC_HAS_SUNDIALS" = "yes"], [ - CXXFLAGS="$CXXFLAGS -DPETSC_HAS_SUNDIALS " - ]) - - # Set the line to be included in the make.conf file - PETSC_MAKE_INCLUDE="include ${PETSC_CONFDIR}/variables" - - BOUT_HAS_PETSC="yes" - - EXTRA_INCS="$EXTRA_INCS \$(PETSC_CC_INCLUDES)" - EXTRA_LIBS="$EXTRA_LIBS \$(PETSC_LIB)" - ], [ dnl pkg-config version - - # Check if PETSc was compiled with SUNDIALS - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $PETSC_CFLAGS" - AC_MSG_CHECKING([PETSc has SUNDIALS support]) - AC_EGREP_CPP([yes], [ - #include - #ifdef PETSC_HAVE_SUNDIALS - yes - #endif - ], [PETSC_HAS_SUNDIALS="yes"], - [PETSC_HAS_SUNDIALS="no"]) - AC_MSG_RESULT([$PETSC_HAS_SUNDIALS]) - CPPFLAGS="$save_CPPFLAGS" - - AS_IF([test "$PETSC_HAS_SUNDIALS" = "yes"], [ - CXXFLAGS="$CXXFLAGS -DPETSC_HAS_SUNDIALS " - ]) - PETSC_MAKE_INCLUDE= - BOUT_HAS_PETSC="yes" - - EXTRA_INCS="$EXTRA_INCS $PETSC_CFLAGS" - EXTRA_LIBS="$PETSC_LIBS $EXTRA_LIBS" - ]) -], [ - PETSC_MAKE_INCLUDE= - BOUT_HAS_PETSC="no" - PETSC_HAS_SUNDIALS="no" -]) - -############################################################# -# SLEPc library -############################################################# - -AS_IF([test "x$with_slepc" != "x" && test "$with_slepc" != "no"], [ - - AS_IF([test $BOUT_HAS_PETSC = "no"], [ - AC_MSG_ERROR([--with-slepc specified, but no PETSc detected. Please reconfigure and specify --with-petsc -PETSC_ERROR_MESSAGE]) - ]) - -# Supplying an argument to "--with-slepc" only works if SLEPC_ARCH -# *should* be empty. If it should be non-empty, THIS WILL NOT WORK - AS_IF([test "$with_slepc" != "yes"], [ - SLEPC_DIR="$with_slepc" - SLEPC_ARCH= - ]) - - AC_MSG_NOTICE([Using SLEPC_DIR=$SLEPC_DIR, SLEPC_ARCH=$SLEPC_ARCH]) - -# Define a macro for a nice error message that preserves the -# formatting. Use like: -# -# SLEPC_ERROR_MESSAGE -# -# with no identation - m4_define(SLEPC_ERROR_MESSAGE, - [ You may need to specify SLEPC_DIR and SLEPC_ARCH like so: - --with-slepc SLEPC_DIR=\$SLEPC_DIR SLEPC_ARCH=\$SLEPC_ARCH - Also see the help online: - http://bout-dev.readthedocs.io/en/latest/user_docs/advanced_install.html#slepc - ]) - -# Slepc changed the location of the conf directory in 3.5, so we -# need to check both locations - AC_CHECK_FILE($SLEPC_DIR/$SLEPC_ARCH/conf, [ - SLEPC_CONFDIR=${SLEPC_DIR}/conf - ], [ - AC_CHECK_FILE($SLEPC_DIR/$SLEPC_ARCH/lib/slepc/conf, [ - SLEPC_CONFDIR=${SLEPC_DIR}/lib/slepc/conf - ], [ - AC_MSG_ERROR([--with-slepc was specified but could not find Slepc distribution. -SLEPC_ERROR_MESSAGE]) - ]) - ]) - -# We've found an installation, need to check we can use it. First we -# need to be able to check the version number, for which we need -# slepcverion.h - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$SLEPC_DIR/include" - AC_CHECK_HEADER([slepcversion.h], - [FOUND_SLEPC_HEADER=yes], - [FOUND_SLEPC_HEADER=no] - ) - -# This is a terrible hack for some Linux distributions (Fedora) that -# install Slepc in a non-supported fashion. This is really the fault -# of Slepc for their weird method of installation - AS_IF([test $FOUND_SLEPC_HEADER = no], [ - AC_CHECK_FILE([${SLEPC_CONFDIR}/slepc_variables], [], [ - AC_MSG_ERROR([Unable to find either slepcversion.h or slepc_variables -SLEPC_ERROR_MESSAGE]) - ]) - -# This relies on the assumption that SLEPC_ARCH is empty - SLEPC_CC_INCLUDES=$(grep ^SLEPC_CC_INCLUDES ${SLEPC_CONFDIR}/slepc_variables | cut -d= -f 2-) - - AC_MSG_NOTICE([Looking for slepcverion.h using $SLEPC_CC_INCLUDES from ${SLEPC_CONFDIR}/slepc_variables]) - - # This is the cache variable set by the previous call to - # AC_CHECK_HEADER. We need to unset it so we can call the macro - # again, but now with different CPPFLAGS - AS_UNSET([ac_cv_header_slepcversion_h]) - - CPPFLAGS="$CPPFLAGS $SLEPC_CC_INCLUDES" - AC_CHECK_HEADER([slepcversion.h], [], [ - AC_MSG_ERROR([Couldn't find or include slepcversion.h. -SLEPC_ERROR_MESSAGE]) - ]) - ], []) - -# Now we have the header we want, we can check the version number - AC_MSG_CHECKING([Slepc is at least 3.4.0]) - AC_EGREP_CPP([yes], [ - #include - #if SLEPC_VERSION_GE(3, 4, 0) - yes - #endif - ], [SLEPC_VERSION_OK="yes"], - [SLEPC_VERSION_OK="no"]) - AC_MSG_RESULT([$SLEPC_VERSION_OK]) - CPPFLAGS="$save_CPPFLAGS" - - AS_IF([test $SLEPC_VERSION_OK = no], [ - AC_MSG_ERROR([Slepc version must be at least 3.4.0]) - ]) - -# Check if Slepc was compiled with SUNDIALS - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$SLEPC_DIR/$SLEPC_ARCH/include" - - # Set the line to be included in the make.conf file - SLEPC_MAKE_INCLUDE="include ${SLEPC_CONFDIR}/slepc_variables" - - BOUT_HAS_SLEPC="yes" - - EXTRA_INCS="$EXTRA_INCS \$(SLEPC_INCLUDE)" - EXTRA_LIBS="$EXTRA_LIBS \$(SLEPC_LIB)" - -], [ - SLEPC_MAKE_INCLUDE= - BOUT_HAS_SLEPC="no" -]) - -############################################################# -# Solver choice: SUNDIALS' IDA, SUNDIALS' CVODE, PVODE -############################################################# - -BOUT_HAS_SUNDIALS=no -AS_IF([test "x$with_sundials" != "x" && test "x$with_sundials" != "xno"], [ - - # Now follows a few different checks for the version of SUNDIALS. - # We need the sundials_config.h header, which comes with all the - # versions we care about - - # If we've been given a path, look in there first - AS_IF([test "x$with_sundials" != "xyes"], [ - AC_CHECK_FILE([$with_sundials/include/sundials/sundials_config.h], - [SUNDIALS_INC=$with_sundials/include], [SUNDIALS_INC=""]) - ]) - - # If we've got one, add the include dir to the preprocessor flags - save_CPPFLAGS=$CPPFLAGS - AS_IF([test "x$SUNDIALS_INC" != "x"], [CPPFLAGS="-I$SUNDIALS_INC"]) - - AC_MSG_CHECKING([for SUNDIALS config header]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ - #include "sundials/sundials_config.h" - ], [])], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_MSG_FAILURE([*** Could not determine SUNDIALS version])]) - - AC_MSG_CHECKING([for SUNDIALS minor version]) - AC_EGREP_CPP([^ *\"? *[12]\.[0-5]\.], [ - #include "sundials/sundials_config.h" - #ifdef SUNDIALS_PACKAGE_VERSION - SUNDIALS_PACKAGE_VERSION - #endif - ], [sundials_minor_ver="too low"], [sundials_minor_ver=ok]) - AC_MSG_RESULT([$sundials_minor_ver]) - - CPPFLAGS=$save_CPPFLAGS - - AS_IF([test "$sundials_minor_ver" = "too low"], [ - AC_MSG_FAILURE([*** Unsupported SUNDIALS version: Requires at least 2.6]) - ]) - - # Set both IDA and CVODE if not set already - AS_IF([test "x$with_ida" = "x"], [ - with_ida=$with_sundials - ]) - - AS_IF([test "x$with_cvode" = "x"], [ - with_cvode=$with_sundials - ]) - - AS_IF([test "x$with_arkode" = "x"], [ - with_arkode=$with_sundials - ]) - BOUT_HAS_SUNDIALS=yes -]) - -AS_IF([test "x$with_ida" != "x" && test "x$with_ida" != "xno"], [ - BOUT_FIND_SUNDIALS_MODULE([ida], [ - #include - #include - extern void foo(N_Vector); - ], [IDACreate();]) -]) - -AS_IF([test "x$with_cvode" != "x" && test "x$with_cvode" != "xno"], [ - BOUT_FIND_SUNDIALS_MODULE([cvode], [ - #include - #include - extern void foo(N_Vector); - ], [ - #if SUNDIALS_VERSION_MAJOR >= 4 - CVodeCreate(0); - #else - CVodeCreate(0, 0); - #endif - ]) -]) - -AS_IF([test "x$with_arkode" != "x" && test "x$with_arkode" != "xno"], [ - BOUT_FIND_SUNDIALS_MODULE([arkode], [ - #include - #if SUNDIALS_VERSION_MAJOR >= 4 - #include - #else - #include - #endif - extern void foo(N_Vector); - ], [ - #if SUNDIALS_VERSION_MAJOR >= 4 - ARKStepCreate(0, 0, 0, 0); - #else - ARKodeCreate(); - #endif - ]) -]) - -############################################################# -# HYPRE -############################################################# - -BOUT_HAS_HYPRE="no" -AS_IF([test "$with_hypre" != "no"], [ - BOUT_ADDPATH_CHECK_HEADER(HYPRE.h, - BOUT_ADDPATH_CHECK_LIB(HYPRE, HYPRE_IJVectorCreate, - [ - BOUT_HAS_HYPRE="yes" - ], - AC_MSG_ERROR([HYPRE requested but not found]), - $with_hypre), - AC_MSG_ERROR([HYPRE requested but not found]), - $with_hypre - ) -]) - -############################################################# -# Scorep setup -############################################################# - -BOUT_HAS_SCOREP="no" -AS_IF([test "$with_scorep" != "no"], [ - - AS_IF([test "$with_scorep" != "yes"], [ - AC_MSG_NOTICE([Searching for Scorep executable in $with_scorep]) - AC_PATH_PROG([SCOREPPATH], [scorep], [], [$with_scorep]) - ], [ - AC_MSG_NOTICE([Searching for Scorep executable]) - AC_PATH_PROG([SCOREPPATH], [scorep], []) - ]) - - AS_IF([test "$SCOREPPATH" = ""], [ - AC_MSG_FAILURE([*** Scorep requested, but executable not found. -Please supply the path using --with-scorep=/path/to/scorep]) - ],[ - CXX="$SCOREPPATH --user --nocompiler $CXX" - BOUT_HAS_SCOREP="yes" - AC_MSG_NOTICE([Scorep support enabled]) - ]) - - ],[ - AC_MSG_NOTICE([Scorep support disabled]) -]) - -############################################################# -# Check for mpark.variant -############################################################# - -AS_IF([test ".$with_system_mpark" = "no"], [ - SYSTEM_HAS_MPARK=no -], [ - AC_MSG_CHECKING([for mpark.variant]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ - #include "mpark/variant.hpp" - ], [])], - [AC_MSG_RESULT([yes]) - SYSTEM_HAS_MPARK=yes], - [AC_MSG_RESULT([no]) - SYSTEM_HAS_MPARK=no - AS_IF([test "$with_system_mpark" = "yes"], [ - AC_MSG_FAILURE([*** System mpark.variant not found - but requested to use]) - ])]) -]) - -AS_IF([test "$SYSTEM_HAS_MPARK" = "yes"], [ - MPARK_VARIANT_INCLUDE_PATH= - MPARK_INCLUDE= - OWN_MPARK= -], [ - AS_IF([test -d externalpackages/mpark.variant/include], [], - [ AS_IF([test -d .git && which git], [ - make -f makefile.submodules mpark_submodule || \ - AC_MSG_FAILURE([*** Could not download mpark.variant]) - ], [ - AC_MSG_FAILURE([mpark.variant not found. Please install mpark.variant or use the official releases.]) - ]) - ]) - - MPARK_VARIANT_INCLUDE_PATH="$PWD/externalpackages/mpark.variant/include" - MPARK_INCLUDE="-I$MPARK_VARIANT_INCLUDE_PATH" - OWN_MPARK=yes -]) - -############################################################# -# Check for libuuid -############################################################# - -AS_IF([test ".$with_system_uuid" = "no"], [ - BOUT_HAS_UUID_SYSTEM_GENERATOR=no -], [ - BOUT_ADDPATH_CHECK_HEADER(uuid/uuid.h, - BOUT_ADDPATH_CHECK_LIB(uuid, uuid_generate, - BOUT_HAS_UUID_SYSTEM_GENERATOR=yes, - BOUT_HAS_UUID_SYSTEM_GENERATOR=no, - [$with_system_uuid]), - BOUT_HAS_UUID_SYSTEM_GENERATOR=no, - [$with_system_uuid]) - AS_IF([test "$with_system_uuid" = "yes"], [ - AC_MSG_FAILURE([*** System UUID generator not found, but explicitly requested]) - ]) -]) - -############################################################# -# Download + Build PVODE '98 -############################################################# - -AS_MKDIR_P(externalpackages) -AS_MKDIR_P(lib) -AS_MKDIR_P(include) - -BOUT_HAS_PVODE="no" -AS_IF([test "$with_pvode" != "no"], [ - AS_IF([test "$enable_pvode_openmp" != "no" ], [ - AS_IF([test "$enable_openmp" != "no" ], [ - PVODE_FLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" - AC_MSG_NOTICE([PVODE being built with OpenMP support]) - ], [ - AC_MSG_ERROR([Cannot enable openmp in PVODE as configuring with OpenMP disabled]) - ]) - ], [ - PVODE_FLAGS="$CXXFLAGS" - AC_MSG_NOTICE([PVODE being built without OpenMP support]) - ]) - # Clean PVODE - CXX="$CXX" CXXFLAGS=$PVODE_FLAGS MKDIR="$MKDIR_P" RANLIB="$RANLIB" $MAKE clean -C externalpackages/PVODE/precon/ >> config-build.log 2>&1 - CXX="$CXX" CXXFLAGS=$PVODE_FLAGS MKDIR="$MKDIR_P" RANLIB="$RANLIB" $MAKE clean -C externalpackages/PVODE/source/ >> config-build.log 2>&1 - - AC_MSG_NOTICE([Building PVODE]) - echo "* Building PVODE" >> config-build.log - echo "*************************************************************" >> config-build.log - - CXX="$CXX" CXXFLAGS=$PVODE_FLAGS MKDIR="$MKDIR_P" RANLIB="$RANLIB" $MAKE -C externalpackages/PVODE/precon/ >> config-build.log 2>&1 - CXX="$CXX" CXXFLAGS=$PVODE_FLAGS MKDIR="$MKDIR_P" RANLIB="$RANLIB" $MAKE -C externalpackages/PVODE/source/ >> config-build.log 2>&1 - - AS_IF([test -f externalpackages/PVODE/lib/libpvode.a && test -f externalpackages/PVODE/lib/libpvpre.a], [ - AC_MSG_NOTICE([Successfully built PVODE]) - AC_MSG_NOTICE([Installing PVODE into BOUT++ sourcetree]) - - echo "*************************************************************" >> config-build.log - echo "* Successfully built PVODE" >> config-build.log - echo "*************************************************************" >> config-build.log - echo "* Installing PVODE into BOUT++ sourcetree" >> config-build.log - echo "*************************************************************" >> config-build.log - ], [ - AC_MSG_ERROR(Could not build PVODE. See config-build.log for errors) - ]) - - # Set the correct libraries and copy them to bout - AS_MKDIR_P(include/pvode) - cp -r externalpackages/PVODE/include/pvode include - cp externalpackages/PVODE/lib/*.a lib/ - EXTRA_LIBS="$EXTRA_LIBS -L\$(BOUT_LIB_PATH) -lpvode -lpvpre" - BOUT_HAS_PVODE="yes" -]) - -############################################################# -# Localisation (i18n) with gettext -############################################################# - -BOUT_HAS_GETTEXT="no" -# Use macro to test if Natural Language Support (gettext) is available. -# If available sets: -# - USE_NLS to "yes" -# - LIBINTL to the linker options -# - Modifies CPPFLAGS if needed -AM_GNU_GETTEXT([external]) -AS_IF([test "$USE_NLS" = "yes"], [ - AC_MSG_NOTICE([Enabling language support with gettext]) - # Turn the .po files into .mo files - $MAKE -C locale | tee -a config-build.log 2>&1 - - # Note: BOUT_LOCALE_PATH is defined in make.config, and may be changed by `make install`. - CXXFLAGS="$CXXFLAGS -DBOUT_LOCALE_PATH=\$(BOUT_LOCALE_PATH)" - - EXTRA_LIBS="$EXTRA_LIBS $LIBINTL" - - # Set variable substituted into bout-config - BOUT_HAS_GETTEXT="yes" -],[ - AC_MSG_NOTICE([Language support with gettext not available]) -]) - -############################################################# -# Sort out fmt -############################################################# - -dnl If in a git repo, get submodule, unless BOUT_DONT_UPDATE_GIT_SUBMODULE is set -AC_CHECK_FILE([.git], [ - AS_IF([test "x$BOUT_DONT_UPDATE_GIT_SUBMODULE" == "x"], [ - git submodule update --init externalpackages/fmt - ]) -]) - -dnl Copy the one file we need to somewhere else -AC_CONFIG_LINKS(src/fmt/format.cxx:externalpackages/fmt/src/format.cc) - -############################################################# -# Check environment -############################################################# - -AS_IF([test "$CXXINCLUDE" != ""], [ - AC_MSG_NOTICE([================================================]) - AC_MSG_NOTICE([ WARNING: CXXINCLUDE environment variable set to:]) - AC_MSG_NOTICE([$CXXINCLUDE]) - AC_MSG_NOTICE([ => This will be added to compile commands]) - AC_MSG_NOTICE([ If this is not intended, then run]) - AC_MSG_NOTICE([ export CXXINCLUDE='']) - AC_MSG_NOTICE([ before making BOUT++]) - AC_MSG_NOTICE([================================================]) -]) - -############################################################# -# Gather configuration info for bout-config -############################################################# - -EXTRA_INCS="${EXTRA_INCS} ${CPPFLAGS}" - -PREFIX=$PWD -IDLCONFIGPATH=$PWD/tools/idllib -PYTHONCONFIGPATH=$PWD/tools/pylib - -BOUT_HAS_IDA="yes" -if test "$IDALIBS" = "" -then - BOUT_HAS_IDA="no" -fi - -BOUT_HAS_CVODE="yes" -if test "$CVODELIBS" = "" -then - BOUT_HAS_CVODE="no" -fi - -BOUT_HAS_ARKODE="yes" -if test "$ARKODELIBS" = "" -then - BOUT_HAS_ARKODE="no" -fi - -BOUT_HAS_PNETCDF="yes" -if test "$PNCPATH" = "" -then - BOUT_HAS_PNETCDF="no" -fi - -# Only make.config is altered by configure -AC_CONFIG_FILES([make.config]) -AC_OUTPUT - -############################################################# -# Use a dummy Makefile to get the cflags and ldflags -# -# This is to capture flags from external libraries such -# as PETSc -############################################################# - -CONFIG_CFLAGS=`$MAKE cflags -f output.make` -CONFIG_LDFLAGS=`$MAKE ldflags -f output.make` - -############################################################# -# Defines which are supported by CMake build but not autoconf - -BOUT_HAS_CUDA="no" -BOUT_HAS_RAJA="no" -BOUT_HAS_UMPIRE="no" -BOUT_HAS_CALIPER="no" -BOUT_HAS_ADIOS="no" - -BOUT_DEFINE_SUBST(BOUT_HAS_CUDA, [Enable CUDA]) -BOUT_DEFINE_SUBST(BOUT_HAS_RAJA, [RAJA support]) -BOUT_DEFINE_SUBST(BOUT_HAS_UMPIRE, [Umpire support]) -BOUT_DEFINE_SUBST(BOUT_HAS_CALIPER, [Caliper support]) -BOUT_DEFINE_SUBST(BOUT_HAS_ADIOS, [ADIOS support]) - -############################################################# -# Write configuration to bout-config -############################################################# - -AC_SUBST(CONFIG_CFLAGS) -AC_SUBST(CONFIG_LDFLAGS) - -# Set path to lib and include here. -# If make install is run then that replaces these paths -BOUT_LIB_PATH=$PWD/lib -BOUT_INCLUDE_PATH=$PWD/include -FMT_INCLUDE_PATH=$PWD/externalpackages/fmt/include -AC_SUBST(BOUT_LIB_PATH) -AC_SUBST(BOUT_INCLUDE_PATH) -AC_SUBST(FMT_INCLUDE_PATH) -AC_SUBST(MPARK_VARIANT_INCLUDE_PATH) -AC_SUBST(MPARK_INCLUDE) -AC_SUBST(OWN_MPARK) - -AC_SUBST(PREFIX) -AC_SUBST(IDLCONFIGPATH) -AC_SUBST(PYTHONCONFIGPATH) -AC_SUBST(LIB_TO_BUILD) -AC_SUBST(STATIC_EXTRA) -AC_SUBST(SHARED_EXTRA) - -AC_SUBST(BOUT_VERSION) -AC_SUBST(BOUT_VERSION_MAJOR) -AC_SUBST(BOUT_VERSION_MINOR) -AC_SUBST(BOUT_VERSION_PATCH) -AC_SUBST(BOUT_VERSION_TAG) -AC_SUBST(BOUT_REVISION) - -AC_SUBST(BOUT_CHECK_LEVEL) -AC_DEFINE_UNQUOTED(BOUT_CHECK_LEVEL, [$BOUT_CHECK_LEVEL], [Runtime error checking level]) - -AC_SUBST(BOUT_OPENMP_SCHEDULE) -AC_DEFINE_UNQUOTED(BOUT_OPENMP_SCHEDULE, [$BOUT_OPENMP_SCHEDULE], [OpenMP schedule]) - -BOUT_DEFINE_SUBST(BOUT_HAS_ARKODE, [ARKODE support]) -BOUT_DEFINE_SUBST(BOUT_HAS_CVODE, [CVODE support]) -BOUT_DEFINE_SUBST(BOUT_HAS_FFTW, [FFTW support]) -BOUT_DEFINE_SUBST(BOUT_HAS_GETTEXT, [NLS support]) -BOUT_DEFINE_SUBST(BOUT_HAS_IDA, [IDA support]) -BOUT_DEFINE_SUBST(BOUT_HAS_LAPACK, [LAPACK support]) -BOUT_DEFINE_SUBST(BOUT_HAS_NETCDF, [NETCDF support]) -BOUT_DEFINE_SUBST(BOUT_HAS_LEGACY_NETCDF, [NETCDF support]) -BOUT_DEFINE_SUBST(BOUT_HAS_PETSC, [PETSc support]) -BOUT_DEFINE_SUBST(BOUT_HAS_HYPRE, [Hypre support]) -BOUT_DEFINE_SUBST(BOUT_HAS_PNETCDF, [PNETCDF support]) -BOUT_DEFINE_SUBST(BOUT_HAS_PRETTY_FUNCTION, [Compiler PRETTYFUNCTION support]) -BOUT_DEFINE_SUBST(BOUT_HAS_PVODE, [PVODE support]) -BOUT_DEFINE_SUBST(BOUT_HAS_SCOREP, [Score-P support]) -BOUT_DEFINE_SUBST(BOUT_HAS_SLEPC, [SLEPc support]) -BOUT_DEFINE_SUBST(BOUT_HAS_SUNDIALS, [SUNDIALS support]) -BOUT_DEFINE_SUBST(BOUT_HAS_UUID_SYSTEM_GENERATOR, [Use libuuid for UUID generation]) -BOUT_DEFINE_SUBST(BOUT_USE_BACKTRACE, [Enable backtrace in exceptions]) -BOUT_DEFINE_SUBST(BOUT_USE_COLOR, [Enable color logs option]) -BOUT_DEFINE_SUBST(BOUT_USE_OUTPUT_DEBUG, [Enabled extra debug output]) -BOUT_DEFINE_SUBST(BOUT_USE_OPENMP, [Enable OpenMP]) -BOUT_DEFINE_SUBST(BOUT_USE_SIGFPE, [Enable floating point exceptions]) -BOUT_DEFINE_SUBST(BOUT_USE_SIGNAL, [Enable signal handlers]) -BOUT_DEFINE_SUBST(BOUT_USE_TRACK, [Enable field name tracking]) -BOUT_DEFINE_SUBST(BOUT_USE_MSGSTACK, [Enable MsgStack for traces]) -AC_DEFINE_UNQUOTED([BOUT_METRIC_TYPE], $BOUT_METRIC_TYPE, [Type of the metric fields]) -BOUT_METRIC_3D=$(test $BOUT_METRIC_TYPE != 3D ; echo $?) -AC_DEFINE_UNQUOTED([BOUT_USE_METRIC_3D], $BOUT_METRIC_3D, [Is the metric field 3D]) -AC_SUBST(BOUT_METRIC_TYPE) - -AC_SUBST(PETSC_HAS_SUNDIALS) -AC_SUBST(PETSC_MAKE_INCLUDE) -AC_SUBST(PETSC_DIR) -AC_SUBST(PETSC_ARCH) -AC_SUBST(SLEPC_MAKE_INCLUDE) -AC_SUBST(SLEPC_DIR) -AC_SUBST(SLEPC_ARCH) - - -AC_CONFIG_HEADERS([include/bout/build_defines.hxx:autoconf_build_defines.hxx.in]) -AC_CONFIG_FILES([include/bout/version.hxx]) -AC_CONFIG_FILES([include/bout/revision.hxx]) -AC_CONFIG_FILES([bin/bout-config]) -AC_CONFIG_FILES([src/makefile]) -AC_CONFIG_FILES([tools/pylib/boutconfig/__init__.py]) -AC_OUTPUT -chmod a+x bin/bout-config - -############################################################# -# Print configuration info -############################################################# - -AC_MSG_NOTICE([-------------------------]) -AC_MSG_NOTICE([ Configuration summary ]) -AC_MSG_NOTICE([-------------------------]) - -AC_MSG_NOTICE([ PETSc support : $BOUT_HAS_PETSC (has SUNDIALS: $PETSC_HAS_SUNDIALS)]) -AC_MSG_NOTICE([ SLEPc support : $BOUT_HAS_SLEPC]) -AC_MSG_NOTICE([ IDA support : $BOUT_HAS_IDA]) -AC_MSG_NOTICE([ CVODE support : $BOUT_HAS_CVODE]) -AC_MSG_NOTICE([ ARKODE support : $BOUT_HAS_ARKODE]) -AC_MSG_NOTICE([ FFTW support : $BOUT_HAS_FFTW]) -AC_MSG_NOTICE([ NetCDF support : $BOUT_HAS_NETCDF (legacy: $BOUT_HAS_LEGACY_NETCDF)]) -AC_MSG_NOTICE([ Parallel-NetCDF support : $BOUT_HAS_PNETCDF]) -AC_MSG_NOTICE([ Lapack support : $BOUT_HAS_LAPACK]) -AC_MSG_NOTICE([ Scorep support : $BOUT_HAS_SCOREP]) -AC_MSG_NOTICE([ OpenMP support : $BOUT_USE_OPENMP (schedule: $OPENMP_SCHEDULE)]) -AC_MSG_NOTICE([ Natural language support: $BOUT_HAS_GETTEXT (path: $localedir)]) -AC_MSG_NOTICE([ HYPRE support : $BOUT_HAS_HYPRE]) -AC_MSG_NOTICE([ System UUID generator : $BOUT_HAS_UUID_SYSTEM_GENERATOR]) -AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ Enable backtrace : $BOUT_USE_BACKTRACE]) -AC_MSG_NOTICE([ Enable color logs : $BOUT_USE_COLOR]) -AC_MSG_NOTICE([ Enable more debug output: $BOUT_USE_OUTPUT_DEBUG]) -AC_MSG_NOTICE([ Enable OpenMP : $BOUT_USE_OPENMP]) -AC_MSG_NOTICE([ Enable FP exceptions : $BOUT_USE_SIGFPE]) -AC_MSG_NOTICE([ Enable signal handlers : $BOUT_USE_SIGNAL]) -AC_MSG_NOTICE([ Enable field names : $BOUT_USE_TRACK]) -AC_MSG_NOTICE([ Metric type : $BOUT_METRIC_TYPE]) - -AC_MSG_NOTICE([]) -AC_MSG_NOTICE([-------------------------------]) -AC_MSG_NOTICE([ Data analysis configuration ]) -AC_MSG_NOTICE([-------------------------------]) -AC_MSG_NOTICE([]) -AC_MSG_NOTICE([=== IDL ===]) -AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Make sure that the tools/idllib directory is in your IDL_PATH]) -AC_MSG_NOTICE([e.g. by adding to your ~/.bashrc file]) -AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ export IDL_PATH=+$PWD/tools/idllib:'':\$IDL_PATH]) -AC_MSG_NOTICE([]) -AC_MSG_NOTICE([=== Python ===]) -AC_MSG_NOTICE([]) -AC_MSG_NOTICE([Make sure that the tools/pylib directory is in your PYTHONPATH]) -AC_MSG_NOTICE([e.g. by adding to your ~/.bashrc file]) -AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ export PYTHONPATH=$PWD/tools/pylib/:\$PYTHONPATH]) -AC_MSG_NOTICE([]) -AC_MSG_NOTICE([*** Now run '$MAKE' to compile BOUT++ ***]) -AC_MSG_NOTICE([]) -AC_MSG_WARN([./configure is deprecated and will be removed in a future version, please use CMake instead]) diff --git a/src/sys/options/makefile b/src/sys/options/makefile deleted file mode 100644 index f8f0c76f69..0000000000 --- a/src/sys/options/makefile +++ /dev/null @@ -1,7 +0,0 @@ -BOUT_TOP = ../../.. -SOURCEC = options_ini.cxx options_netcdf.cxx options_io.cxx - -SOURCEH = $(SOURCEC:%.cxx=%.hxx) globals.hxx bout_types.hxx multiostream.hxx -TARGET = lib - -include $(BOUT_TOP)/make.config From fb7a962fdfe212cfe3db02f15ba4305a40a172c1 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Tue, 5 Dec 2023 13:02:07 -0500 Subject: [PATCH 28/46] Build adios2 for the first ubuntu build --- .build_adios2_for_ci.sh | 62 +++++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 6 ++++ 2 files changed, 68 insertions(+) create mode 100755 .build_adios2_for_ci.sh diff --git a/.build_adios2_for_ci.sh b/.build_adios2_for_ci.sh new file mode 100755 index 0000000000..90f4aae29a --- /dev/null +++ b/.build_adios2_for_ci.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +set -e + +if test $BUILD_ADIOS2 ; then + if [[ ! -d $HOME/local/adios/include/adios2.h ]] || test $1 ; then + echo "****************************************" + echo "Building ADIOS2" + echo "****************************************" + + branch=${1:-release_29} + if [ ! -d adios2 ]; then + git clone -b $branch https://github.com/ornladios/ADIOS2.git adios2 --depth=1 + fi + + pushd adios2 + rm -rf build + mkdir -p build + pushd build + + cmake .. \ + -DCMAKE_INSTALL_PREFIX=$HOME/local/adios2 \ + -DADIOS2_USE_MPI=ON \ + -DADIOS2_USE_Fortran=OFF \ + -DADIOS2_USE_Python=OFF \ + -DADIOS2_BUILD_EXAMPLES=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DADIOS2_BUILD_TESTING=OFF \ + -DADIOS2_USE_SST=OFF \ + -DADIOS2_USE_MGARD=OFF \ + -DADIOS2_USE_HDF5=OFF \ + -DADIOS2_USE_BZip2=OFF \ + -DADIOS2_USE_Blosc2=OFF \ + -DADIOS2_USE_SZ=OFF \ + -DADIOS2_USE_ZFP=OFF \ + -DADIOS2_USE_DAOS=OFF \ + -DADIOS2_USE_UCX=OFF \ + -DADIOS2_USE_LIBPRESSIO=OFF \ + -DADIOS2_USE_Sodium=OFF \ + -DADIOS2_USE_ZeroMQ=OFF \ + -DADIOS2_USE_MHS=OFF \ + -DADIOS2_USE_DataMan=OFF + + make -j 4 && make install + popd + + echo "****************************************" + echo " Finished building ADIOS2" + echo "****************************************" + + else + + echo "****************************************" + echo " ADIOS2 already installed" + echo "****************************************" + fi +else + echo "****************************************" + echo " ADIOS2 not requested" + echo "****************************************" +fi diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1083c5e059..7e4df9abf8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,12 +47,15 @@ jobs: -DBOUT_USE_PETSC=ON -DBOUT_USE_SLEPC=ON -DBOUT_USE_SUNDIALS=ON + -DBOUT_USE_ADIOS2=ON -DBOUT_ENABLE_PYTHON=ON + -DADIOS2_DIR=/home/runner/local/adios2 -DSUNDIALS_ROOT=/home/runner/local -DPETSC_DIR=/home/runner/local/petsc -DSLEPC_DIR=/home/runner/local/slepc" build_petsc: -petsc-main build_petsc_branch: main + build_adios2: true on_cron: true - name: "Default options, Ubuntu 20.04" @@ -201,6 +204,9 @@ jobs: - name: Build PETSc run: BUILD_PETSC=${{ matrix.config.build_petsc }} ./.build_petsc_for_ci.sh ${{ matrix.config.build_petsc_branch }} + - name: Build ADIOS2 + run: BUILD_ADIOS2=${{ matrix.config.build_adios2 }} ./.build_adios2_for_ci.sh + - name: Build BOUT++ run: UNIT_ONLY=${{ matrix.config.unit_only }} ./.ci_with_cmake.sh ${{ matrix.config.cmake_options }} From f4b24d71a6473a9cd3b4b1d246df383738ea36e2 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Tue, 5 Dec 2023 16:44:09 -0800 Subject: [PATCH 29/46] options_adios: Address Clang-tidy comments Mainly unused parameters, moving definitions to the header, adding override keywords. Note that there is a GCC compiler bug with [[maybe_unused]] on first argument of a constructor: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81429 --- include/bout/options_adios.hxx | 42 +++++++++++++++++-------------- include/bout/options_io.hxx | 8 +++--- src/sys/options/options_adios.cxx | 10 -------- 3 files changed, 27 insertions(+), 33 deletions(-) diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx index 0c4853bc38..81e492c2e7 100644 --- a/include/bout/options_adios.hxx +++ b/include/bout/options_adios.hxx @@ -18,24 +18,27 @@ namespace bout { class OptionsADIOS : public OptionsIO { public: + OptionsADIOS() {} explicit OptionsADIOS( - const std::string& filename, - bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace, - bool singleWriteFile = false) {} - OptionsADIOS(const OptionsADIOS&) = default; - OptionsADIOS(OptionsADIOS&&) = default; - OptionsADIOS& operator=(const OptionsADIOS&) = default; - OptionsADIOS& operator=(OptionsADIOS&&) = default; + const std::string& filename [[maybe_unused]], + [[maybe_unused]] bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace, + [[maybe_unused]] bool singleWriteFile = false) {} + OptionsADIOS(const OptionsADIOS&) = delete; + OptionsADIOS(OptionsADIOS&&) noexcept = default; + ~OptionsADIOS() = default; + + OptionsADIOS& operator=(const OptionsADIOS&) = delete; + OptionsADIOS& operator=(OptionsADIOS&&) noexcept = default; /// Read options from file - Options read() { throw BoutException("OptionsADIOS not available\n"); } + Options read() override { throw BoutException("OptionsADIOS not available\n"); } /// Write options to file - void write(const Options& options, const std::string& time_dim) { + void write([[maybe_unused]] const Options& options, [[maybe_unused]] const std::string& time_dim) override { throw BoutException("OptionsADIOS not available\n"); } - void verifyTimesteps() const { throw BoutException("OptionsADIOS not available\n"); } + void verifyTimesteps() const override { throw BoutException("OptionsADIOS not available\n"); } }; } // namespace bout @@ -55,27 +58,28 @@ class OptionsADIOS : public OptionsIO { public: // Constructors need to be defined in implementation due to forward // declaration of ADIOSStream - OptionsADIOS(); + OptionsADIOS() {} OptionsADIOS(std::string filename, bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace, - bool singleWriteFile = false); - ~OptionsADIOS(); + bool singleWriteFile = false) : OptionsIO(filename, mode, singleWriteFile) {} OptionsADIOS(const OptionsADIOS&) = delete; - OptionsADIOS(OptionsADIOS&&) noexcept; + OptionsADIOS(OptionsADIOS&&) noexcept = default; + ~OptionsADIOS() = default; + OptionsADIOS& operator=(const OptionsADIOS&) = delete; - OptionsADIOS& operator=(OptionsADIOS&&) noexcept; + OptionsADIOS& operator=(OptionsADIOS&&) noexcept = default; /// Read options from file - Options read(); + Options read() override; /// Write options to file - void write(const Options& options) { write(options, "t"); } - void write(const Options& options, const std::string& time_dim); + void write(const Options& options) override { write(options, "t"); } + void write(const Options& options, const std::string& time_dim) override; /// Check that all variables with the same time dimension have the /// same size in that dimension. Throws BoutException if there are /// any differences, otherwise is silent - void verifyTimesteps() const; + void verifyTimesteps() const override; private: }; diff --git a/include/bout/options_io.hxx b/include/bout/options_io.hxx index b0ffdb5bb1..d8f26dc8ef 100644 --- a/include/bout/options_io.hxx +++ b/include/bout/options_io.hxx @@ -2,8 +2,8 @@ #pragma once -#ifndef __OPTIONS_IO_H__ -#define __OPTIONS_IO_H__ +#ifndef OPTIONS_IO_H +#define OPTIONS_IO_H #include "bout/build_config.hxx" @@ -35,7 +35,7 @@ public: OptionsIO(); OptionsIO(std::string filename, FileMode mode = FileMode::replace, bool singleWriteFile = false); - ~OptionsIO(); + virtual ~OptionsIO(); OptionsIO(const OptionsIO&) = delete; OptionsIO(OptionsIO&&) noexcept; OptionsIO& operator=(const OptionsIO&) = delete; @@ -97,4 +97,4 @@ void writeDefaultOutputFile( } // namespace bout -#endif // __OPTIONS_IO_H__ +#endif // OPTIONS_IO_H diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index 04bf242d1a..a032fd1629 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -16,16 +16,6 @@ #include namespace bout { - -OptionsADIOS::OptionsADIOS() {} - -OptionsADIOS::OptionsADIOS(std::string filename, FileMode mode, bool singleWriteFile) - : OptionsIO(filename, mode, singleWriteFile) {} - -OptionsADIOS::~OptionsADIOS() = default; -OptionsADIOS::OptionsADIOS(OptionsADIOS&&) noexcept = default; -OptionsADIOS& OptionsADIOS::operator=(OptionsADIOS&&) noexcept = default; - /// Name of the attribute used to track individual variable's time indices constexpr auto current_time_index_name = "current_time_index"; From b95947360ef2f9c5ad37fae3f60e95d7fc8e7e7d Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Tue, 5 Dec 2023 16:46:45 -0800 Subject: [PATCH 30/46] options_adios: Clang format Automatic formatting --- include/bout/options_adios.hxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx index 81e492c2e7..7bbe421247 100644 --- a/include/bout/options_adios.hxx +++ b/include/bout/options_adios.hxx @@ -19,10 +19,10 @@ namespace bout { class OptionsADIOS : public OptionsIO { public: OptionsADIOS() {} - explicit OptionsADIOS( - const std::string& filename [[maybe_unused]], - [[maybe_unused]] bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace, - [[maybe_unused]] bool singleWriteFile = false) {} + explicit OptionsADIOS(const std::string& filename [[maybe_unused]], + [[maybe_unused]] bout::OptionsIO::FileMode mode = + bout::OptionsIO::FileMode::replace, + [[maybe_unused]] bool singleWriteFile = false) {} OptionsADIOS(const OptionsADIOS&) = delete; OptionsADIOS(OptionsADIOS&&) noexcept = default; ~OptionsADIOS() = default; @@ -34,11 +34,14 @@ public: Options read() override { throw BoutException("OptionsADIOS not available\n"); } /// Write options to file - void write([[maybe_unused]] const Options& options, [[maybe_unused]] const std::string& time_dim) override { + void write([[maybe_unused]] const Options& options, + [[maybe_unused]] const std::string& time_dim) override { throw BoutException("OptionsADIOS not available\n"); } - void verifyTimesteps() const override { throw BoutException("OptionsADIOS not available\n"); } + void verifyTimesteps() const override { + throw BoutException("OptionsADIOS not available\n"); + } }; } // namespace bout @@ -61,7 +64,8 @@ public: OptionsADIOS() {} OptionsADIOS(std::string filename, bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace, - bool singleWriteFile = false) : OptionsIO(filename, mode, singleWriteFile) {} + bool singleWriteFile = false) + : OptionsIO(filename, mode, singleWriteFile) {} OptionsADIOS(const OptionsADIOS&) = delete; OptionsADIOS(OptionsADIOS&&) noexcept = default; ~OptionsADIOS() = default; From d7e8865abef3a3036cd617f6169b6c9189db812b Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Wed, 6 Dec 2023 17:47:53 -0800 Subject: [PATCH 31/46] Use generic Factory for OptionsIO Sorry for the large commit; this touches quite a few places. The OptionsNetCDF and OptionsADIOS classes are now private, so that OptionsIO is now the interface to both. The generic Factory is used to implement OptionsIOFactory, and the "netcdf" and "adios" types are registered in their separate header files. The OptionsIOFactory handles the choice of default section ("restart_files" for restarts, "output" for dump/output files), and sets the default path and prefix. This simplifies both the PhysicsModel and the separate implementations by putting that logic in one place. --- CMakeLists.txt | 4 +- include/bout/bout.hxx | 10 +- include/bout/generic_factory.hxx | 6 +- include/bout/options_adios.hxx | 95 -------------- include/bout/options_io.hxx | 135 +++++++++++--------- include/bout/options_netcdf.hxx | 91 ------------- include/bout/physicsmodel.hxx | 9 +- include/bout/solver.hxx | 6 +- src/bout++.cxx | 4 +- src/mesh/data/gridfromfile.cxx | 4 +- src/physics/physicsmodel.cxx | 25 +--- src/sys/options/options_adios.cxx | 18 ++- src/sys/options/options_adios.hxx | 84 ++++++++++++ src/sys/options/options_io.cxx | 129 ++++--------------- src/sys/options/options_netcdf.cxx | 21 +-- src/sys/options/options_netcdf.hxx | 84 ++++++++++++ tools/pylib/_boutpp_build/bout_options.pxd | 18 +-- tools/pylib/_boutpp_build/boutcpp.pxd.jinja | 2 +- tools/pylib/_boutpp_build/boutpp.pyx.jinja | 4 - 19 files changed, 325 insertions(+), 424 deletions(-) delete mode 100644 include/bout/options_adios.hxx delete mode 100644 include/bout/options_netcdf.hxx create mode 100644 src/sys/options/options_adios.hxx create mode 100644 src/sys/options/options_netcdf.hxx diff --git a/CMakeLists.txt b/CMakeLists.txt index ece5d139e4..ada2e6b4c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,8 +148,6 @@ set(BOUT_SOURCES ./include/bout/operatorstencil.hxx ./include/bout/options.hxx ./include/bout/options_io.hxx - ./include/bout/options_netcdf.hxx - ./include/bout/options_adios.hxx ./include/bout/optionsreader.hxx ./include/bout/output.hxx ./include/bout/output_bout_types.hxx @@ -344,7 +342,9 @@ set(BOUT_SOURCES ./src/sys/options/options_ini.hxx ./src/sys/options/options_io.cxx ./src/sys/options/options_netcdf.cxx + ./src/sys/options/options_netcdf.hxx ./src/sys/options/options_adios.cxx + ./src/sys/options/options_adios.hxx ./src/sys/optionsreader.cxx ./src/sys/output.cxx ./src/sys/petsclib.cxx diff --git a/include/bout/bout.hxx b/include/bout/bout.hxx index 5e718dde33..d929a19c2f 100644 --- a/include/bout/bout.hxx +++ b/include/bout/bout.hxx @@ -2,8 +2,6 @@ * * @mainpage BOUT++ * - * @version 3.0 - * * @par Description * Framework for the solution of partial differential * equations, in particular fluid models in plasma physics. @@ -33,8 +31,8 @@ * **************************************************************************/ -#ifndef __BOUT_H__ -#define __BOUT_H__ +#ifndef BOUT_H +#define BOUT_H #include "bout/build_config.hxx" @@ -44,7 +42,7 @@ #include "bout/field3d.hxx" #include "bout/globals.hxx" #include "bout/mesh.hxx" -#include "bout/options_netcdf.hxx" +#include "bout/options_io.hxx" #include "bout/output.hxx" #include "bout/smoothing.hxx" // Smoothing functions #include "bout/solver.hxx" @@ -206,4 +204,4 @@ private: */ int BoutFinalise(bool write_settings = true); -#endif // __BOUT_H__ +#endif // BOUT_H diff --git a/include/bout/generic_factory.hxx b/include/bout/generic_factory.hxx index 3a2a63c94c..f7a0692af8 100644 --- a/include/bout/generic_factory.hxx +++ b/include/bout/generic_factory.hxx @@ -1,8 +1,8 @@ /// Base type for factories #pragma once -#ifndef __BOUT_GENERIC_FACTORY_H__ -#define __BOUT_GENERIC_FACTORY_H__ +#ifndef BOUT_GENERIC_FACTORY_H +#define BOUT_GENERIC_FACTORY_H #include "bout/boutexception.hxx" #include "bout/options.hxx" @@ -259,4 +259,4 @@ public: }; }; -#endif // __BOUT_GENERIC_FACTORY_H__ +#endif // BOUT_GENERIC_FACTORY_H diff --git a/include/bout/options_adios.hxx b/include/bout/options_adios.hxx deleted file mode 100644 index 7bbe421247..0000000000 --- a/include/bout/options_adios.hxx +++ /dev/null @@ -1,95 +0,0 @@ - -#pragma once - -#ifndef __OPTIONS_ADIOS_H__ -#define __OPTIONS_ADIOS_H__ - -#include "bout/build_config.hxx" -#include "bout/options.hxx" -#include "bout/options_io.hxx" - -#if !BOUT_HAS_ADIOS - -#include - -#include "bout/boutexception.hxx" - -namespace bout { - -class OptionsADIOS : public OptionsIO { -public: - OptionsADIOS() {} - explicit OptionsADIOS(const std::string& filename [[maybe_unused]], - [[maybe_unused]] bout::OptionsIO::FileMode mode = - bout::OptionsIO::FileMode::replace, - [[maybe_unused]] bool singleWriteFile = false) {} - OptionsADIOS(const OptionsADIOS&) = delete; - OptionsADIOS(OptionsADIOS&&) noexcept = default; - ~OptionsADIOS() = default; - - OptionsADIOS& operator=(const OptionsADIOS&) = delete; - OptionsADIOS& operator=(OptionsADIOS&&) noexcept = default; - - /// Read options from file - Options read() override { throw BoutException("OptionsADIOS not available\n"); } - - /// Write options to file - void write([[maybe_unused]] const Options& options, - [[maybe_unused]] const std::string& time_dim) override { - throw BoutException("OptionsADIOS not available\n"); - } - - void verifyTimesteps() const override { - throw BoutException("OptionsADIOS not available\n"); - } -}; - -} // namespace bout - -#else - -#include -#include - -namespace bout { - -/// Forward declare ADIOS file type so we don't need to depend -/// directly on ADIOS -struct ADIOSStream; - -class OptionsADIOS : public OptionsIO { -public: - // Constructors need to be defined in implementation due to forward - // declaration of ADIOSStream - OptionsADIOS() {} - OptionsADIOS(std::string filename, - bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace, - bool singleWriteFile = false) - : OptionsIO(filename, mode, singleWriteFile) {} - OptionsADIOS(const OptionsADIOS&) = delete; - OptionsADIOS(OptionsADIOS&&) noexcept = default; - ~OptionsADIOS() = default; - - OptionsADIOS& operator=(const OptionsADIOS&) = delete; - OptionsADIOS& operator=(OptionsADIOS&&) noexcept = default; - - /// Read options from file - Options read() override; - - /// Write options to file - void write(const Options& options) override { write(options, "t"); } - void write(const Options& options, const std::string& time_dim) override; - - /// Check that all variables with the same time dimension have the - /// same size in that dimension. Throws BoutException if there are - /// any differences, otherwise is silent - void verifyTimesteps() const override; - -private: -}; - -} // namespace bout - -#endif // BOUT_HAS_ADIOS - -#endif // __OPTIONS_ADIOS_H__ diff --git a/include/bout/options_io.hxx b/include/bout/options_io.hxx index d8f26dc8ef..0139609417 100644 --- a/include/bout/options_io.hxx +++ b/include/bout/options_io.hxx @@ -6,40 +6,29 @@ #define OPTIONS_IO_H #include "bout/build_config.hxx" +#include "bout/generic_factory.hxx" +#include "bout/options.hxx" #include #include -#include "bout/options.hxx" - namespace bout { class OptionsIO { public: - enum class FileMode { - replace, ///< Overwrite file when writing - append ///< Append to file when writing - }; - - enum class Library { ADIOS, NetCDF, Invalid }; - - static const Library defaultIOLibrary = -#if BOUT_HAS_ADIOS - Library::NetCDF; -#elif BOUT_HAS_NETCDF - Library::NetCDF; -#else - Library::Invalid; -#endif + /// No default constructor, as settings are required + OptionsIO() = delete; + + /// Constructor specifies the kind of file, and options to control + /// the name of file, mode of operation etc. + OptionsIO(Options&) {} + + virtual ~OptionsIO() = default; - OptionsIO(); - OptionsIO(std::string filename, FileMode mode = FileMode::replace, - bool singleWriteFile = false); - virtual ~OptionsIO(); OptionsIO(const OptionsIO&) = delete; - OptionsIO(OptionsIO&&) noexcept; + OptionsIO(OptionsIO&&) noexcept = default; OptionsIO& operator=(const OptionsIO&) = delete; - OptionsIO& operator=(OptionsIO&&) noexcept; + OptionsIO& operator=(OptionsIO&&) noexcept = default; /// Read options from file virtual Options read() = 0; @@ -54,46 +43,72 @@ public: /// ADIOS: Indicate completion of an output step. virtual void verifyTimesteps() const = 0; - /// ADIOS: close file at the end of write(). NetCDF: no effect. - /// restart file must have this true if using ADIOS - //void setSingleWriteFile(const bool flag) { singleWriteFile = flag; }; + static std::unique_ptr create(const std::string& file); +}; + +class OptionsIOFactory : public Factory { +public: + static constexpr auto type_name = "OptionsIO"; + static constexpr auto section_name = "io"; + static constexpr auto option_name = "type"; + static constexpr auto default_type = +#if BOUT_HAS_NETCDF + "netcdf"; +#elif BOUT_HAS_ADIOS + "adios"; +#else + "invalid"; +#endif -protected: - /// Name of the file on disk - std::string filename; - /// How to open the file for writing - FileMode file_mode{FileMode::replace}; - bool singleWriteFile = false; + /// Create a restart file, configured with options (if given), + /// or root "restart_files" section. + /// + /// Options: + /// - "type" The type of file e.g "netcdf" or "adios" + /// - "file" Name of the file. Default is /.[type-dependent] + /// - "path" Path to restart files. Default is root "datadir" option, + /// that defaults to "data" + /// - "prefix" Default is "BOUT.restart" + ReturnType createRestart(Options* optionsptr = nullptr) const; + + /// Create an output file for writing time history. + /// Configure with options (if given), or root "output" section. + /// + /// Options: + /// - "type" The type of file e.g "netcdf" or "adios" + /// - "file" Name of the file. Default is /.[type] + /// - "path" Path to output files. Default is root "datadir" option, + /// that defaults to "data" + /// - "prefix" Default is "BOUT.dmp" + /// - "append" Append to existing file? Default is root "append" option, + /// that defaults to false. + ReturnType createOutput(Options* optionsptr = nullptr) const; + + /// Create a single file (e.g. mesh file) of the default type + ReturnType createFile(const std::string& file) const; }; -std::shared_ptr -OptionsIOFactory(std::string filename, - OptionsIO::FileMode mode = OptionsIO::FileMode::replace, - const OptionsIO::Library library = OptionsIO::defaultIOLibrary, - const bool singleWriteFile = false); - -OptionsIO::Library getIOLibrary(Options& options); - -/// Name of the directory for restart files -std::string getRestartDirectoryName(Options& options); -/// Name of the restart file on this rank -std::string getRestartFilename(Options& options, const OptionsIO::Library library); -/// Name of the restart file on \p rank -std::string getRestartFilename(Options& options, int rank, - const OptionsIO::Library library); -/// Name of the main output file on this rank -std::string getOutputFilename(Options& options, const OptionsIO::Library library); -/// Name of the main output file on \p rank -std::string getOutputFilename(Options& options, int rank, - const OptionsIO::Library library); -/// Write `Options::root()` to the main output file, overwriting any -/// existing files -void writeDefaultOutputFile( - const OptionsIO::Library library = OptionsIO::defaultIOLibrary); -/// Write \p options to the main output file, overwriting any existing -/// files -void writeDefaultOutputFile( - Options& options, const OptionsIO::Library library = OptionsIO::defaultIOLibrary); +/// Simpler name for Factory registration helper class +/// +/// Usage: +/// +/// #include +/// namespace { +/// RegisterOptionsIO registeroptionsiomine("myoptionsio"); +/// } +template +using RegisterOptionsIO = OptionsIOFactory::RegisterInFactory; + +/// Simpler name for indicating that an OptionsIO implementation +/// is unavailable. +/// +/// Usage: +/// +/// namespace { +/// RegisterUnavailableOptionsIO +/// unavailablemyoptionsio("myoptiosio", "BOUT++ was not configured with MyOptionsIO"); +/// } +using RegisterUnavailableOptionsIO = OptionsIOFactory::RegisterUnavailableInFactory; } // namespace bout diff --git a/include/bout/options_netcdf.hxx b/include/bout/options_netcdf.hxx deleted file mode 100644 index 5cbbf7e5fc..0000000000 --- a/include/bout/options_netcdf.hxx +++ /dev/null @@ -1,91 +0,0 @@ - -#pragma once - -#ifndef __OPTIONS_NETCDF_H__ -#define __OPTIONS_NETCDF_H__ - -#include "bout/build_config.hxx" - -#include "bout/options.hxx" -#include "bout/options_io.hxx" - -#if !BOUT_HAS_NETCDF || BOUT_HAS_LEGACY_NETCDF - -#include - -#include "bout/boutexception.hxx" -#include "bout/options.hxx" - -namespace bout { - -class OptionsNetCDF : public OptionsIO { -public: - OptionsNetCDF(const std::string& filename, - bout::OptionsIO::FileMode mode = bout::OptionsIO::FileMode::replace, - bool singleWriteFile = false) {} - OptionsNetCDF(const OptionsNetCDF&) = default; - OptionsNetCDF(OptionsNetCDF&&) = default; - OptionsNetCDF& operator=(const OptionsNetCDF&) = default; - OptionsNetCDF& operator=(OptionsNetCDF&&) = default; - - /// Read options from file - Options read() { throw BoutException("OptionsNetCDF not available\n"); } - - /// Write options to file - void write(const Options& options, const std::string& time_dim) { - throw BoutException("OptionsNetCDF not available\n"); - } - - void verifyTimesteps() const { throw BoutException("OptionsADIOS not available\n"); } -}; - -} // namespace bout - -#else - -#include -#include - -/// Forward declare netCDF file type so we don't need to depend -/// directly on netCDF -namespace netCDF { -class NcFile; -} - -namespace bout { - -class OptionsNetCDF : public OptionsIO { -public: - // Constructors need to be defined in implementation due to forward - // declaration of NcFile - OptionsNetCDF(); - OptionsNetCDF(std::string filename, FileMode mode = FileMode::replace, - bool singleWriteFile = false); - ~OptionsNetCDF(); - OptionsNetCDF(const OptionsNetCDF&) = delete; - OptionsNetCDF(OptionsNetCDF&&) noexcept; - OptionsNetCDF& operator=(const OptionsNetCDF&) = delete; - OptionsNetCDF& operator=(OptionsNetCDF&&) noexcept; - - /// Read options from file - Options read(); - - /// Write options to file - void write(const Options& options) { write(options, "t"); } - void write(const Options& options, const std::string& time_dim); - - /// Check that all variables with the same time dimension have the - /// same size in that dimension. Throws BoutException if there are - /// any differences, otherwise is silent - void verifyTimesteps() const; - -private: - /// Pointer to netCDF file so we don't introduce direct dependence - std::unique_ptr data_file; -}; - -} // namespace bout - -#endif - -#endif // __OPTIONS_NETCDF_H__ diff --git a/include/bout/physicsmodel.hxx b/include/bout/physicsmodel.hxx index eb1bae8ae1..e0f046eb1f 100644 --- a/include/bout/physicsmodel.hxx +++ b/include/bout/physicsmodel.hxx @@ -88,9 +88,6 @@ public: void add(Vector2D* value, const std::string& name, bool save_repeat = false); void add(Vector3D* value, const std::string& name, bool save_repeat = false); - /// Write stored data to file immediately - bool write(); - private: /// Helper struct to save enough information so that we can save an /// object to file later @@ -148,7 +145,7 @@ public: bout::DataFileFacade restart{}; /*! - * Initialse the model, calling the init() and postInit() methods + * Initialise the model, calling the init() and postInit() methods * * Note: this is usually only called by the Solver */ @@ -383,13 +380,13 @@ private: /// State for outputs Options output_options; /// File to write the outputs to - std::shared_ptr output_file; + std::unique_ptr output_file; /// Should we write output files bool output_enabled{true}; /// Stores the state for restarting Options restart_options; /// File to write the restart-state to - std::shared_ptr restart_file; + std::unique_ptr restart_file; /// Should we write restart files bool restart_enabled{true}; /// Split operator model? diff --git a/include/bout/solver.hxx b/include/bout/solver.hxx index 8a3f07c27a..ef7cbe63eb 100644 --- a/include/bout/solver.hxx +++ b/include/bout/solver.hxx @@ -33,8 +33,8 @@ * **************************************************************************/ -#ifndef __SOLVER_H__ -#define __SOLVER_H__ +#ifndef SOLVER_H +#define SOLVER_H #include "bout/build_config.hxx" @@ -597,4 +597,4 @@ private: BoutReal output_timestep; }; -#endif // __SOLVER_H__ +#endif // SOLVER_H diff --git a/src/bout++.cxx b/src/bout++.cxx index a42b0dcff8..1dc93dc76d 100644 --- a/src/bout++.cxx +++ b/src/bout++.cxx @@ -4,9 +4,9 @@ * Adapted from the BOUT code by B.Dudson, University of York, Oct 2007 * ************************************************************************** - * Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu + * Copyright 2010-2023 BOUT++ contributors * - * Contact Ben Dudson, bd512@york.ac.uk + * Contact Ben Dudson, dudson2@llnl.gov * * This file is part of BOUT++. * diff --git a/src/mesh/data/gridfromfile.cxx b/src/mesh/data/gridfromfile.cxx index 7e875bd109..aa66b145c7 100644 --- a/src/mesh/data/gridfromfile.cxx +++ b/src/mesh/data/gridfromfile.cxx @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -14,7 +14,7 @@ #include GridFile::GridFile(std::string gridfilename) - : GridDataSource(true), data(bout::OptionsNetCDF(gridfilename).read()), + : GridDataSource(true), data(bout::OptionsIO::create(gridfilename)->read()), filename(std::move(gridfilename)) { TRACE("GridFile constructor"); diff --git a/src/physics/physicsmodel.cxx b/src/physics/physicsmodel.cxx index 538851f4cb..9f538895ed 100644 --- a/src/physics/physicsmodel.cxx +++ b/src/physics/physicsmodel.cxx @@ -58,18 +58,6 @@ void DataFileFacade::add(Vector3D* value, const std::string& name, bool save_rep add(value->y, name_prefix + "y"s, save_repeat); add(value->z, name_prefix + "z"s, save_repeat); } - -bool DataFileFacade::write() { - for (const auto& item : data) { - bout::utils::visit(bout::OptionsConversionVisitor{Options::root(), item.name}, - item.value); - if (item.repeat) { - Options::root()[item.name].attributes["time_dimension"] = "t"; - } - } - writeDefaultOutputFile(); - return true; -} } // namespace bout PhysicsModel::PhysicsModel() @@ -81,21 +69,12 @@ PhysicsModel::PhysicsModel() .withDefault(true)) { - bout::OptionsIO::Library iolibrary = bout::getIOLibrary(Options::root()); if (output_enabled) { - std::string outputFileName = bout::getOutputFilename(Options::root(), iolibrary); - auto mode = Options::root()["append"] - .doc("Add output data to existing (dump) files?") - .withDefault(false) - ? bout::OptionsIO::FileMode::append - : bout::OptionsIO::FileMode::replace; - output_file = bout::OptionsIOFactory(outputFileName, mode, iolibrary); + output_file = bout::OptionsIOFactory::getInstance().createOutput(); } if (restart_enabled) { - std::string restartFileName = bout::getRestartFilename(Options::root(), iolibrary); - restart_file = bout::OptionsIOFactory( - restartFileName, bout::OptionsIO::FileMode::replace, iolibrary, true); + restart_file = bout::OptionsIOFactory::getInstance().createRestart(); } } diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index a032fd1629..fd8e978091 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -2,8 +2,8 @@ #if BOUT_HAS_ADIOS +#include "options_adios.hxx" #include "bout/adios_object.hxx" -#include "bout/options_adios.hxx" #include "bout/bout.hxx" #include "bout/globals.hxx" @@ -19,6 +19,22 @@ namespace bout { /// Name of the attribute used to track individual variable's time indices constexpr auto current_time_index_name = "current_time_index"; +OptionsADIOS::OptionsADIOS(Options& options) { + if (options["file"].doc("File name. Defaults to /.pb").isSet()) { + filename = options["file"].as(); + } else { + // Both path and prefix must be set + filename = fmt::format("{}/{}.bp", options["path"].as(), + options["prefix"].as()); + } + + file_mode = (options["append"].doc("Append to existing file?").withDefault(false)) + ? FileMode::append + : FileMode::replace; + + singleWriteFile = options["singleWriteFile"].withDefault(false); +} + template bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, const std::string& type, Options& result) { diff --git a/src/sys/options/options_adios.hxx b/src/sys/options/options_adios.hxx new file mode 100644 index 0000000000..2460dfd10c --- /dev/null +++ b/src/sys/options/options_adios.hxx @@ -0,0 +1,84 @@ + +#pragma once + +#ifndef OPTIONS_ADIOS_H +#define OPTIONS_ADIOS_H + +#include "bout/build_config.hxx" +#include "bout/options.hxx" +#include "bout/options_io.hxx" + +#if !BOUT_HAS_ADIOS + +namespace { +bout::RegisterUnavailableOptionsIO + registerunavailableoptionsadios("adios", "BOUT++ was not configured with ADIOS2"); +} + +#else + +#include +#include + +namespace bout { + +/// Forward declare ADIOS file type so we don't need to depend +/// directly on ADIOS +struct ADIOSStream; + +class OptionsADIOS : public OptionsIO { +public: + // Constructors need to be defined in implementation due to forward + // declaration of ADIOSStream + OptionsADIOS() = delete; + + /// Create an OptionsADIOS + /// + /// Options: + /// - "file" The name of the file + /// If not set then "path" and "prefix" must be set, + /// and file is set to {path}/{prefix}.bp + /// - "append" + /// - "singleWriteFile" + OptionsADIOS(Options& options); + + OptionsADIOS(const OptionsADIOS&) = delete; + OptionsADIOS(OptionsADIOS&&) noexcept = default; + ~OptionsADIOS() = default; + + OptionsADIOS& operator=(const OptionsADIOS&) = delete; + OptionsADIOS& operator=(OptionsADIOS&&) noexcept = default; + + /// Read options from file + Options read() override; + + /// Write options to file + void write(const Options& options) override { write(options, "t"); } + void write(const Options& options, const std::string& time_dim) override; + + /// Check that all variables with the same time dimension have the + /// same size in that dimension. Throws BoutException if there are + /// any differences, otherwise is silent + void verifyTimesteps() const override; + +private: + enum class FileMode { + replace, ///< Overwrite file when writing + append ///< Append to file when writing + }; + + /// Name of the file on disk + std::string filename; + /// How to open the file for writing + FileMode file_mode{FileMode::replace}; + bool singleWriteFile = false; +}; + +namespace { +RegisterOptionsIO registeroptionsadios("adios"); +} + +} // namespace bout + +#endif // BOUT_HAS_ADIOS +#endif // OPTIONS_ADIOS_H diff --git a/src/sys/options/options_io.cxx b/src/sys/options/options_io.cxx index 514307ec59..0d25591db7 100644 --- a/src/sys/options/options_io.cxx +++ b/src/sys/options/options_io.cxx @@ -1,118 +1,41 @@ -#include "bout/build_config.hxx" - #include "bout/options_io.hxx" -#include "bout/bout.hxx" -#include "bout/globals.hxx" -#include "bout/mesh.hxx" -#include "bout/sys/timer.hxx" - -#include -#include -#include - -#include "bout/options_adios.hxx" -#include "bout/options_netcdf.hxx" +#include "options_adios.hxx" +#include "options_netcdf.hxx" namespace bout { - -OptionsIO::OptionsIO() {} - -OptionsIO::OptionsIO(std::string filename, FileMode mode, bool singleWriteFile) - : filename(std::move(filename)), file_mode(mode), singleWriteFile(singleWriteFile) {} - -OptionsIO::~OptionsIO() = default; -OptionsIO::OptionsIO(OptionsIO&&) noexcept = default; -OptionsIO& OptionsIO::operator=(OptionsIO&&) noexcept = default; - -OptionsIO::Library getIOLibrary(Options& options) { - if (options["iolibrary"].isSet()) { - // Solver-specific IO library - std::string iolib = options["iolibrary"]; - std::transform(iolib.begin(), iolib.end(), iolib.begin(), ::tolower); - if (iolib == "adios") - return OptionsIO::Library::ADIOS; - else if (iolib == "netcdf") - return OptionsIO::Library::NetCDF; - else - return OptionsIO::Library::Invalid; - } else { - return OptionsIO::defaultIOLibrary; - } +std::unique_ptr OptionsIO::create(const std::string& file) { + return OptionsIOFactory::getInstance().createFile(file); } -std::shared_ptr OptionsIOFactory(std::string filename, - OptionsIO::FileMode mode, - const OptionsIO::Library library, - const bool singleWriteFile) { - if (library == OptionsIO::Library::ADIOS) { - return std::make_shared(OptionsADIOS(filename, mode, singleWriteFile)); - } else if (library == OptionsIO::Library::NetCDF) { - return std::make_shared( - OptionsNetCDF(filename, mode, singleWriteFile)); - } else { - return nullptr; - } -} +OptionsIOFactory::ReturnType OptionsIOFactory::createRestart(Options* optionsptr) const { + Options& options = optionsptr ? *optionsptr : Options::root()["restart_files"]; -std::string getRestartDirectoryName(Options& options) { - if (options["restartdir"].isSet()) { - // Solver-specific restart directory - return options["restartdir"].withDefault("data"); - } - // Use the root data directory - return options["datadir"].withDefault("data"); + // Set defaults + options["path"].overrideDefault( + Options::root()["datadir"].withDefault("data")); + options["prefix"].overrideDefault("BOUT.restart"); + options["append"].overrideDefault(false); + options["singleWriteFile"].overrideDefault(true); + return create(getType(&options), options); } -std::string getRestartFilename(Options& options, const OptionsIO::Library library) { - return getRestartFilename(options, BoutComm::rank(), library); -} - -std::string getRestartFilename(Options& options, int rank, - const OptionsIO::Library library) { - if (library == OptionsIO::Library::ADIOS) - return fmt::format("{}/BOUT.restart.bp", bout::getRestartDirectoryName(options)); - else if (library == OptionsIO::Library::NetCDF) - return fmt::format("{}/BOUT.restart.{}.nc", bout::getRestartDirectoryName(options), - rank); - else - return fmt::format("{}/BOUT.restart.{}.data", bout::getRestartDirectoryName(options), - rank); -} - -std::string getOutputFilename(Options& options, const OptionsIO::Library library) { - return getOutputFilename(options, BoutComm::rank(), library); -} - -std::string getOutputFilename(Options& options, int rank, - const OptionsIO::Library library) { - if (library == OptionsIO::Library::ADIOS) - return fmt::format("{}/BOUT.dmp.bp", - options["datadir"].withDefault("data")); - else if (library == OptionsIO::Library::NetCDF) - return fmt::format("{}/BOUT.dmp.{}.nc", - options["datadir"].withDefault("data"), rank); - else - return fmt::format("{}/BOUT.dmp.{}.data", - options["datadir"].withDefault("data"), rank); -} +OptionsIOFactory::ReturnType OptionsIOFactory::createOutput(Options* optionsptr) const { + Options& options = optionsptr ? *optionsptr : Options::root()["output"]; -void writeDefaultOutputFile(const OptionsIO::Library library) { - writeDefaultOutputFile(Options::root(), library); + // Set defaults + options["path"].overrideDefault( + Options::root()["datadir"].withDefault("data")); + options["prefix"].overrideDefault("BOUT.dmp"); + options["append"].overrideDefault(Options::root()["append"] + .doc("Add output data to existing (dump) files?") + .withDefault(false)); + return create(getType(&options), options); } -void writeDefaultOutputFile(Options& options, const OptionsIO::Library library) { - bout::experimental::addBuildFlagsToOptions(options); - bout::globals::mesh->outputVars(options); - auto mode = options["append"] - .doc("Add output data to existing (dump) files?") - .withDefault(false) - ? bout::OptionsIO::FileMode::append - : bout::OptionsIO::FileMode::replace; - // Note: `options` contains the data to write. - // Get the output file from the `Options::root()` input settings. - auto io = OptionsIOFactory(getOutputFilename(Options::root(), library), mode, library); - io->write(options); +OptionsIOFactory::ReturnType OptionsIOFactory::createFile(const std::string& file) const { + Options options{{"file", file}}; + return create(getDefaultType(), options); } } // namespace bout diff --git a/src/sys/options/options_netcdf.cxx b/src/sys/options/options_netcdf.cxx index 0262e0cbbd..eda2b0bfbd 100644 --- a/src/sys/options/options_netcdf.cxx +++ b/src/sys/options/options_netcdf.cxx @@ -2,7 +2,7 @@ #if BOUT_HAS_NETCDF && !BOUT_HAS_LEGACY_NETCDF -#include "bout/options_netcdf.hxx" +#include "options_netcdf.hxx" #include "bout/bout.hxx" #include "bout/globals.hxx" @@ -643,14 +643,19 @@ std::vector verifyTimesteps(const NcGroup& group) { namespace bout { -OptionsNetCDF::OptionsNetCDF() : data_file(nullptr) {} - -OptionsNetCDF::OptionsNetCDF(std::string filename, FileMode mode, bool singleWriteFile) - : OptionsIO(filename, mode, singleWriteFile), data_file(nullptr) {} +OptionsNetCDF::OptionsNetCDF(Options& options) : OptionsIO(options) { + if (options["file"].doc("File name. Defaults to /..nc").isSet()) { + filename = options["file"].as(); + } else { + // Both path and prefix must be set + filename = fmt::format("{}/{}.{}.nc", options["path"].as(), + options["prefix"].as(), BoutComm::rank()); + } -OptionsNetCDF::~OptionsNetCDF() = default; -OptionsNetCDF::OptionsNetCDF(OptionsNetCDF&&) noexcept = default; -OptionsNetCDF& OptionsNetCDF::operator=(OptionsNetCDF&&) noexcept = default; + file_mode = (options["append"].doc("Append to existing file?").withDefault(false)) + ? FileMode::append + : FileMode::replace; +} void OptionsNetCDF::verifyTimesteps() const { NcFile dataFile(filename, NcFile::read); diff --git a/src/sys/options/options_netcdf.hxx b/src/sys/options/options_netcdf.hxx new file mode 100644 index 0000000000..8f195c9d92 --- /dev/null +++ b/src/sys/options/options_netcdf.hxx @@ -0,0 +1,84 @@ + +#pragma once + +#ifndef OPTIONS_NETCDF_H +#define OPTIONS_NETCDF_H + +#include "bout/build_config.hxx" + +#include "bout/options.hxx" +#include "bout/options_io.hxx" + +#if !BOUT_HAS_NETCDF || BOUT_HAS_LEGACY_NETCDF + +namespace { +RegisterUnavailableOptionsIO + registerunavailableoptionsnetcdf("netcdf", "BOUT++ was not configured with NetCDF"); +} + +#else + +#include +#include +#include + +namespace bout { + +class OptionsNetCDF : public OptionsIO { +public: + // Constructors need to be defined in implementation due to forward + // declaration of NcFile + OptionsNetCDF() = delete; + + /// Create an OptionsNetCDF + /// + /// Options: + /// - "file" The name of the file + /// If not set then "path" and "prefix" options must be set, + /// and file is set to {path}/{prefix}.{rank}.nc + /// - "append" File mode, default is false + OptionsNetCDF(Options& options); + + ~OptionsNetCDF() {} + + OptionsNetCDF(const OptionsNetCDF&) = delete; + OptionsNetCDF(OptionsNetCDF&&) noexcept = default; + OptionsNetCDF& operator=(const OptionsNetCDF&) = delete; + OptionsNetCDF& operator=(OptionsNetCDF&&) noexcept = default; + + /// Read options from file + Options read(); + + /// Write options to file + void write(const Options& options) { write(options, "t"); } + void write(const Options& options, const std::string& time_dim); + + /// Check that all variables with the same time dimension have the + /// same size in that dimension. Throws BoutException if there are + /// any differences, otherwise is silent + void verifyTimesteps() const; + +private: + enum class FileMode { + replace, ///< Overwrite file when writing + append ///< Append to file when writing + }; + + /// Pointer to netCDF file so we don't introduce direct dependence + std::unique_ptr data_file = nullptr; + + /// Name of the file on disk + std::string filename; + /// How to open the file for writing + FileMode file_mode{FileMode::replace}; +}; + +namespace { +RegisterOptionsIO registeroptionsnetcdf("netcdf"); +} + +} // namespace bout + +#endif + +#endif // OPTIONS_NETCDF_H diff --git a/tools/pylib/_boutpp_build/bout_options.pxd b/tools/pylib/_boutpp_build/bout_options.pxd index ba5e64c8e3..550bfc01e1 100644 --- a/tools/pylib/_boutpp_build/bout_options.pxd +++ b/tools/pylib/_boutpp_build/bout_options.pxd @@ -8,20 +8,10 @@ cdef extern from "boutexception_helper.hxx": cdef void raise_bout_py_error() -cdef extern from "bout/options_netcdf.hxx" namespace "bout": - cdef void writeDefaultOutputFile(); - cdef void writeDefaultOutputFile(Options& options); - cppclass OptionsNetCDF: - enum FileMode: - replace - append - OptionsNetCDF() except +raise_bout_py_error - OptionsNetCDF(string filename) except +raise_bout_py_error - OptionsNetCDF(string filename, FileMode mode) except +raise_bout_py_error - OptionsNetCDF(const OptionsNetCDF&); - OptionsNetCDF(OptionsNetCDF&&); - OptionsNetCDF& operator=(const OptionsNetCDF&); - OptionsNetCDF& operator=(OptionsNetCDF&&); +cdef extern from "bout/options_io.hxx" namespace "bout": + cppclass OptionsIO: + @staticmethod + OptionsIO * create(string filename) Options read(); void write(const Options& options); void write(const Options& options, string time_dim); diff --git a/tools/pylib/_boutpp_build/boutcpp.pxd.jinja b/tools/pylib/_boutpp_build/boutcpp.pxd.jinja index c94fd14a17..28633cad95 100644 --- a/tools/pylib/_boutpp_build/boutcpp.pxd.jinja +++ b/tools/pylib/_boutpp_build/boutcpp.pxd.jinja @@ -5,7 +5,7 @@ from libcpp.memory cimport unique_ptr from libcpp.string cimport string cimport resolve_enum as benum -from bout_options cimport Options, OptionsReader, OptionsNetCDF, writeDefaultOutputFile +from bout_options cimport Options, OptionsReader, OptionsIO cdef extern from "boutexception_helper.hxx": cdef void raise_bout_py_error() diff --git a/tools/pylib/_boutpp_build/boutpp.pyx.jinja b/tools/pylib/_boutpp_build/boutpp.pyx.jinja index 657e2f28c1..a8c027475a 100644 --- a/tools/pylib/_boutpp_build/boutpp.pyx.jinja +++ b/tools/pylib/_boutpp_build/boutpp.pyx.jinja @@ -1723,10 +1723,6 @@ cdef class Options: del self.cobj self.cobj = NULL - -def writeDefaultOutputFile(options: Options): - c.writeDefaultOutputFile(deref(options.cobj)) - def print(*args, sep=" ", end="\n"): _print(sep.join([str(a) for a in args]) + end) From ffc1e94ba71c7982f1329cc95a5fb5e4e9143bb8 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Thu, 7 Dec 2023 08:37:05 -0500 Subject: [PATCH 32/46] adios2 build - turn off building testing, pass to cmake ADIOS2_ROOT instead of ADIOS2_DIR --- .build_adios2_for_ci.sh | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.build_adios2_for_ci.sh b/.build_adios2_for_ci.sh index 90f4aae29a..f636252a94 100755 --- a/.build_adios2_for_ci.sh +++ b/.build_adios2_for_ci.sh @@ -26,7 +26,7 @@ if test $BUILD_ADIOS2 ; then -DADIOS2_BUILD_EXAMPLES=OFF \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - -DADIOS2_BUILD_TESTING=OFF \ + -DBUILD_TESTING=OFF \ -DADIOS2_USE_SST=OFF \ -DADIOS2_USE_MGARD=OFF \ -DADIOS2_USE_HDF5=OFF \ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7e4df9abf8..b79144c10a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -49,7 +49,7 @@ jobs: -DBOUT_USE_SUNDIALS=ON -DBOUT_USE_ADIOS2=ON -DBOUT_ENABLE_PYTHON=ON - -DADIOS2_DIR=/home/runner/local/adios2 + -DADIOS2_ROOT=/home/runner/local/adios2 -DSUNDIALS_ROOT=/home/runner/local -DPETSC_DIR=/home/runner/local/petsc -DSLEPC_DIR=/home/runner/local/slepc" From 3b2abb8cae8d28372e12a59beebe3ad5580797e1 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Thu, 7 Dec 2023 13:52:50 -0800 Subject: [PATCH 33/46] Fix compilation of OptionsADIOS Now tested with ADIOS enabled. --- src/sys/options/options_adios.cxx | 2 +- src/sys/options/options_adios.hxx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index fd8e978091..23abcc74bc 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -19,7 +19,7 @@ namespace bout { /// Name of the attribute used to track individual variable's time indices constexpr auto current_time_index_name = "current_time_index"; -OptionsADIOS::OptionsADIOS(Options& options) { +OptionsADIOS::OptionsADIOS(Options& options) : OptionsIO(options) { if (options["file"].doc("File name. Defaults to /.pb").isSet()) { filename = options["file"].as(); } else { diff --git a/src/sys/options/options_adios.hxx b/src/sys/options/options_adios.hxx index 2460dfd10c..eddb3976ff 100644 --- a/src/sys/options/options_adios.hxx +++ b/src/sys/options/options_adios.hxx @@ -53,7 +53,6 @@ public: Options read() override; /// Write options to file - void write(const Options& options) override { write(options, "t"); } void write(const Options& options, const std::string& time_dim) override; /// Check that all variables with the same time dimension have the From 180908651cd8a84fc579e6bc6b1c3ba4043061c6 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Thu, 7 Dec 2023 13:54:57 -0800 Subject: [PATCH 34/46] Add BOUT_DOWNLOAD_ADIOS CMake flag If configured with `-DBOUT_DOWNLOAD_ADIOS=ON`, CMake will download ADIOS2 from github, configure and build it with BOUT++. --- cmake/SetupBOUTThirdParty.cmake | 36 +++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/cmake/SetupBOUTThirdParty.cmake b/cmake/SetupBOUTThirdParty.cmake index b5470a2f46..e1d6f00cb4 100644 --- a/cmake/SetupBOUTThirdParty.cmake +++ b/cmake/SetupBOUTThirdParty.cmake @@ -156,6 +156,7 @@ option(BOUT_USE_NETCDF "Enable support for NetCDF output" ON) option(BOUT_DOWNLOAD_NETCDF_CXX4 "Download and build netCDF-cxx4" OFF) if (BOUT_USE_NETCDF) if (BOUT_DOWNLOAD_NETCDF_CXX4) + message(STATUS "Downloading and configuring NetCDF-cxx4") include(FetchContent) FetchContent_Declare( netcdf-cxx4 @@ -186,14 +187,37 @@ message(STATUS "NetCDF support: ${BOUT_USE_NETCDF}") set(BOUT_HAS_NETCDF ${BOUT_USE_NETCDF}) option(BOUT_USE_ADIOS "Enable support for ADIOS output" ON) +option(BOUT_DOWNLOAD_ADIOS "Download and build ADIOS2" OFF) if (BOUT_USE_ADIOS) - find_package(ADIOS2) - if (ADIOS2_FOUND) - ENABLE_LANGUAGE(C) - find_package(MPI REQUIRED COMPONENTS C) - target_link_libraries(bout++ PUBLIC adios2::cxx11_mpi MPI::MPI_C) + if (BOUT_DOWNLOAD_ADIOS) + message(STATUS "Downloading and configuring ADIOS2") + include(FetchContent) + FetchContent_Declare( + adios2 + GIT_REPOSITORY https://github.com/ornladios/ADIOS2.git + GIT_TAG origin/master + GIT_SHALLOW 1 + ) + set(ADIOS2_USE_MPI ON CACHE BOOL "" FORCE) + set(ADIOS2_USE_Fortran OFF CACHE BOOL "" FORCE) + set(ADIOS2_USE_Python OFF CACHE BOOL "" FORCE) + set(ADIOS2_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) + # Disable testing, or ADIOS will try to find or install GTEST + set(BUILD_TESTING OFF CACHE BOOL "" FORCE) + # Note: SST requires but doesn't check at configure time + set(ADIOS2_USE_SST OFF CACHE BOOL "" FORCE) + FetchContent_MakeAvailable(adios2) + target_link_libraries(bout++ PUBLIC adios2::cxx11_mpi) + message(STATUS "ADIOS2 done configuring") else() - set(BOUT_USE_ADIOS OFF) + find_package(ADIOS2) + if (ADIOS2_FOUND) + ENABLE_LANGUAGE(C) + find_package(MPI REQUIRED COMPONENTS C) + target_link_libraries(bout++ PUBLIC adios2::cxx11_mpi MPI::MPI_C) + else() + set(BOUT_USE_ADIOS OFF) + endif() endif() endif() message(STATUS "ADIOS support: ${BOUT_USE_ADIOS}") From 1399e204f8f8b67dd750efe65e70ef4c5480b34e Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Thu, 7 Dec 2023 17:36:16 -0800 Subject: [PATCH 35/46] test_options_netcdf: Change to OptionsIO interface --- include/bout/options_io.hxx | 1 + src/sys/options/options_io.cxx | 5 ++ tests/unit/sys/test_options_netcdf.cxx | 78 +++++++++++++------------- 3 files changed, 46 insertions(+), 38 deletions(-) diff --git a/include/bout/options_io.hxx b/include/bout/options_io.hxx index 0139609417..9350c252ff 100644 --- a/include/bout/options_io.hxx +++ b/include/bout/options_io.hxx @@ -44,6 +44,7 @@ public: virtual void verifyTimesteps() const = 0; static std::unique_ptr create(const std::string& file); + static std::unique_ptr create(Options& config); }; class OptionsIOFactory : public Factory { diff --git a/src/sys/options/options_io.cxx b/src/sys/options/options_io.cxx index 0d25591db7..13a8c9890a 100644 --- a/src/sys/options/options_io.cxx +++ b/src/sys/options/options_io.cxx @@ -8,6 +8,11 @@ std::unique_ptr OptionsIO::create(const std::string& file) { return OptionsIOFactory::getInstance().createFile(file); } +std::unique_ptr OptionsIO::create(Options& config) { + auto& factory = OptionsIOFactory::getInstance(); + return factory.create(factory.getType(&config), config); +} + OptionsIOFactory::ReturnType OptionsIOFactory::createRestart(Options* optionsptr) const { Options& options = optionsptr ? *optionsptr : Options::root()["restart_files"]; diff --git a/tests/unit/sys/test_options_netcdf.cxx b/tests/unit/sys/test_options_netcdf.cxx index b086043822..3f32b0b7d9 100644 --- a/tests/unit/sys/test_options_netcdf.cxx +++ b/tests/unit/sys/test_options_netcdf.cxx @@ -9,9 +9,9 @@ #include "test_extras.hxx" #include "bout/field3d.hxx" #include "bout/mesh.hxx" -#include "bout/options_netcdf.hxx" +#include "bout/options_io.hxx" -using bout::OptionsNetCDF; +using bout::OptionsIO; #include @@ -39,11 +39,11 @@ TEST_F(OptionsNetCDFTest, ReadWriteInt) { options["test"] = 42; // Write the file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read again - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_EQ(data["test"], 42); } @@ -54,11 +54,11 @@ TEST_F(OptionsNetCDFTest, ReadWriteString) { options["test"] = std::string{"hello"}; // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_EQ(data["test"], std::string("hello")); } @@ -69,11 +69,11 @@ TEST_F(OptionsNetCDFTest, ReadWriteField2D) { options["test"] = Field2D(1.0); // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); Field2D value = data["test"].as(bout::globals::mesh); @@ -87,11 +87,11 @@ TEST_F(OptionsNetCDFTest, ReadWriteField3D) { options["test"] = Field3D(2.4); // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); Field3D value = data["test"].as(bout::globals::mesh); @@ -106,11 +106,11 @@ TEST_F(OptionsNetCDFTest, Groups) { options["test"]["key"] = 42; // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_EQ(data["test"]["key"], 42); } @@ -121,11 +121,11 @@ TEST_F(OptionsNetCDFTest, AttributeInt) { options["test"].attributes["thing"] = 4; // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_EQ(data["test"].attributes["thing"].as(), 4); } @@ -136,11 +136,11 @@ TEST_F(OptionsNetCDFTest, AttributeBoutReal) { options["test"].attributes["thing"] = 3.14; // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_DOUBLE_EQ(data["test"].attributes["thing"].as(), 3.14); } @@ -151,11 +151,11 @@ TEST_F(OptionsNetCDFTest, AttributeString) { options["test"].attributes["thing"] = "hello"; // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_EQ(data["test"].attributes["thing"].as(), "hello"); } @@ -165,11 +165,11 @@ TEST_F(OptionsNetCDFTest, Field2DWriteCellCentre) { options["f2d"] = Field2D(2.0); // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_EQ(data["f2d"].attributes["cell_location"].as(), toString(CELL_CENTRE)); @@ -181,11 +181,11 @@ TEST_F(OptionsNetCDFTest, Field2DWriteCellYLow) { options["f2d"] = Field2D(2.0, mesh_staggered).setLocation(CELL_YLOW); // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_EQ(data["f2d"].attributes["cell_location"].as(), toString(CELL_YLOW)); @@ -197,11 +197,11 @@ TEST_F(OptionsNetCDFTest, Field3DWriteCellCentre) { options["f3d"] = Field3D(2.0); // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_EQ(data["f3d"].attributes["cell_location"].as(), toString(CELL_CENTRE)); @@ -213,11 +213,11 @@ TEST_F(OptionsNetCDFTest, Field3DWriteCellYLow) { options["f3d"] = Field3D(2.0, mesh_staggered).setLocation(CELL_YLOW); // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_EQ(data["f3d"].attributes["cell_location"].as(), toString(CELL_YLOW)); @@ -235,11 +235,11 @@ TEST_F(OptionsNetCDFTest, FieldPerpWriteCellCentre) { fperp.getMesh()->getXcomm(); // Write file - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } // Read file - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_EQ(data["fperp"].attributes["cell_location"].as(), toString(CELL_CENTRE)); @@ -252,10 +252,10 @@ TEST_F(OptionsNetCDFTest, VerifyTimesteps) { options["thing1"] = 1.0; options["thing1"].attributes["time_dimension"] = "t"; - OptionsNetCDF(filename).write(options); + OptionsIO::create(filename).write(options); } - EXPECT_NO_THROW(OptionsNetCDF(filename).verifyTimesteps()); + EXPECT_NO_THROW(OptionsIO::create(filename).verifyTimesteps()); { Options options; @@ -265,10 +265,12 @@ TEST_F(OptionsNetCDFTest, VerifyTimesteps) { options["thing2"] = 3.0; options["thing2"].attributes["time_dimension"] = "t"; - OptionsNetCDF(filename, OptionsNetCDF::FileMode::append).write(options); + Optiond config{{"type", "netcdf"}, {"file", filename}, {"append", true}}; + + OptionsIO::create(config).write(options); } - EXPECT_THROW(OptionsNetCDF(filename).verifyTimesteps(), BoutException); + EXPECT_THROW(OptionsIO::create(filename).verifyTimesteps(), BoutException); } TEST_F(OptionsNetCDFTest, WriteTimeDimension) { @@ -278,10 +280,10 @@ TEST_F(OptionsNetCDFTest, WriteTimeDimension) { options["thing2"].assignRepeat(2.0, "t2"); // non-default // Only write non-default time dim - OptionsNetCDF(filename).write(options, "t2"); + OptionsIO::create(filename).write(options, "t2"); } - Options data = OptionsNetCDF(filename).read(); + Options data = OptionsIO::create(filename).read(); EXPECT_FALSE(data.isSet("thing1")); EXPECT_TRUE(data.isSet("thing2")); @@ -297,12 +299,12 @@ TEST_F(OptionsNetCDFTest, WriteMultipleTimeDimensions) { options["thing4_t2"].assignRepeat(2.0, "t2"); // non-default // Write the non-default time dim twice - OptionsNetCDF(filename).write(options, "t2"); - OptionsNetCDF(filename).write(options, "t2"); - OptionsNetCDF(filename).write(options, "t"); + OptionsIO::create(filename).write(options, "t2"); + OptionsIO::create(filename).write(options, "t2"); + OptionsIO::create(filename).write(options, "t"); } - EXPECT_NO_THROW(OptionsNetCDF(filename).verifyTimesteps()); + EXPECT_NO_THROW(OptionsIO::create(filename).verifyTimesteps()); } #endif // BOUT_HAS_NETCDF From f62b5e5bafa3877d138e14a99cb8b8dc3dab82e5 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Fri, 8 Dec 2023 11:25:26 -0800 Subject: [PATCH 36/46] Adding documentation and fixing tests Some documentation in the comments, and in the manual. --- include/bout/options_io.hxx | 64 +++++++++++++++- manual/sphinx/index.rst | 1 + manual/sphinx/user_docs/adios2.rst | 45 +++++++++++ manual/sphinx/user_docs/advanced_install.rst | 6 +- manual/sphinx/user_docs/bout_options.rst | 48 +++++------- manual/sphinx/user_docs/installing.rst | 4 + src/sys/options/options_io.cxx | 4 + .../test-options-netcdf.cxx | 23 +++--- tests/unit/sys/test_options_netcdf.cxx | 75 +++++++++---------- tools/pylib/_boutpp_build/bout_options.pxd | 1 + tools/pylib/_boutpp_build/boutcpp.pxd.jinja | 2 +- tools/pylib/_boutpp_build/boutpp.pyx.jinja | 3 + 12 files changed, 193 insertions(+), 83 deletions(-) create mode 100644 manual/sphinx/user_docs/adios2.rst diff --git a/include/bout/options_io.hxx b/include/bout/options_io.hxx index 9350c252ff..65c3cb7dd1 100644 --- a/include/bout/options_io.hxx +++ b/include/bout/options_io.hxx @@ -1,4 +1,34 @@ -/* Parent class for IO/ADIOS option classes */ +/// Parent class for IO to binary files and streams +/// +/// +/// Usage: +/// +/// 1. Dump files, containing time history: +/// +/// auto dump = OptionsIOFactory::getInstance().createOutput(); +/// dump->write(data); +/// +/// where data is an Options tree. By default dump files are configured +/// with the root `output` section, or an Option tree can be passed to +/// `createOutput`. +/// +/// 2. Restart files: +/// +/// auto restart = OptionsIOFactory::getInstance().createOutput(); +/// restart->write(data); +/// +/// where data is an Options tree. By default restart files are configured +/// with the root `restart_files` section, or an Option tree can be passed to +/// `createRestart`. +/// +/// 3. Ad-hoc single files +/// Note: The caller should consider how multiple processors interact with the file. +/// +/// auto file = OptionsIOFactory::getInstance().createFile("some_file.nc"); +/// or +/// auto file = OptionsIO::create("some_file.nc"); +/// +/// #pragma once @@ -43,8 +73,35 @@ public: /// ADIOS: Indicate completion of an output step. virtual void verifyTimesteps() const = 0; + /// Create an OptionsIO for I/O to the given file. + /// This uses the default file type and default options. static std::unique_ptr create(const std::string& file); + + /// Create an OptionsIO for I/O to the given file. + /// The file will be configured using the given `config` options: + /// - "type" : string The file type e.g. "netcdf" or "adios" + /// - "file" : string Name of the file + /// - "append" : bool Append to existing data (Default is false) static std::unique_ptr create(Options& config); + + /// Create an OptionsIO for I/O to the given file. + /// The file will be configured using the given `config` options: + /// - "type" : string The file type e.g. "netcdf" or "adios" + /// - "file" : string Name of the file + /// - "append" : bool Append to existing data (Default is false) + /// + /// Example: + /// + /// auto file = OptionsIO::create({ + /// {"file", "some_file.nc"}, + /// {"type", "netcdf"}, + /// {"append", false} + /// }); + static std::unique_ptr + create(std::initializer_list> config_list) { + Options config(config_list); // Construct an Options to pass by reference + return create(config); + } }; class OptionsIOFactory : public Factory { @@ -111,6 +168,11 @@ using RegisterOptionsIO = OptionsIOFactory::RegisterInFactory; /// } using RegisterUnavailableOptionsIO = OptionsIOFactory::RegisterUnavailableInFactory; +/// Convenient wrapper function around OptionsIOFactory::createOutput +/// Opens a dump file configured with the `output` root section, +/// and writes the given `data` to the file. +void writeDefaultOutputFile(Options& data); + } // namespace bout #endif // OPTIONS_IO_H diff --git a/manual/sphinx/index.rst b/manual/sphinx/index.rst index 46728c7119..9f661ca187 100644 --- a/manual/sphinx/index.rst +++ b/manual/sphinx/index.rst @@ -42,6 +42,7 @@ The documentation is divided into the following sections: user_docs/boundary_options user_docs/testing user_docs/gpu_support + user_docs/adios2 .. toctree:: :maxdepth: 2 diff --git a/manual/sphinx/user_docs/adios2.rst b/manual/sphinx/user_docs/adios2.rst new file mode 100644 index 0000000000..8a6228cd3a --- /dev/null +++ b/manual/sphinx/user_docs/adios2.rst @@ -0,0 +1,45 @@ +.. _sec-adios2: + +ADIOS2 support +============== + +This section summarises the use of `ADIOS2 `_ in BOUT++. + +Installation +------------ + +The easiest way to configure BOUT++ with ADIOS2 is to tell CMake to download and build it +with this flag:: + + -DBOUT_DOWNLOAD_ADIOS=ON + +The ``master`` branch will be downloaded from `Github `_, +configured and built with BOUT++. + +Alternatively, if ADIOS is already installed then the following flags can be used:: + + -DBOUT_USE_ADIOS=ON -DADIOS2_ROOT=/path/to/adios2 + +Output files +------------ + +The output (dump) files are controlled with the root ``output`` options. +By default the output format is NetCDF, so to use ADIOS2 instead set +the output type in BOUT.inp:: + + [output] + type = adios + +or on the BOUT++ command line set ``output:type=adios``. The default +prefix is "BOUT.dmp" so the ADIOS file will be called "BOUT.dmp.bp". To change this, +set the ``output:prefix`` option. + +Restart files +------------- + +The restart files are contolled with the root ``restart_files`` options, +so to read and write restarts from an ADIOS dataset, put in BOUT.inp:: + + [restart_files] + type = adios + diff --git a/manual/sphinx/user_docs/advanced_install.rst b/manual/sphinx/user_docs/advanced_install.rst index 957173b820..e25be12b4b 100644 --- a/manual/sphinx/user_docs/advanced_install.rst +++ b/manual/sphinx/user_docs/advanced_install.rst @@ -170,8 +170,10 @@ for a production run use: File formats ------------ -BOUT++ can currently use the NetCDF-4_ file format, with experimental -support for the parallel flavour. NetCDF is a widely used format and +BOUT++ can currently use the NetCDF-4_ file format and the ADIOS2 library +for high-performance parallel output. + +NetCDF is a widely used format and has many tools for viewing and manipulating files. .. _NetCDF-4: https://www.unidata.ucar.edu/software/netcdf/ diff --git a/manual/sphinx/user_docs/bout_options.rst b/manual/sphinx/user_docs/bout_options.rst index 5422558ff9..976faa0544 100644 --- a/manual/sphinx/user_docs/bout_options.rst +++ b/manual/sphinx/user_docs/bout_options.rst @@ -523,6 +523,12 @@ options available are listed in table :numref:`tab-outputopts`. +-------------+----------------------------------------------------+--------------+ | enabled | Writing is enabled | true | +-------------+----------------------------------------------------+--------------+ + | type | File type e.g. "netcdf" or "adios" | "netcdf" | + +-------------+----------------------------------------------------+--------------+ + | prefix | File name prefix | "BOUT.dmp" | + +-------------+----------------------------------------------------+--------------+ + | path | Directory to write the file into | ``datadir`` | + +-------------+----------------------------------------------------+--------------+ | floats | Write floats rather than doubles | false | +-------------+----------------------------------------------------+--------------+ | flush | Flush the file to disk after each write | true | @@ -531,8 +537,6 @@ options available are listed in table :numref:`tab-outputopts`. +-------------+----------------------------------------------------+--------------+ | openclose | Re-open the file for each write, and close after | true | +-------------+----------------------------------------------------+--------------+ - | parallel | Use parallel I/O | false | - +-------------+----------------------------------------------------+--------------+ | @@ -541,20 +545,6 @@ want to exclude I/O from the timings. **floats** can be used to reduce the size of the output files: files are stored as double by default, but setting **floats = true** changes the output to single-precision floats. -To enable parallel I/O for either output or restart files, set - -.. code-block:: cfg - - parallel = true - -in the output or restart section. If you have compiled BOUT++ with a -parallel I/O library such as pnetcdf (see -:ref:`sec-advancedinstall`), then rather than outputting one file per -processor, all processors will output to the same file. For restart -files this is particularly useful, as it means that you can restart a -job with a different number of processors. Note that this feature is -still experimental, and incomplete: output dump files are not yet -supported by the collect routines. Implementation -------------- @@ -833,30 +823,30 @@ This is currently quite rudimentary and needs improving. .. _sec-options-netcdf: -Reading and writing to NetCDF ------------------------------ +Reading and writing to binary formats +------------------------------------- -The `bout::OptionsNetCDF` class provides an interface to read and -write options. Examples are in integrated test +The `bout::OptionsIO` class provides an interface to read and +write options to binary files. Examples are in integrated test ``tests/integrated/test-options-netcdf/`` To write the current `Options` tree (e.g. from ``BOUT.inp``) to a NetCDF file:: - bout::OptionsNetCDF("settings.nc").write(Options::root()); + bout::OptionsIO::create("settings.nc")->write(Options::root()); and to read it in again:: - Options data = bout::OptionsNetCDF("settings.nc").read(); + Options data = bout::OptionsIO::create("settings.nc")->read(); Fields can also be stored and written:: Options fields; fields["f2d"] = Field2D(1.0); fields["f3d"] = Field3D(2.0); - bout::OptionsNetCDF("fields.nc").write(fields); + bout::OptionsIO::create("fields.nc").write(fields); -This should allow the input settings and evolving variables to be +This allows the input settings and evolving variables to be combined into a single tree (see above on joining trees) and written to the output dump or restart files. @@ -865,7 +855,7 @@ an ``Array``, 2D as ``Matrix`` and 3D as ``Tensor``. These can be extracted directly from the ``Options`` tree, or converted to a Field:: - Options fields_in = bout::OptionsNetCDF("fields.nc").read(); + Options fields_in = bout::OptionsIO::create("fields.nc")->read(); Field2D f2d = fields_in["f2d"].as(); Field3D f3d = fields_in["f3d"].as(); @@ -907,7 +897,7 @@ automatically set the ``"time_dimension"`` attribute:: // Or use `assignRepeat` to do it automatically: data["field"].assignRepeat(Field3D(2.0)); - bout::OptionsNetCDF("time.nc").write(data); + bout::OptionsIO::create("time.nc")->write(data); // Update time-dependent values. This can be done without `force` if the time_dimension // attribute is set @@ -915,13 +905,13 @@ automatically set the ``"time_dimension"`` attribute:: data["field"] = Field3D(3.0); // Append data to file - bout::OptionsNetCDF("time.nc", bout::OptionsNetCDF::FileMode::append).write(data); + bout::OptionsIO({{"file", "time.nc"}, {"append", true}})->write(data); -.. note:: By default, `bout::OptionsNetCDF::write` will only write variables +.. note:: By default, `bout::OptionsIO::write` will only write variables with a ``"time_dimension"`` of ``"t"``. You can write variables with a different time dimension by passing it as the second argument: - ``OptionsNetCDF(filename).write(options, "t2")`` for example. + ``OptionsIO::create(filename)->write(options, "t2")`` for example. FFT diff --git a/manual/sphinx/user_docs/installing.rst b/manual/sphinx/user_docs/installing.rst index fc1b2ce2da..eb155909bf 100644 --- a/manual/sphinx/user_docs/installing.rst +++ b/manual/sphinx/user_docs/installing.rst @@ -373,6 +373,10 @@ For SUNDIALS, use ``-DBOUT_DOWNLOAD_SUNDIALS=ON``. If using ``ccmake`` this opti may not appear initially. This automatically sets ``BOUT_USE_SUNDIALS=ON``, and configures SUNDIALS to use MPI. +For ADIOS2, use ``-DBOUT_DOWNLOAD_ADIOS=ON``. This will download and +configure `ADIOS2 `_, enabling BOUT++ +to read and write this high-performance parallel file format. + Bundled Dependencies ~~~~~~~~~~~~~~~~~~~~ diff --git a/src/sys/options/options_io.cxx b/src/sys/options/options_io.cxx index 13a8c9890a..454ba77fc3 100644 --- a/src/sys/options/options_io.cxx +++ b/src/sys/options/options_io.cxx @@ -43,4 +43,8 @@ OptionsIOFactory::ReturnType OptionsIOFactory::createFile(const std::string& fil return create(getDefaultType(), options); } +void writeDefaultOutputFile(Options& data) { + OptionsIOFactory::getInstance().createOutput()->write(data); +} + } // namespace bout diff --git a/tests/integrated/test-options-netcdf/test-options-netcdf.cxx b/tests/integrated/test-options-netcdf/test-options-netcdf.cxx index 7da6199535..f5daf8919c 100644 --- a/tests/integrated/test-options-netcdf/test-options-netcdf.cxx +++ b/tests/integrated/test-options-netcdf/test-options-netcdf.cxx @@ -2,18 +2,17 @@ #include "bout/bout.hxx" #include "bout/options_io.hxx" -#include "bout/options_netcdf.hxx" #include "bout/optionsreader.hxx" -using bout::OptionsNetCDF; +using bout::OptionsIO; int main(int argc, char** argv) { BoutInitialise(argc, argv); // Read values from a NetCDF file - OptionsNetCDF file("test.nc"); + auto file = OptionsIO::create("test.nc"); - auto values = file.read(); + auto values = file->read(); values.printUnused(); @@ -22,15 +21,15 @@ int main(int argc, char** argv) { reader->write(&values, "test-out.ini"); // Write to a NetCDF file - OptionsNetCDF("test-out.nc").write(values); + OptionsIO::create("test-out.nc")->write(values); /////////////////////////// // Write the BOUT.inp settings to NetCDF file - OptionsNetCDF("settings.nc").write(Options::root()); + OptionsIO::create("settings.nc")->write(Options::root()); // Read back in - auto settings = OptionsNetCDF("settings.nc").read(); + auto settings = OptionsIO::create("settings.nc")->read(); // Write to INI file reader->write(&settings, "settings.ini"); @@ -42,12 +41,12 @@ int main(int argc, char** argv) { fields["f2d"] = Field2D(1.0); fields["f3d"] = Field3D(2.0); fields["fperp"] = FieldPerp(3.0); - OptionsNetCDF("fields.nc").write(fields); + OptionsIO::create("fields.nc")->write(fields); /////////////////////////// // Read fields - Options fields_in = OptionsNetCDF("fields.nc").read(); + Options fields_in = OptionsIO::create("fields.nc")->read(); auto f2d = fields_in["f2d"].as(bout::globals::mesh); auto f3d = fields_in["f3d"].as(bout::globals::mesh); @@ -59,7 +58,7 @@ int main(int argc, char** argv) { fields2["fperp"] = fperp; // Write out again - OptionsNetCDF("fields2.nc").write(fields2); + OptionsIO::create("fields2.nc")->write(fields2); /////////////////////////// // Time dependent values @@ -71,14 +70,14 @@ int main(int argc, char** argv) { data["field"] = Field3D(2.0); data["field"].attributes["time_dimension"] = "t"; - OptionsNetCDF("time.nc").write(data); + OptionsIO::create("time.nc")->write(data); // Update time-dependent values data["scalar"] = 2.0; data["field"] = Field3D(3.0); // Append data to file - OptionsNetCDF("time.nc", bout::OptionsIO::FileMode::append).write(data); + OptionsIO::create({{"file", "time.nc"}, {"append", true}})->write(data); BoutFinalise(); }; diff --git a/tests/unit/sys/test_options_netcdf.cxx b/tests/unit/sys/test_options_netcdf.cxx index 3f32b0b7d9..5869cf4932 100644 --- a/tests/unit/sys/test_options_netcdf.cxx +++ b/tests/unit/sys/test_options_netcdf.cxx @@ -39,11 +39,11 @@ TEST_F(OptionsNetCDFTest, ReadWriteInt) { options["test"] = 42; // Write the file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read again - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_EQ(data["test"], 42); } @@ -54,11 +54,11 @@ TEST_F(OptionsNetCDFTest, ReadWriteString) { options["test"] = std::string{"hello"}; // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_EQ(data["test"], std::string("hello")); } @@ -69,11 +69,11 @@ TEST_F(OptionsNetCDFTest, ReadWriteField2D) { options["test"] = Field2D(1.0); // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); Field2D value = data["test"].as(bout::globals::mesh); @@ -87,11 +87,11 @@ TEST_F(OptionsNetCDFTest, ReadWriteField3D) { options["test"] = Field3D(2.4); // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); Field3D value = data["test"].as(bout::globals::mesh); @@ -106,11 +106,11 @@ TEST_F(OptionsNetCDFTest, Groups) { options["test"]["key"] = 42; // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_EQ(data["test"]["key"], 42); } @@ -121,11 +121,11 @@ TEST_F(OptionsNetCDFTest, AttributeInt) { options["test"].attributes["thing"] = 4; // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_EQ(data["test"].attributes["thing"].as(), 4); } @@ -136,11 +136,11 @@ TEST_F(OptionsNetCDFTest, AttributeBoutReal) { options["test"].attributes["thing"] = 3.14; // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_DOUBLE_EQ(data["test"].attributes["thing"].as(), 3.14); } @@ -151,11 +151,11 @@ TEST_F(OptionsNetCDFTest, AttributeString) { options["test"].attributes["thing"] = "hello"; // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_EQ(data["test"].attributes["thing"].as(), "hello"); } @@ -165,11 +165,11 @@ TEST_F(OptionsNetCDFTest, Field2DWriteCellCentre) { options["f2d"] = Field2D(2.0); // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_EQ(data["f2d"].attributes["cell_location"].as(), toString(CELL_CENTRE)); @@ -181,11 +181,11 @@ TEST_F(OptionsNetCDFTest, Field2DWriteCellYLow) { options["f2d"] = Field2D(2.0, mesh_staggered).setLocation(CELL_YLOW); // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_EQ(data["f2d"].attributes["cell_location"].as(), toString(CELL_YLOW)); @@ -197,11 +197,11 @@ TEST_F(OptionsNetCDFTest, Field3DWriteCellCentre) { options["f3d"] = Field3D(2.0); // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_EQ(data["f3d"].attributes["cell_location"].as(), toString(CELL_CENTRE)); @@ -213,11 +213,11 @@ TEST_F(OptionsNetCDFTest, Field3DWriteCellYLow) { options["f3d"] = Field3D(2.0, mesh_staggered).setLocation(CELL_YLOW); // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_EQ(data["f3d"].attributes["cell_location"].as(), toString(CELL_YLOW)); @@ -235,11 +235,11 @@ TEST_F(OptionsNetCDFTest, FieldPerpWriteCellCentre) { fperp.getMesh()->getXcomm(); // Write file - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } // Read file - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_EQ(data["fperp"].attributes["cell_location"].as(), toString(CELL_CENTRE)); @@ -252,10 +252,10 @@ TEST_F(OptionsNetCDFTest, VerifyTimesteps) { options["thing1"] = 1.0; options["thing1"].attributes["time_dimension"] = "t"; - OptionsIO::create(filename).write(options); + OptionsIO::create(filename)->write(options); } - EXPECT_NO_THROW(OptionsIO::create(filename).verifyTimesteps()); + EXPECT_NO_THROW(OptionsIO::create(filename)->verifyTimesteps()); { Options options; @@ -265,12 +265,11 @@ TEST_F(OptionsNetCDFTest, VerifyTimesteps) { options["thing2"] = 3.0; options["thing2"].attributes["time_dimension"] = "t"; - Optiond config{{"type", "netcdf"}, {"file", filename}, {"append", true}}; - - OptionsIO::create(config).write(options); + OptionsIO::create({{"type", "netcdf"}, {"file", filename}, {"append", true}}) + ->write(options); } - EXPECT_THROW(OptionsIO::create(filename).verifyTimesteps(), BoutException); + EXPECT_THROW(OptionsIO::create(filename)->verifyTimesteps(), BoutException); } TEST_F(OptionsNetCDFTest, WriteTimeDimension) { @@ -280,10 +279,10 @@ TEST_F(OptionsNetCDFTest, WriteTimeDimension) { options["thing2"].assignRepeat(2.0, "t2"); // non-default // Only write non-default time dim - OptionsIO::create(filename).write(options, "t2"); + OptionsIO::create(filename)->write(options, "t2"); } - Options data = OptionsIO::create(filename).read(); + Options data = OptionsIO::create(filename)->read(); EXPECT_FALSE(data.isSet("thing1")); EXPECT_TRUE(data.isSet("thing2")); @@ -299,12 +298,12 @@ TEST_F(OptionsNetCDFTest, WriteMultipleTimeDimensions) { options["thing4_t2"].assignRepeat(2.0, "t2"); // non-default // Write the non-default time dim twice - OptionsIO::create(filename).write(options, "t2"); - OptionsIO::create(filename).write(options, "t2"); - OptionsIO::create(filename).write(options, "t"); + OptionsIO::create(filename)->write(options, "t2"); + OptionsIO::create(filename)->write(options, "t2"); + OptionsIO::create(filename)->write(options, "t"); } - EXPECT_NO_THROW(OptionsIO::create(filename).verifyTimesteps()); + EXPECT_NO_THROW(OptionsIO::create(filename)->verifyTimesteps()); } #endif // BOUT_HAS_NETCDF diff --git a/tools/pylib/_boutpp_build/bout_options.pxd b/tools/pylib/_boutpp_build/bout_options.pxd index 550bfc01e1..be17608cea 100644 --- a/tools/pylib/_boutpp_build/bout_options.pxd +++ b/tools/pylib/_boutpp_build/bout_options.pxd @@ -9,6 +9,7 @@ cdef extern from "boutexception_helper.hxx": cdef extern from "bout/options_io.hxx" namespace "bout": + cdef void writeDefaultOutputFile(Options& options); cppclass OptionsIO: @staticmethod OptionsIO * create(string filename) diff --git a/tools/pylib/_boutpp_build/boutcpp.pxd.jinja b/tools/pylib/_boutpp_build/boutcpp.pxd.jinja index 28633cad95..12e210a5b5 100644 --- a/tools/pylib/_boutpp_build/boutcpp.pxd.jinja +++ b/tools/pylib/_boutpp_build/boutcpp.pxd.jinja @@ -5,7 +5,7 @@ from libcpp.memory cimport unique_ptr from libcpp.string cimport string cimport resolve_enum as benum -from bout_options cimport Options, OptionsReader, OptionsIO +from bout_options cimport Options, OptionsReader, OptionsIO, writeDefaultOutputFile cdef extern from "boutexception_helper.hxx": cdef void raise_bout_py_error() diff --git a/tools/pylib/_boutpp_build/boutpp.pyx.jinja b/tools/pylib/_boutpp_build/boutpp.pyx.jinja index a8c027475a..3aeb1428eb 100644 --- a/tools/pylib/_boutpp_build/boutpp.pyx.jinja +++ b/tools/pylib/_boutpp_build/boutpp.pyx.jinja @@ -1723,6 +1723,9 @@ cdef class Options: del self.cobj self.cobj = NULL +def writeDefaultOutputFile(options: Options): + c.writeDefaultOutputFile(deref(options.cobj)) + def print(*args, sep=" ", end="\n"): _print(sep.join([str(a) for a in args]) + end) From 2c1f341b386222824c53fccd26050b959b20e6bf Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Fri, 8 Dec 2023 11:26:14 -0800 Subject: [PATCH 37/46] unit tests build gmock The unit tests require GMock, so set BUILD_GMOCK=ON by default. --- tests/unit/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index c0fd4a1e1f..c4ffa4fa75 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -19,6 +19,9 @@ if(NOT TARGET gtest) message(FATAL_ERROR "googletest not found! Have you disabled the git submodules (GIT_SUBMODULE)?") endif() +# Some unit tests require GMOCK, so make sure we build it +set(BUILD_GMOCK ON) + mark_as_advanced( BUILD_GMOCK BUILD_GTEST BUILD_SHARED_LIBS gmock_build_tests gtest_build_samples gtest_build_tests From 1725c818ab609fb51fffb122faebef5722fe93f7 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Fri, 8 Dec 2023 11:56:36 -0800 Subject: [PATCH 38/46] Fix calls to writeDefaultOutputFile Now always need to pass the data to be written, rather than implicitly writing Options::root(). --- tests/integrated/test-twistshift-staggered/test-twistshift.cxx | 2 +- tests/integrated/test-twistshift/test-twistshift.cxx | 2 +- tests/integrated/test-yupdown-weights/test_yupdown_weights.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integrated/test-twistshift-staggered/test-twistshift.cxx b/tests/integrated/test-twistshift-staggered/test-twistshift.cxx index 87b9e0a094..c9f8be7b09 100644 --- a/tests/integrated/test-twistshift-staggered/test-twistshift.cxx +++ b/tests/integrated/test-twistshift-staggered/test-twistshift.cxx @@ -30,7 +30,7 @@ int main(int argc, char** argv) { Options::root()["test"] = test; Options::root()["test_aligned"] = test_aligned; - bout::writeDefaultOutputFile(); + bout::writeDefaultOutputFile(Options::root()); BoutFinalise(); } diff --git a/tests/integrated/test-twistshift/test-twistshift.cxx b/tests/integrated/test-twistshift/test-twistshift.cxx index ccde8b82b6..2c0fc79563 100644 --- a/tests/integrated/test-twistshift/test-twistshift.cxx +++ b/tests/integrated/test-twistshift/test-twistshift.cxx @@ -28,7 +28,7 @@ int main(int argc, char** argv) { Options::root()["test"] = test; Options::root()["test_aligned"] = test_aligned; - bout::writeDefaultOutputFile(); + bout::writeDefaultOutputFile(Options::root()); BoutFinalise(); } diff --git a/tests/integrated/test-yupdown-weights/test_yupdown_weights.cxx b/tests/integrated/test-yupdown-weights/test_yupdown_weights.cxx index 22d1fb9e07..e8a2982bfd 100644 --- a/tests/integrated/test-yupdown-weights/test_yupdown_weights.cxx +++ b/tests/integrated/test-yupdown-weights/test_yupdown_weights.cxx @@ -70,7 +70,7 @@ int main(int argc, char** argv) { Options::root()["ddy"] = ddy; Options::root()["ddy2"] = ddy2; - bout::writeDefaultOutputFile(); + bout::writeDefaultOutputFile(Options::root()); BoutFinalise(); From eeb91777a2957a74554a5728de04798322dad179 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Fri, 8 Dec 2023 12:58:18 -0800 Subject: [PATCH 39/46] More integrated test fixes Changing from OptionsNetCDF to OptionsIO interface. --- .../test-griddata/test_griddata.cxx | 2 +- .../test-options-adios/test-options-adios.cxx | 52 ++++++++++++------- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/tests/integrated/test-griddata/test_griddata.cxx b/tests/integrated/test-griddata/test_griddata.cxx index 9f12d48d9d..0277f9e001 100644 --- a/tests/integrated/test-griddata/test_griddata.cxx +++ b/tests/integrated/test-griddata/test_griddata.cxx @@ -13,7 +13,7 @@ int main(int argc, char** argv) { dump["Bpxy"] = Bpxy; bout::experimental::addBuildFlagsToOptions(dump); bout::globals::mesh->outputVars(dump); - bout::OptionsNetCDF("data.nc").write(dump); + bout::OptionsIO::create("data.nc")->write(dump); BoutFinalise(); return 0; diff --git a/tests/integrated/test-options-adios/test-options-adios.cxx b/tests/integrated/test-options-adios/test-options-adios.cxx index efd74344c0..727172c688 100644 --- a/tests/integrated/test-options-adios/test-options-adios.cxx +++ b/tests/integrated/test-options-adios/test-options-adios.cxx @@ -1,20 +1,18 @@ #include "bout/bout.hxx" -#include "bout/options_adios.hxx" #include "bout/options_io.hxx" -#include "bout/options_netcdf.hxx" #include "bout/optionsreader.hxx" -using bout::OptionsADIOS; +using bout::OptionsIO; int main(int argc, char** argv) { BoutInitialise(argc, argv); // Read values from a NetCDF file - bout::OptionsNetCDF file("test.nc"); + auto file = bout::OptionsIO::create("test.nc"); - auto values = file.read(); + auto values = file->read(); values.printUnused(); @@ -22,17 +20,24 @@ int main(int argc, char** argv) { OptionsReader* reader = OptionsReader::getInstance(); reader->write(&values, "test-out.ini"); - // Write to ADIOS file - OptionsADIOS("test-out.bp", bout::OptionsIO::FileMode::replace, true).write(values); + // Write to ADIOS file, by setting file type "adios" + OptionsIO::create({{"file", "test-out.bp"}, + {"type", "adios"}, + {"append", false}, + {"singleWriteFile", true}}) + ->write(values); /////////////////////////// // Write the BOUT.inp settings to NetCDF file - OptionsADIOS("settings.bp", bout::OptionsIO::FileMode::replace, true) - .write(Options::root()); + OptionsIO::create({{"file", "settings.bp"}, + {"type", "adios"}, + {"append", false}, + {"singleWriteFile", true}}) + ->write(Options::root()); // Read back in - auto settings = OptionsADIOS("settings.bp").read(); + auto settings = OptionsIO::create({{"file", "settings.bp"}, {"type", "adios"}})->read(); // Write to INI file reader->write(&settings, "settings.ini"); @@ -44,19 +49,20 @@ int main(int argc, char** argv) { fields["f2d"] = Field2D(1.0); fields["f3d"] = Field3D(2.0); fields["fperp"] = FieldPerp(3.0); - auto f = OptionsADIOS("fields.bp"); + auto f = OptionsIO::create({{"file", "fields.bp"}, {"type", "adios"}}); /* write() for adios only buffers data but does not guarantee writing to disk unless singleWriteFile is set to true */ - f.write(fields); + f->write(fields); // indicate completion of step, required to get data on disk - f.verifyTimesteps(); + f->verifyTimesteps(); /////////////////////////// // Read fields - Options fields_in = OptionsADIOS("fields.bp").read(); + Options fields_in = + OptionsIO::create({{"file", "fields.bp"}, {"type", "adios"}})->read(); auto f2d = fields_in["f2d"].as(bout::globals::mesh); auto f3d = fields_in["f3d"].as(bout::globals::mesh); @@ -68,8 +74,10 @@ int main(int argc, char** argv) { fields2["fperp"] = fperp; // Write out again - auto f2 = bout::OptionsIOFactory("fields2.bp", bout::OptionsIO::FileMode::replace, - bout::OptionsIO::Library::ADIOS, true); + auto f2 = OptionsIO::create({{"file", "fields2.bp"}, + {"type", "adios"}, + {"append", false}, + {"singleWriteFile", true}}); f2->write(fields2); /////////////////////////// @@ -82,14 +90,22 @@ int main(int argc, char** argv) { data["field"] = Field3D(2.0); data["field"].attributes["time_dimension"] = "t"; - OptionsADIOS("time.bp", bout::OptionsIO::FileMode::replace, true).write(data); + OptionsIO::create({{"file", "time.bp"}, + {"type", "adios"}, + {"append", false}, + {"singleWriteFile", true}}) + ->write(data); // Update time-dependent values data["scalar"] = 2.0; data["field"] = Field3D(3.0); // Append data to file - OptionsADIOS("time.bp", bout::OptionsIO::FileMode::append, true).write(data); + OptionsIO::create({{"file", "time.bp"}, + {"type", "adios"}, + {"append", true}, + {"singleWriteFile", true}}) + ->write(data); BoutFinalise(); }; From 9ec88574ff126b193b860d095eb119f3746e41b6 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Fri, 8 Dec 2023 14:13:27 -0800 Subject: [PATCH 40/46] Fix MMS-spatial-fci test Output file needs MZ and other mesh variables for collect() to work. --- tests/MMS/spatial/fci/data/BOUT.inp | 1 + tests/MMS/spatial/fci/fci_mms.cxx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/MMS/spatial/fci/data/BOUT.inp b/tests/MMS/spatial/fci/data/BOUT.inp index 5f377bbb56..802f70f99b 100644 --- a/tests/MMS/spatial/fci/data/BOUT.inp +++ b/tests/MMS/spatial/fci/data/BOUT.inp @@ -5,6 +5,7 @@ input_field = sin(y - 2*z) + sin(y - z) solution = (6.28318530717959*(0.01*x + 0.045)*(-2*cos(y - 2*z) - cos(y - z)) + 0.628318530717959*cos(y - 2*z) + 0.628318530717959*cos(y - z))/sqrt((0.01*x + 0.045)^2 + 1.0) MXG = 1 +MYG = 1 NXPE = 1 [mesh] diff --git a/tests/MMS/spatial/fci/fci_mms.cxx b/tests/MMS/spatial/fci/fci_mms.cxx index 5a2599368e..18405a7f88 100644 --- a/tests/MMS/spatial/fci/fci_mms.cxx +++ b/tests/MMS/spatial/fci/fci_mms.cxx @@ -17,6 +17,8 @@ int main(int argc, char** argv) { Field3D error{result - solution}; Options dump; + // Add mesh geometry variables + mesh->outputVars(dump); dump["l_2"] = sqrt(mean(SQ(error), true, "RGN_NOBNDRY")); dump["l_inf"] = max(abs(error), true, "RGN_NOBNDRY"); From 365ce5241112d46caae15551b88a80af967d8703 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Wed, 13 Dec 2023 13:57:03 -0800 Subject: [PATCH 41/46] writeDefaultOutputFile: Add mesh variables Needed in post-processing when reading data --- src/sys/options/options_io.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sys/options/options_io.cxx b/src/sys/options/options_io.cxx index 454ba77fc3..025a655c1d 100644 --- a/src/sys/options/options_io.cxx +++ b/src/sys/options/options_io.cxx @@ -1,4 +1,6 @@ #include "bout/options_io.hxx" +#include "bout/globals.hxx" +#include "bout/mesh.hxx" #include "options_adios.hxx" #include "options_netcdf.hxx" @@ -44,6 +46,9 @@ OptionsIOFactory::ReturnType OptionsIOFactory::createFile(const std::string& fil } void writeDefaultOutputFile(Options& data) { + // Add mesh information + bout::globals::mesh->outputVars(data); + // Write to the default output file OptionsIOFactory::getInstance().createOutput()->write(data); } From 63b25413532337c2a96d37354be47f914d040c9f Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Wed, 13 Dec 2023 17:29:56 -0800 Subject: [PATCH 42/46] writeDefaultOutputFile: Add BOUT++ version and flags collect needs to know BOUT_VERSION or it assumes pre-0.2 format. --- src/sys/options/options_io.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sys/options/options_io.cxx b/src/sys/options/options_io.cxx index 025a655c1d..6717b6b07d 100644 --- a/src/sys/options/options_io.cxx +++ b/src/sys/options/options_io.cxx @@ -1,4 +1,5 @@ #include "bout/options_io.hxx" +#include "bout/bout.hxx" #include "bout/globals.hxx" #include "bout/mesh.hxx" @@ -46,6 +47,8 @@ OptionsIOFactory::ReturnType OptionsIOFactory::createFile(const std::string& fil } void writeDefaultOutputFile(Options& data) { + // Add BOUT++ version and flags + bout::experimental::addBuildFlagsToOptions(data); // Add mesh information bout::globals::mesh->outputVars(data); // Write to the default output file From 77eb501e7310b96c466ef17e64917355f76caf8b Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Thu, 14 Dec 2023 17:53:23 -0800 Subject: [PATCH 43/46] ADIOS reading of groups, more test fixes ADIOS uses '/' as a separator, but BOUT++ options uses ':'. When reading variables, we now split on '/' separator and navigate to the correct subsection. Attributes are also named using the final part of the name after the last '/'. solver and beuler integrated tests weren't calling BoutInitialise, so failed when ADIOSFinalize is called. --- include/bout/adios_object.hxx | 11 +++ src/sys/adios_object.cxx | 16 ++-- src/sys/options/options_adios.cxx | 75 ++++++++++++------- tests/integrated/test-beuler/test_beuler.cxx | 1 + .../test-options-adios/test-options-adios.cxx | 2 +- tests/integrated/test-solver/test_solver.cxx | 1 + 6 files changed, 72 insertions(+), 34 deletions(-) mode change 100755 => 100644 src/sys/adios_object.cxx diff --git a/include/bout/adios_object.hxx b/include/bout/adios_object.hxx index 7568810cfd..9d2f545b46 100755 --- a/include/bout/adios_object.hxx +++ b/include/bout/adios_object.hxx @@ -1,3 +1,14 @@ +/*!************************************************************************ + * Provides access to the ADIOS library, handling initialisation and + * finalisation. + * + * Usage + * ----- + * + * #include + * + **************************************************************************/ + #ifndef ADIOS_OBJECT_HXX #define ADIOS_OBJECT_HXX diff --git a/src/sys/adios_object.cxx b/src/sys/adios_object.cxx old mode 100755 new mode 100644 index 35126090f8..c7d6dab9aa --- a/src/sys/adios_object.cxx +++ b/src/sys/adios_object.cxx @@ -3,6 +3,7 @@ #if BOUT_HAS_ADIOS #include "bout/adios_object.hxx" +#include "bout/boutexception.hxx" #include #include @@ -21,7 +22,7 @@ void ADIOSInit(const std::string configFile, MPI_Comm comm) { void ADIOSFinalize() { if (adios == nullptr) { - throw std::runtime_error( + throw BoutException( "ADIOS needs to be initialized first before calling ADIOSFinalize()"); } adiosStreams.clear(); @@ -30,7 +31,7 @@ void ADIOSFinalize() { ADIOSPtr GetADIOSPtr() { if (adios == nullptr) { - throw std::runtime_error( + throw BoutException( "ADIOS needs to be initialized first before calling GetADIOSPtr()"); } return adios; @@ -76,9 +77,9 @@ void ADIOSSetParameters(const std::string& input, const char delimKeyValue, while (std::getline(inputSS, parameter, delimItem)) { const size_t position = parameter.find(delimKeyValue); if (position == parameter.npos) { - throw std::invalid_argument("ADIOSSetParameters(): wrong format for IO parameter " - + parameter + ", format must be key" + delimKeyValue - + "value for each entry"); + throw BoutException("ADIOSSetParameters(): wrong format for IO parameter " + + parameter + ", format must be key" + delimKeyValue + + "value for each entry"); } std::string key = parameter.substr(0, position); @@ -86,9 +87,8 @@ void ADIOSSetParameters(const std::string& input, const char delimKeyValue, std::string value = parameter.substr(position + 1); lf_Trim(value); if (value.length() == 0) { - throw std::invalid_argument("ADIOS2SetParameters: empty value in IO parameter " - + parameter + ", format must be key" + delimKeyValue - + "value"); + throw BoutException("ADIOS2SetParameters: empty value in IO parameter " + parameter + + ", format must be key" + delimKeyValue + "value"); } io.SetParameter(key, value); } diff --git a/src/sys/options/options_adios.cxx b/src/sys/options/options_adios.cxx index 23abcc74bc..e93a1fea94 100644 --- a/src/sys/options/options_adios.cxx +++ b/src/sys/options/options_adios.cxx @@ -6,6 +6,7 @@ #include "bout/adios_object.hxx" #include "bout/bout.hxx" +#include "bout/boutexception.hxx" #include "bout/globals.hxx" #include "bout/mesh.hxx" #include "bout/sys/timer.hxx" @@ -36,16 +37,15 @@ OptionsADIOS::OptionsADIOS(Options& options) : OptionsIO(options) { } template -bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, - const std::string& type, Options& result) { +Options readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, + const std::string& type) { std::vector data; adios2::Variable variable = io.InquireVariable(name); if (variable.ShapeID() == adios2::ShapeID::GlobalValue) { T value; reader.Get(variable, &value, adios2::Mode::Sync); - result[name] = value; - return true; + return Options(value); } if (variable.ShapeID() == adios2::ShapeID::LocalArray) { @@ -84,51 +84,65 @@ bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& nam Array value(static_cast(dims[0])); BoutReal* data = value.begin(); reader.Get(variableD, data, adios2::Mode::Sync); - result[name] = value; - break; + return Options(value); } case 2: { Matrix value(static_cast(dims[0]), static_cast(dims[1])); BoutReal* data = value.begin(); reader.Get(variableD, data, adios2::Mode::Sync); - result[name] = value; - break; + return Options(value); } case 3: { Tensor value(static_cast(dims[0]), static_cast(dims[1]), static_cast(dims[2])); BoutReal* data = value.begin(); reader.Get(variableD, data, adios2::Mode::Sync); - result[name] = value; - break; + return Options(value); } } - - return true; + throw BoutException("ADIOS reader failed to read '{}' of dimension {} in file '{}'", + name, ndims, reader.Name()); } -bool readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, - const std::string& type, Options& result) { - bool ret = false; -#define declare_template_instantiation(T) \ - if (type == adios2::GetType()) { \ - ret = readVariable(reader, io, name, type, result); \ +Options readVariable(adios2::Engine& reader, adios2::IO& io, const std::string& name, + const std::string& type) { +#define declare_template_instantiation(T) \ + if (type == adios2::GetType()) { \ + return readVariable(reader, io, name, type); \ } ADIOS2_FOREACH_ATTRIBUTE_PRIMITIVE_STDTYPE_1ARG(declare_template_instantiation) + declare_template_instantiation(std::string) #undef declare_template_instantiation - return ret; + output_warn.write("ADIOS readVariable can't read type '{}' (variable '{}')", type, + name); + return Options{}; } bool readAttribute(adios2::IO& io, const std::string& name, const std::string& type, Options& result) { + // Attribute is the part of 'name' after the last '/' separator + std::string attrname; + auto pos = name.find_last_of('/'); + if (pos == std::string::npos) { + attrname = name; + } else { + attrname = name.substr(pos + 1); + } + #define declare_template_instantiation(T) \ if (type == adios2::GetType()) { \ adios2::Attribute a = io.InquireAttribute(name); \ - result[name] = a.Data().data(); \ + result.attributes[attrname] = *a.Data().data(); \ + return true; \ } - ADIOS2_FOREACH_ATTRIBUTE_PRIMITIVE_STDTYPE_1ARG(declare_template_instantiation) + // Only some types of attributes are supported + //declare_template_instantiation(bool) + declare_template_instantiation(int) declare_template_instantiation(BoutReal) + declare_template_instantiation(std::string) #undef declare_template_instantiation - return true; + output_warn.write("ADIOS readAttribute can't read type '{}' (variable '{}')", + type, name); + return false; } Options OptionsADIOS::read() { @@ -157,17 +171,27 @@ Options OptionsADIOS::read() { auto it = varpair.second.find("Type"); const std::string& var_type = it->second; - readVariable(reader, io, var_name, var_type, result); - result[var_name].attributes["source"] = filename; + Options* varptr = &result; + for (const auto& piece : strsplit(var_name, '/')) { + varptr = &(*varptr)[piece]; // Navigate to subsection if needed + } + Options& var = *varptr; + + // Note: Copying the value rather than simple assignment is used + // because the Options assignment operator overwrites full_name. + var = 0; // Setting is_section to false + var.value = readVariable(reader, io, var_name, var_type).value; + var.attributes["source"] = filename; // Get variable attributes for (const auto& attpair : io.AvailableAttributes(var_name, "/", true)) { const auto& att_name = attpair.first; // Attribute name const auto& att = attpair.second; // attribute params + auto it = att.find("Type"); const std::string& att_type = it->second; - readAttribute(io, att_name, att_type, result); + readAttribute(io, att_name, att_type, var); } } @@ -448,6 +472,7 @@ void writeGroup(const Options& options, ADIOSStream& stream, const std::string& } // Write the variable + // Note: ADIOS2 uses '/' to as a group separator; BOUT++ uses ':' std::string varname = groupname.empty() ? name : groupname + "/" + name; bout::utils::visit(ADIOSPutVarVisitor(varname, stream), child.value); diff --git a/tests/integrated/test-beuler/test_beuler.cxx b/tests/integrated/test-beuler/test_beuler.cxx index cfdae89eb2..2f8e082348 100644 --- a/tests/integrated/test-beuler/test_beuler.cxx +++ b/tests/integrated/test-beuler/test_beuler.cxx @@ -41,6 +41,7 @@ class TestSolver : public PhysicsModel { }; int main(int argc, char** argv) { + BoutInitialise(argc, argv); // Absolute tolerance for difference between the actual value and the // expected value diff --git a/tests/integrated/test-options-adios/test-options-adios.cxx b/tests/integrated/test-options-adios/test-options-adios.cxx index 727172c688..60604e1aa3 100644 --- a/tests/integrated/test-options-adios/test-options-adios.cxx +++ b/tests/integrated/test-options-adios/test-options-adios.cxx @@ -29,7 +29,7 @@ int main(int argc, char** argv) { /////////////////////////// - // Write the BOUT.inp settings to NetCDF file + // Write the BOUT.inp settings to ADIOS file OptionsIO::create({{"file", "settings.bp"}, {"type", "adios"}, {"append", false}, diff --git a/tests/integrated/test-solver/test_solver.cxx b/tests/integrated/test-solver/test_solver.cxx index ee64c6097f..2beca7ae06 100644 --- a/tests/integrated/test-solver/test_solver.cxx +++ b/tests/integrated/test-solver/test_solver.cxx @@ -25,6 +25,7 @@ class TestSolver : public PhysicsModel { }; int main(int argc, char** argv) { + BoutInitialise(argc, argv); // The expected answer to the integral of \f$\int_0^{\pi/2}\sin^2(t)\f$ constexpr BoutReal expected = PI / 4.; From af6610f07a80ac89cf30f1b23fce41bf88a8ca59 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Thu, 14 Dec 2023 20:40:34 -0800 Subject: [PATCH 44/46] test-solver: Remove BoutInitialise and BoutFinalise BoutFinalise throws an exception when ADIOS is enabled but BoutInitialise is not called. BoutInitialise throws an exception if the "data" directory doesn't exist. For this test neither BoutInitialise nor BoutFinalise are needed, so removed. --- tests/integrated/test-solver/test_solver.cxx | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/integrated/test-solver/test_solver.cxx b/tests/integrated/test-solver/test_solver.cxx index 2beca7ae06..2e4345c8cc 100644 --- a/tests/integrated/test-solver/test_solver.cxx +++ b/tests/integrated/test-solver/test_solver.cxx @@ -25,7 +25,6 @@ class TestSolver : public PhysicsModel { }; int main(int argc, char** argv) { - BoutInitialise(argc, argv); // The expected answer to the integral of \f$\int_0^{\pi/2}\sin^2(t)\f$ constexpr BoutReal expected = PI / 4.; @@ -147,8 +146,6 @@ int main(int argc, char** argv) { } } - BoutFinalise(false); - if (!errors.empty()) { output_test << "\n => Some failed tests\n\n"; for (auto& error : errors) { From e543cd48c76bf409c3c95b909bf1408143f0372e Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Thu, 14 Dec 2023 21:16:53 -0800 Subject: [PATCH 45/46] test-beuler: Remove BoutInitialise and BoutFinalise Not required, and BoutInitialise throws an exception because the "data" directory doesn't exist. --- tests/integrated/test-beuler/test_beuler.cxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/integrated/test-beuler/test_beuler.cxx b/tests/integrated/test-beuler/test_beuler.cxx index 2f8e082348..5a080767dd 100644 --- a/tests/integrated/test-beuler/test_beuler.cxx +++ b/tests/integrated/test-beuler/test_beuler.cxx @@ -41,8 +41,6 @@ class TestSolver : public PhysicsModel { }; int main(int argc, char** argv) { - BoutInitialise(argc, argv); - // Absolute tolerance for difference between the actual value and the // expected value constexpr BoutReal tolerance = 1.e-5; @@ -88,8 +86,6 @@ int main(int argc, char** argv) { solver->solve(); - BoutFinalise(false); - if (model.check_solution(tolerance)) { output_test << " PASSED\n"; return 0; From 721157a9333fed3e55de9e8ff4804ad040ebdb26 Mon Sep 17 00:00:00 2001 From: Ben Dudson Date: Fri, 15 Dec 2023 11:25:52 -0800 Subject: [PATCH 46/46] CI: Change ADIOS install directory Using $HOME/local rather than $HOME/local/adios2. Hopefully cmake can find it. --- .build_adios2_for_ci.sh | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.build_adios2_for_ci.sh b/.build_adios2_for_ci.sh index f636252a94..c6d4178884 100755 --- a/.build_adios2_for_ci.sh +++ b/.build_adios2_for_ci.sh @@ -19,7 +19,7 @@ if test $BUILD_ADIOS2 ; then pushd build cmake .. \ - -DCMAKE_INSTALL_PREFIX=$HOME/local/adios2 \ + -DCMAKE_INSTALL_PREFIX=$HOME/local \ -DADIOS2_USE_MPI=ON \ -DADIOS2_USE_Fortran=OFF \ -DADIOS2_USE_Python=OFF \ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b79144c10a..c449beb4ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: is_cron: - ${{ github.event_name == 'cron' }} config: - - name: "CMake, PETSc unreleased" + - name: "CMake, PETSc unreleased, ADIOS" os: ubuntu-20.04 cmake_options: "-DBUILD_SHARED_LIBS=ON -DBOUT_ENABLE_METRIC_3D=ON