---
title: "Troubleshoot"
author: "Donny Williams"
date: "5/20/2020"
bibliography: ../inst/REFERENCES.bib
output: 
  rmarkdown::html_vignette:
    toc: yes
vignette: >
  %\VignetteIndexEntry{Installation}
  %\VignetteEngine{knitr::rmarkdown}
  \usepackage[utf8]{inputenc}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# OSX

## Error 1: Missing a Fortran Compiler
The most common error seems to be (or similar).

```
E> ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
E> ld: library not found for -lgfortran
E> clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

This indicates that the fortran compiler is missing. This can can be installed [here](https://github.com/fxcoudert/gfortran-for-macOS/releases/tag/8.2?fbclid=IwAR2SyHWB2BzFcY7bpHYW8VzNvlDsy4Gw1QxUMueXB3H0fXicCWoMbE7Ypac) (the `.dmg` file).


## Error 2: Outdated R and/or R-studio
Typically the above has solved the issue. If not, then an additional error could be

```
Error: (converted from warning) Setting LC_CTYPE failed, using "C"
```

This was solved by updating both R and R-studio. More information can be found [here](https://stackoverflow.com/questions/9689104/installing-r-on-mac-warning-messages-setting-lc-ctype-failed-using-c?fbclid=IwAR0DSaPeWOvRyfIsCx4Tjvz9-jZUh2ySXQIHnzqwbqL2_idfPlFF3j6mOe8).

## Error 3: Xcode missing
If that does not work, then perhaps `Xcode` is missing. This can be installed at the "Mac App Store".

## GitHub Issues
The following are links to issues on github for troubleshooting installation of **BGGM** on OSX. 

* [https://github.com/donaldRwilliams/BGGM/issues/26](https://github.com/donaldRwilliams/BGGM/issues/26)(closed)
