When I try to call #require "core"
in utop
, I get an error:
utop # #require "core";;
Exception: Unix.Unix_error (Unix.ENOENT, "sysconf", "").
Raised by primitive operation at unknown location
Called from file "toplevel/topdirs.ml", line 144, characters 10-51
I have a .ocamlinit
file that looks like this in my current directory:
(* Added by OPAM. *)
let () =
try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
with Not_found -> ()
;;
#use "topfind";;
#thread;;
#camlp4o;;
What could be causing this error to happen? It appears to be an error from Findlib?
I tried wiping away my ~/.opam
directory, rerunning opam init
, opam switch set 4.05.0
, and reinstalling core
and utop
, but this error persists. Is it possible that I also need to reinstall opam
itself? I am currently using a binary version of opam-1.2.2.
I'm running Arch Linux, and I believe this error started occuring after updating all the packages on my system, but I am not sure.
I am still able to use jbuilder
to build executables, but when running the executables, they fail with a similar error:
$ _build/install/default/bin/my_executable
Uncaught exception:
(Unix.Unix_error "Illegal seek" sysconf "")
Raised by primitive operation at unknown location
I am pretty sure this is not an exception being cause by my code, but is similar to the error occuring in utop
.
I have a jbuild
file that looks like this:
(jbuild_version 1)
(executable
((name main)
(libraries (my_library))))
(install
((section bin)
(files ((main.exe as my_executable)))))
edit: I've tried using different versions of opam
and the compiler, including the system compiler (which is also version 4.05.0). Nothing seems to work. Every combination produces the same errors as above.