+ (* Get stdlib directory. *)
+ let datadir =
+ try Sys.getenv "GOALS_DATADIR" with Not_found -> Config.datadir in
+ let stdlibdir = datadir // "stdlib" in
+ let prelude_gl = stdlibdir // "prelude.gl" in
+ if not (is_directory stdlibdir) || not (Sys.file_exists prelude_gl) then
+ failwithf "%s: cannot find the standard library directory, expected %s. If the standard library directory is in a non-standard location then set GOALS_DATADIR. If you can trying to run goals from the build directory then use ‘./run goals ...’"
+ Sys.executable_name stdlibdir;
+