顯示具有 ssreflect 標籤的文章。 顯示所有文章
顯示具有 ssreflect 標籤的文章。 顯示所有文章

Install Coq and ssreflect in Cygwin

Cygwin version: 1.7.7
OS: Microsoft Windows 7

  1. Download and install cygwin. Besides the default installation, I also installed the following packages: autoconf, automake, gtk+, gcc4, intltool, libglade2.0-devel, libglade2.0_0, libgnomecanvas2-devel, libgnomecanvas2_0, libgnomeui2-devel, libgnomeui2_0, libgtk2.0-devel, libgtk2.0_0, libncurses-devel, libncursesw-devel, libpng12-devel, libpng14-devel, librsvg2-devel, librsvg2_2, libstdc++6-devel, libxml2, libxml2-devel, make, pkg-config, ocaml, zlib-devel, xorg-server, xinit, xorg-docs, x-start-menu-icons.
  2. Download and install camlp5-5.15.
    $ ./configure
    $ make world.opt
    $ make install
    
  3. Download and install findlib-1.2.6.
    $ ./configure
    $ make all
    $ make opt
    $ make install
    
  4. Download and install gtksourceview-2.11.2.
    $ ./configure
    $ make
    $ make install
    
  5. Download and install lablgtk-2.14.2.
    $ ./configure
    $ make world
    $ make install
    
  6. Download and install ocamlgraph-1.5.
    $ ./configure
    $ make
    $ make install
    
  7. Download and install coq-8.2pl2.
    $ ./configure
    Remove -mno-cygwin in CFLAGS in config/Makefile.
    Change DLLEXT=.dll to DLLEXT=.so in config/Makefile.
    $ make world
    $ make install
    
  8. Download and install ssreflect-1.2.
    $ coq_makefile -f Make -o Makefile
    $ make
    $ make install
    $ coqmktop -boot -ide -opt src/ssreflect.cmx -o bin/ssrcoqide
    $ cp bin/ssrcoq /usr/local/bin/ssrcoq.opt
    $ cp bin/ssrcoqide /usr/local/bin/ssrcoqide.opt
    

    Create the following two bash scripts.
    • /usr/local/bin/ssrcoq
      #!/bin/bash
      
      /usr/local/bin/ssrcoq.opt \
        -I /usr/local/lib/coq/user-contrib/theories $*
      
    • /usr/local/bin/ssrcoqide
      #!/bin/bash
      
      /usr/local/bin/ssrcoqide.opt \
        -I /usr/local/lib/coq/user-contrib/theories $*
      

How to build ssrcoqide

The installation document of ssreflect states that a custom CoqIDE for ssreflect can be built by the following command:
coqmktop -ide -opt ssreflect.cmx -o ../bin/ssrcoqide

However, I always get the following error message:
Error: Unbound module Coqide


To build ssrcoqide correctly, I need to append the argument "-boot" to coqmktop.
coqmktop -boot -ide -opt ssreflect.cmx -o ../bin/ssrcoqide

Error: The file ssreflect.vo contains library ssreflect and not library theories.ssreflect

After installing ssreflect, its libraries for Coq are installed in /usr/local/lib/coq/user-contrib/theories. When ever I want to import libraries of ssreflect in CoqIDE (ssrcoqide), I get the following error messages:
Error: The file /usr/local/lib/coq/user-contrib/theories/ssreflect.vo
  contains library ssreflect and not library theories.ssreflect
Error: The file /usr/local/lib/coq/user-contrib/theories/eqtype.vo
  contains library eqtype and not library theories.eqtype
......

There are two ways to solve this problem.  I don't know which one is better.

Method 1

Move all the ssreflect libraries for Coq from /usr/local/lib/coq/user-contrib/theories to /usr/local/lib/coq/user-contrib.

Method 2

Add "-I /usr/local/lib/coq/user-contrib/theories" to launch ssrcoq and ssrcoqide. Actually, I rename ssrcoq and ssrcoqide to ssrcoq.opt and ssrcoqide.opt respectively, and use the following two scripts to launch them.

The script /usr/local/bin/ssrcoq:
#!/bin/bash

/usr/local/bin/ssrcoq.opt -I /usr/local/lib/coq/user-contrib/theories $*

The script /usr/local/bin/ssrcoqide:
#!/bin/bash

/usr/local/bin/ssrcoqide.opt -I /usr/local/lib/coq/user-contrib/theories $*