|
|
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 |
|
mirek
Messages: 13979 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 |
|
Klugier
Messages: 1076 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 #58662 is a reply to message #58661] |
Mon, 11 July 2022 22:49 |
|
Klugier
Messages: 1076 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:
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 #58747 is a reply to message #58746] |
Mon, 15 August 2022 18:44 |
|
Klugier
Messages: 1076 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 [message #58749 is a reply to message #58579] |
Tue, 16 August 2022 19:18 |
Novo
Messages: 1358 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 |
Novo
Messages: 1358 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, first milestone finished [message #58759 is a reply to message #58758] |
Sat, 20 August 2022 20:33 |
Novo
Messages: 1358 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 |
Tom1
Messages: 1214 Registered: March 2007
|
Senior 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 #58784 is a reply to message #58780] |
Wed, 31 August 2022 10:00 |
Tom1
Messages: 1214 Registered: March 2007
|
Senior 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
|
|
|
Goto Forum:
Current Time: Mon May 13 09:12:35 CEST 2024
Total time taken to generate the page: 0.01730 seconds
|
|
|