Compiling error - CMakeLists.txt missing

Bugbear
Posts: 30
Joined: Sun Jan 11, 2015 3:45 am

Compiling error - CMakeLists.txt missing

Post by Bugbear » Sun May 24, 2020 5:59 am

Hi all,
Thought I'd come back after an absence of a few years to see what's been happening in the Pioneer universe.

I'm trying to build the game on my Ubuntu system. Getting an error while running the ./bootstrap thirdparty command.

Code: Select all

 /usr/bin/install -c -m 644 SDL2_image.pc '/home/adrian/Documents/Games/Pioneer/pioneer-thirdparty/usr/lib/pkgconfig'
make[2]: Leaving directory '/home/adrian/Documents/Games/Pioneer/pioneer-thirdparty/source/sdl2_image'
make[1]: Leaving directory '/home/adrian/Documents/Games/Pioneer/pioneer-thirdparty/source/sdl2_image'
CMake Error: The source directory "/home/adrian/Documents/Games/Pioneer" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Any idea what's going on here?

Cheers

Bugbear
Posts: 30
Joined: Sun Jan 11, 2015 3:45 am

Re: Compiling error - CMakeLists.txt missing

Post by Bugbear » Mon May 25, 2020 12:09 am

OK, so I've been able to change the nature of the compile error.

I tried running ./bootstrap without the thirdparty parameter, and as expected, got a lot of errors reporting missing dependencies. This time I tried installing them from the ubuntu repository:
- libassimp-dev
- libsigc++-2.0-dev
- libvorbis-dev

Now, after installing these packages, I get a different error when running ./bootstrap:

Code: Select all

-- Version: 6.2.1
-- Build type: RelWithDebInfo
-- CXX_STANDARD: 11
-- Required features: cxx_variadic_templates
-- Configuring done
CMake Error at CMakeLists.txt:282 (add_executable):
  Target "modelcompiler" links to target "Threads::Threads" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at CMakeLists.txt:282 (add_executable):
  Target "modelcompiler" links to target "Threads::Threads" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at CMakeLists.txt:281 (add_executable):
  Target "pioneer" links to target "Threads::Threads" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


-- Generating done
I notice that the final message is "-- Generating done". Sounds like a positive message but given that there are also errors reported, I don't know what to believe. For the sake of science I'm currently running the "make -C build -j4" command to see if it will succeed in building an executable. It's at 20% so far, so I'll report in later with the result...

Bugbear
Posts: 30
Joined: Sun Jan 11, 2015 3:45 am

Re: Compiling error - CMakeLists.txt missing

Post by Bugbear » Mon May 25, 2020 12:53 am

Update time.

Compilation failed - got to 99%, then failed

Code: Select all

[ 97%] Building CXX object src/lua/CMakeFiles/pioneer-lua.dir/LuaVector2.cpp.o
[ 97%] Building CXX object src/lua/CMakeFiles/pioneer-lua.dir/PropertyMap.cpp.o
[ 97%] Building CXX object src/lua/CMakeFiles/pioneer-lua.dir/core/Import.cpp.o
[ 98%] Building CXX object src/lua/CMakeFiles/pioneer-lua.dir/core/Sandbox.cpp.o
[ 98%] Linking CXX static library libpioneer-lua.a
make[2]: Leaving directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer/build'
[ 98%] Built target pioneer-lua
make[2]: Entering directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer/build'
make[2]: Entering directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer/build'
Scanning dependencies of target pioneer
Scanning dependencies of target modelcompiler
make[2]: Leaving directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer/build'
make[2]: Entering directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer/build'
[ 98%] Building CXX object CMakeFiles/modelcompiler.dir/src/modelcompiler.cpp.o
make[2]: Leaving directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer/build'
make[2]: Entering directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer/build'
[ 98%] Building CXX object CMakeFiles/pioneer.dir/src/main.cpp.o
[ 99%] Linking CXX executable modelcompiler
/usr/bin/ld: cannot find -lThreads::Threads
collect2: error: ld returned 1 exit status
CMakeFiles/modelcompiler.dir/build.make:112: recipe for target 'modelcompiler' failed
make[2]: *** [modelcompiler] Error 1
make[2]: Leaving directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer/build'
CMakeFiles/Makefile2:124: recipe for target 'CMakeFiles/modelcompiler.dir/all' failed
make[1]: *** [CMakeFiles/modelcompiler.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Linking CXX executable pioneer
/usr/bin/ld: cannot find -lThreads::Threads
collect2: error: ld returned 1 exit status
CMakeFiles/pioneer.dir/build.make:112: recipe for target 'pioneer' failed
make[2]: *** [pioneer] Error 1
make[2]: Leaving directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer/build'
CMakeFiles/Makefile2:77: recipe for target 'CMakeFiles/pioneer.dir/all' failed
make[1]: *** [CMakeFiles/pioneer.dir/all] Error 2
make[1]: Leaving directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer/build'
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
make: Leaving directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer/build'
So I'm beyond the limits of my knowledge here (when did compiling C++ software get so complicated in the last 20 years?)

I suppose the original error needs to be addressed first, and that's the original ./bootstrap command errors.

Any suggestions?

FluffyFreak
Posts: 1294
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Compiling error - CMakeLists.txt missing

Post by FluffyFreak » Mon May 25, 2020 11:16 am

Hi Bugbear, are you following the instructions for "Linux - CMake" in the COMPILING.txt file?

Yeah I agree about the pain the arse that all this has become, but hopefully we'll get you sorted out pretty quickly!

Bugbear
Posts: 30
Joined: Sun Jan 11, 2015 3:45 am

Re: Compiling error - CMakeLists.txt missing

Post by Bugbear » Wed May 27, 2020 11:25 am

Thanks for the reply FluffyFreak. Don't get me wrong - I'm not criticising the compilation process for Pioneer (and I have gotten it to work in the past. Maybe my machine simply needs a rebuild). I just remember "back in the day" when compiling a HelloWorld.cpp was a single line command :-p

Onto the task at hand. I have tried compiling using the assimp package from the ubuntu repository as well as compiling pioneer-thirdparty explicitly.
This is the state of my system right now.

When I attempt to compile using:

Code: Select all

./bootstrap
... I get...

Code: Select all

-- Version: 6.2.1
-- Build type: RelWithDebInfo
-- CXX_STANDARD: 11
-- Required features: cxx_variadic_templates
-- Configuring done
CMake Error at CMakeLists.txt:282 (add_executable):
  Target "modelcompiler" links to target "Threads::Threads" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at CMakeLists.txt:282 (add_executable):
  Target "modelcompiler" links to target "Threads::Threads" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?


CMake Error at CMakeLists.txt:281 (add_executable):
  Target "pioneer" links to target "Threads::Threads" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


-- Generating done
-- Build files have been written to: /home/xxxxxx/Documents/Games/Pioneer/pioneer/build

When I attempt to compile using:

Code: Select all

./bootstrap thirdparty
... It appears that the thirdparty files are getting compiled, then after about a minute I get ...

Code: Select all

<<<snip>>>
----------------------------------------------------------------------
Libraries have been installed in:
   /home/xxxxxx/Documents/Games/Pioneer/pioneer-thirdparty/usr/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/home/xxxxxx/Documents/Games/Pioneer/pioneer-thirdparty/usr/include/SDL2'
 /usr/bin/install -c -m 644 SDL_image.h '/home/xxxxxx/Documents/Games/Pioneer/pioneer-thirdparty/usr/include/SDL2'
 /bin/mkdir -p '/home/xxxxxx/Documents/Games/Pioneer/pioneer-thirdparty/usr/lib/pkgconfig'
 /usr/bin/install -c -m 644 SDL2_image.pc '/home/xxxxxx/Documents/Games/Pioneer/pioneer-thirdparty/usr/lib/pkgconfig'
make[2]: Leaving directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer-thirdparty/source/sdl2_image'
make[1]: Leaving directory '/home/xxxxxx/Documents/Games/Pioneer/pioneer-thirdparty/source/sdl2_image'
CMake Error at CMakeLists.txt:134 (list):
  list sub-command REMOVE_ITEM requires list to be present.


CMake Error: File /home/xxxxxx/Documents/Games/Pioneer/buildopts.h.cmakein does not exist.
CMake Error at CMakeLists.txt:158 (configure_file):
  configure_file Problem configuring file


CMake Error at CMakeLists.txt:221 (add_subdirectory):
  add_subdirectory given source "contrib/lz4" which is not an existing
  directory.


CMake Error at CMakeLists.txt:222 (add_subdirectory):
  add_subdirectory given source "contrib/fmt" which is not an existing
  directory.


CMake Error at CMakeLists.txt:242 (add_subdirectory):
  add_subdirectory given source "contrib/glew" which is not an existing
  directory.


CMake Error at CMakeLists.txt:243 (add_library):
  add_library cannot create ALIAS target "GLEW::GLEW" because target "glew"
  does not already exist.


CMake Error at CMakeLists.txt:250 (add_subdirectory):
  add_subdirectory given source "contrib/imgui" which is not an existing
  directory.


CMake Error at CMakeLists.txt:251 (add_subdirectory):
  add_subdirectory given source "contrib/jenkins" which is not an existing
  directory.


CMake Error at CMakeLists.txt:252 (add_subdirectory):
  add_subdirectory given source "contrib/PicoDDS" which is not an existing
  directory.


CMake Error at CMakeLists.txt:253 (add_subdirectory):
  add_subdirectory given source "contrib/profiler" which is not an existing
  directory.


CMake Error at CMakeLists.txt:255 (add_subdirectory):
  add_subdirectory given source "contrib/lua" which is not an existing
  directory.


CMake Error at CMakeLists.txt:260 (add_subdirectory):
  add_subdirectory given source "src/core" which is not an existing
  directory.


CMake Error at CMakeLists.txt:265 (add_subdirectory):
  add_subdirectory given source "src/lua" which is not an existing directory.


CMake Error: File /home/xxxxxx/Documents/Games/Pioneer/metadata/net.pioneerspacesim.Pioneer.desktop.cmakein does not exist.
CMake Error at CMakeLists.txt:395 (configure_file):
  configure_file Problem configuring file


-- Configuring incomplete, errors occurred!
See also "/home/xxxxxx/Documents/Games/Pioneer/build/CMakeFiles/CMakeOutput.log".
The location of the pioneer-thirdparty files is interesting.

I've cloned the pioneer code to "/home/xxxxxx/Documents/Games/Pioneer/pioneer". It is from this directory that I'm running bootstrap. Curious that the thridparty files are being put in a sibling folder (i.e. /home/xxxxxx/Documents/Games/Pioneer/pioneer-thirdparty). For some reason I was expecting them to be in "/home/xxxxxx/Documents/Games/Pioneer/pioneer/pioneer-thirdparty"

So once again, FOR SCIENCE!!!, I tried running 'make' against /home/xxxxxx/Documents/Games/Pioneer/pioneer-thirdparty, then running ./bootstrap thirdparty in the pioneer folder.

I get the same errors as when I previously ran ./bootstrap thirdparty

Does this shed any further light on the situation?

FluffyFreak
Posts: 1294
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Compiling error - CMakeLists.txt missing

Post by FluffyFreak » Thu May 28, 2020 10:46 am

`pioneer-thirdparty` is a sibling level project, mostly used on Windows, my advice is to remove that complication because your compilation problem seems to be purely that it can't find "Threads::Threads"

FluffyFreak
Posts: 1294
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Compiling error - CMakeLists.txt missing

Post by FluffyFreak » Thu May 28, 2020 12:05 pm

Suggestions from IRC are to ask if you've installed all of the prerequisite packages?
https://github.com/pioneerspacesim/pion ... NG.txt#L47

FluffyFreak
Posts: 1294
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Compiling error - CMakeLists.txt missing

Post by FluffyFreak » Thu May 28, 2020 4:47 pm

And Sturnclaw says that you might need the "pthreads-devel" package because that's how CMake looks up pthreads... or something.

I am neither a frequent Linux user anymore, nor do I do CMake! :)

sturnclaw
Posts: 48
Joined: Tue Sep 18, 2018 12:20 am

Re: Compiling error - CMakeLists.txt missing

Post by sturnclaw » Thu May 28, 2020 4:59 pm

I'm not a debian / ubuntu native, but Threads::Threads is CMake's "meta target" that links in the posix threads library to enable multithreaded programs to run correctly. It looks like you might not have installed either the pthreads development package (which should be part of the build-essential package), or your version of CMake is sufficiently old that the Threads::Threads target isn't available. If you could double-check your CMake version and upload your whole ./bootstrap log as a pastebin or a post, that'd be nice!

Bugbear
Posts: 30
Joined: Sun Jan 11, 2015 3:45 am

Re: Compiling error - CMakeLists.txt missing

Post by Bugbear » Fri May 29, 2020 12:58 am

When I try to check for the pthreads-devel package, there's no obvious candidate:

Code: Select all

apt-cache search pthreads

libevent-pthreads-2.1-6 - Asynchronous event notification library (pthreads)
libilmbase12 - several utility libraries from ILM used by OpenEXR
libpthread-stubs0-dev - pthread stubs not provided by native libc, development files
blcr-testsuite - Userspace tools to Checkpoint and Restart Linux processes
blcr-util - Userspace tools to Checkpoint and Restart Linux processes
hyphy-pt - Hypothesis testing using Phylogenies (pthreads version)
lib32cr0 - (32bit) Libraries to Checkpoint and Restart Linux processes
libcr-dbg - Libraries to Checkpoint and Restart Linux processes
libcr-dev - Development files for BLCR
libcr0 - Libraries to Checkpoint and Restart Linux processes
libtrilinos-kokkos-dev - Trilinos Kokkos programming model - development files
libtrilinos-kokkos12 - Trilinos Kokkos programming model - runtime files
libzthread-2.3-2 - Object-oriented synchronization library for C++
libzthread-dev - Object-oriented synchronization library for C++
pbzip2 - parallel bzip2 implementation
CMake version according to apt:

Code: Select all

:$ cmake --version

cmake version 3.10.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Latest version is 3.17.3 so I'm a bit behind. I downloaded the latest version, extracted, built and installed it. I did need to uninstall the distro version of cmake, and update my PATH variable to point to the new location but now when I check cmake's version, it points to the latest:

Code: Select all

cmake --version

:$ cmake version 3.17.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Unfortunately, updating cmake doesn't change the results I'm seeing when I run ./bootstrap.

Where would I find the ./bootstrap log?

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests