2.3. Manual Installation

N.B. The cabal makefile command is not available with GHC version 8.2.x or higher. The steps described as runhaskell Setup.hs makefile followed by gmake in the following sections must therefore be replaced with the command runhaskell Setup.hs build. The build process for qtHaskell will require approximately 3GB of RAM in this mode, which may require users to cancel and restart the process several times. It is therefore highly recommended that the automated build script be used wherever possible and particularly with GHC version 8.2.x or higher.

2.3.1. Linux Manual Installation

First apply the instructions in Section 2.2, “General Instructions” without actually executing the ./build script, then at the command line type as follows:

cd qws
qmake -recursive

Qt will generate the Makefiles for the Qtc wrapper libraries.

gmake[1]

This will build the libraries - this may take some time. (Type gmake all to build the both the release and debug versions of the Qtc libraries, if required).

su

Enter the superuser password

gmake[1] install
ldconfig
exit
cd ..

The Qtc libraries are now installed

The Haskell package (qt) is built with Cabal as follows:

runhaskell Setup.hs configure --ghc [--enable-shared][2]
runhaskell Setup.hs makefile[3]
gmake[1]

This will compile all the Haskell code which may take some time.

su

Enter the superuser password

runhaskell Setup.hs install
exit

To compile the qtHaskell programs in the examples and demos directories type:

cd examples
../bin/qbe examples [-dynamic][4]
cd ../demos
../bin/qbe demos [-dynamic][4]
cd ..

The qtHaskell version of Glome is built as a package (qt-glome) with Cabal as follows:

cd extra-pkgs/Glome
runhaskell Setup.hs configure --ghc
runhaskell Setup.hs build

This will compile all the Haskell code for Glome which may take some time.

su

Enter the superuser password

runhaskell Setup.hs install
exit
cd ../..

To compile the imageviewer demo program for Glome type:

cd demos/Glome
../../bin/qbe2 demos/Glome -package qt-glome [-dynamic][4]
cd ../..

(See the section Section 3.1, “Building qtHaskell Applications” for instructions on how to build individual qtHaskell programs).

2.3.2. Windows Manual Installation

N.B. The Windows manual installation procedure for qtHaskell version 1.1.10 requires an MSYS bourne shell interpreter as well as the MinGW toolset. If necessary this should be installed, then open an MSYS window and cd to the current build location. During the installation process some commands will be typed at the MSYS prompt and some will be typed at the Dos box prompt.

Open a Dos box and apply the instructions in Section 2.2, “General Instructions” without actually executing the build batch file.

Add the installation bin directories to the local path environment variable.

set path=%cd%\qws\bin;%cd%\bin;%path%

Edit the file qt.cabal and add the line

extra-lib-dirs: mypath\qws\bin

where mypath is the full pathname of the installation directory e.g. c:\qthaskell\qthaskell-1.1.10.

cd qws
qmake -recursive
mingw32-make

This will build the libraries - which may take some time. (Type mingw32-make all to build both the release and debug versions of the Qtc libraries, if required).

The Haskell package (qt) is built with Cabal as follows:

runhaskell Setup.hs configure --ghc
runhaskell Setup.hs makefile

Then at the MSYS window type

mingw32-make

This will compile all the Haskell code which may take some time. It is also likely that mingw32-make will crash when it actually tries to link the archive. Ignore that and carry on back at the Dos box as follows.

runhaskell Setup.hs build
runhaskell Setup.hs install

This will link the library and install it as a Haskell package.

N.B. The library linking will take a very, very long time if left to run to its normal completion. The following procedure, although somewhat unorthodox may reduce the link time from several hours to a few minutes.

After you have typed the runhaskell Setup.hs build command, monitor the state of the dist/build directory in the current installation directory (e.g. type ls -l dist/build in the MSYS window. Once the ar program has completed building the libHSqt-1.1.10.a library (its final size is normally about 95MB), it will start to build the HSqt-1.1.10.o file, which may take several hours as opposed to a few minutes for the library. You can check that the HSqt-1.1.10.o file is being built by looking to see whether the ld program is running in the system process monitor. If so simply terminate the runhaskell Setup.hs build command and continue with the runhaskell Setup.hs install command.

N.B. the install command requires that a file named HSqt-1.1.10.o actually exists on the disk in the dist/build directory, even if its size is 0 bytes. If you only have a HSqt-1.1.10.o.tmp file when you terminate the build command, move it to HSqt-1.1.10.o before running the install command.

To compile the qtHaskell programs in the examples and demos directories type:

cd examples
qbe examples
cd ..\demos
qbe demos
cd ..

The qtHaskell version of Glome is built as a package (qt-glome) with Cabal as follows:

cd extra-pkgs/Glome
runhaskell Setup.hs configure --ghc
runhaskell Setup.hs build
runhaskell Setup.hs install
cd ../..

This will compile and install all the Haskell code for Glome which may take some time.

To compile the imageviewer demo program for Glome type:

cd demos/Glome
qbe2 demos/Glome -package qt-glome
cd ../..

(See the section Section 3.1, “Building qtHaskell Applications” for instructions on how to build individual qtHaskell programs).

Finally don't forget to add the installation bin directory to the path environment variable using the Windows control panel.



[1] gmake is used as the recommended make tool in the Linux build instructions. If it is not installed or otherwise available, the plain make program should work just as well on most Linux/Unix systems.

[2] add the final paramater --enable-shared to the configure command for Linux builds of qtHaskell using GHC version 8.2.x or higher to build dynamically linked versions of qtHaskell.

[3] cabal makefile is only available with GHC versions < 8.2.x. This step and the following gmake command should be replaced with the command runhaskell Setup.hs build otherwise.

[4] add the final paramater -dynamic to the qbe and qbe2 commands for Linux builds of qtHaskell using GHC version 8.2.x or higher to build dynamically linked versions of the examples/demos.