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

Package dependency when building on debian #635

Closed
PSE-AG opened this Issue Jul 6, 2016 · 35 comments

Comments

Projects
None yet
6 participants
@PSE-AG
Copy link

PSE-AG commented Jul 6, 2016

Hi

I'm currently running on a debian 7.11, cmake version 2.8.9 and tried to compile the package by myself.

I checked https://github.com/sqlitebrowser/sqlitebrowser/blob/master/BUILDING.md and made sure that build-essential, cmake, libqt4-dev and libsqlite3-dev are installed.

I'm building it with USE_QT5=OFF. ccmake shows

ANTLR2_INCLUDE_DIR               ANTLR2_INCLUDE_DIR-NOTFOUND
ANTLR2_LIBRARY                   ANTLR2_LIBRARY-NOTFOUND

Which debian package would satisfy that?

I continued the process and executed make but it stops at

Building CXX object libs/qscintilla/Qt4Qt5/CMakeFiles/qscintilla2.dir/qsciscintilla.cpp.o
In file included from /usr/src/sqlitebrowser-3.8.0/libs/qscintilla/Qt4Qt5/qsciscintilla.cpp:23:0:
/usr/src/sqlitebrowser-3.8.0/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:98:30: error: ‘ANNOTATION_INDENTED’ was not declared in this scope
/usr/src/sqlitebrowser-3.8.0/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:267:28: error: ‘INDIC_FULLBOX’ was not declared in this scope
/usr/src/sqlitebrowser-3.8.0/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:285:35: error: ‘INDIC_SQUIGGLEPIXMAP’ was not declared in this scope
/usr/src/sqlitebrowser-3.8.0/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:289:37: error: ‘INDIC_COMPOSITIONTHICK’ was not declared in this scope
/usr/src/sqlitebrowser-3.8.0/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:293:36: error: ‘INDIC_COMPOSITIONTHIN’ was not declared in this scope
/usr/src/sqlitebrowser-3.8.0/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:297:30: error: ‘INDIC_TEXTFORE’ was not declared in this scope
/usr/src/sqlitebrowser-3.8.0/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:428:20: error: ‘SC_MARK_BOOKMARK’ was not declared in this scope
/usr/src/sqlitebrowser-3.8.0/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:457:26: error: ‘SC_WRAP_WHITESPACE’ was not declared in this scope
/usr/src/sqlitebrowser-3.8.0/libs/qscintilla/Qt4Qt5/Qsci/qsciscintilla.h:2092:5: error: ‘ScintillaBytes’ does not name a type

Is there any other package besides libqt4-dev that is needed there?

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jul 8, 2016

Hmmm, that's interesting. The ANTLR2 stuff is part of our source code. We bundle it with the rest of our source here, and it's supposed to be found automatically by cmake.

    https://github.com/sqlitebrowser/sqlitebrowser/tree/master/libs/antlr-2.7.7

Just as a curiosity thing, what happens if you run qmake instead of cmake?

@justinclift justinclift added the linux label Jul 8, 2016

@PSE-AG

This comment has been minimized.

Copy link
Author

PSE-AG commented Jul 8, 2016

Hi

If I run qmake in the source code directory, nothing happens, qmake exists with status 0.

If I run qmake in the build directory after cmake generated the makefiles, I get an error:

build$ qmake
Usage: qmake [mode] [options] [files]
.....

Doing

$ cmake .
-- Could NOT find Antlr2 (missing:  ANTLR2_LIBRARIES ANTLR2_INCLUDE_DIRS) 

Could it be a path issue?

You have

if(NOT ANTLR2_FOUND)
    set(ANTLR_DIR libs/antlr-2.7.7)
    add_subdirectory(${ANTLR_DIR})
endif()

and this is a relative path, I guess relative to current running directiory and not necessarily to CMAKE_SOURCE_DIR. I always create a build directory outside of the source code and this could be an issue.

Do you usually generate the cmake-Makefile on the same directory as the source code?

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jul 8, 2016

Yeah, it could be a path issue.

With cmake, it kind of has a macro like language, so the "if(NOT ANTLR2 ..." clause you're talking about here shouldn't trigger, because it's coming after this line here:

find_package(Antlr2)

That "find_package()" macro runs this code, which seems to be where the problem is:

    https://github.com/sqlitebrowser/sqlitebrowser/blob/master/cmake/FindAntlr2.cmake

The trick will be figuring out what and why. 😉

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jul 8, 2016

Btw, with qmake, run it in the main (root) checked out sqlitebrowser git source dir, then run make after it. Like this:

$ git clone https://github.com/sqlitebrowser/sqlitebrowser.git
$ cd sqlitebrowser
$ qmake
$ make
[compiling stuff should happen here]

