celestia won't run from command prompt in linux

General discussion about Celestia that doesn't fit into other forums.
Topic author
karsten
Posts: 8
Joined: 03.07.2006
With us: 18 years 4 months

celestia won't run from command prompt in linux

Post #1by karsten » 03.08.2006, 04:30

hi, i'm trying this in arch linux, and it's not working. it's a 64-bit build:

Code: Select all

$ celestia
Cannot chdir to '${prefix}/share/celestia', probably due to improper installation.

(celestia:13618): Gtk-CRITICAL **: gtk_widget_set_size_request: assertion `width >= -1' failed


./configure was run with --prefix=/usr. any ideas why this would happen? if i use

Code: Select all

$ celestia --dir=/usr/share/celestia


then it works fine.. i'm stumped. thanks for any help..

Abor
Posts: 16
Joined: 07.07.2006
With us: 18 years 4 months

Post #2by Abor » 03.08.2006, 13:29

I'm wondering where that "${prefix}" comes from. Is it possible that it is hardcoded in the binary? I'm using the same prefix in i586 and I can see that expression in the Makefiles, but celestia binary has:

Code: Select all

$ strings /usr/bin/celestia | grep usr
/usr/lib/qt3/lib:/usr/X11R6/lib
/usr/share/locale
/usr/share/celestia
/usr/lib/qt3//include/qvaluelist.h

$ strings /usr/bin/celestia | grep share
_ZN7QString11shared_nullE
/usr/share/locale
/usr/share/celestia

$  strings /usr/bin/celestia | grep prefix
(nothing)

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #3by selden » 03.08.2006, 15:52

$ usually represents the command prompt typed by the operating system, not something that the user should type.

If Celestia is in the user's PATH, then just
celestia
needs to be typed. If it isn't in one of the directories listed in the PATH search list, then the full path needs to be included in the command, maybe something like
/usr/local/bin/celestia/celestia
Selden

Abor
Posts: 16
Joined: 07.07.2006
With us: 18 years 4 months

Post #4by Abor » 03.08.2006, 16:35

Yes, that's true, selden. I think you may have read the first version of my message, where I wrongly wrote "$prefix" (sorry about that).

I meant the "${prefix}" expression inside the error message printed by karsten's celestia. If for some reason the compilation didn't translate it to the specified "/usr", celestia could show a message like that. A check of the binary's strings may clarify it.

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #5by Christophe » 03.08.2006, 19:31

This looks like a build system problem.

A C preprocessor macro is used to set the installation directory: CONFIG_DATA_DIR. This macro is normaly set in the makefile by the autotools. Which source package are you building: 1.4.1 or cvs? and which versions of automake and autoconf are you using?
Christophe

Topic author
karsten
Posts: 8
Joined: 03.07.2006
With us: 18 years 4 months

Post #6by karsten » 03.08.2006, 21:27

hi, thanks for the help, guys :D

looks like automake is at version 1.9.6-1.1, and autoconf is at version 2.60-1. compiled from celestia-1.4.1.tar.gz, using celestia-1.4.0-compile.patch and celestia-lua51.patch.

i agree, it looks like {prefix} isn't getting translated to /usr somewhere. here's the results of searching for /usr:


Code: Select all

$ strings /usr/bin/celestia | grep usr
/usr/share/locale

$ strings /usr/bin/celestia | grep share
${prefix}/share/celestia
/usr/share/locale

$ strings /usr/bin/celestia | grep prefix
${prefix}/share/celestia



how would one go about fixing this? :)

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

re

Post #7by John Van Vliet » 04.08.2006, 06:53

that is odd i did a build on fedora 5 last week and except for the 2 edits in celengine to get it to build with gcc 4.1
and my prefix setting worked fine
but you are doing a 64 bit build , and that being a new os , you may nead to hard code it in the configure .in

it dose sound as there it a bug with the macros

Abor
Posts: 16
Joined: 07.07.2006
With us: 18 years 4 months

Post #8by Abor » 04.08.2006, 15:20

I'd try similar buildings of other apps and report the results to the Arch Linux forums for hints. Meanwhile you can try this bash script before doing "make":

Code: Select all

#!/bin/bash
# Change '${prefix}/share' by '/usr/share' in Celestia's makefiles

case "$1" in

    -w) for mfile in $(find ./ -name Makefile) ; do
        TmP=$(< $mfile)
        echo "$TmP" | sed s/\$\{prefix}\\/share/\\/usr\\/share/ > "$mfile"
        done
        echo "End of write. Run \"${0/*\//} -l\" to check." ;;

     -p) egrep  "(${prefix}/share| /usr/share)" $(find ./ -name Makefile)
         echo "End of list" ;;

      *) echo "Parameters: -p to print. -w to write." ;;
esac


I used it, compiled and run successfully celestia from the build dir. I didn't install but the strings inside the binary are the same as before, except for a double "/usr/lib/qt3//lib" in the libs path.

Topic author
karsten
Posts: 8
Joined: 03.07.2006
With us: 18 years 4 months

Post #9by karsten » 07.08.2006, 03:31

hi thanks abor. i tried that script i don't think i have it working right.. i'm going to take another look at it. thanks :)

Topic author
karsten
Posts: 8
Joined: 03.07.2006
With us: 18 years 4 months

Post #10by karsten » 08.08.2006, 01:37

abor- you're great, it worked perfectly :) i just pasted the write portion into our build script and it did it's thing. no more {prefix} in the executable anymore. thanks a ton

Abor
Posts: 16
Joined: 07.07.2006
With us: 18 years 4 months

Post #11by Abor » 08.08.2006, 19:42

Nice to read that, karsten; you're welcome.

That "build script" sounded strange to me and I googled it a bit. I presume that you are using the pacman facility to compile and integrate the app into your distro, instead of the common "configure && make && make install" that most people use. Those build scripts contain the previous commands plus some other instructions, so you had to insert our crude sed substitution before a "make" line. Obviously this is not the best fix because we're only dirtly-hacking a previous distro-specific error that should be tracked and reported.

Anyway, I'm glad you managed to get it working. Greetings.

Pedja
Posts: 4
Joined: 17.05.2006
With us: 18 years 6 months
Location: Serbia

Re: celestia won't run from command prompt in linux

Post #12by Pedja » 05.08.2007, 02:48

Code: Select all

$ celestia
Cannot chdir to '${prefix}/share/celestia', probably due to improper installation.

(celestia:13618): Gtk-CRITICAL **: gtk_widget_set_size_request: assertion `width >= -1' failed


I had the same problem.
When I added

Code: Select all

--datarootdir=/usr/share
as configure switch,celestia builds and runs just fine :) ( and without ugly hacks ;) )


Return to “Celestia Users”