protz / ocaml-installer

The official windows installer (built using NSIS) for OCaml
http://protz.github.com/ocaml-installer/
GNU General Public License v3.0
66 stars 11 forks source link

ocamlc -where reports incorrect path remotely #21

Closed nrlucaroni closed 11 years ago

nrlucaroni commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

I suspect you don't have the same PATH variable depending on how you connect to your machine. Have you tried:

echo $PATH

in both situations?

On Wed 20 Mar 2013 09:45:46 PM CET, Nicholas wrote:

Correction, It defaulted there the /second/ time I installed. The first time it was probably what you've mentioned, but I changed it noting issue with spaces in paths previously.

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 http://gallium.inria.fr/%7Eprotzenk/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

— Reply to this email directly or view it on GitHub https://github.com/protz/ocaml-installer/issues/21#issuecomment-15202281.

nrlucaroni commented 11 years ago

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 commented 11 years ago

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.

nrlucaroni commented 11 years ago

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.