Skip to content

Commit 95dddca

Browse files
committed
Don't fail if ocannl_config not found
1 parent d36b419 commit 95dddca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

arrayjit/lib/utils.ml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,18 @@ let config_file_args =
118118
let fname, config_lines =
119119
let rev_dirs = List.rev @@ filename_parts @@ Stdlib.Sys.getcwd () in
120120
let rec find_up = function
121-
| [] -> failwith "OCANNL could not find the ocannl_config file along current path"
121+
| [] ->
122+
Stdio.printf
123+
"\nWelcome to OCANNL! No ocannl_config file found along current path.\n%!";
124+
("", [])
122125
| _ :: tl as rev_dirs -> (
123126
let fname = filename_of_parts (List.rev @@ ("ocannl_config" :: rev_dirs)) in
124127
try (fname, read fname) with Sys_error _ -> find_up tl)
125128
in
126129
find_up rev_dirs
127130
in
128-
Stdio.printf "\nWelcome to OCANNL! Reading configuration defaults from %s.\n%!" fname;
131+
if String.length fname > 0 then
132+
Stdio.printf "\nWelcome to OCANNL! Reading configuration defaults from %s.\n%!" fname;
129133
config_lines
130134
|> List.filter ~f:(fun l ->
131135
not (String.is_prefix ~prefix:"~~" l || String.is_prefix ~prefix:"#" l))

0 commit comments

Comments
 (0)