Skip to content

Commit

Permalink
Guard all examples to avoid errors with --disable-optional.
Browse files Browse the repository at this point in the history
This way we can still run "make check" successfully even though it
doesn't really check much of anything.
  • Loading branch information
jwpeterson committed Jul 25, 2017
1 parent 20a8690 commit 262c8c4
Show file tree
Hide file tree
Showing 36 changed files with 144 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/adaptivity/adaptivity_ex1/adaptivity_ex1.C
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ int main(int argc, char ** argv)
// finalized.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Skip adaptive examples on a non-adaptive libMesh build
#ifndef LIBMESH_ENABLE_AMR
libmesh_example_requires(false, "--enable-amr");
Expand Down
4 changes: 4 additions & 0 deletions examples/adaptivity/adaptivity_ex2/adaptivity_ex2.C
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

#ifndef LIBMESH_ENABLE_AMR
libmesh_example_requires(false, "--enable-amr");
#else
Expand Down
4 changes: 4 additions & 0 deletions examples/adaptivity/adaptivity_ex3/adaptivity_ex3.C
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ int main(int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Single precision is inadequate for p refinement
libmesh_example_requires(sizeof(Real) > 4, "--disable-singleprecision");

Expand Down
4 changes: 4 additions & 0 deletions examples/adaptivity/adaptivity_ex4/adaptivity_ex4.C
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ int main(int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Adaptive constraint calculations for fine Hermite elements seems
// to require half-decent precision
#ifdef LIBMESH_DEFAULT_SINGLE_PRECISION
Expand Down
4 changes: 4 additions & 0 deletions examples/adaptivity/adaptivity_ex5/adaptivity_ex5.C
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Skip this 2D example if libMesh was compiled as 1D-only.
libmesh_example_requires(2 <= LIBMESH_DIM, "2D support");

Expand Down
4 changes: 4 additions & 0 deletions examples/adjoints/adjoints_ex1/adjoints_ex1.C
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Skip adaptive examples on a non-adaptive libMesh build
#ifndef LIBMESH_ENABLE_AMR
libmesh_example_requires(false, "--enable-amr");
Expand Down
4 changes: 4 additions & 0 deletions examples/adjoints/adjoints_ex2/adjoints_ex2.C
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Skip adaptive examples on a non-adaptive libMesh build
#ifndef LIBMESH_ENABLE_AMR
libmesh_example_requires(false, "--enable-amr");
Expand Down
4 changes: 4 additions & 0 deletions examples/adjoints/adjoints_ex4/adjoints_ex4.C
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ int main (int argc, char** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Skip adaptive examples on a non-adaptive libMesh build
#ifndef LIBMESH_ENABLE_AMR
libmesh_example_requires(false, "--enable-amr");
Expand Down
4 changes: 4 additions & 0 deletions examples/fem_system/fem_system_ex1/fem_system_ex1.C
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// This example fails without at least double precision FP
#ifdef LIBMESH_DEFAULT_SINGLE_PRECISION
libmesh_example_requires(false, "--disable-singleprecision");
Expand Down
4 changes: 4 additions & 0 deletions examples/fem_system/fem_system_ex2/fem_system_ex2.C
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ int main(int argc, char ** argv)
// Initialize libMesh and any dependent libraries
LibMeshInit init(argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Skip this example if we do not meet certain requirements
#ifndef LIBMESH_HAVE_VTK
libmesh_example_requires(false, "--enable-vtk");
Expand Down
4 changes: 4 additions & 0 deletions examples/fem_system/fem_system_ex3/fem_system_ex3.C
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Parse the input file
GetPot infile("fem_system_ex3.in");

Expand Down
4 changes: 4 additions & 0 deletions examples/fem_system/fem_system_ex4/fem_system_ex4.C
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

#ifndef LIBMESH_ENABLE_AMR
libmesh_example_requires(false, "--enable-amr");
#else
Expand Down
4 changes: 4 additions & 0 deletions examples/introduction/introduction_ex2/introduction_ex2.C
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ int main (int argc, char ** argv)
// Skip this 2D example if libMesh was compiled as 1D-only.
libmesh_example_requires(2 <= LIBMESH_DIM, "2D support");

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// A brief message to the user to inform her of the
// exact name of the program being run, and its command line.
libMesh::out << "Running " << argv[0];
Expand Down
4 changes: 4 additions & 0 deletions examples/introduction/introduction_ex3/introduction_ex3.C
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ int main (int argc, char ** argv)
// Initialize libraries, like in example 2.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Brief message to the user regarding the program name
// and command line arguments.
libMesh::out << "Running " << argv[0];
Expand Down
4 changes: 4 additions & 0 deletions examples/introduction/introduction_ex4/introduction_ex4.C
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ int main (int argc, char ** argv)
// Initialize libMesh and any dependent libaries, like in example 2.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Declare a performance log for the main program
// PerfLog perf_main("Main Program");

Expand Down
4 changes: 4 additions & 0 deletions examples/introduction/introduction_ex5/introduction_ex5.C
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ int main (int argc, char ** argv)
// Initialize libMesh and any dependent libaries, like in example 2.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Check for proper usage. The quadrature rule
// must be given at run time.
if (argc < 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ int main (int argc, char ** argv)
START_LOG("Initialize and create cubes", "main");
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Create a GetPot object to parse the command line
GetPot command_line (argc, argv);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Skip this 3D example if libMesh was compiled as 1D/2D-only.
libmesh_example_requires (3 == LIBMESH_DIM, "3D support");

Expand Down
4 changes: 4 additions & 0 deletions examples/miscellaneous/miscellaneous_ex5/miscellaneous_ex5.C
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ int main (int argc, char** argv)
{
LibMeshInit init(argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Skip adaptive examples on a non-adaptive libMesh build
#ifndef LIBMESH_ENABLE_AMR
libmesh_example_requires(false, "--enable-amr");
Expand Down
4 changes: 4 additions & 0 deletions examples/reduced_basis/reduced_basis_ex1/reduced_basis_ex1.C
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

#if !defined(LIBMESH_HAVE_XDR)
// We need XDR support to write out reduced bases
libmesh_example_requires(false, "--enable-xdr");
Expand Down
4 changes: 4 additions & 0 deletions examples/reduced_basis/reduced_basis_ex4/reduced_basis_ex4.C
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

#if !defined(LIBMESH_HAVE_XDR)
// We need XDR support to write out reduced bases
libmesh_example_requires(false, "--enable-xdr");
Expand Down
4 changes: 4 additions & 0 deletions examples/reduced_basis/reduced_basis_ex5/reduced_basis_ex5.C
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ int main(int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

#if !defined(LIBMESH_HAVE_XDR)
// We need XDR support to write out reduced bases
libmesh_example_requires(false, "--enable-xdr");
Expand Down
4 changes: 4 additions & 0 deletions examples/reduced_basis/reduced_basis_ex6/reduced_basis_ex6.C
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

#if !defined(LIBMESH_HAVE_XDR)
// We need XDR support to write out reduced bases
libmesh_example_requires(false, "--enable-xdr");
Expand Down
4 changes: 4 additions & 0 deletions examples/subdomains/subdomains_ex2/subdomains_ex2.C
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ int main (int argc, char ** argv)
// Initialize libMesh and any dependent libaries, like in example 2.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Declare a performance log for the main program
// PerfLog perf_main("Main Program");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Skip this 2D example if libMesh was compiled as 1D-only.
libmesh_example_requires(2 <= LIBMESH_DIM, "2D support");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ int main (int argc, char** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Skip this 2D example if libMesh was compiled as 1D-only.
libmesh_example_requires(2 <= LIBMESH_DIM, "2D support");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Skip this 2D example if libMesh was compiled as 1D-only.
libmesh_example_requires(2 <= LIBMESH_DIM, "2D support");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ int main (int argc, char ** argv)
// Initialize libMesh and any dependent libaries
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Initialize the cantilever mesh
const unsigned int dim = 2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ int main (int argc, char ** argv)
// Initialize libMesh and any dependent libaries
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// This example NaNs with the Eigen sparse linear solvers
libmesh_example_requires(libMesh::default_solver_package() != EIGEN_SOLVERS, "--enable-petsc or --enable-laspack");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@ int main (int argc, char ** argv)
// Initialize libMesh and any dependent libraries
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Initialize the cantilever mesh
const unsigned int dim = 3;

Expand Down
4 changes: 4 additions & 0 deletions examples/transient/transient_ex1/transient_ex1.C
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// This example requires Adaptive Mesh Refinement support - although
// it only refines uniformly, the refinement code used is the same
// underneath
Expand Down
4 changes: 4 additions & 0 deletions examples/transient/transient_ex2/transient_ex2.C
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ int main (int argc, char** argv)
// Initialize libraries, like in example 2.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Check for proper usage.
if (argc < 2)
libmesh_error_msg("Usage: " << argv[0] << " [meshfile]");
Expand Down
4 changes: 4 additions & 0 deletions examples/vector_fe/vector_fe_ex1/vector_fe_ex1.C
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ int main (int argc, char ** argv)
// Initialize libraries.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Brief message to the user regarding the program name
// and command line arguments.
libMesh::out << "Running " << argv[0];
Expand Down
4 changes: 4 additions & 0 deletions examples/vector_fe/vector_fe_ex2/vector_fe_ex2.C
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ int main (int argc, char** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Parse the input file
GetPot infile("vector_fe_ex2.in");

Expand Down
4 changes: 4 additions & 0 deletions examples/vector_fe/vector_fe_ex3/vector_fe_ex3.C
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Parse the input file
GetPot infile("vector_fe_ex3.in");

Expand Down
4 changes: 4 additions & 0 deletions examples/vector_fe/vector_fe_ex4/vector_fe_ex4.C
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ int main (int argc, char ** argv)
// Initialize libMesh.
LibMeshInit init (argc, argv);

// This example requires a linear solver package.
libmesh_example_requires(libMesh::default_solver_package() != INVALID_SOLVER_PACKAGE,
"--enable-petsc, --enable-trilinos, or --enable-eigen");

// Parse the input file
GetPot infile("vector_fe_ex4.in");

Expand Down

0 comments on commit 262c8c4

Please sign in to comment.