Note that sometimes when compiling this way on OSX it barfs after a while with an error about missing language translation files. Running make again fixes the problem. (yeah, someone needs to look into that, but it's a pretty minor problem)

@PSE-AG

This comment has been minimized.

Copy link
Author

PSE-AG commented Jul 8, 2016

Oh man, I'm stupid, I only executed qmake and didn't realize that it only creates the Malefiles.

Now I get

cd libs/antlr-2.7.7/ && make -f Makefile.antlr 
make[1]: Entering directory `/tmp/test/sqlitebrowser/libs/antlr-2.7.7'
make -f Makefile.antlr.Release
make[2]: Entering directory `/tmp/test/sqlitebrowser/libs/antlr-2.7.7'
g++ -c -m64 -pipe -O2 -fPIC -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -Irelease -o release/TreeParser.o src/TreeParser.cpp
make[2]: *** [release/TreeParser.o] Segmentation fault
make[2]: Leaving directory `/tmp/test/sqlitebrowser/libs/antlr-2.7.7'
make[1]: *** [release] Error 2
make[1]: Leaving directory `/tmp/test/sqlitebrowser/libs/antlr-2.7.7'
make: *** [sub-libs-antlr-2-7-7-antlr-pro-make_default] Error 2

That's strange

$ g++ -c -m64 -pipe -O2 -fPIC -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -Irelease -o release/TreeParser.o src/TreeParser.cpp
Segmentation fault

Last time I had a segfault with GCC it was when I discovered that my RAM was faulty and had to change my ram. That's strange because I have to compile quite a bit of C++ code and I usually don't have these problems.

// edit:

when compiling with cmake, TreeParser.cpp is compiled without a problem.

@PSE-AG

This comment has been minimized.

Copy link
Author

PSE-AG commented Jul 8, 2016

The trick will be figuring out what and why. 

I'll take a look at that later when I get back home (right now @work). I have some projects using CMake, I have some experience with it.

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jul 8, 2016

Sure no worries at all. Wonder if this is somehow showing up a weird gcc bug or something?

@PSE-AG

This comment has been minimized.

Copy link
Author

PSE-AG commented Jul 8, 2016

I'm not sure, I think I have a problem with my RAM. I'll let memtest run over the weekend.

When I use qmake to compile as root, then the build was complete. But sqlitebrowser crashes immediately with a segfault. If I run it with valgrind (might give me a clue as why it dies with segfault) the QT app window is loaded, rendered but after a couple of seconds it dies with segfault.

As I said, I'll let run memtest over the weekend and see what happens.

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jul 8, 2016

Yeah, that does sound kind of weird. 😦

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jul 29, 2016

@PSE-AG How did this go?

@PSE-AG

This comment has been minimized.

Copy link
Author

PSE-AG commented Jul 29, 2016

I didn't forget this issue but I was on holiday and this week has been crazy, lots of deadlines.

I executed memtest over the weekend as I planned, it run more than 60 hour straight without interruptions and not a single error was found. I don't know why gcc fails with segfaults.

I'm still running on a debian 7. I will install debian 8 on virtualbox and see if I can reproduce the same results.

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jul 29, 2016

Thanks. Please keep us posted. 😄

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Aug 26, 2016

@PSE-AG Any luck with this? 😄

@PSE-AG

This comment has been minimized.

Copy link
Author

PSE-AG commented Aug 26, 2016

Hi

I'm so sorry, I have been terribly busy in the last couple of weeks and I had an operation two weeks ago and have been recovering since then.

I did find out however that the reason I got the segfaults was not my RAM or debian buildchain. Some time ago I installed linuxbrew because I wanted to test something. linuxbrew compiled a glibc, gcc and other packages on its own and put them at the front of PATH. I haven't realized that until I was compiling something for one client of ours and I constantly got segfaults. That's when I executed gcc --version and I got a segfault as well. Then I realized that I was executing the gcc from linuxbrew the whole time.

Since then I haven't had the time to experiment with that. But I haven't forgotten it :)

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Aug 26, 2016

No worries at all. 😄

Healing well, and getting better is definitely of much higher importance. 😁

@PSE-AG

This comment has been minimized.

Copy link
Author

PSE-AG commented Aug 30, 2016

So, I make a git clone and the current commit is 684958b29ce3d26684d9142d73df773b11189d54.

I first tried qmake && make and this time it compilied without any issue. The program runs without problems.

I also tried cmake. It still complaining about missing ANTLR2 libraries, but this may be a path issue. cmake is able to generate a Makefile and running make works also as well, the binary runs, everything seems fine.

The only issue I have is that the UI is to aggressive with the focus. If the UI loses focus, it regains automatically again, and this is a problem when you have virtual desktops, because the moment you change to another virtual desktop/screen and the UI loses focus, it regains focus and you jump back at the virtual desktop you've started the UI. I use fluxbox with at 12 virtual screens where every virtual screen has something running. While te UI runs, I'm unable to switch to the other screens.

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Aug 30, 2016

Cool, making progress. 😄

With the ANTLR2 warnings, there seem to be two distinct paths that can go down:

a) Warning message about it not being found, but DB4S compiles + works ok anyway
b) Warning message, then failure to compile

With a), it can be ignored. It turns out there there are two different approaches for finding ANTLR2 in our CMake configuration, one of them is a fallback to the other. The "ANTLR2 warning but still compiles" situation happens when one of the approaches doesn't work (generating a warning), but the other one does (without giving a "found it!" message 😦 ).

With b) above... that's when it really can't be found. You're not hitting that though, so it sounds like the build step is working "good enough" for you now. 😄

With the focus problem, that's interesting. It's not something I remember anyone mentioning before. It's probably an unexpected interaction from something... but figuring out what exactly is the next challenge. 😄

As a first thought, would you be ok to try compiling against our v3.9.x branch, instead of our master branch?

If the focus problem doesn't happen with the v3.9.x branch, then we'll know it's our recent code which introduced it. That'll give us a much better idea of what to look at. 😄

@PSE-AG

This comment has been minimized.

Copy link
Author

PSE-AG commented Aug 30, 2016

Hi

the v3.9.x also compiles (qmake/cmake) without a problem. The focus problem is there as well. I'll test it later @home, different system (gentoo).

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Sep 5, 2016

@PSE-AG How'd this go? 😉

@shaoran

This comment has been minimized.

Copy link

shaoran commented Sep 5, 2016

@justinclift: it's me, same person, different account (my personal).

I've made an update in gentoo (dev-db/sqlitebrowser-3.8.0) and it works normal, I can change the to my virtual desktops when sqlitebrowser is running.

I've compiled the v3.9.x version using qmake and cmake and I had the same issue: If I change to another virtual desktop, sqlitebrowser regains immediately the focus and my virtual desktop goes back to that where sqlitebrowser is running.

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Sep 5, 2016

@shaoran Thanks. 😄

Just to confirm I'm reading that correctly:

  • When compiled for the v3.9.x branch, the focus problem is happening
  • When compiled for the master branch, the focus problem is not happening

Is that right?

@shaoran

This comment has been minimized.

Copy link

shaoran commented Sep 6, 2016

No,

  • When compiled for the v3.9.x branch, the focus problem is happening
  • When compiled for the master branch, the focus problem is happening
  • When compiled for the v3.8.0 branch, the focus problem is not happening
@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Sep 6, 2016

Thanks, now it's clear. It's something we've done between the 3.8.0 and 3.9.0 releases, and it's still happening.

Damn. 😦

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Sep 6, 2016

We can probably take a brute force approach to working out why. (eg manual bisect)

It's a bit time consuming, although very effective. I won't have time for it personally for at least the next fortnight though. 😦

@justinclift justinclift self-assigned this Sep 6, 2016

@revolter

This comment has been minimized.

Copy link
Member

revolter commented Sep 19, 2016

It looks like you can activate a window using the QWidget::activateWindow function, and we only call it here, but that shouldn't be a problem. So maybe it's an implicit behaviour caused by something else, rather than some explicit call?

@jlmcgraw jlmcgraw referenced this issue Jan 5, 2017

Closed

Screen corruption #920

2 of 13 tasks complete
@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Feb 3, 2017

Sounds like the focus problem is the same as in #934. But the bi-sected commits mentioned there are from a later date. Maybe it's a connection of multiple things causing this behaviour, I don't know. Either way, if anybody feels like bi-secting this (earlier) problem, please do so 😃

@chrisjlocke chrisjlocke referenced this issue Jul 26, 2017

Closed

minimising issue #1063

3 of 13 tasks complete
@EmperorArthur

This comment has been minimized.

Copy link

EmperorArthur commented Sep 27, 2017

Hi, I can confirm this issue is still present as of commit 425bfa1.

-- Could NOT find Antlr2 (missing: ANTLR2_LIBRARIES ANTLR2_INCLUDE_DIRS)

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Sep 27, 2017

@EmperorArthur Try running make afterwards, even though that error shows up. There's some indication that the message there is bogus, and might not really mean anything went wrong after all. 😄

@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Sep 27, 2017

Yep, the error message just means that no Antlr2 development files provided by your distribution were found. In that case we just fall back to the Antlr2 library which is included in our repository. So it's safe to just run make as @justinclift said.

However, if you have the Antlr2 lib and dev packages installed and you still see that error message, then that's probably a bug in our cmake file which is worth investigating 😄

@EmperorArthur

This comment has been minimized.

Copy link

EmperorArthur commented Sep 28, 2017

The program still compiled, but I spent a bit of time googling around until I found this issue page. If the warning is meant to be ignored, it might be worth it to have the cmake file print out a note.

We've all been trained to treat these sorts of warnings as important. It's really confusing ignoring it. Especially since all the other dependency warnings will cause compilation issues.

MKleusberg added a commit that referenced this issue Sep 30, 2017

@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Sep 30, 2017

I see 😄 I've just changed our cmake script to not print this warning and just silently use the copy of Antlr that's provided in our repository.

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Sep 30, 2017

@EmperorArthur Would you be ok to try compiling again, using the latest git source, to verify the compile process is warning free for you now? 😄

@EmperorArthur

This comment has been minimized.

Copy link

EmperorArthur commented Oct 8, 2017

Confirmed fixed.

#cmake -Wno-dev .
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/src/sqlitebrowser
@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Oct 8, 2017

Awesome! Thanks for checking and letting us know @EmperorArthur. 😄

@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Oct 12, 2017

@PSE-AG The problem with DB4S being too aggressive with it's focus has likely just been fixed in our source code with #1168.

Would you have the time/interest to compile and verify it from your point of view? 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment