File: Install.nt

package info (click to toggle)
nethack 3.6.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,468 kB
  • sloc: ansic: 266,495; cpp: 13,652; yacc: 2,903; perl: 1,426; lex: 581; sh: 535; xml: 372; awk: 98; makefile: 68; fortran: 51; sed: 11
file content (333 lines) | stat: -rw-r--r-- 14,041 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
         Copyright (c) NetHack Development Team 1990-2023
         NetHack may be freely redistributed.  See license for details.
         ==============================================================
                  Instructions for compiling and installing
                       NetHack 3.6 on a Windows system
                       (Windows 10/11 or later)
         ==============================================================
          Last revision: $NHDT-Date: 1575245156 2019/12/02 00:05:56 $

Credit for the porting of NetHack to the Win32 Console Subsystem goes to
the NT Porting Team started by Michael Allison.

Credit for the Win32 Graphical version of NetHack (aka "NetHack for
Windows" or NetHackW) goes to Alex Kompel who initially developed and
contributed the port.

Alex Kompel, Dion Nicolaas, Yitzhak Sapir, Derek S. Ray, Michael Allison,
Pasi Kallinen, Bart House, and Janet Walz contributed to the maintainance
of the tty and graphical windows versions of NetHack 3.6.7.

You can build a TTY version of NetHack and a Windows Graphical
version.  You can use one of the following build environments:

  o A copy of Microsoft Visual Studio 2017 Community Edition or
    a copy of Microsoft Visual Studio 2019 Community Edition

    OR

  o (Untested for 3.6) A copy of MinGW. MinGW is a collection of header
    files and import libraries with which native Windows32 programs
    can be built; the MinGW distribution contains the GNU Compiler
    Collection. You can download MinGW at
        http://www.mingw.org/
    Earlier versions of MinGW will not allow you to build the Windows
    Graphical version.

/---------------------------------------------\
|    Directories for a Win32 NetHack build    |
\---------------------------------------------/


                 (NetHack-top) ----------------------(optional-pdcurses-top)
                       |                                        |
  ----------------------------------------------          --------------
  |     |     |        |      |     |          |          |            |
 util  dat   doc    include  src   sys        win      pdcurses      wincon
                                    |          |
                                 ------    --------
                                 |    |    |      |
                             share  winnt tty   win32
                                                  |
                                                vs2017


/--------------------------------------------------------\
| Building And Running Using Visual Studio               |
\--------------------------------------------------------/

If you are NOT using Visual Studio 2017 IDE, or you prefer to build
using a Make utility and a Makefile proceed to "Building Using Make".

When using either Visual Studio 2017, you simply need to load the
solution file within the IDE, build the solution and  run the version
of NetHack you wish to run.

The Visual Studio 2017 NetHack solution file can be found here:
    win\win32\vs2017\NetHack.sln

You can use that same win\win32\vs2017\NetHack.sln with Visual Studio 2019,
but you likely have to retarget the projects. The same would apply if you are
trying to build using an even more recent version of Visual Studio as well.
Note: If you already built NetHack previously with an older version of
Visual Studio, manually delete the following subfolders of win\win32\vs2017:
        <DIR>          obj
        <DIR>          symbols

    Windows SDK Version: 10.0.22000.0  [ There have been some reports of
                                         difficulties if you choose
                                         "10.0 (latest installed version)"
                                         instead ]
    Platform Toolset: Upgrade to v142


Before executing the steps to build listed in the next paragraph,
decide if you want to include optional curses window-port. See
the note just below entitled "Optional curses window-port support."

So the steps are:
    1. Launch the IDE.
    2. Open the appropriate solution file.
    3. Select the build configuration you wish to use (Release, Debug, etc.).
    4. From the build menu, select build solution.
    5. Type F5 to start debugging.

You can also build all the projects for all platforms and configurations
using a "build.bat" batch file found in the same directory as the solution.

Open a developer command prompt for the version of Visual Studio you are
using.  Change to the directory win\win32\vs2017 and run "build.bat".

 * Optional curses window-port support *

Since 3.6.2, the community patch for a window-port that uses curses has been
incorporated into the NetHack source code tree. That window-port, which
evolved from work originally done by Karl Garrison, has been used in several
NetHack variants and on nethack.alt.org and on www.hardfought.org/nethack/.

If you want to include the curses window-port support in your Visual Studio
build, you will have to first obtain the PDCurses sources from
https://github.com/wmcbrine/PDCurses
and have them available prior to building NetHack. There are two ways to
enable curses window-port support during the VS build: Either set the
environment variable PDCURSES to a folder containing a PDCurses
repository/source-tree
    OR
Place the PDCurses folder alongside the NetHack source repository prior
to proceeding with steps 1 through 5 above.


/-------------------------------------------\
| Building From the Command Line Using Make |
\-------------------------------------------/

--------------------------------------------------------------------------
-- Beginning of prerequisite step --

The first step in building either version of NetHack via Makefile is to
execute sys\winnt\nhsetup.bat to move some files to their required locations.

From the command prompt:
        cd sys\winnt
        nhsetup

From a Windows explorer window:
        double-click on nhsetup.bat

If you wish to build from the command line, proceed to "BUILDING FROM
THE COMMAND LINE."

-- end of prerequisite step --
--------------------------------------------------------------------------

Two different versions of NetHack will be built for Windows from the
command line using the Makefile approach:
    A tty port utilizing the Win32 Console I/O subsystem, Console
        NetHack;
    A Win32 native port built on the Windows API, Graphical NetHack or
        NetHackW.

The executable for Console NetHack will be named NetHack.exe. The
executable for Graphical NetHack will be named NetHackW.exe. The
Makefile configuration will build both; NetHackW.exe and NetHack.exe
will be able to use the same datafiles, save files and bones files.

Since the last official release of NetHack, compilers and computer
architectures have evolved and you can now choose whether to build
a 32-bit x86 version, or a 64-bit x64 version.  The default Makefile
is set up for a 32-bit x86 version, but that's only because it will
run on the most number of existing Windows environments.

NetHack's save files and bones files in the 3.6.7 release have not yet
evolved enough to allow them to interchange between the 32-bit version
and the 64-bit version (or between different platforms). Hopefully
that will change in an upcoming release.

I. Dispelling the Myths:

    Compiling NetHack for Windows is not as easy as it sounds, nor as hard
    as it looks, however it will behoove you to read this entire section
    through before beginning the task.

    We have provided a Makefile for each of the following compilers:

        o Microsoft Visual Studio 2017 or 2019 C++ Compiler
          The Community Editions are fine and available at no cost
        o MinGW 2.0 (with GCC 3.2)

    The Microsoft Visual Studio makefile was created for use
    with MS NMAKE which is provided with the Microsoft compiler.
    The supplied Makefile may work with earlier versions of the Microsoft
    compiler, but that has not been tested.

    The GCC Makefile was created for use with GNU Make version 3.79.1,
    which comes with the MinGW package.

    You may find it useful to obtain copies of lex (flex) and yacc
    (bison, or byacc).  While not strictly necessary to compile nethack,
    they are required should you desire to make any changes to the level
    and dungeon compilers.

II. To compile your copy of NetHack on a Windows machine:

Setting Up

1.  It almost goes without saying that you should make sure that your
    tools are set up and running correctly.  That includes ensuring that
    all the necessary environment variables for the compiler environment
    are set correctly.

    Change your current directory to the src subfolder of the nethack
    source tree.
        cd src

    GCC

    For the GCC Makefile, add <mingw>\bin to your path, where <mingw>
    is your MinGW root directory.).

    Change your current directory to src subfolder of the nethack
    source tree.
        cd src

2.  Since 3.6.2, the community patch for an optional curses window-port
    has been incorporated into the NetHack source code tree. That
    window-port, which evolved from work originally done by Karl Garrison,
    has been used in several NetHack variants and on nethack.alt.org and
    on www.hardfought.org/nethack/. The optional curses window-port is
    available for Windows, Mac OS X, and Unix (and also DOS).

    If you want to include the optional curses window-port support in your
    command line Makefile build, you will have to first obtain the
    PDCurses sources from https://github.com/wmcbrine/PDCurses
    and have that source code tree available prior to building NetHack.
    Edit your Makefile and in Question 4 of the four decisions you can
    make in there, uncomment these two lines:
        ADD_CURSES=Y
        PDCURSES_TOP=..\..\pdcurses

    Adjust the PDCURSES_TOP macro so that it points to the correct
    location for the top of the PDCurses source tree if it differs from
    the path shown.

3.  Make sure all the necessary files are in the appropriate directory
    structure.  You should have a main NetHack top directory with
    subdirectories dat, doc, include, src, sys\share, sys\winnt,
    win\tty, util.

    If you are including the optional Curses window port into your
    build,then you will need the top of the PDCurses sources in a
    folder parallel to the top of the NetHack folder (or you will need
    to change the value of the PDCURSES_TOP macro in the Makefile to
    specify the appropriate location.

    (You can check the file "Files" in your top level directory for a
     more complete listing of what file is in which directory.)

    If you downloaded or ftp'd the sources from a UNIX system, the lines
    will probably end in UNIX-style newlines, instead of the carriage
    return and line feed pairs used by Windows.  Some programs have
    trouble with them, so you may need to convert them. The compiler
    should not have any problems with them however.

4.  Edit your Makefile if you wish, but it is not required unless
    you are altering the build options.

    If you are recompiling after patching your sources, or if you got
    your files from somewhere other than the official distribution,
    "touch makedefs.c" to ensure that certain files (onames.h and pm.h)
    are remade, lest potentially troublesome timestamps fool your make
    (or nmake) utility.

Compiling

5.  Now that everything is set up...

    For the Visual Studio compiler, as mentioned above, you should now be
    at the command prompt to carry out the build and your current
    directory should be the src subdirectory in the NetHack source tree.

    In the src subdirectory, issue this command:
	        nmake install

    For GCC:
	Change your current directory to the NetHack src directory.
	Issue this command:
        	mingw32-make -f Makefile.gcc install

    If you get any errors along the way then something has not been set
    up correctly. The time it takes to compile depends on your
    particular machine of course, but you should be able to go for lunch
    and return to find everything finished.  The less memory, and slower
    your machine, the longer the lunch you may take. :-)

    In any case, it is likely that the command prompt window where you
    are doing the compiling will be occupied for a while.  If all goes
    well, you will get an NetHack executable.

