Please explain what you did when you say “I tried running”, as there are several ways in which a piece of OCaml code can be executed.
If you tried compiling it (using ocamlc or ocamlopt), it sounds like a linking error. I’m not sure you can get this error using the toplevel. But you seem to be using toplevel directives (#require), so it is a bit confusing.
I know this is counterintuitive, but #require "base" is only valid in the “toplevel” (the OCaml REPL), as @nojb already explained. The double semicolons ;; is also a toplevel idiosyncrasy and although syntactically valid, should not be used in OCaml files.