Skip to content

Commit

Permalink
add a warning if the optional PGPLOT dependency is not available
Browse files Browse the repository at this point in the history
This warns if PGPLOT is missing when is not installed because optional
dependencies can be skipped at installation. This gives users a clear
notification of why their code will not load.

Mithaldu++ for bringing up the issue on the #pdl IRC
<http://irclog.perlgeek.de/pdl/2015-09-15#i_11219756>.
  • Loading branch information
zmughal committed Sep 16, 2015
1 parent b26afaa commit 67a48ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Graphics/PGPLOT/PGPLOT.pm
Expand Up @@ -146,7 +146,9 @@ package PDL::Graphics::PGPLOT;
use PDL::Core qw/:Func :Internal/; # Grab the Core names
use PDL::Graphics::PGPLOTOptions qw(default_options);
use PDL::Graphics::PGPLOT::Window;
use PGPLOT;
eval { require PGPLOT; PGPLOT->import(); 1 } or do {
warn "depedency on PGPLOT is not satisfied: $@";
};
use Exporter;

use strict;
Expand Down
4 changes: 3 additions & 1 deletion Graphics/PGPLOT/Window/Window.pm
Expand Up @@ -2258,7 +2258,9 @@ use PDL::Graphics::PGPLOTOptions qw(default_options);
use PDL::Slices;
use PDL::NiceSlice;
use SelfLoader;
use PGPLOT;
eval { require PGPLOT; PGPLOT->import(); 1 } or do {
warn "depedency on PGPLOT is not satisfied: $@";
};

require DynaLoader;

Expand Down

0 comments on commit 67a48ac

Please sign in to comment.