Compilation issue on Linux

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
pirogronian
Posts: 13
Joined: 05.01.2018
With us: 6 months 16 days

Compilation issue on Linux

Post #1by pirogronian » 05.01.2018, 17:53

Hi.

My attempt to compilation of GIT version of celestia broken with several errors like this:

Code: Select all

src/celephem/scriptorbit.cpp:78:32: error: ‘LUA_GLOBALSINDEX’ was not declared in this scope
         lua_gettable(luaState, LUA_GLOBALSINDEX);


I searched whole project, and found definition of macro LUA_GLOBALSINDEX in
macosx/lua.h and
windows/inc/lua/lua.h


However, there seems to be no definition for Linux. Can You fix that?

Avatar
John Van Vliet
Posts: 2706
Joined: 28.08.2002
With us: 15 years 10 months

Post #2by John Van Vliet » 06.01.2018, 22:42

what github page did you use ?

i know that the qt5 version that i have on mine dose build using qmake-qt5 on my OpenSUSE 42.3 install

https://github.com/JohnVV/MyCelestiaBuild

i have not yet updated it with my working copy on my home system
-- to many bugs yet

this is a NAIF spice build
"cspice" needs to be installed
( see the readme files )

Topic author
pirogronian
Posts: 13
Joined: 05.01.2018
With us: 6 months 16 days

Post #3by pirogronian » 07.01.2018, 19:54

I used oficial github repo: https://github.com/CelestiaProject/Celestia

Sounds interesting, however perhaps it won't replace the original one. However, I'll try to install cspice and compile Your version, then let You know.

Thanks!

Avatar
John Van Vliet
Posts: 2706
Joined: 28.08.2002
With us: 15 years 10 months

Post #4by John Van Vliet » 08.01.2018, 06:38

i really do not care for he Microsoft centric
https://github.com/CelestiaProject/Celestia

qt is cross platform , but i am right now focusing on Linux only
Now i might be merging the code base with a very similar VS 2013 build

just fallow the basic build instructions and have the devel rpm's or dev deb's installed for the prerequisites

if something is missing this will tell you from the error in the output

Code: Select all

qmake-qt5 prefix=/usr ..

Topic author
pirogronian
Posts: 13
Joined: 05.01.2018
With us: 6 months 16 days

Post #5by pirogronian » 08.01.2018, 16:07

Hi John

Is the official Celestia repo Windows-centric? I remember, that Alexel also switch to Qt only, or maybe I'm wrong...

Anyway, I got the same error, while compiling Your sources:

Code: Select all

src/celephem/scriptorbit.cpp:78:32: error: ‘LUA_GLOBALSINDEX’ was not declared in this scope
         lua_gettable(luaState, LUA_GLOBALSINDEX);
                                ^~~~~~~~~~~~~~~~


So perhaps there is something not right with my system, but what?

Edit:
A described here, this is LUA version 5.1 -> 5.2 transition issue. Has Your system Lua 5.1?

Randall
Posts: 1
Joined: 28.05.2018
With us: 1 month 24 days

Cannot compile Celestia 1.6.1

Post #6by Randall » 28.05.2018, 23:42

Hi all:

I spent 2.5 hours fixing problems with the source code for Celestia 1.6.1 on my up-to-date openSuse leap 42.3 linux system, only to discover that apparently Celestia 1.6.1 expects to use the lua library version 5.1, NOT the present version 5.2 which eliminated the LUA_GLOBALSINDEX global variable. The Lua website discusses this. My openSuse is stuck on lua 5.2, not 5.1

Someone with more knowledge than me of lua, is going to have to migrate the Celestia software from lua v5.1 to the newer version 5.2 to fix the compile errors.

I also had to fix lots of compiler warnings and the -Weffc++ flag really needs to be added to catch uninitialized member variables inside the class definitions. One class even had the private variables at the end of the class definition but used these variables for the member functions, it is always a good idea to put the private variables first, as the C++ compiler (in my case g++) can find the reference first, and not be stymied trying to find them as it encouters the member functions.

I also encoutered some include packages missing other mandatory include packages, one such example was the macro square() for the mathlib library.

Anyone know how to migrate from lua v5.1 to lua v5.2?

Avatar
Alexell M
Site Admin
Posts: 279
Joined: 07.10.2010
Age: 24
With us: 7 years 9 months
Location: Moscow, Russia
Contact:

Post #7by Alexell » 28.05.2018, 23:48

Randall, hi. Please check repository on Github. There are already fixes for compatibility with Lua 5.2 and 5.3, especially for Linux.
Admin of celestia.space
PC: Intel Core i7-8700 @ 3.20GHz, SSD, 16 Gb RAM, NVIDIA GeForce GTX 1080, Creative Sound Blaster ZxR. Windows 10 x64.
Phone: iPhone 7 Plus 128 Gb. iOS 11.
Image

Janus
Posts: 200
Joined: 13.08.2016
With us: 1 year 11 months

Post #8by Janus » 29.05.2018, 02:14

I have already updated Lua to 5.3.4 in my fork, which is so far windows only, but the fix should be multiplatform.
There is even a minor improvement in script speed that goes with it.

A warning to those trying to compile Celestia from scratch.
Have copies of or whole support libraries used specifically and only for for Celestia.
Mix and match lib files will drive you nuts tracing random stuff down.


Janus.

randallrathbun
Posts: 4
Joined: 29.05.2018
With us: 1 month 23 days

Post #9by randallrathbun » 29.05.2018, 20:01

Alexell:
I pulled directly from the git site live today, but when I run autoconf, the following errors occur:
configure.ac:9: error: possibly undefined macro: AC_CONFIG_MACRO_DIRS
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:83: error: possibly undefined macro: AM_INIT_AUTOMAKE
configure.ac:84: error: possibly undefined macro: AM_CONFIG_HEADER
configure.ac:86: error: possibly undefined macro: AM_PO_SUBDIRS
configure.ac:91: error: possibly undefined macro: AM_GNU_GETTEXT
configure.ac:99: error: possibly undefined macro: AC_PROG_LIBTOOL
configure.ac:118: error: possibly undefined macro: AC_MSG_RESULT
configure.ac:161: error: possibly undefined macro: AM_CONDITIONAL
configure.ac:200: error: possibly undefined macro: AC_CHECK_COMPILERS
configure.ac:257: error: possibly undefined macro: AM_GCONF_SOURCE_2
configure.ac:296: error: possibly undefined macro: AC_ENABLE_SHARED
configure.ac:297: error: possibly undefined macro: AC_ENABLE_STATIC
configure.ac:300: error: possibly undefined macro: AM_KDE_WITH_NLS
configure.ac:303: error: possibly undefined macro: AC_PATH_KDE
---------
What is wrong?

randallrathbun
Posts: 4
Joined: 29.05.2018
With us: 1 month 23 days

Post #10by randallrathbun » 30.05.2018, 20:52

Alexell:
I used the git clone command to pull the latest, but got the following errors upon running the autoconf command:

owner@linux:~/Celestia> autoconf
configure.ac:9: error: possibly undefined macro: AC_CONFIG_MACRO_DIRS
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:83: error: possibly undefined macro: AM_INIT_AUTOMAKE
configure.ac:84: error: possibly undefined macro: AM_CONFIG_HEADER
configure.ac:86: error: possibly undefined macro: AM_PO_SUBDIRS
configure.ac:91: error: possibly undefined macro: AM_GNU_GETTEXT
configure.ac:99: error: possibly undefined macro: AC_PROG_LIBTOOL
configure.ac:118: error: possibly undefined macro: AC_MSG_RESULT
configure.ac:161: error: possibly undefined macro: AM_CONDITIONAL
configure.ac:200: error: possibly undefined macro: AC_CHECK_COMPILERS
configure.ac:257: error: possibly undefined macro: AM_GCONF_SOURCE_2
configure.ac:296: error: possibly undefined macro: AC_ENABLE_SHARED
configure.ac:297: error: possibly undefined macro: AC_ENABLE_STATIC
configure.ac:300: error: possibly undefined macro: AM_KDE_WITH_NLS
configure.ac:303: error: possibly undefined macro: AC_PATH_KDE

Any ideas what I need to do, to fix these missing macros?

randallrathbun
Posts: 4
Joined: 29.05.2018
With us: 1 month 23 days

Post #11by randallrathbun » 30.05.2018, 21:20

Another update on my attempts to compile celestia from github on an openSuse Leap 42.3 linux system.

A user name emcrisostomo on the github forum writes:

That's correct, in fact. autoconf is telling you that some macros are missing, and they are missing because, as their prefix also suggests, they have not been added yet by the corresponding program (in the case of AM_* macros, automake).

It's a bad idea to run autoconf unless you know exactly which other macros are needed by the package being configured and where they are.

Instead of using autoconf, use autoreconf instead, or better yet, the included autogen.sh script.

This procedure is described in the README and a specific document also exists (README.gnu-build-system).
------
Following his advice I ran the following autoreconf command, which almost was successful, but came up with an error:
owner@linux:~/Celestia> autoreconf
autoreconf: configure.ac: AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION
configure.ac:99: error: required file 'admin/ltmain.sh' not found
autoreconf: automake failed with exit status: 1

Where do I go from here?

randallrathbun
Posts: 4
Joined: 29.05.2018
With us: 1 month 23 days

Post #12by randallrathbun » 30.05.2018, 22:25

I finally got celestia to build on the openSuse Leap v42.3 version using the github clone pull, but I had to carefully do the following steps:

1. Make sure that the lua development and theora development files are installed by Yast.
2. Run the libtoolize command in the local build directory to fix the missing ltmain.sh error message
3. Run the autoreconf command to reconfigure and correctly create the appropriate makefiles.
4. Run the configure command with display type ( I chooose the gtk build: ./configure --with-gtk )
5. Run the make command
6. Run the "make install" command with sudoer privileges

Celestia built without error, I am happy now.

Avatar
Alexell M
Site Admin
Posts: 279
Joined: 07.10.2010
Age: 24
With us: 7 years 9 months
Location: Moscow, Russia
Contact:

Post #13by Alexell » 02.06.2018, 08:26

randallrathbun, I'm happy for you.
Unfortunately, I could not help you, because I do not use Linux and I have no idea about Celestia compilation on Linux.
But I recommend doing a compilation with QT. Perhaps in the future, GTK and others will be deleted.

Added after 55 seconds:
As for Linux, you can always consult with pirogronian. He's a Linux expert.
Admin of celestia.space
PC: Intel Core i7-8700 @ 3.20GHz, SSD, 16 Gb RAM, NVIDIA GeForce GTX 1080, Creative Sound Blaster ZxR. Windows 10 x64.
Phone: iPhone 7 Plus 128 Gb. iOS 11.
Image


Return to “Development”

Who is online

Users browsing this forum: 3 guests