Improved mingw.txt instructions.
This commit is contained in:
parent
d6be82f748
commit
35ce5f3e2a
|
|
@ -7,12 +7,12 @@
|
||||||
# to just run this script to autoconf wherever needed.
|
# to just run this script to autoconf wherever needed.
|
||||||
#
|
#
|
||||||
echo "Autoconf in root..."
|
echo "Autoconf in root..."
|
||||||
autoconf
|
autoconf -f
|
||||||
|
|
||||||
for dir in vpip vpi vvp tgt-vvp tgt-fpga tgt-stub libveriuser cadpli
|
for dir in vpip vpi vvp tgt-vvp tgt-fpga tgt-stub libveriuser cadpli
|
||||||
do
|
do
|
||||||
echo "Autoconf in $dir..."
|
echo "Autoconf in $dir..."
|
||||||
( cd ./$dir ; autoconf --include=.. )
|
( cd ./$dir ; autoconf -f --include=.. )
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Precompiling lexor_keyword.gperf"
|
echo "Precompiling lexor_keyword.gperf"
|
||||||
|
|
|
||||||
217
mingw.txt
217
mingw.txt
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
MINGW PORT OF ICARUS VERILOG
|
MINGW PORT OF ICARUS VERILOG
|
||||||
|
|
||||||
Copyright 2003 Stephen Williams <steve@icarus.com>
|
Copyright 2006 Stephen Williams <steve@icarus.com>
|
||||||
|
|
||||||
|
|
||||||
Icarus Verilog source can be compiled with the mingw C/C++ compilers
|
Icarus Verilog source can be compiled with the mingw C/C++ compilers
|
||||||
|
|
@ -12,13 +12,13 @@ or without Cygwin, so this is the preferred Windows distribution form.
|
||||||
The configure scripts automatically detect that the compilers in use
|
The configure scripts automatically detect that the compilers in use
|
||||||
are the mingw compilers and will configure the Makefiles appropriately.
|
are the mingw compilers and will configure the Makefiles appropriately.
|
||||||
|
|
||||||
However, the mingw tools do not include all the other tools around the
|
The mingw patch doesn't contain tools beyond the compiler, but there
|
||||||
compiler, including the shell interpreter for the configure script,
|
is the "msys" package that the makers of Mingw publish that has enough
|
||||||
bison, flex, gperf, etc. Therefore, you still need Cygwin to compile
|
extra tools to get most everything else working. There are a few extra
|
||||||
Icarus Verilog, even if you don't need the Cygwin compilers. There are
|
packages needed beyond mingw and msys, and the following instructions
|
||||||
also a few precompiled library prerequisites that you need.
|
explain how to get them and install them.
|
||||||
|
|
||||||
* Some Preliminary Comments
|
* Some Preliminary Comments -- PLEASE READ ME --
|
||||||
|
|
||||||
The Windows port of Icarus Verilog is the most difficult of all the
|
The Windows port of Icarus Verilog is the most difficult of all the
|
||||||
ports. The Windows system off the shelf is completely stripped, devoid
|
ports. The Windows system off the shelf is completely stripped, devoid
|
||||||
|
|
@ -26,7 +26,15 @@ of any support for software development. Everything needed to compile
|
||||||
Icarus Verilog must be collected from various sources and stitched
|
Icarus Verilog must be collected from various sources and stitched
|
||||||
together by hand. Normal human beings with a basic understanding of
|
together by hand. Normal human beings with a basic understanding of
|
||||||
software development can do this, but some patience (and access to the
|
software development can do this, but some patience (and access to the
|
||||||
Internet) is required. You may choose to print these instructions.
|
Internet) is required. You may choose to print these instructions. FOR
|
||||||
|
BEST RESULTS, FOLLOW THESE INSTRUCTIONS CAREFULLY.
|
||||||
|
|
||||||
|
NOTE that if you have Cygwin installed, it is best to not use a cygwin
|
||||||
|
window to do the build, as the Cygwin tools will intermix with the
|
||||||
|
mingw tools such that it is hard to be sure you are using the right
|
||||||
|
compiler. Thus, it is recommended that these steps be *not* done in a
|
||||||
|
Cygwin window. Use an MSYS window instead, and be careful that your
|
||||||
|
msys/mingw tools are not masked by paths that point to Cygwin binaries.
|
||||||
|
|
||||||
I have no plans to intentionally support MSVC++ compilation. Don't ask.
|
I have no plans to intentionally support MSVC++ compilation. Don't ask.
|
||||||
|
|
||||||
|
|
@ -36,13 +44,15 @@ This is a brief list of prerequisite packages, along with the URL
|
||||||
where each can be found. In most cases, the specific version is not
|
where each can be found. In most cases, the specific version is not
|
||||||
critical, but these are the versions I use.
|
critical, but these are the versions I use.
|
||||||
|
|
||||||
Cygwin <http://cygwin.com>
|
msys-1.0 <http://www.mingw/org>
|
||||||
Mingw32-2.0.0 <http://www.mingw.org>
|
msysDTK-1.0 <http://www.mingw.org>
|
||||||
|
Mingw32-5.x <http://www.mingw.org>
|
||||||
readline-4.2-20010727.zip <http://mingwrep.sourceforge.net>
|
readline-4.2-20010727.zip <http://mingwrep.sourceforge.net>
|
||||||
bzip2-1.0.2-bin.zip <http://gnuwin32.sourceforge.net>
|
bzip2-1.0.3 <http://gnuwin32.sourceforge.net>
|
||||||
zlib-1.1.4-bin.zip <http://gnuwin32.sourceforge.net>
|
zlib-1.2.3 <http://gnuwin32.sourceforge.net>
|
||||||
bzip2-1.0.2-lib.zip <http://gnuwin32.sourceforge.net>
|
gperf-3.0.1 <http://gnuwin32.sourceforge.net>
|
||||||
zlib-1.1.4-lib.zip <http://gnuwin32.sourceforge.net>
|
bison-2.1 <http://gnuwin32.sourceforge.net>
|
||||||
|
flex-2.5.4a <http://gnuwin32.sourceforge.net>
|
||||||
|
|
||||||
The above table lists the packages required. It is convenient to
|
The above table lists the packages required. It is convenient to
|
||||||
install them in the above order. Many of these packages are also
|
install them in the above order. Many of these packages are also
|
||||||
|
|
@ -55,59 +65,38 @@ installation of Icarus Verilog is complete. These are only needed to
|
||||||
build the compiler. The Mingw32 package can be used to compile VPI
|
build the compiler. The Mingw32 package can be used to compile VPI
|
||||||
modules if you choose.
|
modules if you choose.
|
||||||
|
|
||||||
* Install Cygwin
|
* Install MSYS and msysDTK
|
||||||
|
|
||||||
So, step 1 is "Download and Install Cygwin." See the web page
|
The msys package is available from the mingw download site. This is
|
||||||
http://www.cygwin.com for instructions and the files to do
|
not the compiler but a collection of *nix tools ported to Windows and
|
||||||
this. Cygwin *is* a kool package, and is worth having anyhow. There is
|
wrapped in a convenient installer. The msys package is all the various
|
||||||
a convenient setup program that you download first. You execute the
|
basic tools (shells, file utils, etc) and the msysDTK is extra
|
||||||
setup program, and that prompts you to select the package you want.
|
developer tools other then the compiler.
|
||||||
|
|
||||||
You need in particular the Cygwin base, bison (see notes) flex, make
|
Download the msys-1.x.x.exe and msysdtc-1.x.x.exe binaries. These are
|
||||||
and gperf. If you are compiling from CVS, you also need cvs, rcs and
|
self-installing packages. Install msys first, and then msysDTC. Most
|
||||||
automake packages. You will also need tar and gunzip, but these are
|
likely, you want to install them in c:/msys. (The msysDTK is installed
|
||||||
hard to not install. I recommend installing the "which" package as
|
in the same location, as it is an add-on.)
|
||||||
well. Beyond the basics, be sure to install these Cygwin packages:
|
|
||||||
|
|
||||||
bison (*not* 1.875. See Notes.)
|
This install should be easy and reliable.
|
||||||
flex
|
|
||||||
ghostscript (makes the documentation)
|
|
||||||
gperf
|
|
||||||
gzip
|
|
||||||
make
|
|
||||||
strip
|
|
||||||
tar (tar and gunzip for unpacking the source)
|
|
||||||
unzip (For unpacking zip compressed packages.)
|
|
||||||
which
|
|
||||||
|
|
||||||
NOTES:
|
The installation will leave an "msys" icon on your desktop and in the
|
||||||
bison-1.875 is broken, it generates invalid C/C++ code. You
|
mingw sub-menu of your Start menu. This icon brings up a shell window
|
||||||
don't want that version for anything you do. If you have that
|
(a command line) that has paths all set up for executing msys and
|
||||||
version (use "bison -V" to check the version) then use the
|
mingw commands. This is what you will want to use while executing
|
||||||
Cygwin setup program to get a different version. I've downgraded
|
commands below.
|
||||||
to 1.75 and couldn't be happier. In fact, a whole host of insane
|
|
||||||
bison bugs can be avoided that way.
|
|
||||||
|
|
||||||
There is a mingw32 runtime package included in the Cygwin
|
|
||||||
distribution. You do *not* need that, as you will be getting
|
|
||||||
everything from the mingw32 distribution itself.
|
|
||||||
|
|
||||||
Other then the install of mingw32, most of the remaining steps are
|
|
||||||
best done in a Cygwin window. When you installed Cygwin, a start menu
|
|
||||||
entry was created to allow you to start up the Cygwin window. I'll use
|
|
||||||
the string "$ " to represent a command prompt in this window, because
|
|
||||||
that is the usual bash prompt.
|
|
||||||
|
|
||||||
* Install Mingw32
|
* Install Mingw32
|
||||||
|
|
||||||
The obvious step 2, then, is install the mingw compilers. These can be
|
The obvious step 2, then, is install the mingw compilers. These can be
|
||||||
found at the web page <http://www.mingw.org>. The Mingw-2.x.x version
|
found at the web page <http://www.mingw.org>. The Mingw-5.x.x package
|
||||||
comes prepackaged in a convenient, Windows style, installer. I
|
is a convenient remote installer. Download this program and run
|
||||||
recommend you download this package instead of picking and choosing
|
it. The installer will ask wich components you want to install. You
|
||||||
bits.
|
need only the base C compiler and the C++ compiler. (You may install
|
||||||
|
other languages if you wish.)
|
||||||
|
|
||||||
When I install Mingw32 (using the installer) I typically set a
|
When I install Mingw32 (using the installer) I typically set a
|
||||||
destination directory of d:\mingw-2.0.0 or the like. You will be using
|
destination directory of d:\mingw or the like. You will be using
|
||||||
that path later.
|
that path later.
|
||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
|
|
@ -115,6 +104,10 @@ that path later.
|
||||||
need Mingw32, even if you are using a precompiled binary. VPI
|
need Mingw32, even if you are using a precompiled binary. VPI
|
||||||
modules only require Mingw32, and none of the other libraries.
|
modules only require Mingw32, and none of the other libraries.
|
||||||
|
|
||||||
|
Finally, as part of installing the mingw32 compilers, remember to add
|
||||||
|
the mingw/bin directory to your path. You will need that to be able to
|
||||||
|
find the compilers later.
|
||||||
|
|
||||||
* Install Mingw32 Packages
|
* Install Mingw32 Packages
|
||||||
|
|
||||||
There is a collection of precompiled libraries and add-on packages
|
There is a collection of precompiled libraries and add-on packages
|
||||||
|
|
@ -123,86 +116,94 @@ with simplified Windows installers, but they are pretty easy to
|
||||||
install by hand. Icarus Verilog uses the readline-4.2 package from
|
install by hand. Icarus Verilog uses the readline-4.2 package from
|
||||||
that collection.
|
that collection.
|
||||||
|
|
||||||
Since I installed Mingw32 in d:\mingw-2.0.0, I also created a
|
Since I installed Mingw32 in c:\mingw, I also created a
|
||||||
Mingw-packages directory called d:\mingw-packages. The install, then,
|
Mingw-packages directory called c:\mingw-packages. The install, then,
|
||||||
is as easy as this:
|
is as easy as this:
|
||||||
|
|
||||||
<cygwin shell>
|
<msys shell>
|
||||||
$ cd d:/mingw-packages
|
$ cd c:/mingw-packages
|
||||||
$ unzip readline-4.2-20010727.zip
|
$ unzip readline-4.2-20010727.zip
|
||||||
[lots of inflating...]
|
[lots of inflating...]
|
||||||
|
|
||||||
|
There is no need to adjust your execution path for this package as we
|
||||||
|
are only using a library out of here. However, do remember the
|
||||||
|
directory name, as you will need it later.
|
||||||
|
|
||||||
Done. On to the next packages.
|
Done. On to the next packages.
|
||||||
|
|
||||||
* Install GnuWin32 Packages
|
* Install GnuWin32 Packages
|
||||||
|
|
||||||
The GnuWin32 project is a collections of open source programs and
|
The GnuWin32 project is a collections of open source programs and
|
||||||
libraries ported to Windows. These also work well with the Mingw
|
libraries ported to Windows. These also work well with the Mingw
|
||||||
compiler, and in fact Icarus Verilog uses a few libraries from this
|
compiler, and in fact Icarus Verilog uses a few pieces from this
|
||||||
collection.
|
collection.
|
||||||
|
|
||||||
You will need these gnuwin32 packages to compile Icarus Verilog:
|
You will need these gnuwin32 packages to compile Icarus Verilog:
|
||||||
|
|
||||||
<http://gnuwin32.sourceforge.net>
|
<http://gnuwin32.sourceforge.net>
|
||||||
bzip2-1.0.2-lib.zip
|
bzip2-1.0.3.exe
|
||||||
bzip2-1.0.2-bin.zip
|
zlib-1.2.3.exe
|
||||||
zlib-1.1.4-lib.zip
|
gperf-3.0.1.exe
|
||||||
zlib-1.1.4-bin.zip
|
bison-2.1.exe
|
||||||
|
flex-2.5.4a.exe
|
||||||
|
|
||||||
I suggest creating a common directory for holding all your gnuwin32
|
I suggest creating a common directory for holding all your gnuwin32
|
||||||
packages. I use D:\gnuwin32.
|
packages. I use C:\gnuwin32. The download page at the gnuwin32 site
|
||||||
|
has a "setup" link for each of these packages. Click the setup to
|
||||||
|
download the installer for each of the desired programes, then execute
|
||||||
|
the downloaded .exe files to invoke the installer. Install into the
|
||||||
|
c:\gunwin32 directory.
|
||||||
|
|
||||||
After downloading these packages, put the .zip files in your gnuwin32
|
NOTES:
|
||||||
directory and install them like so:
|
You need the binaries and the developer files, but you do not
|
||||||
|
need the source to these packages. The installer gives you the
|
||||||
|
choice.
|
||||||
|
|
||||||
<cygwin shell>
|
After you are done installing the gnuwin32 tools, you should add the
|
||||||
$ cd d:/gnuwin32
|
c:\gnuwin32\bin directory (assuming you installed in c:\gnuwin32) to
|
||||||
$ unzip bzip2-1.0.2-bin.zip
|
your Windows path. The msys shell will pick up your Windows path.
|
||||||
[lots of inflating...]
|
|
||||||
$ unzip bzip2-1.0.2-lib.zip
|
|
||||||
[lots of inflating...]
|
|
||||||
$ unzip zlib-1.1.4-bin.zip
|
|
||||||
[lots of inflating...]
|
|
||||||
$ unzip zlib-1.1.4-lib.zip
|
|
||||||
[lots of inflating...]
|
|
||||||
|
|
||||||
Done.
|
|
||||||
|
|
||||||
* Unpack Icarus Verilog source
|
* Unpack Icarus Verilog source
|
||||||
|
|
||||||
Unpack the compressed tar file (.tar.gz) of the source with a command
|
Unpack the compressed tar file (.tar.gz) of the source with a command
|
||||||
like this:
|
like this:
|
||||||
|
|
||||||
$ gunzip -d verilog-20030303.tar.gz | tar xvf -
|
$ gunzip -d verilog-xxxxxxxx.tar.gz | tar xvf -
|
||||||
|
|
||||||
This will create a directory "verilog-20030303" that contains all the
|
This will create a directory "verilog-xxxxxxxx" that contains all the
|
||||||
source for Icarus Verilog. Descend into that directory, as that is
|
source for Icarus Verilog. Descend into that directory, as that is
|
||||||
where we will work from now on.
|
where we will work from now on.
|
||||||
|
|
||||||
$ cd verilog-20030303
|
$ cd verilog-xxxxxxxx
|
||||||
|
|
||||||
NOTE:
|
NOTES:
|
||||||
The exact name of the file will vary according to the
|
The exact name of the file will vary according to the
|
||||||
snapshot. The 20030303 name is only an example.
|
snapshot. The 20030303 name is only an example.
|
||||||
|
|
||||||
* Select the mingw compilers
|
Unpack the source into a directory that has no spaces. The
|
||||||
|
makefiles included in the source get confused by white space in
|
||||||
|
directory names.
|
||||||
|
|
||||||
In your cygwin window, if you type "which c++" you might get the
|
* Preconfigure Icarus Verilog (Not normally needed)
|
||||||
response path "/usr/bin/c++" which is the cygwin compiler. This is not
|
|
||||||
the one we want to use, however. Tell the shell where the mingw
|
|
||||||
compilers are by setting the search path like so:
|
|
||||||
|
|
||||||
$ PATH=/cygdrive/d/mingw-2.0.0/bin:$PATH
|
Under certain cases, you may need to "preconfigure" the Icarus Verilog
|
||||||
|
source tree. You should only need to do this if you are getting the
|
||||||
|
Icarus Verilog source tree from CVS, or you are using an existing
|
||||||
|
source tree that you've patched to cause configure.in files to change.
|
||||||
|
|
||||||
This assumes that you installed mingw in D:\mingw-2.0.0. The actual
|
NOTE: If you are building from a fresh, bundled source tree that
|
||||||
programs are in the bin directory under the root. After this command,
|
you downloaded from an FTP site, then SKIP THIS STEP. Go on to
|
||||||
check that you are now getting the right compilers with this "which"
|
the "Configure Icarus Verilog" step below.
|
||||||
command:
|
|
||||||
|
|
||||||
$ which c++
|
First, remove any autom4te.cache directories that may exist in your
|
||||||
/cygdrive/d/mingw-2.0.0/bin/c++
|
source tree. These can make a mess of autoconf runs. Then, generate
|
||||||
|
configure scripts with this command:
|
||||||
|
|
||||||
Good!
|
$ sh autoconf.sh
|
||||||
|
|
||||||
|
This script will run the "autoconf" command (part of the msysDTK) to
|
||||||
|
generate all the necessary "configure" scripts. This will take a few
|
||||||
|
minutes. This should go smoothly.
|
||||||
|
|
||||||
* Configure Icarus Verilog
|
* Configure Icarus Verilog
|
||||||
|
|
||||||
|
|
@ -215,10 +216,10 @@ without white space.
|
||||||
Now, configure the source to make the makefiles and configuration
|
Now, configure the source to make the makefiles and configuration
|
||||||
details. Run these commands:
|
details. Run these commands:
|
||||||
|
|
||||||
$ CPPFLAGS="-Id:/gnuwin32/include -Id:/mingw-packages/include"
|
$ CPPFLAGS="-Ic:/gnuwin32/include -Ic:/mingw-packages/include"
|
||||||
$ LDFLAGS="-Ld:/gnuwin32/lib -Ld:/mingw-packages/include"
|
$ LDFLAGS="-Lc:/gnuwin32/lib -Lc:/mingw-packages/lib"
|
||||||
$ export CPPFLAGS LDFLAGS
|
$ export CPPFLAGS LDFLAGS
|
||||||
$ ./configure --prefix=d:/iverilog
|
$ ./configure --prefix=c:/iverilog
|
||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
The CPPFLAGS and LDFLAGS variables tell configure where
|
The CPPFLAGS and LDFLAGS variables tell configure where
|
||||||
|
|
@ -267,10 +268,10 @@ directory you chose) and away you go.
|
||||||
You may find that you need to put some of the prerequisite DLLs into
|
You may find that you need to put some of the prerequisite DLLs into
|
||||||
the d:\iverilog\bin directory. These include:
|
the d:\iverilog\bin directory. These include:
|
||||||
|
|
||||||
d:\mingw-2.0.0\bin\mingw10.dll
|
c:\mingw\bin\mingw10.dll
|
||||||
d:\mingw-packages\bin\libreadline.dll
|
c:\mingw-packages\bin\libreadline.dll
|
||||||
d:\gnuwin32\bin\bzip2.dll
|
c:\gnuwin32\bin\bzip2.dll
|
||||||
d:\gnuwin32\bin\zlib.dll
|
c:\gnuwin32\bin\zlib.dll
|
||||||
|
|
||||||
If you already have these in your Windows path (i.e. your system32
|
If you already have these in your Windows path (i.e. your system32
|
||||||
directory) then you do not need to copy them into the iverilog
|
directory) then you do not need to copy them into the iverilog
|
||||||
|
|
@ -279,14 +280,14 @@ files.
|
||||||
|
|
||||||
* Running Icarus Verilog
|
* Running Icarus Verilog
|
||||||
|
|
||||||
Finally, put the D:\iverilog\bin directory in your Windows path, and
|
Finally, put the C:\iverilog\bin directory in your Windows path, and
|
||||||
you should be able to run the iverilog and vvp commands to your
|
you should be able to run the iverilog and vvp commands to your
|
||||||
heart's content.
|
heart's content.
|
||||||
|
|
||||||
Currently, the iverilog.exe uses the path to itself to locate the
|
Currently, the iverilog.exe uses the path to itself to locate the
|
||||||
libraries and modules associated with itself. In other words, if you
|
libraries and modules associated with itself. In other words, if you
|
||||||
execute the D:\iverilog\bin\iverilog.exe program, it will locate its
|
execute the C:\iverilog\bin\iverilog.exe program, it will locate its
|
||||||
subparts in the D:\iverilog directory and subdirectories below
|
subparts in the C:\iverilog directory and subdirectories below
|
||||||
that. This means you can move the Icarus Verilog installation by
|
that. This means you can move the Icarus Verilog installation by
|
||||||
simply moving the root directory and all its contents.
|
simply moving the root directory and all its contents.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue