The OCaml sumcol benchmark assumes stdin, which appears to be wrong. Here's a fixed version: let sum = ref 0 let inchan = open_in Sys.argv.(1) let rec loop () = sum := !sum + int_of_string (input_line inchan); loop ();; try loop () with End_of_file -> Printf.printf "%d\n" !sum