Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
diana:windows:building:environment [2009-11-25 15:35:37]
dages moved
diana:windows:building:environment [2022-05-31 09:29:31] (current)
Line 3: Line 3:
 Assuming Windows XP 32.  We will use MinGW to build the libraries and application and MSYS as a working environment. Assuming Windows XP 32.  We will use MinGW to build the libraries and application and MSYS as a working environment.
  
-The distinction between MinGW and MSYS is very important: MinGW is a set of compilers and libraries you use to build Windows applications, while MSYS is GNU environment similar to (and, in fact, based on) Cygwin.  You can //not// use MSYS libraries in your Windows application.+The distinction between MinGW and MSYS is very important: MinGW is a set of compilers and libraries you use to build Windows applications, while MSYS is an emulated GNU environment similar to (and, in fact, based on) Cygwin.  You can //not// use MSYS libraries in your Windows application.  This means that you will sometimes have two copies of a particular library: an MSYS version used by MSYS tools, and a native version built with MinGW and used by MinGW tools and / or your application. 
 + 
 +===== Directories ===== 
 + 
 +We will install MinGW into ''C:\MinGW'' and MSYS into ''C:\MSYS''
 + 
 +MSYS maps Unix-like paths to Windows paths: ''/'' translates to ''C:\MSYS'' and ''/mingw'' translates to ''C:\MinGW'' In addition, all Windows drives will show up as ''/x'', where ''x'' corresponds to the drive letter, so ''/c/windows'' translates to ''C:\windows'', etc. 
 + 
 +We will install our libraries and applications into ''C:\met.no'' You should start by creating that directory and the required subdirectories: 
 + 
 +  C:\> mkdir met.no 
 +  C:\> mkdir met.no\bin 
 +  C:\> mkdir met.no\include 
 +  C:\> mkdir met.no\lib 
 +  C:\> mkdir met.no\share 
 +  C:\> mkdir met.no\copyright
  
 ===== Subversion ===== ===== Subversion =====
Line 18: Line 33:
  
 At this point, you may want to download bsdtar from http://sourceforge.net/projects/mingw/files/MinGW%20Utilities/basic%20bsdtar/bsdtar-2.7.900a_r1628-20091110/ and install ''bsdtar.exe'' as ''/mingw/bin/tar'' It supports a wider range of archive formats and compression algorithms than GNU tar, and automatically detects which one to use. At this point, you may want to download bsdtar from http://sourceforge.net/projects/mingw/files/MinGW%20Utilities/basic%20bsdtar/bsdtar-2.7.900a_r1628-20091110/ and install ''bsdtar.exe'' as ''/mingw/bin/tar'' It supports a wider range of archive formats and compression algorithms than GNU tar, and automatically detects which one to use.
 +
 +You may want to install InfoZip's ''zip'' utility as well, since ''bsdtar'' can //extract// zip files but not //create// them: download the source code from http://sourceforge.net/projects/infozip/files/, extract it, and run the following commands in the source directory:
 +
 +  $ make -f win32/makefile.gcc
 +  $ cp zip.exe /mingw/bin
  
 ===== MSYS ===== ===== MSYS =====
Line 77: Line 97:
   $ cat >hello.f   $ cat >hello.f
         PROGRAM HELLOW         PROGRAM HELLOW
-        WRITE(UNIT=*, FMT=*) 'Hello World'+        WRITE(UNIT=*, FMT=*) 'Hello, Fortran world!'
         END         END
   ^D   ^D
Line 86: Line 106:
 ===== lex & yacc ===== ===== lex & yacc =====
  
-Or rather, in our brave GNU world, flex (http://downloads.sourceforge.net/project/mingw/MSYS%20flex/flex-2.5.35-1/flex-2.5.35-1-msys-1.0.11-bin.tar.lzma) and bison (http://downloads.sourceforge.net/project/mingw/MSYS%20bison/bison-2.4.1-1/bison-2.4.1-1-msys-1.0.11-bin.tar.lzma).  In addition, flex requires the GNU regex library (http://downloads.sourceforge.net/project/mingw/MSYS%20regex/regex-1.20090805-1/libregex-1.20090805-1-msys-1.0.11-dll-1.tar.lzma).  Download and install as usual.+Or rather, in our brave GNU world, flex and bison.  There is a problem here: you can't use the MSYS versions, because they're not just build tools—bison includes a runtime library (''liby'').  Hence we need native versions of both tools.  We can get those from [[http://sourceforge.net/projects/gnuwin32|GnuWin32]]. 
 + 
 +Download the following files from http://sourceforge.net/projects/gnuwin32/files/
 + 
 +  * the ''bin'', ''lib'' and ''dep'' zipfiles for the latest bison release (the ''dep'' zipfile contains a few libraries that bison needs, so you won't have to install them separately) 
 +  * the ''bin'' and ''lib'' zipfiles for the latest flex release 
 + 
 +For some unfathomable reason, both the flex and bison ''lib'' zipfiles contain incorrect copies of ''<unistd.h>'' Either make a backup copy of ''/MinGW/include/unistd.h'' before you unpack them, or tell ''unzip'' (or ''bsdtar'') not to overwrite existing files: 
 + 
 +  $ tar -kxf bison-2.4.1-lib.zip -C /MinGW 
 + 
 +This will install a shell script called ''/MinGW/bin/yacc'' which incorrectly redirects to ''c:/progra~1/bison/bin/bison''.  Edit it so the entire script looks like this: 
 + 
 +  #! /bin/sh 
 +  exec /mingw/bin/bison -y "$@"
  
 ===== WiX ===== ===== WiX =====
  • diana/windows/building/environment.1259163337.txt.gz
  • Last modified: 2022-05-31 09:23:14
  • (external edit)