wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
10.19k stars 684 forks source link

Building Tracy profiler under K/Ubuntu 22.04 #678

Closed robertosfield closed 11 months ago

robertosfield commented 11 months ago

I am struggling to get the profiler built Kubuntu 22.04. As I haven't been able to find a clear guide to what dependencies I need to install I have tried to address the build errors by installing the closest packages I find from the Ubuntu repos that might plausible supply these. bit still get the following errors:

/3rdParty/tracy/profiler/build/unix$ make
make[1]: Entering directory '/home/robert/3rdParty/tracy/profiler/build/unix'
Package capstone was not found in the pkg-config search path.
Perhaps you should add the directory containing `capstone.pc'
to the PKG_CONFIG_PATH environment variable
No package 'capstone' found
Package capstone was not found in the pkg-config search path.
Perhaps you should add the directory containing `capstone.pc'
to the PKG_CONFIG_PATH environment variable
No package 'capstone' found
Package dbus-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dbus-1' found
Package dbus-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dbus-1' found

And while I have freetype and headers installed I still get:

Resolving dependencies of ../../../imgui/misc/freetype/imgui_freetype.cpp
../../../imgui/misc/freetype/imgui_freetype.cpp:40:10: error: #include expects "FILENAME" or <FILENAME>
   40 | #include FT_FREETYPE_H          // <freetype/freetype.h>
      |          ^~~~~~~~~~~~~

and

g++ -c  -I../../../imgui -O3 -flto -s -march=native -std=c++17 -DNDEBUG -DIMGUI_ENABLE_FREETYPE ../../../imgui/misc/freetype/imgui_freetype.cpp -o obj/release/o/o/o/../../../imgui/misc/freetype/imgui_freetype.o
../../../imgui/misc/freetype/imgui_freetype.cpp:39:10: fatal error: ft2build.h: No such file or directory
   39 | #include <ft2build.h>
      |          ^~~~~~~~~~~~

This is what pkg-config is reporting for freetype2:

 pkg-config --cflags freetype2
-I/usr/include/freetype2 -I/usr/include/libpng16

$ dpkg -S "freetype2.pc"
libfreetype-dev:amd64: /usr/lib/x86_64-linux-gnu/pkgconfig/freetype2.pc

I have installed capstone-tools but there isn't any other related packages in the Ubuntu repo, and no .pc file:

$ dpkg -S "capstone.pc"
dpkg-query: no path found matching pattern *capstone.pc*

I have dbus installed but again I can find a package that has a dbus-1.pc:

$ dpkg -S "dbus-1.pc"
dpkg-query: no path found matching pattern *dbus-1.pc*

Do we have to build 3rd party solutions for these, pull in some other repos?

robertosfield commented 11 months ago

Thanks to @timoore for the suggestions, I have been able to get things to build with the following package installs:

sudo apt-get install libdbus-1-dev libcapstone-dev libglfw3-dev libfreetype-dev

This list probably isn't exhaustive I already had a number of dependencies installed.

Then built the profiler with make LEGACY=1 to get the Wayland requirement.

I would be worth adding details of what packages work with different distro's somewhere in the Tracy documentation is rather lacking.

wolfpld commented 11 months ago

Listing all the requirements for every possible Linux distro out there is out of scope here. The manual already contains instructions on what to install.

robertosfield commented 11 months ago

The existing Tracy docs is not sufficient, if it was I wouldn't have posted this Issue. Closing an issue that isn't resolved is not solving a problem that end users have. I looking at adding Tracy support to the VulkanSceneGraph project and want to know that if we recommend Tracy to end users they aren't going to be hit the same lack of documentation,

Almost all other open source projects can manage to list dependencies and make recommendations for major platforms. Even just starting with debian and redhat would help the majority of linux users even if it's not the platform they are working on it'll give them clues that can help them.

I know because I've been an open source developer/run a free software business for the past 22 years. Most days I have to do some level of support, making sure the software I am responsible for can be built within needing support is significant part of keeping this support load down, good cross platform build support and documentation help massively in this.

One thing that the Tracy project could do is enable Discussion on this github repo, this way users can help each other and have a long term record for others to search and reference.

wolfpld commented 11 months ago

As I said, the manual already lists what needs to be installed, and I am not interested in enumerating the names that each possible distribution gives to the required packages. Who is going to update this if the requirements change?

The two distributions you are suggesting are very political in what they do. RedHat is a paid product, so who knows what happens there, and besides, you are already paying for support if you use it, so talk to them if you have problems. On the other hand, Debian always ships outdated packages because that's their vision of what stability is, and the end result is that Capstone breaks builds because they ship 3.x while the latest release is 5.x and the APIs have changed.

I have enabled Discussions here, so feel free to provide any additional guidance you feel is needed.