Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 283 lines (209 sloc) 11.063 kb
a51f2dc Cary R. Update MinGW requirements, etc.
caryr authored
1 Please NOTE:
2
3 These directions are slightly outdated and need to be updated.
4 The plan is to rewrite all this using the latest MinGW at
5 some time in the not too distant future (CR Aug. 2009)
4a2168b Describe the mingw compile.
steve authored
6
7
8 MINGW PORT OF ICARUS VERILOG
9
35ce5f3 Improved mingw.txt instructions.
steve authored
10 Copyright 2006 Stephen Williams <steve@icarus.com>
4a2168b Describe the mingw compile.
steve authored
11
12
13 Icarus Verilog source can be compiled with the mingw C/C++ compilers
e941e7e Spelling fixes.
steve authored
14 to get a Windows binary that does not require the POSIX compatibility
f78e014 Updated mingw build instructions.
steve authored
15 cruft of the Cygwin.dll library. The resulting program can be run with
16 or without Cygwin, so this is the preferred Windows distribution form.
17 The configure scripts automatically detect that the compilers in use
18 are the mingw compilers and will configure the Makefiles appropriately.
4a2168b Describe the mingw compile.
steve authored
19
35ce5f3 Improved mingw.txt instructions.
steve authored
20 The mingw patch doesn't contain tools beyond the compiler, but there
21 is the "msys" package that the makers of Mingw publish that has enough
22 extra tools to get most everything else working. There are a few extra
23 packages needed beyond mingw and msys, and the following instructions
24 explain how to get them and install them.
f78e014 Updated mingw build instructions.
steve authored
25
35ce5f3 Improved mingw.txt instructions.
steve authored
26 * Some Preliminary Comments -- PLEASE READ ME --
f78e014 Updated mingw build instructions.
steve authored
27
28 The Windows port of Icarus Verilog is the most difficult of all the
29 ports. The Windows system off the shelf is completely stripped, devoid
30 of any support for software development. Everything needed to compile
31 Icarus Verilog must be collected from various sources and stitched
32 together by hand. Normal human beings with a basic understanding of
33 software development can do this, but some patience (and access to the
35ce5f3 Improved mingw.txt instructions.
steve authored
34 Internet) is required. You may choose to print these instructions. FOR
35 BEST RESULTS, FOLLOW THESE INSTRUCTIONS CAREFULLY.
36
37 NOTE that if you have Cygwin installed, it is best to not use a cygwin
38 window to do the build, as the Cygwin tools will intermix with the
39 mingw tools such that it is hard to be sure you are using the right
40 compiler. Thus, it is recommended that these steps be *not* done in a
41 Cygwin window. Use an MSYS window instead, and be careful that your
42 msys/mingw tools are not masked by paths that point to Cygwin binaries.
f78e014 Updated mingw build instructions.
steve authored
43
44 I have no plans to intentionally support MSVC++ compilation. Don't ask.
45
46 * Summary of Prerequisites
47
48 This is a brief list of prerequisite packages, along with the URL
49 where each can be found. In most cases, the specific version is not
155eb70 More details about the Cygwin parts.
steve authored
50 critical, but these are the versions I use.
f78e014 Updated mingw build instructions.
steve authored
51
35ce5f3 Improved mingw.txt instructions.
steve authored
52 msys-1.0 <http://www.mingw/org>
53 msysDTK-1.0 <http://www.mingw.org>
54 Mingw32-5.x <http://www.mingw.org>
3113392 Stephen Williams Minor improvement to mingw.txt
authored
55 ... including the sub-packages binutils, gcc-core and gcc-g++
56 if you are given the option.
a51f2dc Cary R. Update MinGW requirements, etc.
caryr authored
57 readline-5.0-1 <http://gnuwin32.sourceforge.net>
35ce5f3 Improved mingw.txt instructions.
steve authored
58 bzip2-1.0.3 <http://gnuwin32.sourceforge.net>
59 zlib-1.2.3 <http://gnuwin32.sourceforge.net>
60 gperf-3.0.1 <http://gnuwin32.sourceforge.net>
61 bison-2.1 <http://gnuwin32.sourceforge.net>
62 flex-2.5.4a <http://gnuwin32.sourceforge.net>
f78e014 Updated mingw build instructions.
steve authored
63
64 The above table lists the packages required. It is convenient to
65 install them in the above order. Many of these packages are also
66 collected into the directory:
67
68 <ftp://icarus.com/pub/eda/verilog/win32-build-parts>
4a2168b Describe the mingw compile.
steve authored
69
155eb70 More details about the Cygwin parts.
steve authored
70 Incidentally, besides Mingw32, none of these packages are needed after
71 installation of Icarus Verilog is complete. These are only needed to
72 build the compiler. The Mingw32 package can be used to compile VPI
73 modules if you choose.
74
35ce5f3 Improved mingw.txt instructions.
steve authored
75 * Install MSYS and msysDTK
f78e014 Updated mingw build instructions.
steve authored
76
35ce5f3 Improved mingw.txt instructions.
steve authored
77 The msys package is available from the mingw download site. This is
78 not the compiler but a collection of *nix tools ported to Windows and
79 wrapped in a convenient installer. The msys package is all the various
80 basic tools (shells, file utils, etc) and the msysDTK is extra
611d2c8 Spelling fixes from Larry
steve authored
81 developer tools other than the compiler.
35ce5f3 Improved mingw.txt instructions.
steve authored
82
83 Download the msys-1.x.x.exe and msysdtc-1.x.x.exe binaries. These are
84 self-installing packages. Install msys first, and then msysDTC. Most
85 likely, you want to install them in c:/msys. (The msysDTK is installed
86 in the same location, as it is an add-on.)
ec49f10 Stephen Williams Revert bad merge from vhdl branch
authored
87
35ce5f3 Improved mingw.txt instructions.
steve authored
88 This install should be easy and reliable.
89
90 The installation will leave an "msys" icon on your desktop and in the
91 mingw sub-menu of your Start menu. This icon brings up a shell window
92 (a command line) that has paths all set up for executing msys and
93 mingw commands. This is what you will want to use while executing
94 commands below.
f78e014 Updated mingw build instructions.
steve authored
95
96 * Install Mingw32
4a2168b Describe the mingw compile.
steve authored
97
98 The obvious step 2, then, is install the mingw compilers. These can be
35ce5f3 Improved mingw.txt instructions.
steve authored
99 found at the web page <http://www.mingw.org>. The Mingw-5.x.x package
100 is a convenient remote installer. Download this program and run
388bb93 Larry Doolittle Spelling fixes
ldoolitt authored
101 it. The installer will ask which components you want to install. You
35ce5f3 Improved mingw.txt instructions.
steve authored
102 need only the base C compiler and the C++ compiler. (You may install
103 other languages if you wish.)
f78e014 Updated mingw build instructions.
steve authored
104
105 When I install Mingw32 (using the installer) I typically set a
35ce5f3 Improved mingw.txt instructions.
steve authored
106 destination directory of d:\mingw or the like. You will be using
f78e014 Updated mingw build instructions.
steve authored
107 that path later.
108
109 NOTES:
110 If you intend to compile VPI modules for Icarus Verilog, you
111 need Mingw32, even if you are using a precompiled binary. VPI
112 modules only require Mingw32, and none of the other libraries.
113
35ce5f3 Improved mingw.txt instructions.
steve authored
114 Finally, as part of installing the mingw32 compilers, remember to add
115 the mingw/bin directory to your path. You will need that to be able to
116 find the compilers later.
117
f78e014 Updated mingw build instructions.
steve authored
118 * Install GnuWin32 Packages
119
120 The GnuWin32 project is a collections of open source programs and
121 libraries ported to Windows. These also work well with the Mingw
35ce5f3 Improved mingw.txt instructions.
steve authored
122 compiler, and in fact Icarus Verilog uses a few pieces from this
f78e014 Updated mingw build instructions.
steve authored
123 collection.
124
125 You will need these gnuwin32 packages to compile Icarus Verilog:
126
127 <http://gnuwin32.sourceforge.net>
35ce5f3 Improved mingw.txt instructions.
steve authored
128 bzip2-1.0.3.exe
129 zlib-1.2.3.exe
130 gperf-3.0.1.exe
131 bison-2.1.exe
132 flex-2.5.4a.exe
a51f2dc Cary R. Update MinGW requirements, etc.
caryr authored
133 readline-5.0-1.exe
f78e014 Updated mingw build instructions.
steve authored
134
135 I suggest creating a common directory for holding all your gnuwin32
35ce5f3 Improved mingw.txt instructions.
steve authored
136 packages. I use C:\gnuwin32. The download page at the gnuwin32 site
137 has a "setup" link for each of these packages. Click the setup to
388bb93 Larry Doolittle Spelling fixes
ldoolitt authored
138 download the installer for each of the desired programs, then execute
35ce5f3 Improved mingw.txt instructions.
steve authored
139 the downloaded .exe files to invoke the installer. Install into the
140 c:\gunwin32 directory.
f78e014 Updated mingw build instructions.
steve authored
141
35ce5f3 Improved mingw.txt instructions.
steve authored
142 NOTES:
143 You need the binaries and the developer files, but you do not
144 need the source to these packages. The installer gives you the
145 choice.
f78e014 Updated mingw build instructions.
steve authored
146
35ce5f3 Improved mingw.txt instructions.
steve authored
147 After you are done installing the gnuwin32 tools, you should add the
148 c:\gnuwin32\bin directory (assuming you installed in c:\gnuwin32) to
149 your Windows path. The msys shell will pick up your Windows path.
4a2168b Describe the mingw compile.
steve authored
150
151 * Unpack Icarus Verilog source
152
f78e014 Updated mingw build instructions.
steve authored
153 Unpack the compressed tar file (.tar.gz) of the source with a command
154 like this:
4a2168b Describe the mingw compile.
steve authored
155
35ce5f3 Improved mingw.txt instructions.
steve authored
156 $ gunzip -d verilog-xxxxxxxx.tar.gz | tar xvf -
4a2168b Describe the mingw compile.
steve authored
157
35ce5f3 Improved mingw.txt instructions.
steve authored
158 This will create a directory "verilog-xxxxxxxx" that contains all the
f78e014 Updated mingw build instructions.
steve authored
159 source for Icarus Verilog. Descend into that directory, as that is
160 where we will work from now on.
4a2168b Describe the mingw compile.
steve authored
161
35ce5f3 Improved mingw.txt instructions.
steve authored
162 $ cd verilog-xxxxxxxx
4a2168b Describe the mingw compile.
steve authored
163
35ce5f3 Improved mingw.txt instructions.
steve authored
164 NOTES:
f78e014 Updated mingw build instructions.
steve authored
165 The exact name of the file will vary according to the
166 snapshot. The 20030303 name is only an example.
4a2168b Describe the mingw compile.
steve authored
167
35ce5f3 Improved mingw.txt instructions.
steve authored
168 Unpack the source into a directory that has no spaces. The
169 makefiles included in the source get confused by white space in
170 directory names.
171
172 * Preconfigure Icarus Verilog (Not normally needed)
4a2168b Describe the mingw compile.
steve authored
173
35ce5f3 Improved mingw.txt instructions.
steve authored
174 Under certain cases, you may need to "preconfigure" the Icarus Verilog
175 source tree. You should only need to do this if you are getting the
83fff3a Cary R. Remove more CVS stuff
caryr authored
176 Icarus Verilog source tree from git, or you are using an existing
35ce5f3 Improved mingw.txt instructions.
steve authored
177 source tree that you've patched to cause configure.in files to change.
4a2168b Describe the mingw compile.
steve authored
178
35ce5f3 Improved mingw.txt instructions.
steve authored
179 NOTE: If you are building from a fresh, bundled source tree that
180 you downloaded from an FTP site, then SKIP THIS STEP. Go on to
181 the "Configure Icarus Verilog" step below.
4a2168b Describe the mingw compile.
steve authored
182
35ce5f3 Improved mingw.txt instructions.
steve authored
183 First, remove any autom4te.cache directories that may exist in your
184 source tree. These can make a mess of autoconf runs. Then, generate
185 configure scripts with this command:
4a2168b Describe the mingw compile.
steve authored
186
35ce5f3 Improved mingw.txt instructions.
steve authored
187 $ sh autoconf.sh
4a2168b Describe the mingw compile.
steve authored
188
35ce5f3 Improved mingw.txt instructions.
steve authored
189 This script will run the "autoconf" command (part of the msysDTK) to
190 generate all the necessary "configure" scripts. This will take a few
191 minutes. This should go smoothly.
4a2168b Describe the mingw compile.
steve authored
192
193 * Configure Icarus Verilog
194
195 Now we are all set to configure and compile Icarus Verilog. Choose a
196 destination path where you will want to install the binaries. I chose
197 on my system the directory "D:\iverilog". This choice is not
198 permanent, so don't get too much angst over it. Just choose a name
199 without white space.
200
201 Now, configure the source to make the makefiles and configuration
f78e014 Updated mingw build instructions.
steve authored
202 details. Run these commands:
4a2168b Describe the mingw compile.
steve authored
203
a51f2dc Cary R. Update MinGW requirements, etc.
caryr authored
204 $ CPPFLAGS="-Ic:/gnuwin32/include
205 $ LDFLAGS="-Lc:/gnuwin32/lib
f78e014 Updated mingw build instructions.
steve authored
206 $ export CPPFLAGS LDFLAGS
35ce5f3 Improved mingw.txt instructions.
steve authored
207 $ ./configure --prefix=c:/iverilog
4a2168b Describe the mingw compile.
steve authored
208
f78e014 Updated mingw build instructions.
steve authored
209 NOTES:
210 The CPPFLAGS and LDFLAGS variables tell configure where
211 the gnuwin32 packages are. The configure program will
212 write these values into the Makefiles, so you only need to
213 keep these variables long enough for the configure program
214 to work.
215
216 Your PATH variable was set in the previous step.
217
cadf4cf Spelling fixes.
steve authored
218 Use forward slashes as directory characters. All the various
f78e014 Updated mingw build instructions.
steve authored
219 tools prefer the forward slash.
220
4a2168b Describe the mingw compile.
steve authored
221 Substitute your chosen directory for the prefix. This will cause the
222 makefiles to build and the source code to configure. The configure
223 program will detect that this is a mingw environment and set things up
224 to build properly.
225
f78e014 Updated mingw build instructions.
steve authored
226 (For a prefix, use the drive letter notation; the mingw compiled parts
f014d4c Update instructions, now that Cygwin handles X:/path strings.
steve authored
227 require it, and the Cygwin tools should be able to handle it. You may
228 need to check or upgrade your Cygwin installation if this causes
229 problems for you.)
230
4a2168b Describe the mingw compile.
steve authored
231
232 * Compile Icarus Verilog
233
234 This, believe it or not, should be the easy part:
235
f78e014 Updated mingw build instructions.
steve authored
236 $ make
4a2168b Describe the mingw compile.
steve authored
237
238 It could take a while. Now is a good time to go get some coffee or
f78e014 Updated mingw build instructions.
steve authored
239 take a tea break.
4a2168b Describe the mingw compile.
steve authored
240
241
242 * Install Icarus Verilog
243
244 If the compile ran OK, then next you install Icarus Verilog in the
f78e014 Updated mingw build instructions.
steve authored
245 directory you have chosen. When you are ready, install like this:
ac6caaf More make install details.
steve authored
246
f78e014 Updated mingw build instructions.
steve authored
247 $ make install
4a2168b Describe the mingw compile.
steve authored
248
249 This is part of what the configure program did for you. The Makefiles
f78e014 Updated mingw build instructions.
steve authored
250 now know to put the files under the D:\iverilog directory (or whatever
251 directory you chose) and away you go.
252
cadf4cf Spelling fixes.
steve authored
253 You may find that you need to put some of the prerequisite DLLs into
f78e014 Updated mingw build instructions.
steve authored
254 the d:\iverilog\bin directory. These include:
4a2168b Describe the mingw compile.
steve authored
255
35ce5f3 Improved mingw.txt instructions.
steve authored
256 c:\mingw\bin\mingw10.dll
a51f2dc Cary R. Update MinGW requirements, etc.
caryr authored
257 c:\gnuwin32\bin\readline.dll
258 c:\gnuwin32\bin\history.dll
35ce5f3 Improved mingw.txt instructions.
steve authored
259 c:\gnuwin32\bin\bzip2.dll
260 c:\gnuwin32\bin\zlib.dll
f78e014 Updated mingw build instructions.
steve authored
261
262 If you already have these in your Windows path (i.e. your system32
263 directory) then you do not need to copy them into the iverilog
264 directory. However, prepackaged Icarus Verilog binaries include these
265 files.
4a2168b Describe the mingw compile.
steve authored
266
267 * Running Icarus Verilog
268
35ce5f3 Improved mingw.txt instructions.
steve authored
269 Finally, put the C:\iverilog\bin directory in your Windows path, and
4a2168b Describe the mingw compile.
steve authored
270 you should be able to run the iverilog and vvp commands to your
271 heart's content.
97d972e More details about running Icarus Verilog.
steve authored
272
273 Currently, the iverilog.exe uses the path to itself to locate the
274 libraries and modules associated with itself. In other words, if you
35ce5f3 Improved mingw.txt instructions.
steve authored
275 execute the C:\iverilog\bin\iverilog.exe program, it will locate its
276 subparts in the C:\iverilog directory and subdirectories below
97d972e More details about running Icarus Verilog.
steve authored
277 that. This means you can move the Icarus Verilog installation by
278 simply moving the root directory and all its contents.
f78e014 Updated mingw build instructions.
steve authored
279
280 The vvp.pdf and iverilog.pdf files document the main commands. View
281 these with Acrobat reader, or any other viewer capable of displaying
282 PDF format files.
Something went wrong with that request. Please try again.