udoprog / c10t

A minecraft cartography tool
Other
225 stars 50 forks source link

c10t does not compile (anymore) #232

Closed Tmkrth closed 12 years ago

Tmkrth commented 12 years ago

Hello everyone.

Since two weeks or so i cannot compile c10t anymore. cmake tells

CMake Error at /usr/share/cmake/Modules/FindBoost.cmake:1197 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.46.1

  Boost include path: /usr/include

  The following Boost libraries could not be found:

          boost_thread
          boost_filesystem
          boost_system

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.
Call Stack (most recent call first):
  CMakeLists.txt:30 (find_package)

and

CMake Warning (dev) at CMakeLists.txt:56 (add_subdirectory):
  The source directory

    /home/tmk/c10t/libs/unc

  does not contain a CMakeLists.txt file.

  CMake does not support this case but it used to work accidentally and is
  being allowed for compatibility.

Running cmake with smth like --BOOST_LIBRARYDIR=/usr/lib64 or --BOOST_LIBRARYDIR=/usr/include/boost , where on my system boost libs are present, does not change anything. Maybe my syntax is wrong, does anyone has a command example for running cmake with arguments?

Setting "set(Boost_USE_STATIC_LIBS TRUE)" to FALSE in the CMakeLists.txt and running cmake with "-Wno-dev" finds the boost libraries and does not complain about the missing CMakeLists.txt, although this file exists in c10t/

tmk@Heisenberg:~/c10t> ls
ChangeLog  CMakeCache.txt  cmake_install.cmake  CMakeLists.txt~  docs  libs         Makefile   res      src
cmake      CMakeFiles      CMakeLists.txt       dist             gui   LICENSE.txt  README.md  scripts  test
tmk@Heisenberg:~/c10t> cmake -Wno-dev .
-- Boost version: 1.46.1
-- Found the following Boost libraries:
--   thread
--   filesystem
--   system
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tmk/c10t

But, make stops with

