U++ framework
Do not panic. Ask here before giving up.

Home » Developing U++ » U++ Developers corner » theide with libclang
Re: theide with libclang, first milestone finished [message #58659 is a reply to message #58655] Mon, 11 July 2022 18:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
OK, so I have tried to install llvm-14 in my linux distro and linked theide with its libclang - and things started to work even with preamble, totally fine, fast, just as in Windows (except some fixing of include paths to get autocomplete of std:: stuff, but nothing serious; that part is under development anyway).

(Note - if you wonder why I am speaking about preamble so much - preamble is a flag that you give to libclang that makes it create implicit precompiled header in the first file parse. This is very important for autocomplete because we do that parse in background thread and when user needs the autocomplete, all is ready and fast. So it is really important for comfort - using preamble, autocomplete is almost instant (~400ms). Without it can take 1-5 seconds to popup).

So my conclusion: I will only use preamble only when I detect libclang 14, I do not care about outdated distros. Autocomplete will be slow if libclang 14 is not available.

Latest ubuntu has 14, so... Maybe one last thing to try is whether libclang 13 works, if somebody has time to test.

This will be hell in the installation script (to get the most fresh libclang for given distro or even disable libclang completely), but what can we do...

I really would appreciate help with installation script BTW!

Mirek

[Updated on: Mon, 11 July 2022 18:42]

Report message to a moderator

Re: theide with libclang, first milestone finished [message #58660 is a reply to message #58659] Mon, 11 July 2022 21:57 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1118
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Mirek,

libclang-14 requierments explains a lot. On Manjaro current available version is libclang-13, so maybe the issues mentioned by me in my previous message are caused by insufficient libclang library version. Manjaro is rolling release, it means that it has relatively new packages. So, the general adoption of libclang-14 in the Linux word is low.

Quote:
So it is really important for comfort - using preamble, autocomplete is almost instant (~400ms). Without it can take 1-5 seconds to popup).

I can confirm that CTRL+Space take some time to appear on the screen. Is there a way to optimize it for example by pre generating auto complete or using caching? Also, I think user should be somehow inform that something is generating under the hood. For me it looks like TheIDE is unresponsive after using Ctrl+Space. Moreover, ~400ms might be too much. You need to take into consideration that it calculates that time on your CPU. With weaker CPU's this value might be bigger. So, maybe we could also optimize this using similar techniques I proposed.

Could you also tell me from where on Windows I can download libclang-14? I would like to have comparison.

Klugier


U++ - one framework to rule them all.

[Updated on: Mon, 11 July 2022 21:59]

Report message to a moderator

Re: theide with libclang, first milestone finished [message #58661 is a reply to message #58660] Mon, 11 July 2022 22:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Klugier wrote on Mon, 11 July 2022 21:57
Hello Mirek,

libclang-14 requierments explains a lot.


OK, some good news. I have finally figured it out and it now works fine with libclang 10 as well Smile (commit 046f816b5a12aae4813cf4a7a83e4b6f11c13ca9)

The problem was actually in those headers, sort of as expected. In windows, I need to add compiler options for header paths even for standard headers. I left that feature in linux as well and it turns out that this is the primary cause of the problem. I guess the real issue is there is too many header paths or maybe duplicating standard paths is confusing clang. All in all, it seems to work great in linux now.

Mirek

[Updated on: Mon, 11 July 2022 22:30]

Report message to a moderator

Re: theide with libclang, first milestone finished [message #58662 is a reply to message #58661] Mon, 11 July 2022 22:49 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1118
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Mirek,

I tested on the latest commit and from my perspective the performance is better, however my feelings are that Assist++ is not supper responsive and you can fell that it takes some time to appear. Could you add a release log file that will measure the Assist++ opening time? From request to appear.

For the rest of the issues I have mentioned in my previous message, everything is the same. Here is screenshot from String without AString methods:
index.php?t=getfile&id=6631&private=0

The console.${Assist++} doesn't open assist.

Klugier


U++ - one framework to rule them all.

[Updated on: Mon, 11 July 2022 22:57]

Report message to a moderator

Re: theide with libclang, first milestone finished [message #58663 is a reply to message #58662] Mon, 11 July 2022 23:00 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1118
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Mirek,

I think it would be nice to add "No suggestions" information when you explicitly hit CTRL+Space. Right now it is difficult to distinguish whenever Assist++ can not find any symbols or it is working under the hood.

Here is the feature from VSCode ("Brak sugesti." = "No sugesttions."):
index.php?t=getfile&id=6632&private=0

Klugier


U++ - one framework to rule them all.
Re: theide with libclang, first milestone finished [message #58746 is a reply to message #58663] Mon, 15 August 2022 10:44 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
So I guess I have reached another (and sort of final) milestone - for more than week I am now working with theide with clang based navigator (that means, it is running 'indexer' in background - the code that continually maintains the database of the whole project). BTW, it takes 20 seconds to reindex theide sources on my machine - BLITZ and 16 cores in action....

Not everything is happy valley though, theide requires far more powerful HW than before. Reindexing consumes a lot of memory (around 6GB) - that is understandable considering we are running 32 C++ compilers in parallel to do it. Also autocomplete is sort of lazy in large projects as compared to my in-house parser, but that is the price to pay I guess...

There is a lot of things to fix and mature yet, my defect list has around 70 entries... Smile Simultaneously, I will be adding nice new shiny features; new theide already got "Search for usages" that seems to be pretty useful.

I have also changed win32 nightly to contain all .dll and headers to be able to compile this llbm_ide branch directly, all you need to make sure is that new ide.exe is placed into the same directory as installed one (you can actually even use "Setup/Upgrade theide.." I think).

The remaining major issue is how to install this in linux....
Re: theide with libclang, first milestone finished [message #58747 is a reply to message #58746] Mon, 15 August 2022 18:44 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1118
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Mirek,

Thanks for the update, I will play with llbm_ide branch.

Quote:
Not everything is happy valley though, theide requires far more powerful HW than before. Reindexing consumes a lot of memory (around 6GB) - that is understandable considering we are running 32 C++ compilers in parallel to do it. Also autocomplete is sort of lazy in large projects as compared to my in-house parser, but that is the price to pay I guess...

As, I understand the number of C++ compiler jobs depends on HYDRA threads parameter. Could it be limited to one thread only if HYDRA threads are set to one? It would be good if TheIDE will still work on all these ARM devices that has single CPU. With only one thread running, the memory requirements should also be lower.

We have a lot of users from countries where there are difficulties to have access to modern hardware. In such cases TheIDE should work fine, even if indexing will take longer.

Scanning operation takes some time, it would be good to let user know that something is happening under the hood. We should avoid situation when user fells confusion. I think we can introduce following things:
- scanning progress is present in status bar (A lot of ide's are using this option...). Status bar is visible by default.
- CTRL+SPACE should indicate that the scanning is in progress and symbols are not ready yet. The information can be displayed in tooltip window.
- CTRL+SPACE should indicate that there are no symbols after scan (please back to my previous message). The same situation it can be displayed in tooltip window. This is exactly what I have presented in my previous message.

Klugier


U++ - one framework to rule them all.

[Updated on: Mon, 15 August 2022 18:48]

Report message to a moderator

Re: theide with libclang, first milestone finished [message #58748 is a reply to message #58747] Tue, 16 August 2022 08:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Klugier wrote on Mon, 15 August 2022 18:44
- CTRL+SPACE should indicate that there are no symbols after scan (please back to my previous message). The same situation it can be displayed in tooltip window. This is exactly what I have presented in my previous message.
Klugier


Well, there are always some symbols to display after CTRL+SPACE (unless you are in the completely empty file)...

Better indication of autocomplete in progress is coming..

Mirek


Re: theide with libclang [message #58749 is a reply to message #58579] Tue, 16 August 2022 19:18 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1432
Registered: December 2006
Ultimate Contributor
Linux. Branch: llbm_ide
Command: make -f umkMakefile
In file included from ./uppsrc/CtrlCore/CtrlCore.h:49,
                 from ./uppsrc/CtrlLib/CtrlLib.h:4,
                 from ./uppsrc/RichEdit/RichEdit.h:4,
                 from ./uppsrc/ide/ide.h:4,
                 from ./uppsrc/ide/Core/Ide.cpp:1:
./uppsrc/CtrlCore/Gtk.h:12:10: fatal error: gtk/gtk.h: No such file or directory
   12 | #include <gtk/gtk.h>
      |          ^~~~~~~~~~~

umk is a console app ...


Regards,
Novo
Re: theide with libclang [message #58750 is a reply to message #58579] Tue, 16 August 2022 19:25 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1432
Registered: December 2006
Ultimate Contributor
Linux. Branch: llbm_ide
Command: ./umk uppsrc ide CLANG -arbus
Problem: Fatal error Invalid memory access! (on opening a project)


Regards,
Novo
Re: theide with libclang [message #58752 is a reply to message #58749] Fri, 19 August 2022 13:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Novo wrote on Tue, 16 August 2022 19:18
Linux. Branch: llbm_ide
Command: make -f umkMakefile
In file included from ./uppsrc/CtrlCore/CtrlCore.h:49,
                 from ./uppsrc/CtrlLib/CtrlLib.h:4,
                 from ./uppsrc/RichEdit/RichEdit.h:4,
                 from ./uppsrc/ide/ide.h:4,
                 from ./uppsrc/ide/Core/Ide.cpp:1:
./uppsrc/CtrlCore/Gtk.h:12:10: fatal error: gtk/gtk.h: No such file or directory
   12 | #include <gtk/gtk.h>
      |          ^~~~~~~~~~~

umk is a console app ...


Fixed.
Re: theide with libclang, first milestone finished [message #58753 is a reply to message #58747] Fri, 19 August 2022 13:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Klugier wrote on Mon, 15 August 2022 18:44

- scanning progress is present in status bar (A lot of ide's are using this option...). Status bar is visible by default.


Working on it all, however the idea is that scanning will be represented by left bar changing color (which makes sense as there are annotation that get updated).
Re: theide with libclang, first milestone finished [message #58754 is a reply to message #58753] Fri, 19 August 2022 13:05 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Hopefully fixed Linux crashing in release mode.
Re: theide with libclang, first milestone finished [message #58758 is a reply to message #58754] Sat, 20 August 2022 20:00 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1432
Registered: December 2006
Ultimate Contributor
mirek wrote on Fri, 19 August 2022 07:05
Hopefully fixed Linux crashing in release mode.

Thanks. TheIde works fine on Linux.


Regards,
Novo
Re: theide with libclang, first milestone finished [message #58759 is a reply to message #58758] Sat, 20 August 2022 20:33 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1432
Registered: December 2006
Ultimate Contributor
CPU usage.

TheIde is heavily using CPU even if I change one character.
This is a problem for my ten-years-old laptop.
Is it possible to add an options, which will
1) disable libclang completely.
2) limit reindexing to a "Save" command.
3) keep libclang running all the time.

TIA.


Regards,
Novo
Re: theide with libclang, first milestone finished [message #58760 is a reply to message #58754] Sat, 20 August 2022 20:34 Go to previous messageGo to next message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
Hi,

I had to move #include <X11/Xlib.h> in GtkApp.cpp in order to compile in Windows with clang:
#include <CtrlCore/CtrlCore.h>


#ifdef GUI_GTK
#include <X11/Xlib.h>
#define CATCH_ERRORS 1


Additionally, compilation fails to missing include in MSBT22x64:
C:\upp-16323\upp.src\uppsrc\ide/clang/clang.h (5): fatal error C1083: Cannot open include file: 'clang-c/Index.h': No such file or directory


Best regards,

Tom
Re: theide with libclang, first milestone finished [message #58761 is a reply to message #58760] Sun, 21 August 2022 00:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Tom1 wrote on Sat, 20 August 2022 20:34
Hi,

I had to move #include <X11/Xlib.h> in GtkApp.cpp in order to compile in Windows with clang:
#include <CtrlCore/CtrlCore.h>


#ifdef GUI_GTK
#include <X11/Xlib.h>
#define CATCH_ERRORS 1


Additionally, compilation fails to missing include in MSBT22x64:
C:\upp-16323\upp.src\uppsrc\ide/clang/clang.h (5): fatal error C1083: Cannot open include file: 'clang-c/Index.h': No such file or directory


Best regards,

Tom


Compilation of theide with MSC is not supported at the moment. Not sure it will be possible. Use CLANG64...

Mirek
Re: theide with libclang, first milestone finished [message #58762 is a reply to message #58759] Sun, 21 August 2022 00:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Novo wrote on Sat, 20 August 2022 20:33
CPU usage.

TheIde is heavily using CPU even if I change one character.
This is a problem for my ten-years-old laptop.
Is it possible to add an options, which will
1) disable libclang completely.
2) limit reindexing to a "Save" command.
3) keep libclang running all the time.

TIA.


Disable is needed. However, reindexing is already issued only in specific moments (save being one of them). The problem is that initially it has to do it all.

Also, changing headers can trigger reindexing of a lot of files.

This is the price to pay.... (this is the reason I was reluctant to do abandon my parser....)

Mirek
Re: theide with libclang, first milestone finished [message #58780 is a reply to message #58762] Tue, 30 August 2022 16:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Good news: I have found a bug in my code (unitialised variable for all things) that was making autocomplete slow. It now seems to be superfast after the initial parse.

Things appear to fall in place. The last major hurdle is to figure out Linux installation. The new idea to try is to use runtime .so loading...

Mirek
Re: theide with libclang, first milestone finished [message #58784 is a reply to message #58780] Wed, 31 August 2022 10:00 Go to previous messageGo to next message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
Hi Mirek,

Each time I have e.g.:
	void LeftDown(Point p, dword keyflags) override {

I get a row: "WARNING: EMIT" in my Navigator. If I remove the override, it goes away. (I do not think this is anything new, but it shows up in the latest version too.)

Second, there are some warnings (at least on MSBT):
C:\upp-git\upp.src\uppsrc\Core\Other.h(123): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
C:\upp-git\upp.src\uppsrc\Core\Other.h(143): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
C:\upp-git\upp.src\uppsrc\CtrlLib/DropChoice.h(83): warning C4099: 'Upp::PopUpList::Popup': type name first seen using 'struct' now seen using 'class'
C:\upp-git\upp.src\uppsrc\CtrlLib/DropChoice.h(54): note: see declaration of 'Upp::PopUpList::Popup'


Best regards,

Tom
Re: theide with libclang, first milestone finished [message #58785 is a reply to message #58784] Wed, 31 August 2022 10:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Tom1 wrote on Wed, 31 August 2022 10:00
Hi Mirek,

Each time I have e.g.:
	void LeftDown(Point p, dword keyflags) override {

I get a row: "WARNING: EMIT" in my Navigator. If I remove the override, it goes away. (I do not think this is anything new, but it shows up in the latest version too.)


I have to say I am a bit confused here... Smile

Can you post a screenshot? (full window so that I can see the source etc.. too)
Re: theide with libclang, first milestone finished [message #58786 is a reply to message #58785] Wed, 31 August 2022 10:50 Go to previous messageGo to next message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
Hi,

Sorry. This must be caused by something strange deeper in my own code, since creating a simple test case does not seem to trigger showing it.
index.php?t=getfile&id=6653&private=0
Anyway, I will stop wasting your time on this one for now. (I bet you have something better to do... Smile

Thanks and best regards,

Tom

Re: theide with libclang, first milestone finished [message #58787 is a reply to message #58786] Wed, 31 August 2022 11:37 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Tom1 wrote on Wed, 31 August 2022 10:50
Hi,

Sorry. This must be caused by something strange deeper in my own code, since creating a simple test case does not seem to trigger showing it.
index.php?t=getfile&id=6653&private=0
Anyway, I will stop wasting your time on this one for now. (I bet you have something better to do... Smile

Thanks and best regards,

Tom



Ah, ok, by the screenshot I immediatelly see this non-clang version anyway Smile (new theide has arrow instead of ":")

Mirek
Re: theide with libclang, first milestone finished [message #58788 is a reply to message #58787] Wed, 31 August 2022 12:33 Go to previous messageGo to next message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
mirek wrote on Wed, 31 August 2022 12:37
Tom1 wrote on Wed, 31 August 2022 10:50
Hi,

Sorry. This must be caused by something strange deeper in my own code, since creating a simple test case does not seem to trigger showing it.
index.php?t=getfile&id=6653&private=0
Anyway, I will stop wasting your time on this one for now. (I bet you have something better to do... Smile

Thanks and best regards,

Tom



Ah, ok, by the screenshot I immediatelly see this non-clang version anyway Smile (new theide has arrow instead of ":")

Mirek


Thanks Mirek!

For some reason my upp.src had slipped back to master branch. Anyway, I switched back to clang and now all my problems are gone. Arrows are shown instead of colon and there are no more "WARNING: EMIT" for overrides. Thanks!

Best regards,

Tom
Re: theide with libclang, first milestone finished [message #58824 is a reply to message #58788] Thu, 15 September 2022 08:31 Go to previous messageGo to next message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
Mirek,

Would it be possible to add support for working with git branches in TheIDE menu?

Support for 'switching branch' for any git repository currently in use would be most useful, but possibly also support for creating and merging of branches.

Best regards,

Tom
Re: theide with libclang, first milestone finished [message #58826 is a reply to message #58824] Thu, 15 September 2022 09:48 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Tom1 wrote on Thu, 15 September 2022 08:31
Mirek,

Would it be possible to add support for working with git branches in TheIDE menu?

Support for 'switching branch' for any git repository currently in use would be most useful, but possibly also support for creating and merging of branches.

Best regards,

Tom


I would like to, I just do not quite know how to do it right. So far "Terminal at file directory" was my favorite tool in this regard...

Plus it is not quite related to Assist/clang, correct?

I plan a batch of another theide improvements after libclang is merged. Which now seems will be quite soon.

Mirek
Re: theide with libclang, first milestone finished [message #58828 is a reply to message #58826] Thu, 15 September 2022 14:10 Go to previous messageGo to next message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
mirek wrote on Thu, 15 September 2022 10:48
Tom1 wrote on Thu, 15 September 2022 08:31
Mirek,

Would it be possible to add support for working with git branches in TheIDE menu?

Support for 'switching branch' for any git repository currently in use would be most useful, but possibly also support for creating and merging of branches.

Best regards,

Tom


I would like to, I just do not quite know how to do it right. So far "Terminal at file directory" was my favorite tool in this regard...

Plus it is not quite related to Assist/clang, correct?

I plan a batch of another theide improvements after libclang is merged. Which now seems will be quite soon.

Mirek


Yes, sorry. This is not the place for this discussion. Anyway, I'm looking forward to progress on this too.

Best regards,

Tom
Re: theide with libclang, first milestone finished [message #58836 is a reply to message #58828] Fri, 16 September 2022 11:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Merged...
Re: theide with libclang, first milestone finished [message #58842 is a reply to message #58836] Sat, 17 September 2022 05:54 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1432
Registered: December 2006
Ultimate Contributor
Merged version. Linux.
libclang: crash detected during reparsing
libclang: crash detected during parsing: {
  'source_filename' : '(null)'
  'command_line_args' : ['clang', '-I/home/ssg/dvlp/cpp/sergey/upp', '-I/home/ssg/dvlp/cpp/code/upp/git/uppsrc', '-I/home/ssg/dvlp/cpp/code/upp/git/bazaar', '-I/home/ssg/.local/tmp/dvlp/cpp/code/upp/.config/u++/ide/UppHub/SysExec', '-I/home/ssg/.local/tmp/dvlp/cpp/code/upp/.config/u++/ide/UppHub/Updater', '-I/usr/include/freetype2', '-I/usr/include/libpng16
', '-I/usr/include/freetype2', '-I/usr/include/libpng16
', '-I/usr/include/freetype2', '-I/usr/include/libpng16
', '-I/usr/include/gtk-3.0', '-I/usr/include/at-spi2-atk/2.0', '-I/usr/include/at-spi-2.0', '-I/usr/include/dbus-1.0', '-I/usr/lib64/dbus-1.0/include', '-I/usr/include/gtk-3.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/harfbuzz', '-I/usr/include/pango-1.0', '-I/usr/include/fribidi', '-I/usr/include/harfbuzz', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/pixman-1', '-I/usr/include/freetype2', '-I/usr/include/libpng16', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/libpng16', '-I/usr/include/libmount', '-I/usr/include/blkid', '-I/usr/include/glib-2.0', '-I/usr/lib64/glib-2.0/include
', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/libpng16', '-I/usr/include/libmount', '-I/usr/include/blkid', '-I/usr/include/glib-2.0', '-I/usr/lib64/glib-2.0/include
', '-I/usr/include/libpng16
', '-I/usr/include/c++/10.2', '-I/usr/include/c++/10.2/x86_64-unknown-linux-gnu', '-I/usr/include/c++/10.2/backward', '-I/usr/local/include', '-I/usr/lib/clang/12.0.1/include', '-I/usr/include', '-I/usr/include/c++/10.2', '-I/usr/include/c++/10.2/x86_64-unknown-linux-gnu', '-I/usr/include/c++/10.2/backward', '-I/usr/local/include', '-I/usr/lib/clang/12.0.1/include', '-I/usr/include', '-DflagGUI', '-DflagPOSIX', '-DflagLINUX', '-DCLANG', '/home/ssg/dvlp/cpp/code/upp/git/uppsrc/Core/lheap.cpp', '-DflagDEBUG', '-DflagDEBUG_FULL', '-DflagMAIN', '-DflagCLANG', '-xc++', '-std=c++17', '-Dlint'],
  'unsaved_files' : [],
  'options' : -2147483136,
}


Regards,
Novo
Re: theide with libclang, first milestone finished [message #58843 is a reply to message #58842] Sat, 17 September 2022 06:44 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1432
Registered: December 2006
Ultimate Contributor
Is it possible to disable libclang support during compilation?
I'm having troubles trying to cross-compile Clang. Actually, I couldn't compile it at all.
I'm trying to cross-compile TheIDE for Windows on Linux.


Regards,
Novo
Re: theide with libclang, first milestone finished [message #58844 is a reply to message #58843] Sat, 17 September 2022 11:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
What is your HW configuration?

I am setting some defaults for assist config, but the lowest HW I can test with is Ryzen 2400G 8GB Linux - they seems to work fine.

Check Setup BTW, I would start with disabling automatic indexer... BTW, I might be wrong, but I think for theide, every "indexer thread" and "autocomplete file cache" is about 200MB of memory.

Mirek
Re: theide with libclang, first milestone finished [message #58845 is a reply to message #58844] Sat, 17 September 2022 12:23 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1432
Registered: December 2006
Ultimate Contributor
mirek wrote on Sat, 17 September 2022 05:04
What is your HW configuration?

Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz (4 cores / 8 threads)
16GM RAM
It is a Lenovo W530. (I also have a T530 Smile )
I like the keyboard on these models Smile


Regards,
Novo

[Updated on: Sat, 17 September 2022 12:41]

Report message to a moderator

Re: theide with libclang, first milestone finished [message #58846 is a reply to message #58844] Sat, 17 September 2022 12:37 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1432
Registered: December 2006
Ultimate Contributor
mirek wrote on Sat, 17 September 2022 05:04

Check Setup BTW, I would start with disabling automatic indexer... BTW, I might be wrong, but I think for theide, every "indexer thread" and "autocomplete file cache" is about 200MB of memory.

Opening a project and closing it in a couple of seconds leads to "Invalid memory access" ...
EDIT: Happens after full rebuild.


Regards,
Novo

[Updated on: Sat, 17 September 2022 12:44]

Report message to a moderator

Re: theide with libclang, first milestone finished [message #58847 is a reply to message #58845] Sat, 17 September 2022 12:48 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Novo wrote on Sat, 17 September 2022 12:23
mirek wrote on Sat, 17 September 2022 05:04
What is your HW configuration?

Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz (4 cores / 8 threads)
16GM RAM
It is a Lenovo W530. (I also have a T530 Smile )
I like the keyboard on these models Smile


That is strange, that is about the same or better than my linux machine....

Maybe your libclang is somehow deffective?

Mirek
Re: theide with libclang, first milestone finished [message #58848 is a reply to message #58847] Sat, 17 September 2022 12:57 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1432
Registered: December 2006
Ultimate Contributor
mirek wrote on Sat, 17 September 2022 06:48

Maybe your libclang is somehow deffective?

I'm using "Void Linux". Its default clang version is 12.0.1.
Void Linux is like a stable version of Arch.
I do not have any problems with ccls on these machines ...


Regards,
Novo
Re: theide with libclang, first milestone finished [message #58849 is a reply to message #58848] Sat, 17 September 2022 13:01 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1432
Registered: December 2006
Ultimate Contributor
I'm getting weird error messages in console on exit.
/usr/include/glib-2.0/glib/gtypes.h:32:10: error: 'glibconfig.h' file not found
/usr/include/glib-2.0/glib/gversionmacros.h:375:2: error: "GLIB_VERSION_MIN_REQUIRED must be >= GLIB_VERSION_2_26"
/usr/include/glib-2.0/glib/gtypes.h:548:2: error: unknown ENDIAN type
/usr/include/glib-2.0/glib/garray.h:49:3: error: unknown type name 'guint8'
/usr/include/glib-2.0/glib/garray.h:75:36: error: unknown type name 'gsize'
...
/home/ssg/dvlp/cpp/sergey/upp/amap/amap.cpp:81:2: error: cannot initialize object parameter of type 'Upp::TopWindow' with an expression of type 'amap'
/home/ssg/dvlp/cpp/sergey/upp/amap/amap.cpp:83:2: error: no matching member function for call to 'Icon'
/home/ssg/dvlp/cpp/code/upp/git/uppsrc/CtrlCore/TopWindow.h:174:13: note: candidate function not viable: no known conversion from 'amap' to 'Upp::TopWindow' for object argument
/home/ssg/dvlp/cpp/code/upp/git/uppsrc/CtrlCore/TopWindow.h:176:13: note: candidate function not viable: requires 2 arguments, but 1 was provided
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]


Regards,
Novo
Re: theide with libclang [message #58856 is a reply to message #58579] Sun, 18 September 2022 12:22 Go to previous messageGo to next message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 227
Registered: June 2011
Experienced Member
Seemed OK at first but:

- Include file completion doesn't work (you're probably already aware of this)
- Alt+C works in .cpp files (only one direction though, from inner class scope to outer) but not .h files. It also appears to sometimes get the outer class name wrong.

Biggest issue thus far is 100% CPU and memory exhaustion. Before indexing, TheIDE uses around 50 megabytes, after first indexing it goes up to around 150, then eventually libclang breaks, autocomplete stops working for some symbols, then all - a second indexing increases memory usage until it reaches around 1.8 gig. This is with only one core enabled. With all cores, it uses all available system memory and freezes the OS... typically when compiling.

[Updated on: Sun, 18 September 2022 12:23]

Report message to a moderator

Re: theide with libclang [message #58857 is a reply to message #58856] Sun, 18 September 2022 13:05 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
jjacksonRIAB wrote on Sun, 18 September 2022 12:22
Seemed OK at first but:

- Include file completion doesn't work (you're probably already aware of this)


I went really far to make it work (is not really simple with libclang), so that is unpleasant surprise.

Quote:

Biggest issue thus far is 100% CPU and memory exhaustion. Before indexing, TheIDE uses around 50 megabytes, after first indexing it goes up to around 150, then eventually libclang breaks, autocomplete stops working for some symbols, then all - a second indexing increases memory usage until it reaches around 1.8 gig. This is with only one core enabled. With all cores, it uses all available system memory and freezes the OS... typically when compiling.


Can you please tell me details about the machine? Smile

I was mostly testing / using in Windows; there with 32 indexing threads the memory goes to somewhere like 6GB.
Re: theide with libclang [message #58858 is a reply to message #58857] Sun, 18 September 2022 13:27 Go to previous messageGo to next message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 227
Registered: June 2011
Experienced Member
Linux mint, it's an older machine with 8 cores and 16 gig of memory, libclang should be version 12 IIRC. If 6 gig is common I'll probably have to turn it off because the compiler causes a lot of memory pressure as is, oh well Very Happy
Re: theide with libclang [message #58859 is a reply to message #58858] Sun, 18 September 2022 16:57 Go to previous messageGo to previous message
Novo is currently offline  Novo
Messages: 1432
Registered: December 2006
Ultimate Contributor
In my case (Lenovo ThikPad T530 8GB RAM, 2 cores (4 threads), indexer is using 4 threads) when indexing TheIde itself:

- 1.3GB when reindexing all src. Memory usage doesn't go down after reindexing.
- 300MB when opening an already indexed TheIde project.

I guess, memory allocation strategy is inefficient.


Regards,
Novo
Previous Topic: Impressive improvement in stl::vector when dealing with raw memory.
Next Topic: about unicode supporting
Goto Forum:
  


Current Time: Thu Jun 25 18:42:58 GMT+2 2026

Total time taken to generate the page: 0.01421 seconds