Notes:

1.  To install an update of NetHack after changing something, change
    your current directory to src and issue the appropriate command for
    your compiler:

    For Microsoft compiler:
        nmake

    For GCC:
        mingw32-make -f Makefile.gcc

    If you add, delete, or reorder monsters or objects, or you change
    the format of saved level files, delete any save and bones files.
    (Trying to use such files sometimes produces amusing confusions on
    the game's part, but usually crashes.)

    If you made changes to any of the level compiler software, you may
    have to delete dgn_flex.c, dgn_yacc.c, lev_flex.c, and lev_yacc.c
    from the util directory to ensure that they are remade.

2.  Depending on the build and compiler and tools used above, the
    executable produced by the TTY build is either:
      - a 32-bit (x86), flat-address space, non-overlayed .exe file,
        which should run on any recent Win32 environment.
    or
      - a 64-bit (x64) .exe file,
        which should run on any 64-bit Windows O/S.

    Note that saved games are NOT compatible between the 32-bit and the
    64-bit versions at this time.

NetHack.exe is the tty version. NetHackW.exe is the graphical version.
Play NetHack.

PROBLEMS

    If you discover a bug and wish to report it, or if you have comments
    or suggestions we recommend using our "Contact Us" web page at:
        http://www.nethack.org/common/contact.html

    If you don't have access to the web, or you want to send us a patch
    to the NetHack source code feel free to drop us a line c/o:
        DevTeam (at) nethack.org

    Happy NetHacking!