Sunday, August 10, 2014

Building and Running on Windows 8.1 – Command Line

The application can also be built using the command line, either from the Windows Command Prompt or from the BASH shell that comes with Git for Windows named Git Bash in the menu or start screen.  However, the procedure is slightly different between the two.  The procedures below include cloning the IBCP Git repository.  Here are the steps for using Git Bash:
  1. cd Documents
  2. git clone https://github.com/thunder422/ibcp
  3. cd ibcp                               (shows master is the current branch)
  4. git checkout branch0.6                (now shows branch0.6 is the current branch)
  5. cd ..
  6. mkdir ibcp-build
  7. cd ibcp-build
  8. cmake -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make ../ibcp
  9. mingw32-make
  10. regtest                               (runs the Linux regression test script)
In step 8, the MSYS generator looks for the make command, which it will not find because it is named ming32-make with the MinGW-w64 installation.  Therefore the make program needs to be identified on the command line.

Here are the steps for using the Command Prompt:
  1. cd Documents
  2. git clone https://github.com/thunder422/ibcp
  3. cd ibcp
  4. git checkout branch0.6
  5. cd ..
  6. md ibcp-build
  7. cd ibcp-build
  8. cmake -G "MinGW Makefiles" ../ibcp    (produces errors - see below)
  9. cmake -G "MinGW Makefiles" ../ibcp
  10. mingw32-make
  11. regtest                               (runs Windows regression test batch file)
In steps 8 and 9, unlike the MSYS generator, the MinGW generator does look for the mingw32-make command, so the make program does not need to be specified.  In step 8 like Qt Creator, there are a bunch of errors, one screaming about sh.exe being in the path and that MinGW make won't work correctly.  This does not appear to actually affect the build however.  In step 9 again like with Qt Creator, the second time no errors are reported.

In step 11, the batch file will run all the tests and then it will compare the first set of results (parser tests).  If the tests are successful it will say OK for each file.  Answer N for comparing more files.  The next set of results will be compared.  Answer N after each comparison (otherwise it will prompt for more files to compare).

In step 8 for Git Bash and steps 8 and 9 for the Command Prompt, add -DCMAKE_BUILD_TYPE=Debug before the source directory to do a debug build.

No comments:

Post a Comment

All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)