Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in building on a 64-bit machine #97

Closed
pvonmoradi opened this issue Oct 3, 2018 · 16 comments
Closed

Problem in building on a 64-bit machine #97

pvonmoradi opened this issue Oct 3, 2018 · 16 comments

Comments

@pvonmoradi
Copy link

pvonmoradi commented Oct 3, 2018

I've installed qt4 and lua dependencies on my machine. Then as per @randallrathbun instructions over at forum, I ran libtoolize, autoreconf and ./configure --prefix=/usr --with-qt --with-lua --with-cspice-dir=/path_to_folder/Celestia/cspice/ (Also downloaded cspice library).
Now when I make, I'm presented with the following error:

make  all-recursive
  2 make[1]: Entering directory 'path_to_folder/Celestia'
  3 Making all in src
  4 make[2]: Entering directory 'path_to_folder/Celestia/src'
  5 Making all in celutil
  6 make[3]: Entering directory 'path_to_folder/Celestia/src/celutil'
  7 make[3]: Nothing to be done for 'all'.
  8 make[3]: Leaving directory 'path_to_folder/Celestia/src/celutil'
  9 Making all in celmath
 10 make[3]: Entering directory 'path_to_folder/Celestia/src/celmath'
 11 make[3]: Nothing to be done for 'all'.
 12 make[3]: Leaving directory 'path_to_folder/Celestia/src/celmath'
 13 Making all in cel3ds
 14 make[3]: Entering directory 'path_to_folder/Celestia/src/cel3ds'
 15 make[3]: Nothing to be done for 'all'.
 16 make[3]: Leaving directory 'path_to_folder/Celestia/src/cel3ds'
 17 Making all in celtxf
 18 make[3]: Entering directory 'path_to_folder/Celestia/src/celtxf'
 19 make[3]: Nothing to be done for 'all'.
 20 make[3]: Leaving directory 'path_to_folder/Celestia/src/celtxf'
 21 Making all in celengine
 22 make[3]: Entering directory 'path_to_folder/Celestia/src/celengine'
 23 make[3]: Nothing to be done for 'all'.
 24 make[3]: Leaving directory 'path_to_folder/Celestia/src/celengine'
 25 Making all in celephem
 26 make[3]: Entering directory 'path_to_folder/Celestia/src/celephem'
 27 make[3]: Nothing to be done for 'all'.
 28 make[3]: Leaving directory 'path_to_folder/Celestia/src/celephem'
 29 Making all in celmodel
 30 make[3]: Entering directory 'path_to_folder/Celestia/src/celmodel'
 31 make[3]: Nothing to be done for 'all'.
 make[3]: Leaving directory 'path_to_folder/Celestia/src/celmodel'
 33 Making all in celestia
 34 make[3]: Entering directory 'path_to_folder/Celestia/src/celestia'
 35 Making all in qt
 36 make[4]: Entering directory 'path_to_folder/Celestia/src/celestia/qt'
 37 make[4]: *** No rule to make target 'qtcelestiaactions.h', needed by 'qtcelestiaactions.moc.cpp'.  Stop    .
 38 make[4]: Leaving directory 'path_to_folder/Celestia/src/celestia/qt'
 39 Makefile:1048: recipe for target 'all-recursive' failed
 40 make[3]: *** [all-recursive] Error 1
 41 make[3]: Leaving directory 'path_to_folder/Celestia/src/celestia'
 42 Makefile:612: recipe for target 'all-recursive' failed
 43 make[2]: *** [all-recursive] Error 1
 44 make[2]: Leaving directory 'path_to_folder/Celestia/src'
 45 Makefile:688: recipe for target 'all-recursive' failed
 46 make[1]: *** [all-recursive] Error 1
 47 make[1]: Leaving directory 'path_to_folder/Celestia'
 48 Makefile:578: recipe for target 'all' failed
 49 make: *** [all] Error 2

What is the problem?

@375gnu
Copy link
Member

