Description

In this page, I've put some notes about using Yorick under MS-Windows.

Building and installing Yorick

In this section I explain how I've built relocatable Yorick versions for MS-Windows and which can be downloaded here. Building Yorick following my instructions require to have Cygwin installed, but the executable is compiled with option --nocygwin and can be used without Cygwin at all. Possible alternatives would be to compile Yorick with MinGW (a free set of Unix-like tools and files for compilation with GCC under MS-Windows) or with some other compiler for MS-Windows, but I've never tried.

  1. Launch a Cygwin terminal and type the following commands (I assume that you use a Bourne shell like bash).

  2. Download Yorick CVS code:

    cvs -z3 -d:pserver:anonymous@yorick.cvs.sourceforge.net:/cvsroot/yorick \
        co -P yorick
    
  3. Go to the Yorick source directory:

    cd yorick
  4. Configure Yorick for installation as a relocatable application:

    export CC=gcc
    export CFLAGS='-pipe -Wall -O2 -fomit-frame-pointer -ffast-math -mtune=i686'
    make Y_HOME=relocate ysite
    make config
    

    By default the level of optimization is rather low (only -O) this is why I recommend to set your optimization level (and other compiler flags) by exporting the definition of environment variable CFLAGS prior the make config command. Of course, you can choose other options. You can check/fix the optimization settings by editing file Make.cfg and look at the definition of COPT_DEFAULT.

  5. Build Yorick and install in local ./relocate directory:

    make
    make install
    
  6. Then fix/complete contents of ./relocate directory:

    cp -p install.rel relocate/README
    cp -p play/libplay.a relocate/lib/.
    cp -p gist/libgist.a relocate/lib/.
    chmod 644 relocate/include/*.h
    mkdir -p relocate/contrib
    mv relocate/doc/README relocate/doc/CONTENTS
    cp -p LICENSE ONEWS README TODO VERSION relocate/doc/.
    cp -p gist/README relocate/doc/README.gist
    cp -p play/README relocate/doc/README.play
    
  7. If you have Emacs (Cygwin version):

    mkdir -p relocate/emacs
    cp -p emacs/README emacs/*.el relocate/emacs/.
    emacs --batch relocate/emacs/yorick.el -f emacs-lisp-byte-compile
    
  8. You can now move the directory ./relocate to where you want (you may also change its name) and directly use the executable yorick into the subdirectory bin.

    You can also pack the contents of ./relocate into an archive for further installation. The following commands will rename and pack ./relocate directory (warning: change the values of the PACKAGE variable according to your taste and to Yorick version):

    PACKAGE=yorick-2.1.02-cvs2007.03.04-win-i686
    mv relocate ../${PACKAGE}
    cd ..
    tar cvf - ${PACKAGE} | bzip2 -9 > ${PACKAGE}.tar.bz2
    rm -rf yorick-${VERSION}
    

Problems

  1. set_path in file stdx.i keeps the Windows-style directory separator (backslash) which causes my $HOME/yorick directory to be ignored. The fix consists in replacing file stdx.i by the following version stdx.i. The pre-compiled MS-Windows versions of Yorick (+ Yeti) available here have already been patched.

    Without the fix:

    > get_path();
    "./:C:\\Documents and Settings\\eric\\yorick/:c:/Cygwin/home/eric/src/yorick\
    /i/:c:/Cygwin/home/eric/src/yorick/contrib/:c:/Cygwin/home/eric/src/yorick/i\
    0/:c:/Cygwin/home/eric/src/yorick/lib/"
    

    With the fix:

    > get_path();
    "./:C:/Documents and Settings/eric//yorick/:c:/Cygwin/home/eric/src/yorick/i\
    /:c:/Cygwin/home/eric/src/yorick/contrib/:c:/Cygwin/home/eric/src/yorick/i0/\
    :c:/Cygwin/home/eric/src/yorick/lib/"
    
  2. Any error causes Yorick to exit, even in interactive (non-batch mode). Apparently, this is caused by excessive optimization with GCC (why?).

    For that reason, I'd kept the optimization level to something not too aggressive like:

    COPT_DEFAULT=-O2 -ffast-math
    
  3. Under Emacs compiled for Windows (not Cygwin Emacs), Yorick output is very slow. This is not the case if I start Emacs under Zsh (provided by UnxTools).

  4. Yorick is not insensitive to the end-of-line style. At this time only Unix style (newline \n) and DOS style (carriage-return newline \r\n) are recognized, a carriage return (\r) followed by anything (but a newline) cause a syntax-error.