Compiling Hedgewars-0.9.21 from source, a few problems (solved)

1 reply [Last post]
Moonlight
User offline. Last seen 8 years 38 weeks ago. Offline
Joined: 2015-07-13
Posts: 4

I'd like to describe a few problems I got while compiling Hedgewars-0.9.21 from source and the solutions which worked for me.

Quote:
$ uname -a
Linux localhost 2.6.32-alternative #1 SMP Wed Feb 4 07:00:51 MSK 2015 x86_64 GNU/Linux

It was the Debian "Squeeze" operating system, partially updated to "Wheezy"; the Kernel was compiled "by hands".

Out-of-tree building was used, in order to keep the source code clean:

Quote:
$mkdir build
$cd build
$cmake -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="/tmp" -DDATA_INSTALL_DIR="/tmp" -DNOVIDEOREC=1 ..

Off-topic: I wonder why the instruction for in-tree building, "cmake .", is given in the file "INSTALL": it is so uncomfortable...

Problem 0

The source code does not stay clean even in case of out-of-tree building: namely, the files "checkModule.hi" and "checkModule.o" appear in the subdirecotry "cmake_modules".

Solution: in the file "CheckHaskellModuleExists.cmake" after the 32-th line:

Quote:
-c "${CMAKE_MODULE_PATH}/checkModule.hs"

insert the following two lines:

Quote:
-odir ${CMAKE_CURRENT_BINARY_DIR}
-hidir ${CMAKE_CURRENT_BINARY_DIR}

Warning: afther this patching I did not find the files "checkModule.hi" and "checkModule.o" at all, but I was not lazy to check, the module still works correctly, raising an error if a function is absents.

Problem 1

To compile the Hedgewars-0.9.21 server, it is not sufficent to installthe packages mentioned in the "INSTALL" file. The following packagesare also required, but they are not mentioned in the "INSTALL" file:
1) "libghc-vector-dev";
2) "libghc-sha-dev";
3) "libghc-entropy-dev";
4) "libghc-zlib-dev".

Solution: in the file "INSTALL" to the section "For server" add the following lines:

Quote:
- vector package
- sha package
- entropy package
- zlib package

Problem 2

Lua library was not found.

Solution: in the file "cmake_modules/FindLua.cmake" after the 21-th line:

Quote:
find_library(LUA_LIBRARY NAMES lua51 lua5.1 lua-5.1 lua

modify the 22-th line in the following way:

Quote:
PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib /usr/lib/x86_64-linux-gnu)

Problem 3

Surprisingly:

Quote:
"CMake Error: Could not find cmake module file:CMakePascalInformation.cmake"
"CMake Error: Internal CMake error, TryCompile configure of cmake failed"

Analysis: the abslolute path to the source directory contained space bars.

Partial solution: move the source code to another directory, whose absolute path does not contain space bars.

sheepluva
sheepluva's picture
User offline. Last seen 25 min 14 sec ago. Offline
Joined: 2009-07-18
Posts: 563

Thanks for posting! Smile

  sheepluva <- me  my code stats -> 
a Hedgewars Developer


   <- where I'm from  what I speak -> 

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]