375gnu commented Oct 3, 2018

Those instructions are outdated.
1st you need qt5, not 4.
2nd you need to use qmake instead of autotools (configure script)

mkdir build && cd build
qmake -qt=5 PREFIX=/opt/celestia -o Makefile ../celestia.pro
make

Nonstandard spice locations are not supported yet so to compile with it put it into /usr/local/cspice/ or edit files celestia.pro lines 670, 671 and config.tests/spice/spice.pro lines 12,13.

@pvonmoradi
Copy link
Author

@375gnu OK. I installed sudo apt install qt5-default build-essential. Now I get this error after your instructions:

make -qt=5 PREFIX=/opt/celestia -o Makefile ../celestia.pro
Info: creating stash file /home/path-to-folder/Celestia/build/.qmake.stash
Info: creating cache file /home/path-to-folder/Celestia/build/.qmake.cache
Checking for spice... no
Checking for byteswap... yes
Checking for eigen... no
Checking for glew... no
Project ERROR: Unknown module(s) in QT: multimedia

@pvonmoradi
Copy link
Author

pvonmoradi commented Oct 3, 2018

sudo apt install qtmultimedia5-dev was also needed. I also changed those two occurrences for my non-standard cpsice path...Building now...
Another error:

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DGIT_COMMIT=\"80a1abbd\" -DGLEW_STATIC -DCELX -DHAVE_BYTESWAP_H -DEIGEN_NO_DEBUG -DNDEBUG -DNO_DEBUG -DTHEORA -DLUA_VER    =0x050100 -DCONFIG_DATA_DIR=\"/opt/celestia/share/Celestia_QT\" -DSPLASH_DIR=\"/opt/celestia/share/Celestia_QT/splash/\" -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_L    IB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/home/path_to_folder/Celestia -I. -I/home/path_to_folder/Celestia/thirdparty/glew/i    nclude -I/home/path_to_folder/Celestia -I/home/path_to_folder/Celestia/src -I/home/path_to_folder/Celestia/thirdparty/Eigen -I/home/path_to_folder/Celestia/thirdpart    y/curveplot/include -isystem /usr/include/libdrm -isystem /usr/include/lua5.1 -isystem /usr/include/libpng16 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr    /include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem /usr/inc    lude/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtXml -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-li    nux-gnu/qt5/QtCore -Imoc -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o obj/asterism.o /home/path_to_folder/Celestia/src/celen    gine/asterism.cpp
  2 In file included from /usr/include/c++/7/cstdio:42:0,
  3                  from /usr/include/c++/7/ext/string_conversions.h:43,
  4                  from /usr/include/c++/7/bits/basic_string.h:6349,
  5                  from /usr/include/c++/7/string:52,
  6                  from /home/path_to_folder/Celestia/src/celutil/util.h:15,
  7                  from /home/path_to_folder/Celestia/src/celengine/asterism.cpp:18:
  8 /usr/include/stdio.h:340:12: error: declaration of ‘int snprintf(char*, size_t, const char*, ...) throw ()’ has a different exception specifier
  9  extern int snprintf (char *__restrict __s, size_t __maxlen,
 10             ^~~~~~~~
 11 In file included from /home/path_to_folder/Celestia/src/celengine/asterism.cpp:14:0:
 12 /home/path_to_folder/Celestia/config.h:260:5: note: from previous declaration ‘int snprintf(char*, size_t, const char*, ...)’
 13  int snprintf(char *str, size_t n, char const *fmt, ...);
 14      ^~~~~~~~
 15 In file included from /usr/include/c++/7/cstdio:42:0,
 16                  from /usr/include/c++/7/ext/string_conversions.h:43,
 17                  from /usr/include/c++/7/bits/basic_string.h:6349,
 18                  from /usr/include/c++/7/string:52,
 19                  from /home/path_to_folder/Celestia/src/celutil/util.h:15,
 20                  from /home/path_to_folder/Celestia/src/celengine/asterism.cpp:18:
 21 /usr/include/stdio.h:344:12: error: declaration of ‘int vsnprintf(char*, size_t, const char*, __va_list_tag*) throw ()’ has a different exception specifier
 22  extern int vsnprintf (char *__restrict __s, size_t __maxlen,
 23             ^~~~~~~~~
 24 In file included from /home/path_to_folder/Celestia/src/celengine/asterism.cpp:14:0:
 25 /home/path_to_folder/Celestia/config.h:256:5: note: from previous declaration ‘int vsnprintf(char*, size_t, const char*, __va_list_tag*)’
 26  int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
 27      ^~~~~~~~~
 28 Makefile:6969: recipe for target 'obj/asterism.o' failed
 29 make: *** [obj/asterism.o] Error 1

@375gnu
Copy link
Member

375gnu commented Oct 4, 2018

@pvonmoradi please delete config.h (/home/path_to_folder/Celestia/config.h), it's left by configure invocation and has incorrect data.

@pvonmoradi
Copy link
Author

@375gnu After build, I ran sudo make install. Here is the new error :(
A splash screen loads some stuff then an error dialog appears showing "Cannot read star database"

/Celestia/build$ sudo ./Celestia_QT 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Segmentation fault

@375gnu
Copy link
Member

375gnu commented Oct 4, 2018

Why do you run it with sudo?

@pvonmoradi
Copy link
Author

pvonmoradi commented Oct 4, 2018

@375gnu ./Celestia_QT throws similar error and it prints only a seg falult at terminal. sudo adds the line QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'

@375gnu
Copy link
Member

375gnu commented Oct 4, 2018

Quite interesting.

Do the following:

cd build
make clean

then edit Makefile, find CXXFLAGS and add -g to its values, so you get something like

CXXFLAGS      = -g -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)

then run make and execute celestia under gdb:

gdb ./Celesta_QT
run
bt
quit

and post output here.

@pvonmoradi
Copy link
Author

@375gnu Shouldn't I run sudo make install for the new binary?
Here is my CXXFLAGS:
CXXFLAGS = -g -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)

  1 $ gdb ./Celestia_QT 
  2 GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
  3 Copyright (C) 2018 Free Software Foundation, Inc.
  4 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  5 This is free software: you are free to change and redistribute it.
  6 There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  7 and "show warranty" for details.
  8 This GDB was configured as "x86_64-linux-gnu".
  9 Type "show configuration" for configuration details.
 10 For bug reporting instructions, please see:
 11 <http://www.gnu.org/software/gdb/bugs/>.
 12 Find the GDB manual and other documentation resources online at:
 13 <http://www.gnu.org/software/gdb/documentation/>.
 14 For help, type "help".
 15 Type "apropos word" to search for commands related to "word"...
 16 Reading symbols from ./Celestia_QT...run
 17 done.
 18 (gdb) run
 19 Starting program: /home/path_to_folder/Celestia/build/Celestia_QT 
 20 [Thread debugging using libthread_db enabled]
 21 Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
 22 [New Thread 0x7fffe842a700 (LWP 13963)]
 23 [New Thread 0x7fffe71d2700 (LWP 13964)]
 24 [New Thread 0x7fffdeac3700 (LWP 13966)]
 25 [New Thread 0x7fffddc9a700 (LWP 13967)]
 26 [New Thread 0x7fffdd499700 (LWP 13968)]
 27 [New Thread 0x7fffdcc98700 (LWP 13969)]
 28 [New Thread 0x7fffc3fff700 (LWP 13970)]
 29 
 30 Thread 1 "Celestia_QT" received signal SIGSEGV, Segmentation fault.
 31 Simulation::getSyncTime (this=0x0) at /home/path_to_folder/Celestia/src/celengine/simulation.cpp:504
 32 504     return syncTime;
 33 (gdb) bt
 34 #0  Simulation::getSyncTime (this=0x0) at /home/path_to_folder/Celestia/src/celengine/simulation.cpp:504
 35 #1  0x00005555556fe0d5 in CelestiaQt::CelestiaAppWindow::createMenus (this=this@entry=0x7fffffffdc60)
 36     at /home/path_to_folder/Celestia/src/celestia/qt/qtappwin.cpp:1317
 37 #2  0x00005555556ff527 in CelestiaQt::CelestiaAppWindow::init (this=0x7fffffffdc60, qConfigFileName=..., 
 38     qExtrasDirectories=...) at /home/path_to_folder/Celestia/src/celestia/qt/qtappwin.cpp:281
 39 #3  0x000055555559ce5c in main (argc=<optimized out>, argv=<optimized out>)
 40     at /home/path_to_folder/Celestia/src/celestia/qt/qtmain.cpp:125

