Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ocamlc -where reports incorrect path remotely #21

Closed
nrlucaroni opened this Issue · 6 comments

2 participants

@nrlucaroni

Running Windows 8, 64bit, using the ocaml 4.00.1 mingw binary.

I installed from the installer into the default directory (C:\OCaml). Locally ocamlc -where reports the correct path and works fine. But through an SSH session ocaml fails and reports the following,

developer@Noland ~
$ which ocamlc
/cygdrive/c/OCaml/bin/ocamlc

developer@Noland ~
$ ocamlc -where
C:/ocamlmgw/lib

Let me know if you need any further information, I have no idea what to even think about this oddity. Thanks for you hard work!

@protz
Owner

Hi,

The defautl directory the installer picks is not c:\ocaml, but rather c:\program files\OCaml . Are you positive you used this very installer?

@nrlucaroni

Yes it's the same install as I interpret it,

$ md5sum.exe ocaml-4.00.1-i686-mingw64.exe
a99fac6722a74649ab90a1edd433b409 *ocaml-4.00.1-i686-mingw64.exe

$wget http://gallium.inria.fr/~protzenk/caml-installer/ocaml-4.00.1-i686-mingw64.exe
$ md5sum.exe ocaml-4.00.1-i686-mingw64.exe
a99fac6722a74649ab90a1edd433b409 ocaml-4.00.1-i686-mingw64.exe

@protz
Owner
@nrlucaroni

If I'm understanding what your implying, then "ocamlc -where" searches the PATH for the library directory, not from a compile time constant?

The PATH variables are the same in both situations,

Remotely -
$echo $PATH
/usr/lib/gcc/i686-w64-mingw32/4.5.3/:/usr/i686-w64-mingw32/sys-root/mingw/lib/:/usr/i686-w64-mingw32/sys-root/mingw/bin/:/usr/i686-w64-mingw32/sys-root/mingw/include/:/usr/bin/:/usr/local/bin:/usr/bin:/cygdrive/c/OCaml/bin:/usr/bin:/cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Intel/Services/IPT:/cygdrive/c/Program Files (x86)/NTRU Cryptosystems/NTRU TCG Software Stack/bin:/cygdrive/c/Program Files/NTRU Cryptosystems/NTRU TCG Software Stack/bin:/cygdrive/c/Program Files/Dell/Dell Data Protection/Access/Advanced/Wave/Gemalto/Access Client/v5:/cygdrive/c/Program Files (x86)/Windows Live/Shared:/bin

Locally -
$echo $PATH
/usr/lib/gcc/i686-w64-mingw32/4.5.3/:/usr/i686-w64-mingw32/sys-root/mingw/lib/:/usr/i686-w64-mingw32/sys-root/mingw/bin/:/usr/i686-w64-mingw32/sys-root/mingw/include/:/usr/bin/:/usr/local/bin:/usr/bin:/cygdrive/c/OCaml/bin:/usr/bin:/cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Intel/Services/IPT:/cygdrive/c/Program Files (x86)/NTRU Cryptosystems/NTRU TCG Software Stack/bin:/cygdrive/c/Program Files/NTRU Cryptosystems/NTRU TCG Software Stack/bin:/cygdrive/c/Program Files/Dell/Dell Data Protection/Access/Advanced/Wave/Gemalto/Access Client/v5:/cygdrive/c/Program Files (x86)/Windows Live/Shared:/bin

@protz
Owner

Sorry I replied too fast. I think there's an environment variable that the installer sets, something like OCAML_LIBRARY_PATH (using the system preferences panel to find out). ssh'ing into the machine will not get that env variable properly set.

This is needed because when compiled, OCaml does not know where to find its standard library; on unix-like systems, this is determined at compile-time (--prefix switch of the configure script), but on windows, the user is free to pick any destination directory for the installation of ocaml, so ocaml should have a run-time mechanism for determining where it is installed.

@protz protz closed this
@nrlucaroni

Yes this is correct, although the variable set in the windows session is OCAMLLIB not OCAML_LIBRARY_PATH. OCAMLFIND_CONF should also be included in that list.

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.