source: project/wiki/running-csi-on-cygwin

Last change on this file was 32258, checked in by Christian Kellermann, 5 years ago

add outdated warning to csi on cygwin, I need to verify this

File size: 1.6 KB
Line 
1
2== Warning: This might be outdated, I will check this - 2015-02-07 [[users/christian-kellermann]]
3
4The behavior of dynamic link libraries (DLLs) on Cygwin is somewhat schizoid, because Cygwin programs are loaded by the regular Windows program loader.  When Windows loads a DLL that a program executable requires, it looks on {{PATH}}, but when a Cygwin program decides to load a DLL itself using the Unix-compatible {{dlopen()}} call, it looks on {{LD_LIBRARY_PATH}} as Unix systems do.  This is fundamental and unchangeable, and usually doesn't cause a problem.  However, with {{csi}}, CHICKEN's interpreter, it does.
5
6The standard units like {{srfi-1}} and {{posix}} are stored in the standard CHICKEN DLL, which on Cygwin is called {{cygchicken-0.dll}}.  This file is loaded by Windows when {{csi.exe}} starts up.  However, it also needs to be loaded again when you say {{(use srfi-1)}} in order to use SRFI 1 procedures in the REPL.  Unfortunately, {{cygchicken-0.dll}} is not on {{LD_LIBRARY_PATH}} at all; it's in {{/usr/local/bin}}, which is where Windows needs it to be.
7
8I've experimented with a few ways to solve this.  Creating a symbolic link, hard link, or copy of {{/usr/local/bin/cygchicken-0.dll}} in {{/usr/local/lib}} or {{/usr/lib}} does ''not'' work.  You can set {{LD_LIBRARY_PATH}} permanently to {{/usr/local/bin}}, but that may cause funky problems with other Cygwin programs.  So I recommend adding this line to your {{.bash_profile}} or {{.bash_aliases}} file:
9
10  alias csi='LD_LIBRARY_PATH=/usr/local/bin csi'
11
12Doing so will set {{$LD_LIBRARY_PATH}} if and only if you are running {{csi}}.
Note: See TracBrowser for help on using the repository browser.