@375gnu
Copy link
Member

375gnu commented Oct 4, 2018

omg, it looks like we have a weird bug with app initialization.

Shouldn't I run sudo make install for the new binary?

not now, for test purposes we can run it from a build dir

@pvonmoradi could you provide your compiled Celestia_QT somewhere?

I'll try to compile it under Ubuntu 18.04 on weekend and compare with yours.

@pvonmoradi
Copy link
Author

@375gnu Here it is (valid for 14 days)

@375gnu
Copy link
Member

375gnu commented Oct 5, 2018

@pvonmoradi could you try this workaround:
export CELESTIA_DATA_DIR=/home/path_to_folder/Celestia

and then run celesta binary?

It looks we don't install everything, I should notice

A splash screen loads some stuff then an error dialog appears showing "Cannot read star database"

but I missed it and concentrated on a segfault. So we have 2 issues.

@pvonmoradi
Copy link
Author

@375gnu exported that shell variable.
Program runs with a dialogue about bein unable to find bookmarks and then the main window renders.
I guess it solved the problem?

$ ./Celestia_QT 
Initializing ARB vertex programs . . .
Loading ARB vertex program: shaders/diffuse_arb.vp
Loading ARB vertex program: shaders/specular_arb.vp
Loading ARB vertex program: shaders/haze_arb.vp
Loading ARB vertex program: shaders/bumpdiffuse_arb.vp
Loading ARB vertex program: shaders/bumphaze_arb.vp
Loading ARB vertex program: shaders/shadowtex_arb.vp
Loading ARB vertex program: shaders/diffuse_texoff_arb.vp
Loading ARB vertex program: shaders/rings_arb.vp
Loading ARB vertex program: shaders/ringshadow_arb.vp
Loading ARB vertex program: shaders/night_arb.vp
Loading ARB vertex program: shaders/glossmap_arb.vp
Loading ARB vertex program: shaders/diffuse2_arb.vp
Loading ARB vertex program: shaders/haze2_arb.vp
Loading ARB vertex program: shaders/diffuse_texoff2_arb.vp
Loading ARB vertex program: shaders/specular2_arb.vp
Loading ARB vertex program: shaders/night2_arb.vp
Loading ARB vertex program: shaders/star_arb.vp
Loading ARB vertex program: shaders/multishadow_arb.vp
Loading ARB vertex program: shaders/texphong_arb.vp
Loading ARB vertex program: shaders/texphong_alpha_arb.vp
Loading ARB vertex program: shaders/ell_galaxy_arb.vp
All ARB vertex programs loaded successfully.
render path: 8

@pvonmoradi
Copy link
Author

That dialog about bookmarks doesn't show up the second time.
Here is the approximate startup time on my AMD E1 machine:

real	0m13.845s
user	0m10.579s
sys	0m2.320s

375gnu added a commit to 375gnu/Celestia that referenced this issue Oct 5, 2018
@375gnu
Copy link
Member

375gnu commented Oct 5, 2018

At least temporary, a proper fix is in #99. You can try to compile it instead of using the workaround.

@pvonmoradi
Copy link
Author

@375gnu thanks for your help :)

@375gnu 375gnu closed this as completed Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants