Need help with compiling Celestia

The place to discuss creating, porting and modifying Celestia's source code.
Avatar
Topic author
SevenSpheres
Moderator
Posts: 826
Joined: 08.10.2019
With us: 5 years 2 months

Need help with compiling Celestia

Post #1by SevenSpheres » 07.04.2020, 18:29

In part prompted by the Enhanced Celestia Project, I've decided to try compiling Celestia myself. I'm following the instructions in INSTALL.md and I've already installed Visual Studio, cmake, vcpkg, and everything that needs to be installed through vcpkg. Now I'm trying to build Celestia, and I'm getting errors; apparently there are several things missing. Does anyone know what I'm doing wrong here?

Command line output, 32-bit build:

Code: Select all

D:\GitHub\Celestia\build32>cmake -DCMAKE_TOOLCHAIN_FILE=D:/GitHub/vcpkg/scripts/buildsystems/vcpkg.cmake ..
-- Building for: Visual Studio 16 2019
CMake Warning at D:/GitHub/vcpkg/scripts/buildsystems/vcpkg.cmake:124 (message):
  There are no libraries installed for the Vcpkg triplet x64-windows.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.17/Modules/CMakeDetermineSystem.cmake:93 (include)
  CMakeLists.txt:17 (project)


-- The C compiler identification is MSVC 19.25.28612.0
-- The CXX compiler identification is MSVC 19.25.28612.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Gettext (missing: GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE)
CMake Warning at CMakeLists.txt:100 (message):
  Gettext is not found, traslations won't be created.


CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Failed to find Gettext libintl (missing: Intl_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindIntl.cmake:60 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  D:/GitHub/vcpkg/scripts/buildsystems/vcpkg.cmake:286 (_find_package)
  CMakeLists.txt:104 (find_package)


-- Configuring incomplete, errors occurred!
See also "D:/GitHub/Celestia/build32/CMakeFiles/CMakeOutput.log".


Log file, 32-bit build:
CMakeOutput.log
(10.78 KiB) Downloaded 308 times


Command line output, 64-bit build:

Code: Select all

D:\GitHub\Celestia\build64>cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_TOOLCHAIN_FILE=D:/GitHub/vcpkg/scripts/buildsystems/vcpkg.cmake ..
CMake Warning at D:/GitHub/vcpkg/scripts/buildsystems/vcpkg.cmake:124 (message):
  There are no libraries installed for the Vcpkg triplet x64-windows.
Call Stack (most recent call first):
  build64/CMakeFiles/3.17.0/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:17 (project)


-- Could NOT find Gettext (missing: GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE)
CMake Warning at CMakeLists.txt:100 (message):
  Gettext is not found, traslations won't be created.


CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Failed to find Gettext libintl (missing: Intl_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindIntl.cmake:60 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  D:/GitHub/vcpkg/scripts/buildsystems/vcpkg.cmake:286 (_find_package)
  CMakeLists.txt:104 (find_package)


-- Configuring incomplete, errors occurred!
See also "D:/GitHub/Celestia/build64/CMakeFiles/CMakeOutput.log".


Log file, 64-bit build:
CMakeOutput.log
(10.78 KiB) Downloaded 289 times
My Addons: viewtopic.php?f=23&t=19978 • Discord server admin
Celestia versions: 1.5.1, 1.6.1, 1.6.2, 1.7.0, and some unofficial versions like Celestia-ED

Janus
Posts: 537
Joined: 13.08.2016
With us: 8 years 4 months

Post #2by Janus » 07.04.2020, 22:39

I can't help you with the vcpkg & cmake issues, which is what you are fighting.

I can however offer you a VS2015 static link source tree, (Commit 5772), with support libraries ready to compile.
You can use it directly if you install and select the VS2015 compiler setup for VS2019.
I have not used it that way myself, but there are options in the install that I saw.

Having lots of fun assembling new hardware after some kinetically assisted failures.
Loaner system from a customer came with VS2019, and I am not really impressed by it.
I still prefer VS2010 or VS2013, both which however, are a complete joke when it comes to doing 64-bit.


Janus.

Avatar
Topic author
SevenSpheres
Moderator
Posts: 826
Joined: 08.10.2019
With us: 5 years 2 months

Post #3by SevenSpheres » 07.04.2020, 22:46

Janus, thanks, but I want to be able to compile the code directly from GitHub so that I can potentially contribute to development (more than I already have, that is). I don't just want binaries built from the latest source; I'm aware of and have used both your forks and the Appveyor builds for that purpose.

Added after 2 hours 19 minutes:
I've figured it out. I think. To make the build work (even the 32-bit build) I had to install 64-bit versions of the vcpkg packages, like this:

Code: Select all

vcpkg install libpng:x64-windows libjpeg-turbo:x64-windows gettext:x64-windows lua:x64-windows fmt:x64-windows glew:x64-windows eigen3:x64-windows qt5:x64-windows luajit:x64-windows

This means that it's impossible to compile Celestia on 32-bit Windows systems.

Added after 14 minutes 19 seconds:
So I still don't have an executable; cmake just generated some .sln and .vcxproj files that I think are for Visual Studio, but I have no idea what to do with them. Why aren't there instructions for this part of the build?
My Addons: viewtopic.php?f=23&t=19978 • Discord server admin
Celestia versions: 1.5.1, 1.6.1, 1.6.2, 1.7.0, and some unofficial versions like Celestia-ED

Janus
Posts: 537
Joined: 13.08.2016
With us: 8 years 4 months

Post #4by Janus » 08.04.2020, 04:00

@SevenSpheres

You did better than I did when I tried to get vcpkg working.
I got absolutely nowhere with it.
The system I was handed by customer as a loaner has VS2015/17/19 on it, but vcpkg.exe is nowhere.
Besides, unless it can keep separate repositories for each VS version, it accomplishes nothing for me.
I need more than that, but I can swap out directories based on project if need be, but by VS version is to much work..

As for the files you got, open the .sln or .vcxproj files with VS via file:open or drag & drop.

The first build will take quite a while because of locating and downloading required libraries, and possibly compiling them as well.
Good luck.


Janus.

onetwothree
Site Admin
Posts: 706
Joined: 22.09.2018
With us: 6 years 2 months

Post #5by onetwothree » 08.04.2020, 13:24

Use correct *.bat file provided with studio, it provides them for x86 and x64 toolchanins.

Avatar
Topic author
SevenSpheres
Moderator
Posts: 826
Joined: 08.10.2019
With us: 5 years 2 months

Post #6by SevenSpheres » 08.04.2020, 16:09

Janus wrote:As for the files you got, open the .sln or .vcxproj files with VS via file:open or drag & drop.

I did figure out what to do with those files yesterday (with Sirius_Alpha's help), but when I tried to compile I got an error:

vserror.png
vserror.png (4.33 KiB) Viewed 16131 times

I then tried uninstalling VS2019 and installing VS2017. I tried to compile again and it showed this:

vserror3.png
vserror3.png (4.49 KiB) Viewed 16131 times

Clicking "Yes" resulted in the same error I got the first time; clicking "No", the error list was empty:

noerrors.png
noerrors.png (8.05 KiB) Viewed 16131 times

It would be great if anyone could help me out here...

onetwothree wrote:Use correct *.bat file provided with studio, it provides them for x86 and x64 toolchanins.

And where would I find these files? I was following the instructions in INSTALL.md, it doesn't say anything about batch files.
My Addons: viewtopic.php?f=23&t=19978 • Discord server admin
Celestia versions: 1.5.1, 1.6.1, 1.6.2, 1.7.0, and some unofficial versions like Celestia-ED

onetwothree
Site Admin
Posts: 706
Joined: 22.09.2018
With us: 6 years 2 months

Post #7by onetwothree » 08.04.2020, 19:01

SevenSpheres wrote:And where would I find these files?

In the "start" menu. Is it so hard to check your system?

SevenSpheres wrote:I was following the instructions in INSTALL.md, it doesn't say anything about batch files.

Because it's about how to compile Celestia, not how to use visual studio.

Avatar
Topic author
SevenSpheres
Moderator
Posts: 826
Joined: 08.10.2019
With us: 5 years 2 months

Post #8by SevenSpheres » 08.04.2020, 19:24

onetwothree wrote:In the "start" menu. Is it so hard to check your system?

I don't know what these files are called, all you've said is that they're batch files that come with Visual Studio and install vcpkg packages (I think?)
I could spend lots of time trying to find them, or you could just tell me what they're called.

Added after 4 minutes 45 seconds:
In any case I already have the packages installed, what I'm trying to do now is get VS to compile Celestia without errors.

Added after 5 minutes 24 seconds:
onetwothree wrote:Because it's about how to compile Celestia, not how to use visual studio.

The instructions should at least say that the end result is a Visual Studio project file, not an executable as I expected.

Added after 22 minutes 36 seconds:
Maybe I'll just try Appveyor again. onetwothree what are your Appveyor settings? With the default settings Celestia won't compile.

Added after 1 hour 19 minutes:
Decided I might as well completely ignore INSTALL.md and just start from scratch in Visual Studio. I cloned the Celestia repository, and eventually figured out how to compile it (right-click on CMakeLists.txt and click "Build"). The program doesn't seem to have fully compiled, but there was an executable buried under quite literally half a dozen folders (out/build/x64-Debug/src/celestia/qt). I copied the exe along with associated dlls to the main Celestia directory and tried to run it, and got this error message:

nthcompileerror.png


When I click "Retry", nothing happens. I think these files are some kind of artifacts of the build process and aren't supposed to actually work? In any case... I'm still stuck! How do I get Celestia to fully compile? :help:
My Addons: viewtopic.php?f=23&t=19978 • Discord server admin
Celestia versions: 1.5.1, 1.6.1, 1.6.2, 1.7.0, and some unofficial versions like Celestia-ED

Janus
Posts: 537
Joined: 13.08.2016
With us: 8 years 4 months

Post #9by Janus » 09.04.2020, 00:55

Welcome to assertion H$LL, C++ purgatory.

I never build debug if the source contains asserts.
Checks for errors yes, but asserts have never been worth messing with for me.
If you need to trace, do a traceable build with pdb, map & debugable assembly.

Have fun.


Janus.

Avatar
Topic author
SevenSpheres
Moderator
Posts: 826
Joined: 08.10.2019
With us: 5 years 2 months

Post #10by SevenSpheres » 09.04.2020, 01:34

Janus, keep in mind that I'm very new to Visual Studio; I installed it just 2 days ago. I really have no idea what you mean. I don't want a debug build, I want an actual full build, but it seems VS generated a debug build. What setting do I need to change to make VS generate a real build?
My Addons: viewtopic.php?f=23&t=19978 • Discord server admin
Celestia versions: 1.5.1, 1.6.1, 1.6.2, 1.7.0, and some unofficial versions like Celestia-ED

Janus
Posts: 537
Joined: 13.08.2016
With us: 8 years 4 months

Post #11by Janus » 09.04.2020, 03:12

@SevenSpheres

Let me be clear, I AM NOT A VS EXPERT, just someone faking their way through.
I spend more time in assembly than C & C++ combined, and prefer it.
It gets tiring dealing with C/C++ dialects, and the latter's love of virtualization & indirection.

Open the sln with VS.
Across the top will be menus (Hit F10 or alt-F if they are not) file:edit:view ...
Approximately under build : debug : test will be two drop downs.
The first is the build type, the second the processor.
Right now the first will say debug (of some sort), change that to release (Final or other word that means the same.).
The second may say win32 or x86 or x64, select which ever you like.
The variety of labels I have seen those two is crazy, I should make a list to send to xkcd.

Do a build:clean before doing a Build:build solution.

Good luck.


Janus.

onetwothree
Site Admin
Posts: 706
Joined: 22.09.2018
With us: 6 years 2 months

Post #12by onetwothree » 09.04.2020, 05:32

SevenSpheres wrote:Maybe I'll just try Appveyor again. onetwothree what are your Appveyor settings? With the default settings Celestia won't compile.
everything is inside .appveyor.yml

Avatar
Topic author
SevenSpheres
Moderator
Posts: 826
Joined: 08.10.2019
With us: 5 years 2 months

Post #13by SevenSpheres » 09.04.2020, 16:35

onetwothree wrote:everything is inside .appveyor.yml

Well, I connected my fork to Appveyor and made a simple commit (changing orbit/label colors), and it wouldn't compile.

Added after 30 minutes 45 seconds:
Also, thanks Janus.
My Addons: viewtopic.php?f=23&t=19978 • Discord server admin
Celestia versions: 1.5.1, 1.6.1, 1.6.2, 1.7.0, and some unofficial versions like Celestia-ED

Avatar
Gurren Lagann
Posts: 434
Joined: 31.01.2018
Age: 18
With us: 6 years 10 months
Location: State of Rio de Janeiro, Brazil

Post #14by Gurren Lagann » 09.04.2020, 17:24

This may or may not be related to this thread, but I'm also trying to compile Celestia (actually, Cel+) using AppVeyor, and I keep hitting a roadblock that I cant solve!

There's this piece of code in .appveyor.xml:

Code: Select all

only_commits:
  files:
  - src/
  - .appveyor.yml
  - CMakeLists.txt

...and I don't seem to be able to recreate this part in the AppVeyor UI settings, and (I think) because of that, this error keeps appearing in the log:

Code: Select all

CMake Error: Error processing file: C:/Tools/vcpkg/scripts/get_triplet_environment.cmake
(This is on Line 2874)
Can any dev help me in this case? Where and how do I apply that piece of code in the AppVeyor UI settings?
"The tomorrow we're trying to reach is not a tomorrow you had decided on!"
- Simon the Digger
"Nothing is impossible for me, as long I'm determinated to keep moving forward!"
"If other people aren't going to do it, I'm going to do it myself!"
- Me (Gurren)

Current major projects:
- Aur Cir
- Cel+
- Project Sisyphus
- Populating the Local Group
- An galaxy generator

Avatar
Topic author
SevenSpheres
Moderator
Posts: 826
Joined: 08.10.2019
With us: 5 years 2 months

Post #15by SevenSpheres » 09.04.2020, 17:29

That's why I gave up on Appveyor and used Visual Studio. I have it sort of working now.
My Addons: viewtopic.php?f=23&t=19978 • Discord server admin
Celestia versions: 1.5.1, 1.6.1, 1.6.2, 1.7.0, and some unofficial versions like Celestia-ED

onetwothree
Site Admin
Posts: 706
Joined: 22.09.2018
With us: 6 years 2 months

Post #16by onetwothree » 09.04.2020, 18:17

Gurren Lagann wrote:Can any dev help me in this case? Where and how do I apply that piece of code in the AppVeyor UI settings?

afair i only have filename set in UI (.appveyor.yml instead of default appveyor.yml).

and why do you want it? it's required only to build pull requests

Added after 3 minutes 35 seconds:
no, without even this. only project name is set. so essentially everything is configured through yaml file

Avatar
Gurren Lagann
Posts: 434
Joined: 31.01.2018
Age: 18
With us: 6 years 10 months
Location: State of Rio de Janeiro, Brazil

Post #17by Gurren Lagann » 09.04.2020, 19:09

I put literally everything else, and the CMake error simply wont leave the builds alone...
"The tomorrow we're trying to reach is not a tomorrow you had decided on!"
- Simon the Digger
"Nothing is impossible for me, as long I'm determinated to keep moving forward!"
"If other people aren't going to do it, I'm going to do it myself!"
- Me (Gurren)

Current major projects:
- Aur Cir
- Cel+
- Project Sisyphus
- Populating the Local Group
- An galaxy generator


Return to “Development”