Build CodeLite 15.0 fails in make -j$(nproc)

CodeLite installation/troubleshooting forum
Steve Petrie
CodeLite Enthusiast
Posts: 11
Joined: Mon Jan 31, 2022 5:52 pm
Genuine User: Yes
IDE Question: C++
Contact:

Build CodeLite 15.0 fails in make -j$(nproc)

Post by Steve Petrie »

Building CodeLite 15.0 from source on Debian linux fails in make -j$(nproc) step.



== > gcc version:
...
(miniconda3)steve@debian1:~$ gcc --version
gcc (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
...

==> cmake version:

(miniconda3)steve@debian1:~$ cmake --version
cmake version 3.7.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
(miniconda3)steve@debian1:~$



==> here is a paste of the steps:
==> clone git repository
==> run cmake-3.22.2
...
==> clone git repository:
==> 300.1 MB !!
...
(miniconda3)steve@debian1:~/apps/CodeLite-15.0$ git clone https://github.com/eranif/codelite.git
Cloning into 'codelite'...
remote: Enumerating objects: 138499, done.
remote: Total 138499 (delta 0), reused 0 (delta 0), pack-reused 138499
Receiving objects: 100% (138499/138499), 572.92 MiB | 6.88 MiB/s, done.
Resolving deltas: 100% (108056/108056), done.
(miniconda3)steve@debian1:~/apps/CodeLite-15.0$
...

==> run cmake-3.22.2:
...
miniconda3)steve@debian1:~/apps/CodeLite-15.0/codelite/build-release$ /home/steve/apps/cmake-3.22.2/cmake-3.22.2-linux-x86_64/bin/cmake -DCMAKE_BUILD_TYPE=Release .. -DCOPY_WX_LIBS=1
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SQLite3: /usr/include (found version "3.16.2")
-- BUILD_DIRECTORY is set to /home/steve/apps/CodeLite-15.0/codelite/build-release
-- OS name Linux
-- wx-config used is: /usr/local/bin/wx-config
-- wxWidgets version is: 3.0.5
-- gtk version is: 3
-- LIBSSH_LIB is set to /usr/lib/x86_64-linux-gnu/libssh.so
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29")
-- Checking for module 'gtk+-3.0'
-- Found gtk+-3.0, version 3.22.11
-- Checking for module 'gdk-pixbuf-2.0'
-- Found gdk-pixbuf-2.0, version 2.36.5
-- Checking for one of the modules 'glib-2.0'
-- Found GLib2: glib-2.0 /usr/include/glib-2.0;/usr/lib/x86_64-linux-gnu/glib-2.0/include
-- Looking for include file glib/gregex.h
-- Looking for include file glib/gregex.h - not found
-- Checking for module 'pango'
-- Found pango, version 1.40.5
-- Checking for module 'atk'
-- Found atk, version 2.22.0
-- Found GTK3: /usr/lib/x86_64-linux-gnu/libgtk-3.so
-- Found wxWidgets: -L/usr/local/lib;-pthread;;;-lwx_gtk3u_adv-3.0;-lwx_gtk3u_aui-3.0;-lwx_baseu-3.0;-lwx_gtk3u_core-3.0;-lwx_gtk3u_html-3.0;-lwx_gtk3u_propgrid-3.0;-lwx_baseu_xml-3.0;-lwx_gtk3u_xrc-3.0;-lwx_baseu_net-3.0;-lwx_gtk3u_stc-3.0;-lwx_gtk3u_ribbon-3.0;-lwx_gtk3u_richtext-3.0 (found version "3.0.5")
-- PLUGINS_DIR is set to /usr/lib/x86_64-linux-gnu/codelite
-- Using Native Notebook class
-- Building in Release mode
-- CMAKE_INSTALL_DO_STRIP is TRUE
-- Executables will be written into /home/steve/apps/CodeLite-15.0/codelite/build-release/bin
-- Shared Objects will be written into /home/steve/apps/CodeLite-15.0/codelite/build-release/lib
-- Adding -DNDEBUG to definitions
-- CPACK_SYSTEM_NAME debian-stretch-x86_64
-- OS_CODENAME is set to stretch
-- ARCH 64
-- ARCH_NAME x86_64
-- USE_SFTP is set to 1
-- Flex support is disabled
**
** NOTICE ** Could not locate libhunspell. SpellChecker plugin will not be build
** NOTICE ** Try installing libhunspell-dev package
**
**** NOTICE: lldb is not available. You could try installing the lldb-3.4-dev (or equivalent) package
-- CL_SRC_ROOT is set to /home/steve/apps/CodeLite-15.0/codelite
-- Adding Valgrind Plugin
-- Building wxCrafter as codelite plugin
-- Generating makefile for wxCrafter
-- wxlibsdir is: /usr/local/lib
-- will copy /usr/lib/x86_64-linux-gnu/libssh.so;/usr/lib/x86_64-linux-gnu/libssh.so.4;/usr/lib/x86_64-linux-gnu/libssh.so.4.4.1
-I/usr/local/lib/wx/include/gtk3-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -DWXGTK -pthread
-- Including plugin.cmake module
-- CMAKE_SOURCE_DIR is set to /home/steve/apps/CodeLite-15.0/codelite
-- Configuring done
-- Generating done
-- Build files have been written to: /home/steve/apps/CodeLite-15.0/codelite/build-release
(miniconda3)steve@debian1:~/
...



