Following this post I installed brew and then reinstalled ocaml to include graphics:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask install xquartz
brew reinstall ocaml --with-x11
But after restarting my computer, when I tried to run an ocaml program that used graphics I got the error
Error: Cannot find file /Users/.../.opam/4.03.0/lib/ocaml/graphics.cma
The post also said:
Finally remember to check that the instance of ocaml that is running is the one in
/usr/local/Cellar/objective-caml/x.yy.z[_w]/bin
, and if it isn't then prepend that url to yourPATH
environment variable.
How do I do check the instance of ocaml that is running? And what does the poster mean by "prepending that url to your PATH
environment"?
I've tried changing my directory to that path, but I get an error:
$ cd /usr/local/Cellar/objective-caml/
-bash: cd: /usr/local/Cellar/objective-caml/: No such file or directory
If someone could please tell me what I need to do to get graphics.cma working that would be great!
UPDATES:
I've tried creating .bashrc
and putting in
alias ocaml="/usr/local/Cellar/ocaml/4.04.0/bin/ocaml”
Yet with no avail...I'm quite lost on what to do. If anyone could give me an inkling of what to do that would be great!
(Note: I put 4.04.0
instead of 4.03.0
because when I explored the directory /usr/local/Cellar/ocaml/4.03.0/bin/ocaml
but the directory /usr/local/Cellar/ocaml/4.04.0/bin/ocaml
does)