Hi there,
I compiled Poly/ML on Windows with msys2 and I use it on msysw-mingw64.
I compiled a Hello World program but when I try to run it I get into trouble:
$ ./a.exe C:/msys64/home/gbuday/a.exe: error while loading shared libraries: libpolyml-14.dll: cannot open shared object file: No such file or directory
When I check the lib library I see
$ ls -l /c/polyml/lib total 2140 -rw-r--r-- 1 gbuday None 1152 May 22 11:17 libpolymain.a -rw-r--r-- 1 gbuday None 932 May 22 11:17 libpolymain.la -rw-r--r-- 1 gbuday None 1151480 May 22 11:17 libpolyml.a -rw-r--r-- 1 gbuday None 1020630 May 22 11:17 libpolyml.dll.a -rw-r--r-- 1 gbuday None 956 May 22 11:17 libpolyml.la drwxr-xr-x 1 gbuday None 0 May 22 11:17 pkgconfig drwxr-xr-x 1 gbuday None 0 May 22 11:17 polyml
I used
./configure --disable-windows --enable-windows-64bit --prefix=/c/polyml
Was this a mistake?
- Gergely
Hi, DLL paths in Windows are a bit different to shared libraries in Unix-like systems. There are various ways of configuring DLL paths on Windows but the easiest is just to copy the DLL so that it is in the same directory as the executable.
The installation process that configure creates puts the DLL into the bin subdirectory. So if you want to run a.exe in your home directory make a copy of /c/polyml/bin/libpolyml-14.dll and put it in your home directory.
David
On 22/05/2025 11:56, Gergely Buday wrote:
Hi there,
I compiled Poly/ML on Windows with msys2 and I use it on msysw-mingw64.
I compiled a Hello World program but when I try to run it I get into trouble:
$ ./a.exe C:/msys64/home/gbuday/a.exe: error while loading shared libraries: libpolyml-14.dll: cannot open shared object file: No such file or directory
When I check the lib library I see
$ ls -l /c/polyml/lib total 2140 -rw-r--r-- 1 gbuday None 1152 May 22 11:17 libpolymain.a -rw-r--r-- 1 gbuday None 932 May 22 11:17 libpolymain.la -rw-r--r-- 1 gbuday None 1151480 May 22 11:17 libpolyml.a -rw-r--r-- 1 gbuday None 1020630 May 22 11:17 libpolyml.dll.a -rw-r--r-- 1 gbuday None 956 May 22 11:17 libpolyml.la drwxr-xr-x 1 gbuday None 0 May 22 11:17 pkgconfig drwxr-xr-x 1 gbuday None 0 May 22 11:17 polyml
I used
./configure --disable-windows --enable-windows-64bit --prefix=/c/polyml
Was this a mistake?
- Gergely
Poly/ML mailing list -- polyml@lists.polyml.org To unsubscribe send an email to polyml-leave@lists.polyml.org
You did the right thing but I have made a mistake. I have put the Poly/ML bin directory into the PATH variable but with a wrong path syntax. Correcting it made it work, as Windows looks for DLLs in the directories listed in PATH. So now ./a.exe works on a fresh shell with PATH set correctly.
I have another question, possibly related to libraries as well. When trying to start the poly executable on msys2-mingw64, I get
$ poly Poly/ML 5.9.1 Release
but no prompt I get, it freezes and I cannot get out of it by ctrl-c or ctrl-d.
Is this a library problem or some lack of functionality in Windows prevents this from working?
- Gergely
On Thu, 22 May 2025 at 13:39, David Matthews David.Matthews@prolingua.co.uk wrote:
Hi, DLL paths in Windows are a bit different to shared libraries in Unix-like systems. There are various ways of configuring DLL paths on Windows but the easiest is just to copy the DLL so that it is in the same directory as the executable.
The installation process that configure creates puts the DLL into the bin subdirectory. So if you want to run a.exe in your home directory make a copy of /c/polyml/bin/libpolyml-14.dll and put it in your home directory.
David
On 22/05/2025 11:56, Gergely Buday wrote:
Hi there,
I compiled Poly/ML on Windows with msys2 and I use it on msysw-mingw64.
I compiled a Hello World program but when I try to run it I get into trouble:
$ ./a.exe C:/msys64/home/gbuday/a.exe: error while loading shared libraries: libpolyml-14.dll: cannot open shared object file: No such file or directory
When I check the lib library I see
$ ls -l /c/polyml/lib total 2140 -rw-r--r-- 1 gbuday None 1152 May 22 11:17 libpolymain.a -rw-r--r-- 1 gbuday None 932 May 22 11:17 libpolymain.la -rw-r--r-- 1 gbuday None 1151480 May 22 11:17 libpolyml.a -rw-r--r-- 1 gbuday None 1020630 May 22 11:17 libpolyml.dll.a -rw-r--r-- 1 gbuday None 956 May 22 11:17 libpolyml.la drwxr-xr-x 1 gbuday None 0 May 22 11:17 pkgconfig drwxr-xr-x 1 gbuday None 0 May 22 11:17 polyml
I used
./configure --disable-windows --enable-windows-64bit --prefix=/c/polyml
Was this a mistake?
- Gergely
Poly/ML mailing list -- polyml@lists.polyml.org To unsubscribe send an email to polyml-leave@lists.polyml.org
By default the version on Windows includes a GUI so that clicking on the application puts up a window. This isn't always convenient if you want to run it under the Msys prompt and it's possible to build a "console" application by adding --disable-windows-gui to the configure line. When running poly use "poly -i" to get the interactive prompt. This still doesn't seem to get end-of-file to work properly under the Msys prompt since ctrl-D isn't recognised and the usual Windows ctrl-Z seems to try to generate a signal. The only way of exiting seems to be with
OS.Process.exit OS.Process success;
Running under the Windows "cmd" window works better and ctrl-Z is recognised as end-of-file.
David
On 22/05/2025 14:03, Gergely Buday wrote:
I have another question, possibly related to libraries as well. When trying to start the poly executable on msys2-mingw64, I get
$ poly Poly/ML 5.9.1 Release
but no prompt I get, it freezes and I cannot get out of it by ctrl-c or ctrl-d.
Is this a library problem or some lack of functionality in Windows prevents this from working?
On a mingw64 terminal window poly -i does start, I get a prompt and can write an expression to evaluate but I get no response after sending it. Is there any cure for this?
In a cmd window for poly -i I get the standard Windows interface to Poly/ML and I did a double check that I did not start the canonical Windows Poly/ML executable, and my Windows PATH did not include the directory for that. I did use the --disable-windows-gui in the beginning. Do you have an idea why this has happened?
- Gergely
On Thu, 22 May 2025 at 15:10, David Matthews David.Matthews@prolingua.co.uk wrote:
By default the version on Windows includes a GUI so that clicking on the application puts up a window. This isn't always convenient if you want to run it under the Msys prompt and it's possible to build a "console" application by adding --disable-windows-gui to the configure line. When running poly use "poly -i" to get the interactive prompt. This still doesn't seem to get end-of-file to work properly under the Msys prompt since ctrl-D isn't recognised and the usual Windows ctrl-Z seems to try to generate a signal. The only way of exiting seems to be with
OS.Process.exit OS.Process success;
Running under the Windows "cmd" window works better and ctrl-Z is recognised as end-of-file.
David
On 22/05/2025 14:03, Gergely Buday wrote:
I have another question, possibly related to libraries as well. When trying to start the poly executable on msys2-mingw64, I get
$ poly Poly/ML 5.9.1 Release
but no prompt I get, it freezes and I cannot get out of it by ctrl-c or ctrl-d.
Is this a library problem or some lack of functionality in Windows prevents this from working?
It works for me.
$ ./poly -i Poly/ML 5.9.1 Release (Git version v5.9.1)
1;
val it = 1: int
it;
val it = 1: int
OS.Process.exit OS.Process.success;
poly: : warning: The type of (it) contains a free type variable. Setting it to a unique monotype.
Are you sure you've built it with --disable-windows-gui ? If you find the "poly" executable with the Explorer and double-click on it it should pop up a black console window. If it pops up a white "Poly/ML" window it's using the Poly windows GUI.
David
On 22/05/2025 16:09, Gergely Buday wrote:
On a mingw64 terminal window poly -i does start, I get a prompt and can write an expression to evaluate but I get no response after sending it. Is there any cure for this?
In a cmd window for poly -i I get the standard Windows interface to Poly/ML and I did a double check that I did not start the canonical Windows Poly/ML executable, and my Windows PATH did not include the directory for that. I did use the --disable-windows-gui in the beginning. Do you have an idea why this has happened?
- Gergely