Here is a paste of relevant lines from the bash cli window of the make -j$(nproc) step:
...
[ 61%] Linking CXX executable ../bin/PHPUnitTests
[ 62%] Linking CXX shared library ../lib/Remoty.so
/usr/local/lib/libwx_gtk3u_stc-3.0.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
collect2: error: ld returned 1 exit status
codelitephp/CMakeFiles/PHPUnitTests.dir/build.make:124: recipe for target 'bin/PHPUnitTests' failed
make[2]: *** [bin/PHPUnitTests] Error 1
CMakeFiles/Makefile2:2177: recipe for target 'codelitephp/CMakeFiles/PHPUnitTests.dir/all' failed
make[1]: *** [codelitephp/CMakeFiles/PHPUnitTests.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs.
...
[ 66%] Linking CXX shared library ../lib/codelitephp.so
[ 66%] Built target codelitephp
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2
(miniconda3)steve@debian1:~/apps/CodeLite-15.0/codelite/build-release$
...



Here is a paste of more lines around the errors from the bash cli window of the make -j$(nproc) step:
(miniconda3)steve@debian1:~/apps/CodeLite-15.0/codelite/build-release$ make -j$(nproc)
[ 0%] Building CXX object sdk/wxsqlite3/CMakeFiles/wxsqlite3.dir/src/wxsqlite3.cpp.o
...
[ 60%] Built target Subversion
[ 60%] Building CXX object Remoty/CMakeFiles/Remoty.dir/RemotyConfig.cpp.o
[ 60%] Building CXX object SFTP/CMakeFiles/SFTP.dir/SFTPTreeView.cpp.o
[ 60%] Building CXX object Docker/CMakeFiles/Docker.dir/clDockerWorkspaceSettings.cpp.o
[ 60%] Building CXX object Remoty/CMakeFiles/Remoty.dir/RemotyNewWorkspaceDlg.cpp.o
[ 60%] Building CXX object Docker/CMakeFiles/Docker.dir/clDockerWorkspaceView.cpp.o
[ 60%] Building CXX object LanguageServer/CMakeFiles/LanguageServer.dir/LanguageServerLogView.cpp.o
[ 60%] Building CXX object Remoty/CMakeFiles/Remoty.dir/RemotyPlugin.cpp.o
[ 60%] Building CXX object LanguageServer/CMakeFiles/LanguageServer.dir/LanguageServerPage.cpp.o
[ 60%] Building CXX object SFTP/CMakeFiles/SFTP.dir/SFTPUploadDialog.cpp.o
[ 60%] Building CXX object SFTP/CMakeFiles/SFTP.dir/UI.cpp.o
[ 60%] Building CXX object Docker/CMakeFiles/Docker.dir/clDockerfile.cpp.o
[ 60%] Building CXX object Remoty/CMakeFiles/Remoty.dir/RemotySwitchToWorkspaceDlg.cpp.o
[ 60%] Building CXX object Docker/CMakeFiles/Docker.dir/docker.cpp.o
[ 60%] Building CXX object LanguageServer/CMakeFiles/LanguageServer.dir/LanguageServerSettingsDlg.cpp.o
[ 60%] Building CXX object SFTP/CMakeFiles/SFTP.dir/UI_sftp_bitmaps.cpp.o
[ 60%] Building CXX object LanguageServer/CMakeFiles/LanguageServer.dir/NewLanguageServerDlg.cpp.o
[ 60%] Building CXX object Remoty/CMakeFiles/Remoty.dir/RemotyUI.cpp.o
[ 60%] Building CXX object SFTP/CMakeFiles/SFTP.dir/remote_file_info.cpp.o
[ 60%] Linking CXX shared library ../lib/Docker.so
[ 60%] Built target Docker
[ 60%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/FileMappingDlg.cpp.o
[ 61%] Building CXX object SFTP/CMakeFiles/SFTP.dir/sftp.cpp.o
[ 61%] Building CXX object LanguageServer/CMakeFiles/LanguageServer.dir/PathConverterDefault.cpp.o
[ 61%] Building CXX object Remoty/CMakeFiles/Remoty.dir/RemotyUI_remoty_bitmaps.cpp.o
[ 61%] Building CXX object Remoty/CMakeFiles/Remoty.dir/RemotyWorkspace.cpp.o
[ 61%] Building CXX object LanguageServer/CMakeFiles/LanguageServer.dir/UI.cpp.o
[ 61%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/NewPHPClass.cpp.o
[ 61%] Building CXX object SFTP/CMakeFiles/SFTP.dir/sftp_worker_thread.cpp.o
[ 61%] Building CXX object LanguageServer/CMakeFiles/LanguageServer.dir/UI_languageserver_bitmaps.cpp.o
[ 61%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/NewPHPProjectWizard.cpp.o
[ 61%] Building CXX object LanguageServer/CMakeFiles/LanguageServer.dir/languageserver.cpp.o
[ 61%] Building CXX object SFTP/CMakeFiles/SFTP.dir/sftp_workspace_settings.cpp.o
[ 61%] Building CXX object Remoty/CMakeFiles/Remoty.dir/RemotyWorkspaceView.cpp.o
[ 61%] Linking CXX shared library ../lib/SFTP.so
[ 61%] Built target SFTP
[ 61%] Building CXX object codelitephp/CMakeFiles/PHPUnitTests.dir/PHPParserUnitTests/main.cpp.o
[ 61%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/PHPDebugPane.cpp.o
[ 61%] Linking CXX shared library ../lib/LanguageServer.so
[ 61%] Built target LanguageServer
[ 61%] Building CXX object WordCompletion/CMakeFiles/WordCompletion.dir/UI.cpp.o
[ 61%] Building CXX object Remoty/CMakeFiles/Remoty.dir/clRemoteTerminal.cpp.o
[ 61%] Building CXX object WordCompletion/CMakeFiles/WordCompletion.dir/UI_wordcompletion_bitmaps.cpp.o
[ 61%] Building CXX object codelitephp/CMakeFiles/PHPUnitTests.dir/PHPParserUnitTests/tester.cpp.o
[ 61%] Building CXX object WordCompletion/CMakeFiles/WordCompletion.dir/WordCompletionDictionary.cpp.o
[ 61%] Linking CXX executable ../bin/PHPUnitTests
[ 62%] Linking CXX shared library ../lib/Remoty.so
/usr/local/lib/libwx_gtk3u_stc-3.0.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
collect2: error: ld returned 1 exit status
codelitephp/CMakeFiles/PHPUnitTests.dir/build.make:124: recipe for target 'bin/PHPUnitTests' failed
make[2]: *** [bin/PHPUnitTests] Error 1
CMakeFiles/Makefile2:2177: recipe for target 'codelitephp/CMakeFiles/PHPUnitTests.dir/all' failed
make[1]: *** [codelitephp/CMakeFiles/PHPUnitTests.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 62%] Building CXX object WordCompletion/CMakeFiles/WordCompletion.dir/WordCompletionSettings.cpp.o
[ 62%] Built target Remoty
[ 62%] Building CXX object WordCompletion/CMakeFiles/WordCompletion.dir/WordCompletionSettingsDlg.cpp.o
[ 62%] Building CXX object WordCompletion/CMakeFiles/WordCompletion.dir/WordCompletionThread.cpp.o
[ 62%] Building CXX object WordCompletion/CMakeFiles/WordCompletion.dir/WordTokenizer.cpp.o
[ 62%] Building CXX object WordCompletion/CMakeFiles/WordCompletion.dir/wordcompletion.cpp.o
[ 62%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/PHPDebugStartDlg.cpp.o
[ 62%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/PHPSettersGettersDialog.cpp.o
[ 62%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/PHPXDebugSetupWizard.cpp.o
[ 63%] Linking CXX shared library ../lib/WordCompletion.so
[ 63%] Built target WordCompletion
[ 63%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/PhpSFTPHandler.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugBreakpointCmdHandler.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugCommThread.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugCommandHandler.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugContextGetCmdHandler.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugEvalCmdHandler.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugManager.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugPropertyGetHandler.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugRunCmdHandler.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugStackGetCmdHandler.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugStopCmdHandler.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugTester.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XDebugUnknownCommand.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/XVariable.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/evalpane.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/localsview.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/my_tree_view.cpp.o
[ 64%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/new_class.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/new_class_php-plugin_bitmaps.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/new_file_dlg.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/new_php_workspace_dlg.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/php.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/php_editor_context_menu.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/php_file_layout_tree.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/php_open_resource_dlg.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/php_project_settings_dlg.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/php_settings_dlg.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/php_ui.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/php_ui_php-plugin_bitmaps.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/php_workspace_view.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/plugin_settings.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/quick_outline_dlg.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/ssh_workspace_settings.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/xdebugbreakpointsmgr.cpp.o
[ 65%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/xdebugevent.cpp.o
[ 66%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/xdebuglocalsviewmodel.cpp.o
[ 66%] Linking CXX shared library ../lib/codelitephp.so
[ 66%] Built target codelitephp
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2
(miniconda3)steve@debian1:~/apps/CodeLite-15.0/codelite/build-release$
...



Any suggestions would be welcome !!

Thanks,

Steve Petrie

apetrie@aspetrie.net

DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Build CodeLite 15.0 fails in make -j$(nproc)

Post by DavidGH »

Hi,

Building CodeLite 15.0 from source

Are you? Your paste shows a git clone, but I didn't see you then checkout the 15.0 tag. I think you're building git HEAD, and that's confirmed by the later mention of post-15.0 items, e.g. remoty.

And which debian version? Your gcc is 11.2.0, which suggests testing or unstable, but of course you could be using stable or earlier and have installed your own gcc.

Regards,

David

Steve Petrie
CodeLite Enthusiast
Posts: 11
Joined: Mon Jan 31, 2022 5:52 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Build CodeLite 15.0 fails in make -j$(nproc)

Post by Steve Petrie »

David:

Thanks for your prompt response.



My operating environment:

(miniconda3)steve@debian1:~$ cat /etc/debian_version
9.4
(miniconda3)steve@debian1:~$ uname -srm
Linux 4.9.0-6-amd64 x86_64
(miniconda3)steve@debian1:~$



I built gcc 11.2.0 from source.

According to the gcc website this is a "Supported Release"
https://gcc.gnu.org/
https://gcc.gnu.org/gcc-11/
https://gcc.gnu.org/releases.html



I'm a naive github newbie. I followed the instructions at https://docs.codelite.org/build/build_from_sources/

Which tell me to:
...
Git clone the sources:

Code: Select all

git clone https://github.com/eranif/codelite.git

...

my bad for not looking for the 15.0 tag :(



Today I fetched codelite-15.0.tar.gz from: https://downloads.codelite.org/

And tried to build it but had the same problem in the make -j$(nproc) step:
...
[ 62%] Built target Subversion
[ 62%] Building CXX object WordCompletion/CMakeFiles/WordCompletion.dir/UI.cpp.o
[ 62%] Building CXX object codelitephp/CMakeFiles/codelitephp.dir/php-plugin/PHPDebugStartDlg.cpp.o
[ 62%] Building CXX object WordCompletion/CMakeFiles/WordCompletion.dir/UI_wordcompletion_bitmaps.cpp.o
[ 63%] Building CXX object codelitephp/CMakeFiles/PHPUnitTests.dir/PHPParserUnitTests/tester.cpp.o
[ 63%] Building CXX object SFTP/CMakeFiles/SFTP.dir/SFTPUploadDialog.cpp.o
[ 63%] Linking CXX executable ../bin/PHPUnitTests
/usr/local/lib/libwx_gtk3u_stc-3.0.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
collect2: error: ld returned 1 exit status
codelitephp/CMakeFiles/PHPUnitTests.dir/build.make:124: recipe for target 'bin/PHPUnitTests' failed
make[2]: *** [bin/PHPUnitTests] Error 1
CMakeFiles/Makefile2:1990: recipe for target 'codelitephp/CMakeFiles/PHPUnitTests.dir/all' failed
make[1]: *** [codelitephp/CMakeFiles/PHPUnitTests.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 63%] Building CXX object SFTP/CMakeFiles/SFTP.dir/UI.cpp.o
...



After much research I conclude that the problem may be because the build make step has gcc (gcc 11.2.0) linking object module libwx_gtk3u_stc-3.0.so with the wrong version of libstdc++.a and not the version of libstdc++.a created during my build of gcc 11.2.0

(miniconda3)steve@debian1:/usr/local/lib64$ ls -Al --group-directories-first --time-style=long-iso libstdc++.a
-rw-r--r-- 1 root staff 33415622 2022-01-18 21:39 libstdc++.a
(miniconda3)steve@debian1:/usr/local/lib64$

So I tried unsuccessfully to modify the Makefile to add the correct directory /usr/local/lib64 to the linker's library search path.

Unfortunately I am also a naive Cmake / make newbie. After many hours of searching the Internet for tips on how to modify a Makefile to tell make to tell the gcc link step to use the version of libstdc++.a in /usr/local/lib64 I have to admit failure.

I attach the Makefile (as Makefile.txt to satisfy the forum's requirement for a filename extension) in the hope that the developers of CodeLite will :
either:
modify it so that the gcc (11.2.0) link step uses /usr/local/lib64/ibstdc++.a when building CodeLite 15.0
or:
tell me how to modify it so that the gcc (11.2.0) link step uses /usr/local/lib64/ibstdc++.a when building CodeLite 15.0

Any assistance gratefully appreciated.

Steve Petrie

apetrie@aspetrie.net

DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Build CodeLite 15.0 fails in make -j$(nproc)

Post by DavidGH »

After many hours of searching the Internet for tips on how to modify a Makefile

As you probably realise, that's wouldn't be an ideal solution anyway: you'd have to redo the modification after every rebuild.

I understand that you're using your self-built gcc to compile CodeLite, but did you also self-build wxWidgets, using the same gcc? If not, that might explain the problem and suggest a solution.

Otherwise I'm afraid your situation is outside my experience; the mixture of the 'testing' version of gcc on 'oldoldstable' is surely unusual. I expect there is a way to get the linking right, but I don't know it. Perhaps you could find something in this howto.

Steve Petrie
CodeLite Enthusiast
Posts: 11
Joined: Mon Jan 31, 2022 5:52 pm
Genuine User: Yes
IDE Question: C++
Contact:

CodeLite Now Builds Successfully With GCC 11.2.0

Post by Steve Petrie »

Hi David,

Thanks for your earlier response.

I now have codelite 15.0 building successfully using gcc 11.2.0. The fixes to get this build working turned out to be laughably simple. After many days of investigative work.



Now, codelite starts and a cli command of "codelite --help" produces the expected output:
...
(miniconda3)steve@debian1:~/apps/CodeLite-15.0/codelite-15.0/build-release$ codelite --help
Usage: codelite [-v] [-h] [-n] [-g <str>] [-l <num>] [-b <str>] [-d <str>] [-w <str>] [-p <str>] [Input file...]
-v, --version Print current version
-h, --help Print usage
-n, --no-plugins Start CodeLite without any plugins
-g, --dbg=<str> Start CodeLite's GDB debugger to debug an executable
-l, --line=<num> Open the file at a given line number
-b, --basedir=<str> Use this path as the CodeLite installation path (Windows only)
-d, --datadir=<str> Use this path as the CodeLite data path
-w, --dbg-dir=<str> When started with --dbg, set the working directory for the debugger
-p, --with-plugins=<str> Comma separated list of plugins to load
(miniconda3)steve@debian1:~/apps/CodeLite-15.0/codelite-15.0/build-release$ codelite-15.0/build-release$ codelite --version
CodeLite IDE v15.0.0
(miniconda3)steve@debian1:~/apps/CodeLite-15.0/codelite-15.0/build-release$
...



Unfortunately, when I try to start the codelite gui, codelite quietly terminates and returns to the cli: without displaying any window, or message on the cli console:
...
(miniconda3)steve@debian1:~/apps/CodeLite-15.0/codelite-15.0/build-release$ codelite
(miniconda3)steve@debian1:~/apps/CodeLite-15.0/codelite-15.0/build-release$
...

Interesting messages appear at the tail of the /var/log/syslog file:
...
(miniconda3)steve@debian1:/var/log$ sudo tail syslog
...
Feb 11 07:49:17 debian1 gnome-terminal-[5079]: Allocating size to GtkScrollbar 0x56058f646480 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
Feb 11 07:49:17 debian1 gnome-terminal-[5079]: Allocating size to GtkScrollbar 0x56058f646480 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
Feb 11 07:49:18 debian1 gnome-terminal-[5079]: Allocating size to GtkScrollbar 0x56058f646480 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
Feb 11 07:49:18 debian1 gnome-terminal-[5079]: Allocating size to GtkScrollbar 0x56058f646480 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
Feb 11 07:49:18 debian1 gnome-terminal-[5079]: Allocating size to GtkScrollbar 0x56058f646480 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
(miniconda3)steve@debian1:/var/log$
...

Looks to me like I could have something wrong in the operating context, causing codelite to call an incompatible version of GTK.

After a pause to deal with other business, I'm now back at work on codelite, investigating these errors.

Once I get the codelitw gui starting and working, I'll send you a report on the fixes I made to get codelite working when compiled with gcc 11.2.0.

If you have any suggestions as to the possible cause of / fix for the above errors, please let me know.

Thanks,

Steve Petrie

apetrie@aspetrie.net

DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Build CodeLite 15.0 fails in make -j$(nproc)

Post by DavidGH »

The fixes to get this build working turned out to be laughably simple.

What were they?

If you have any suggestions as to the possible cause of / fix for the above errors, please let me know

Have you tried running CodeLite in gdb?

Steve Petrie
CodeLite Enthusiast
Posts: 11
Joined: Mon Jan 31, 2022 5:52 pm
Genuine User: Yes
IDE Question: C++
Contact:

CodeLite Now Builds Successfully With GCC 11.2.0, But Fails Silently When Run

Post by Steve Petrie »

Here is a summary of the fixes I have made. This summary is based on my detailed text files documenting the work.

In brief, the fixes I implemented so far are (items: 1., 2., 3.):

  1. setup (2 fixes: 1.1, 1.2):

1.1 use CMake 2.8.12.2 instead of CMake 3.22.2 (gives perfectly clean CMake run, instead of many incomprehensible CMake warnings)

1.2 download CodeLite 15.0 source code via CodeLite website (easier for naive GitHub newbie, instead of messing directly with GitHub website):
1.2.1 https://downloads.codelite.org/
1.2.3 right-click "Download CodeLite 15.0 tar.gz from GitHub"
1.2.4 save as /home/steve/apps/CodeLite-15.0/_download/codelite-15.0.tar.gz

  1. fix codelite source (2 fixes):

    Code: Select all

    2.1 fix  Cmake.lists (2 fixes: 2.1.1, 2.1.2 ):
    
    2.1.1  tell CMake to use g++ 11.2.0 compiler I built (instead of gcc 11.2.0 compiler I built, or default gcc 6.3.0 compiler that comes with linux distribution)
       (fixes linker error /usr/local/lib/libwx_gtk3u_stc-3.0.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29')
       (fixes linker error ""/usr/bin/ld: CMakeFiles/codelite_cppcheck.dir/lib/mathlib.cpp.o: undefined reference to symbol 'cos@@GLIBC_2.2.5'"")
    ...
    # 20220302 steve - tell Cmake to use gcc 11.2.0 compiler instead of default gcc 6.3.0 compiler.
    # fixes error when make is linking PHPUnitTests with GTK3 built with gcc 11.2.0
    # ...
    #  Linking CXX executable ../bin/PHPUnitTests
    #  /usr/local/lib/libwx_gtk3u_stc-3.0.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
    # ...
    # (line must be ***BEFORE*** project command).
    #
    # 20220205 steve - tell CMake to use g++ 11.2.0 compiler instead of gcc 11.2.0 compiler.
    # fixes linker error "/usr/bin/ld: CMakeFiles/codelite_cppcheck.dir/lib/mathlib.cpp.o: undefined reference to symbol 'cos@@GLIBC_2.2.5'"
    set(CMAKE_CXX_COMPILER "/usr/local/bin/g++")   # g++ compiler automatically includes math library.
    # set(CMAKE_CXX_COMPILER "/usr/local/bin/gcc") # tell CMake to use this compiler.
    ...
    
    2.1.2 add link library for gcc-11.2.0 compiler compatibility
    ...
    # 20220204 steve - add link library for gcc-11.2.0 compiler compatibility.
    # fixes error when make is linking PHPUnitTests that is built with gcc 11.2.0
    # ...
    # Linking CXX executable ../bin/PHPUnitTests
    # /usr/bin/ld: CMakeFiles/PHPUnitTests.dir/PHPParserUnitTests/main.cpp.o: undefined reference to symbol '_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3'
    # ...
                list(APPEND LINKER_OPTIONS "-s" "-lstdc++") ## strip binaries, add gcc 11.2.0 library (***NOTE*** must remove "lib" prefix & ".so.6" suffix from library file name (if libstdc++.so exists)).
    #           list(APPEND LINKER_OPTIONS "-s") ## strip binaries
    # ... steve.
    ...
    
    3. running codelite (1 fix):
    
    3.1 set LD_LIBRARY_PATH (to use the gcc 11.2.0  libraries I built)
    ..
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64
    ...
    (fixes errors when codelite runs:
    ...
    :(miniconda3)steve@debian1:~/apps/CodeLite-15.0/codelite-15.0/build-release$ codelite
    codelite: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by codelite)
    codelite: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/local/lib/libwx_gtk3u_stc-3.0.so.0)
    codelite: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/x86_64-linux-gnu/codelite/liblibcodelite.so)
    codelite: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/lib/x86_64-linux-gnu/codelite/liblibcodelite.so)
    codelite: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/x86_64-linux-gnu/codelite/libplugin.so)
    (miniconda3)steve@debian1:~/apps/CodeLite-15.0/codelite-15.0/build-release$
    ...
    
    * * *
    * * *
    
    Today I investigated the GTK messages in /var/log/syslog file, that are written when I run codelite at a cli, and codelite terminates silently without displaying any messages on the cli or displaying any gui windows:
    ...
    Feb 11 07:49:17 debian1 gnome-terminal-[5079]: Allocating size to GtkScrollbar 0x56058f646480 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
    Feb 11 07:49:17 debian1 gnome-terminal-[5079]: Allocating size to GtkScrollbar 0x56058f646480 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
    Feb 11 07:49:18 debian1 gnome-terminal-[5079]: Allocating size to GtkScrollbar 0x56058f646480 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
    Feb 11 07:49:18 debian1 gnome-terminal-[5079]: Allocating size to GtkScrollbar 0x56058f646480 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
    Feb 11 07:49:18 debian1 gnome-terminal-[5079]: Allocating size to GtkScrollbar 0x56058f646480 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
    ...
    
    These messages are not relevant to the silent CodeLite termination, they are spurious messages from GTK.
    
    Here s a paste from my text file of notes from the investigation:
    ...
    ==> further research into the GTK messages in /var/log/syslog file:
       ==> indicates that the messages are spurious warning messages:
          ==> that do not indicate any failure of GTK or the GTK application:
             ==> messages like these are widely reported on the Internet by many users of many GTK apps;
    
    ==> there is a potential workaround / fix  to eliminate the spurious message:
       ==> but the workaround / fix has to be made to the source code of the app that calls the GTK functions:
          ==> since codelite uses wxWidgets for its GUI management:
             ==> the workaround / fix would need to change the wxWidgets source code and re-build wxWidgets:
                ==> hardly seems worth the effort;
    
    ==> see web page:
       ==> https://bugzilla.gnome.org/show_bug.cgi?id=769566
          ==> for technical explanation of the spurious message bug;
    
    * * *
    * * *
    
    ==> this analysis means that the spurious GTK error messages in /var/log/syslog are ***IRRELEVANT***:
       ==> to my problem with codelite silently exiting:
          ==> upon invocation from the cli command prompt:
             ==> so, I'm going to need to track down the cause of the silent codelite termination:
                ==> probably need to use a debug version of a build codelite app; 
    
    * * *
    * * * 
    So, as you have already suggested, my next task is to use gdb to track down the reason why CodeLite is failing silently.

    Since I have never used gdb before, this will be yet another learning experience :)

    I'll let you know when I have made significant progress.

    Best Regards,

    Steve Petrie
Steve Petrie
CodeLite Enthusiast
Posts: 11
Joined: Mon Jan 31, 2022 5:52 pm
Genuine User: Yes
IDE Question: C++
Contact:

Attached Is A Clean Copy Of Most Recent Post;

Post by Steve Petrie »

David,

Looks like the CodeLite forum software interpreted some of my posting text as meta-code.

I attach to this present posting a text file with a clean copy of my posting:

<ASP -- Codelite - forum posting #2 - 20220211.txt>

Hope this helpx.

Steve

You do not have the required permissions to view the files attached to this post.
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Build CodeLite 15.0 fails in make -j$(nproc)

Post by DavidGH »

I've edited your post to add code-tags (the </> icon) around the offending parts.

Steve Petrie
CodeLite Enthusiast
Posts: 11
Joined: Mon Jan 31, 2022 5:52 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Build CodeLite 15.0 fails in make -j$(nproc)

Post by Steve Petrie »

Thanks for fixing my post.

I'm still working on building the debug version of CodeLite.

It's failing in the make step:

Code: Select all

...
[  5%] Building CXX object wxcrafter/CMakeFiles/wxcLib.dir/wxcLib/clSocketClient.cpp.o
/usr/bin/ld: Dwarf Error: found dwarf version '5', this reader only handles version 2, 3 and 4 information.
CMakeFiles/codelite_indexer.dir/codelite_index_main.cpp.o: In function `__gnu_cxx::new_allocator<std::_List_node<clNamedPipe*> >::allocate(unsigned long, void const*)':
codelite_index_main.cpp:(.text._ZN9__gnu_cxx13new_allocatorISt10_List_nodeIP11clNamedPipeEE8allocateEmPKv[_ZN9__gnu_cxx13new_allocatorISt10_List_nodeIP11clNamedPipeEE8allocateEmPKv]+0x45): undefined reference to `std::__throw_bad_array_new_length()'
...

Looking into versions of Dwarf on my debian PC ...

Post Reply