arturbac / kdevcxx_with_ai

KDevelop and Kate plugins using OpenAI API to assist with code development
MIT License
8 stars 2 forks source link

Compiling for first time... #5

Open JJones780 opened 4 months ago

JJones780 commented 4 months ago

I just gave it a quick try at compiling .. with updates

Here's my experience thus far:

cmake --workflow --preset="clang-release" gave me an error "The CMAKE_CXX_COMPILER: clang++ is not a full path and was not found in the PATH."

I had to use `cmake -G "Kate - Ninja" -D CMAKE_C_COMPILER="gcc" -D CMAKE_CXX_COMPILER="g++" --preset="clang-release"

which got me going to where I'm installing missing dependencies:

qtwebengine5-dev
libkf5texteditor-dev
libkf5parts-dev
libboost-system-dev
libboost-thread-dev
kdevelop-dev     

I also had to install chrpath
sudo apt install chrpath as I was being told:

target requires changing an RPATH from the build tree, but this is not supported with the Ninja generator unless on an ELF-based or XCOFF-based platform.

I've edited this to clean it up a bit after trying again from scratch ( and corrected instead of working around the rpath error ).

next issue: The "workflow" argument is not understood by my cmake version 3.26.4 despite the argument being introduced in 3.25?

In my sleep-deprived delirium I had originally misread the "build" files as "built" files... so have to manually do the workflow steps if I can't upgrade to a cmake that has workflow.

Manually:

cd build/clang-release
ninja

running into more requirements ( spdlog ) but now out of time. ... to be continued...

Also, I see you have a link in the git to your local directory structure: kdevcxx_with_ai_settings -> /home/artur/.config/kdevcxx_with_ai

jbbjarnason commented 4 months ago

have you tried:

cd <git root>
cmake -S . -B builddir
cmake --build builddir
JJones780 commented 4 months ago

yes, that seems to work better. I'm still getting spdlog errors however. ie: "/usr/include/spdlog/common.h:168:111: error: ‘basic_runtime’ is not a member of ‘fmt’"

spdlog version: -- CPM: adding package spdlog@1.13.0 (v1.13.0)

I'll try to get time to look into it more myself.. but if anything obvious comes to mind please let me know. Thanks

JJones780 commented 4 months ago

spdlog had gotten out of sync with the fmt library it uses. This has been fixed in spdlog 1.14.0

I changed line 92 in kdevcxx_with_ai/CMakeLists.txt to v1.14.0:

CPMAddPackage(
  NAME spdlog
  GITHUB_REPOSITORY gabime/spdlog
  GIT_TAG v1.14.0
)

re: https://github.com/gabime/spdlog/issues/3070

JJones780 commented 4 months ago

It was then trying to compile against my local install of spdlog. I needed to modify:

kdevcxx_with_ai/ai_processing/CMakeLists.txt

added below line 13 ( i.e. to target_link_libraries): spdlog::spdlog

now I'm getting ai_processing/source/network.cc errors.. which I'll look into next... out of time for now.