# Package check error on OSX in example using rgl

**URL:** <https://travis-ci.community/t/package-check-error-on-osx-in-example-using-rgl/8560>\
**Category:** R\
**Created:** [May 11, 2020, 4:35pm UTC](https://travis-ci.community/t/package-check-error-on-osx-in-example-using-rgl/8560 "2020-05-11T16:35:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trevorld](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/trevorld/32/4573_2.png) [@trevorld](https://travis-ci.community/u/trevorld)\
**Post date:** [May 11, 2020, 4:35pm UTC](https://travis-ci.community/t/package-check-error-on-osx-in-example-using-rgl/8560/1 "2020-05-11T16:35:20Z")

</div>

I get a check error on OSX (but not Linux) when running my examples for an example that uses rgl. I get a check message like:

```
 ERROR
Running examples in ‘piecepackr-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: piece3d
> ### Title: Draw board game pieces using rgl
> ### Aliases: piece3d
> 
> ### ** Examples
> 
> if (require("rgl") && class(try(rgl.open())) != "try-error") {
+ cfg <- pp_cfg()
+ piece3d("tile_face", suit = 3, rank = 3, cfg = cfg, x = 0, y = 0, z = 0)
+ piece3d("coin_back", suit = 4, rank = 2, cfg = cfg, x = 2, y = 0, z = 0)
+ piece3d("saucer_back", suit = 1, cfg = cfg, x = 2, y = 2, z=-2)
+ piece3d("pawn_face", suit = 2, cfg = cfg, x = 1, y = 1, z = 2)
+ }

```

- Is there a way to get the OSX rgl to run correctly and not throw an error

- Is there anyway to suppress that check other than

- Is there anyway to get the OSX (but not Linux) checks to not check tests wrapped in \donttest?

Thanks,

[https://travis-ci.org/github/piecepackr/piecepackr/jobs/685534170](https://travis-ci.org/github/piecepackr/piecepackr/jobs/685534170)

---

<div class="post-metadata">

**Author:** ![trevorld](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/trevorld/32/4573_2.png) [@trevorld](https://travis-ci.community/u/trevorld)\
**Post date:** [May 11, 2020, 10:42pm UTC](https://travis-ci.community/t/package-check-error-on-osx-in-example-using-rgl/8560/2 "2020-05-11T22:42:36Z")

</div>

The low-hanging solution is to change the example so we don’t run it if it we are on Travis-CI i.e.

```auto
if ((Sys.getenv("TRAVIS") == "") && require("rgl")) {
    open3d()
    cfg <- pp_cfg()
    piece3d("tile_face", suit = 3, rank = 3, cfg = cfg, x = 0, y = 0, z = 0)
    piece3d("coin_back", suit = 4, rank = 2, cfg = cfg, x = 2, y = 0, z = 0)
    piece3d("saucer_back", suit = 1, cfg = cfg, x = 2, y = 2, z=-2)
    piece3d("pawn_face", suit = 2, cfg = cfg, x = 1, y = 1, z = 2)
}

```

It is important to put the Travis-CI check before the `require(rgl)` call because `require(rgl)` seems to cause an error on Travis CI’s OSX build.