tmk@Heisenberg:~/c10t> make -j 4
Scanning dependencies of target c10t-nbt
Scanning dependencies of target c10t-image
Scanning dependencies of target c10t-mc
Scanning dependencies of target c10t-engine
[  2%] [  5%] [  8%] Building CXX object src/nbt/CMakeFiles/c10t-nbt.dir/nbt.cpp.o
[ 10%] Building CXX object src/image/CMakeFiles/c10t-image.dir/image_operations.cpp.o
Building CXX object src/mc/CMakeFiles/c10t-mc.dir/blocks.cpp.o
Building CXX object src/engine/CMakeFiles/c10t-engine.dir/isometric_base.cpp.o
Linking CXX static library libc10t-nbt.a
[ 13%] Building CXX object src/image/CMakeFiles/c10t-image.dir/image_base.cpp.o
[ 13%] Built target c10t-nbt
[ 16%] Building CXX object src/image/CMakeFiles/c10t-image.dir/memory_image.cpp.o
[ 18%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/level.cpp.o
[ 21%] Building CXX object src/engine/CMakeFiles/c10t-engine.dir/flat_base.cpp.o
[ 24%] Building CXX object src/engine/CMakeFiles/c10t-engine.dir/topdown_engine.cpp.o
[ 27%] Building CXX object src/image/CMakeFiles/c10t-image.dir/cached_image.cpp.o
[ 29%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/utils.cpp.o
[ 32%] Building CXX object src/image/CMakeFiles/c10t-image.dir/color.cpp.o
[ 35%] Building CXX object src/engine/CMakeFiles/c10t-engine.dir/oblique_engine.cpp.o
[ 37%] Building CXX object src/image/CMakeFiles/c10t-image.dir/algorithms.cpp.o
[ 40%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/world.cpp.o
[ 43%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/region.cpp.o
[ 45%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/level_info.cpp.o
Linking CXX static library libc10t-image.a
[ 48%] Building CXX object src/engine/CMakeFiles/c10t-engine.dir/obliqueangle_engine.cpp.o
[ 48%] Built target c10t-image
[ 51%] Building CXX object src/engine/CMakeFiles/c10t-engine.dir/isometric_engine.cpp.o
[ 54%] Building CXX object src/engine/CMakeFiles/c10t-engine.dir/fatiso_engine.cpp.o
[ 56%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/region_iterator.cpp.o
[ 59%] Building CXX object src/engine/CMakeFiles/c10t-engine.dir/functions.cpp.o
[ 62%] Building CXX object src/engine/CMakeFiles/c10t-engine.dir/block_rotation.cpp.o
[ 64%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/rotated_level_info.cpp.o
[ 67%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/dynamic_buffer.cpp.o
[ 70%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/marker.cpp.o
Linking CXX static library libc10t-engine.a
[ 70%] Built target c10t-engine
Linking CXX static library libc10t-mc.a
[ 70%] Built target c10t-mc
Scanning dependencies of target c10t
[ 78%] [ 78%] [ 78%] [ 81%] Building CXX object CMakeFiles/c10t.dir/src/main_utils.cpp.o
Building CXX object CMakeFiles/c10t.dir/src/algorithm.cpp.o
Building CXX object CMakeFiles/c10t.dir/src/dlopen.cpp.o
Building CXX object CMakeFiles/c10t.dir/src/main.cpp.o
[ 83%] Building CXX object CMakeFiles/c10t.dir/src/players.cpp.o
[ 86%] Building CXX object CMakeFiles/c10t.dir/src/fileutils.cpp.o
[ 89%] Building CXX object CMakeFiles/c10t.dir/src/dirlist.cpp.o
/home/tmk/c10t/src/main.cpp: In function ‘bool generate_map(std::ostream&, std::ostream&, settings_t&, boost::filesystem3::path&, boost::filesystem3::path&)’:
/home/tmk/c10t/src/main.cpp:606:48: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [enabled by default]
[ 91%] Building CXX object CMakeFiles/c10t.dir/src/altitude_graph.cpp.o
[ 94%] Building CXX object CMakeFiles/c10t.dir/src/warps.cpp.o
[ 97%] Building CXX object CMakeFiles/c10t.dir/src/text.cpp.o
/home/tmk/c10t/src/text.cpp:4:23: fatal error: unc/unc.hpp: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/c10t.dir/src/text.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/c10t.dir/all] Error 2
make: *** [all] Error 2

There is a directory called "unc" in c10t/libs/ but no unc.hpp

I tried this on Suse 12.1, Suse 11.4 and Lubuntu 11.10, all x86_64, whereas on Lubuntu it found the boost libs without the need of editing the CMakeLists.txt file.

Does anyone else experience this? What could I do?

Tmkrth commented 12 years ago

Last revision I can get to work is dated 2011-24-25: 1bed5b0dae9fd1a1b2d1e2fc0c30d8e65d75bf2e

udoprog commented 12 years ago

See README, there is a submodule you need to initialize.

FabianN commented 12 years ago

I just updated and having similar issues

I tried to re-do it from scratch, followed the steps in the readme closely, including the submodules part. This is a copy of my last attempt:

fabiann@melchior:/minecraft$ git clone git@github.com:udoprog/c10t.git
Cloning into c10t...
remote: Counting objects: 11588, done.
remote: Compressing objects: 100% (6304/6304), done.
remote: Total 11588 (delta 5205), reused 11526 (delta 5150)
Receiving objects: 100% (11588/11588), 9.30 MiB | 768 KiB/s, done.
Resolving deltas: 100% (5205/5205), done.
fabiann@melchior:/minecraft$ cd c10t
fabiann@melchior:/minecraft/c10t$ git submodule init
Submodule 'libs/unc' (git://github.com/udoprog/unc.git) registered for path 'libs/unc'
fabiann@melchior:/minecraft/c10t$ git submodule update
Cloning into libs/unc...
remote: Counting objects: 122, done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 122 (delta 54), reused 101 (delta 34)
Receiving objects: 100% (122/122), 1.31 MiB | 124 KiB/s, done.
Resolving deltas: 100% (54/54), done.
Submodule path 'libs/unc': checked out '6eb764fefcd1504d411647a5b23eb4b8f23c1756'
fabiann@melchior:/minecraft/c10t$ mkdir build
fabiann@melchior:/minecraft/c10t$ cd build/
fabiann@melchior:/minecraft/c10t/build$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found ZLIB: /usr/include (found version "1.2.3.4")
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so 
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE 
-- Boost version: 1.42.0
-- Found the following Boost libraries:
--   thread
--   filesystem
--   system
-- Configuring done
-- Generating done
-- Build files have been written to: /minecraft/c10t/build
fabiann@melchior:/minecraft/c10t/build$ make c10t
Scanning dependencies of target c10t-mc
[  2%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/blocks.cpp.o
[  5%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/level.cpp.o
[  7%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/utils.cpp.o
[ 10%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/world.cpp.o
In file included from /minecraft/c10t/src/mc/world.hpp:13:0,
                 from /minecraft/c10t/src/mc/world.cpp:3:
/minecraft/c10t/src/fileutils.hpp: In function ‘std::string path_string(boost::filesystem::path)’:
/minecraft/c10t/src/fileutils.hpp:17:10: error: conversion from ‘boost::filesystem::path’ to non-scalar type ‘std::string’ requested
make[3]: *** [src/mc/CMakeFiles/c10t-mc.dir/world.cpp.o] Error 1
make[2]: *** [src/mc/CMakeFiles/c10t-mc.dir/all] Error 2
make[1]: *** [CMakeFiles/c10t.dir/rule] Error 2
make: *** [c10t] Error 2
cal commented 12 years ago

I get the same error as FabianN, trying to build on an ubuntu system.

udoprog commented 12 years ago

Which version of boost are you using?

The requested position is a boost compatibility hack, if you check it out there is an #if macro with two alternatives, it chooses the wrong functionality for your version.

This is due to a upgrade from filesystem v2 to v3 somewhere around boost 1.45

cal commented 12 years ago
cal@pumpkin:~$ apt-cache show libboost-all-dev | grep Version
Version: 1.42.0.1ubuntu1

Looks like I have 1.42~ish

cal@pumpkin:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10"

Also I guess I haven't upgraded my 'buntu in a bit, looks like the more recent release(s) have 1.46+

Anyway, this is how i made it compile:

cal@pumpkin:/var/minecraft/c10t$ git diff
diff --git a/src/fileutils.hpp b/src/fileutils.hpp
index 9b3b3cd..b27a51a 100644
--- a/src/fileutils.hpp
+++ b/src/fileutils.hpp
@@ -8,7 +8,7 @@
 #include <boost/filesystem.hpp>
 #include <boost/version.hpp>

-#define BOOST_FSv2 ((BOOST_VERSION / 100) <= 1045)
+#define BOOST_FSv2 ((BOOST_VERSION / 100) <= 1041)

 namespace fs = boost::filesystem;

It compiles just fine, but still throws a few warnings ...

In file included from /var/minecraft/c10t/src/threads/renderer.hpp:14,
                 from /var/minecraft/c10t/src/main.cpp:30:
/var/minecraft/c10t/src/cache.hpp: In member function 'bool cache_file::exists()':
/var/minecraft/c10t/src/cache.hpp:46: warning: comparison between signed and unsigned integer expressions
/var/minecraft/c10t/src/cache.hpp: In member function 'bool cache_file::read(boost::shared_ptr<image_operations>)':
/var/minecraft/c10t/src/cache.hpp:144: warning: comparison between signed and unsigned integer expressions
/var/minecraft/c10t/src/main.cpp: In function 'bool generate_map(std::ostream&, std::ostream&, settings_t&, boost::filesystem::path&, boost::filesystem::path&)':
/var/minecraft/c10t/src/main.cpp:606: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object
cal commented 12 years ago

Doesn't render though, looks like the same problem as #231.

I also updated to the latest ubuntu (boost 1.46), it compiles without the code change, I get the same warnings, and the resulting binary doesn't render.

uap-universe commented 12 years ago

@Tmkrth is your issue resolved? Does the submodule thing work for you now?

I would like to close this then and continue the discussion about libboost or other reasons why c10t does not compile or work in the respective issue reports.

Tmkrth commented 12 years ago

No, the submodule thing is not working. Still I can't compile anything newer than 1bed5b0dae9fd1a1b2d1e2fc0c30d8e65d75bf2e

uap-universe commented 12 years ago

And what have you already tried out to get it working?

What error messages appear when you type "git submodule init" or "git submodule update"? I need some information to localize a possible error. To be honest, I still believe you haven't loaded the submodule yet with the respective git commands ;)

Tmkrth commented 12 years ago

Well you are right, somehow I missed that there are two git submodule commands to be executed, which I ask pardon for. It pulls, compiles and renders as nice as c10t just does :-)

chum commented 12 years ago

Are the boost and the unc problems related? I did not see any boost problem, but am having the missing unc.hpp problem, vis:

[ 94%] Building CXX object CMakeFiles/c10t.dir/src/warps.cpp.o
[ 97%] Building CXX object CMakeFiles/c10t.dir/src/text.cpp.o
/.../c10t/udoprog-c10t-8e9f550/src/text.cpp:4:23: error: unc/unc.hpp: No such file or directory
/.../c10t/udoprog-c10t-8e9f550/src/text.cpp: In member function 'void text::font_face::draw(image_ptr, std::string, int, int) const':
/.../c10t/udoprog-c10t-8e9f550/src/text.cpp:77: error: 'unc' has not been declared
/.../c10t/udoprog-c10t-8e9f550/src/text.cpp:77: error: expected `;' before 'text'
/.../c10t/udoprog-c10t-8e9f550/src/text.cpp:79: error: 'unc' has not been declared
/.../c10t/udoprog-c10t-8e9f550/src/text.cpp:79: error: expected `;' before 'it'
/.../c10t/udoprog-c10t-8e9f550/src/text.cpp:79: error: 'it' was not declared in this scope
/.../c10t/udoprog-c10t-8e9f550/src/text.cpp:79: error: expected primary-expression before '.' token
make[2]: *** [CMakeFiles/c10t.dir/src/text.cpp.o] Error 1
make[1]: *** [CMakeFiles/c10t.dir/all] Error 2
make: *** [all] Error 2

This is the first time I've ever tried to build c10t, so I can't comment on differences from earlier builds. I'm also not fluent with make & friends -- I've used them before, but typically build via an IDE, so have been shielded from the low level stuff for several years (decades!)

I'm following the steps on this page:

https://github.com/udoprog/c10t/wiki/Building-on-Mac-OS-X

and everything went well up until this very last bit. (Several warnings, but this was the only error.) I'm running on Mac-OS-X Lion (latest.)

Any help would be appreciated.

Thanks!

chum commented 12 years ago

P.S. All downloads -- c10t, boost, cmake, etc. -- were today & yesterday, so freshly installed.

chum commented 12 years ago

Bah! Sorry for the spamming -- a friend walked me through it. I was missing the steps where you

git submodule init
git submodule update

to get unc. I updated the building for OS-X wiki page. Hope that helps future Mac users.