Re: How to compile (Linux, Debian or Ubuntu, x86-64) FOX toolkit (snapshot) with -g and -O2 [RefPerSys]
Basile Starynkevitch <[email protected]>
| Newsgroups | gmane.comp.lib.fox-toolkit.user |
|---|---|
| Message-ID | <[email protected]> |
On 01/04/2022 20:02, Basile Starynkevitch wrote: > > On 01/04/2022 18:39, Jeroen van der Zijp wrote: >> On Fri, 1 Apr 2022 16:44:37 +0200 >> Basile Starynkevitch <[email protected]> wrote: >> >>> On 01/04/2022 14:08, Basile Starynkevitch wrote: >>>> Hello all, >>>> >>>> As you probably know, on recent Linux distributions the recent GCC >>>> <https://gcc.gnu.org/> or Clang <https://clang.llvm.org/> compilers >>>> can be invoked with both -O2 and -g (or even -g3) >>>> >>>> For the *RefPerSys* project (symbolic AI, open source, GPLv3+; see >>>> *http://refpersys.org/* <http://refpersys.org/> and source code on >>>> https://github.com/RefPerSys/RefPerSys ...) we are considering using >>>> FOX toolkit, but we need DWARF debugging information for several >>>> important reasons: >>>> >>>> >>>> * manual debugging with GDB at first. >>>> * generation (at "runtime") of C++ code compiled to some dlopen >>>> <https://man7.org/linux/man-pages/man3/dlopen.3.html>-ed plugin. >>>> The generated C++ code would depend upon some rules entered thru >>>> the FOX graphical user interface >>>> * software introspection and runtime reflection using Ian Lance >>>> Taylor libbacktrace >>>> <https://github.com/ianlancetaylor/libbacktrace> combioned with >>>> dladdr <https://man7.org/linux/man-pages/man3/dladdr.3.html>. >>>> * Hopefully, homoiconicity >>>> <https://en.wikipedia.org/wiki/Homoiconicity> of the /RefPerSys/ >>>> system and rule language >>>> >>>> >>>> I tried several times to configure FOX source tree /fox-1.7.80/ using >>>> ./configure --enable-debug CFLAGS='-O2 -g3' CXXFLAGS='-O2 -g3' but the >>>> compilation of FOX did not show any -O flag. >>>> >>>> This is on Ubuntu 21.10, with g++ being GCC 11.1 >>> >>> It seems (I am not sure) that using make CXXFLAGS='-O2 -g3' in FOX >>> toolkit source tree solved the problem. >>> >>> >>> I am unhappy of that ugly way to solve it. >> Try configure --help to see the options. >> >> For optimized compile: >> >> configure --enable-release --enable-native <other options> >> >> The --enable-native tells GCC to generate optimal code for the host; >> do NOT use this option if compiling code for 3rd parties that may have >> different processor than yours. [because GCC will potentially generate >> AVX2, FMA3, etc. instructions and these require late-model x86 cpus to >> be able to work. >> >> You can also use --enable-native=<cpu target> >> >> for instance, --enable-native=ssse4.2 >> >> Would tell GCC its OK to target processors capable of SSE4.2 [you can >> pass >> whatever -march argument would be legal]. >> >> Since its a GUI, -O3 will potentially lead to a lot of code-bloat and >> may be only marginally faster, due to the fact that most speed will be >> limited by drawing things on the screen, and these things are done >> in libraries that your compile-options have not much effect on... >> >> So, optimization in --enable-release is set to O2. > > Thanks Jeoren van der Zijp. > > > But I absolutely need every library used by RefPerSys (see > http://refpersys.org/ and code on > https://github.com/RefPerSys/RefPerSys commit b13ac8a1c04650) to be > compiled with DWARF debugging information. I could accept optimization > to be only -Og or -O1. > > (except perhaps libc and libstdc++) > > DWARF debugging information is required by libbacktrace. > > Basically I want configure --enable-debug --enable-release > > With fox-1.7.79 it fails: > > make[2]: Entering directory '/usr/src/X11/fox-1.7.79/lib' > /bin/bash ../libtool --tag=CXX --mode=compile g++ > -DPACKAGE_NAME=\"fox\" -DPACKAGE_TARNAME=\"fox\" > -DPACKAGE_VERSION=\"1.7.79\" -DPACKAGE_STRING=\"fox\ 1.7.79\" > -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" > -DPACKAGE=\"fox\" -DVERSION=\"1.7.79\" -DSTDC_HEADERS=1 > -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 > -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 > -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 > -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -D__EXTENSIONS__=1 > -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS=1 > -D_TANDEM_SOURCE=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SYS_WAIT_H=1 > -DHAVE_DIRENT_H=1 -DHAVE_LIBRT=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBDL=1 > -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_GETPWUID_R=1 > -DHAVE_GETGRGID_R=1 -DHAVE_GETPWNAM_R=1 > -DHAVE_PTHREAD_SETAFFINITY_NP=1 -DHAVE_PTHREAD_GETNAME_NP=1 > -DHAVE_PTHREAD_SETNAME_NP=1 -DHAVE_SCHED_GETCPU=1 > -DHAVE_EPOLL_CREATE1=1 -DHAVE_TIMERFD_CREATE=1 -DHAVE_PIPE2=1 > -DHAVE_STATVFS=1 -DHAVE_GETRLIMIT=1 -DHAVE_INOTIFY_INIT1=1 > -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_EPOLL_H=1 -DHAVE_SYS_TIMERFD_H=1 > -DHAVE_SYS_IPC_H=1 -DHAVE_SYS_SHM_H=1 -DHAVE_SYS_MMAN_H=1 > -DHAVE_SYS_MOUNT_H=1 -DHAVE_SEMAPHORE_H=1 -DHAVE_DLFCN_H=1 > -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_INOTIFY_H=1 -DHAVE_SYS_RESOURCE_H=1 > -DHAVE_IMMINTRIN_H=1 -DHAVE_PNG_H=1 -DHAVE_TIFF_H=1 -DHAVE_ZLIB_H=1 > -DHAVE_BZLIB_H=1 -DHAVE_X11_EXTENSIONS_XSHM_H=1 > -DHAVE_X11_EXTENSIONS_SHAPE_H=1 -DHAVE_X11_XCURSOR_XCURSOR_H=1 > -DHAVE_X11_EXTENSIONS_XRENDER_H=1 -DHAVE_X11_EXTENSIONS_XRANDR_H=1 > -DHAVE_X11_EXTENSIONS_XFIXES_H=1 -DHAVE_X11_EXTENSIONS_XINPUT2_H=1 -I. > -I../include -I../include -I/usr/include/freetype2 -Wall -Wextra > -Woverloaded-virtual -Wshadow -g -DDEBUG -O2 -DNDEBUG -ffast-math > -fstrict-aliasing -finline-functions -fomit-frame-pointer > -DHAVE_JPEG_H=1 -DHAVE_PNG_H=1 -DHAVE_TIFF_H=1 -DHAVE_ZLIB_H=1 > -DHAVE_BZ2LIB_H=1 -DHAVE_XSHM_H=1 -DHAVE_XSHAPE_H=1 -DHAVE_XCURSOR_H=1 > -DHAVE_XRENDER_H=1 -DHAVE_XRANDR_H=1 -DHAVE_XFIXES_H=1 > -DHAVE_XINPUT2_H=1 -DNO_XIM -DHAVE_XFT_H=1 -DHAVE_XFT_H=1 > -DHAVE_GL_H=1 -DHAVE_GLU_H=1 -DHAVE_GLX_H=1 -MT FXRex.lo -MD -MP -MF > .deps/FXRex.Tpo -c -o FXRex.lo FXRex.cpp > libtool: compile: g++ -DPACKAGE_NAME=\"fox\" > -DPACKAGE_TARNAME=\"fox\" -DPACKAGE_VERSION=\"1.7.79\" > "-DPACKAGE_STRING=\"fox 1.7.79\"" > -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" > -DPACKAGE=\"fox\" -DVERSION=\"1.7.79\" -DSTDC_HEADERS=1 > -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 > -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 > -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 > -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -D__EXTENSIONS__=1 > -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS=1 > -D_TANDEM_SOURCE=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SYS_WAIT_H=1 > -DHAVE_DIRENT_H=1 -DHAVE_LIBRT=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBDL=1 > -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_GETPWUID_R=1 > -DHAVE_GETGRGID_R=1 -DHAVE_GETPWNAM_R=1 > -DHAVE_PTHREAD_SETAFFINITY_NP=1 -DHAVE_PTHREAD_GETNAME_NP=1 > -DHAVE_PTHREAD_SETNAME_NP=1 -DHAVE_SCHED_GETCPU=1 > -DHAVE_EPOLL_CREATE1=1 -DHAVE_TIMERFD_CREATE=1 -DHAVE_PIPE2=1 > -DHAVE_STATVFS=1 -DHAVE_GETRLIMIT=1 -DHAVE_INOTIFY_INIT1=1 > -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_EPOLL_H=1 -DHAVE_SYS_TIMERFD_H=1 > -DHAVE_SYS_IPC_H=1 -DHAVE_SYS_SHM_H=1 -DHAVE_SYS_MMAN_H=1 > -DHAVE_SYS_MOUNT_H=1 -DHAVE_SEMAPHORE_H=1 -DHAVE_DLFCN_H=1 > -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_INOTIFY_H=1 -DHAVE_SYS_RESOURCE_H=1 > -DHAVE_IMMINTRIN_H=1 -DHAVE_PNG_H=1 -DHAVE_TIFF_H=1 -DHAVE_ZLIB_H=1 > -DHAVE_BZLIB_H=1 -DHAVE_X11_EXTENSIONS_XSHM_H=1 > -DHAVE_X11_EXTENSIONS_SHAPE_H=1 -DHAVE_X11_XCURSOR_XCURSOR_H=1 > -DHAVE_X11_EXTENSIONS_XRENDER_H=1 -DHAVE_X11_EXTENSIONS_XRANDR_H=1 > -DHAVE_X11_EXTENSIONS_XFIXES_H=1 -DHAVE_X11_EXTENSIONS_XINPUT2_H=1 -I. > -I../include -I../include -I/usr/include/freetype2 -Wall -Wextra > -Woverloaded-virtual -Wshadow -g -DDEBUG -O2 -DNDEBUG -ffast-math > -fstrict-aliasing -finline-functions -fomit-frame-pointer > -DHAVE_JPEG_H=1 -DHAVE_PNG_H=1 -DHAVE_TIFF_H=1 -DHAVE_ZLIB_H=1 > -DHAVE_BZ2LIB_H=1 -DHAVE_XSHM_H=1 -DHAVE_XSHAPE_H=1 -DHAVE_XCURSOR_H=1 > -DHAVE_XRENDER_H=1 -DHAVE_XRANDR_H=1 -DHAVE_XFIXES_H=1 > -DHAVE_XINPUT2_H=1 -DNO_XIM -DHAVE_XFT_H=1 -DHAVE_XFT_H=1 > -DHAVE_GL_H=1 -DHAVE_GLU_H=1 -DHAVE_GLX_H=1 -MT FXRex.lo -MD -MP -MF > .deps/FXRex.Tpo -c FXRex.cpp -fPIC -DPIC -o .libs/FXRex.o > FXRex.cpp:4676:10: fatal error: fxrexdbg.h: No such file or directory > 4676 | #include "fxrexdbg.h" > | ^~~~~~~~~~~~ > compilation terminated. > make[2]: *** [Makefile:1466: FXRex.lo] Error 1 > make[2]: Leaving directory '/usr/src/X11/fox-1.7.79/lib' > make[1]: *** [Makefile:993: all] Error 2 > make[1]: Leaving directory '/usr/src/X11/fox-1.7.79/lib' > make: *** [Makefile:496: all-recursive] Error 1 > Etienne Mollier suggested to edit the configure.ac file of FOX and put there near line 57 CXXFLAGS="-O -g" Then I run autoconf (version is 2.69) and then I run ./configure --enable-debug --enable-release, but make fails: rimski.x86_64 src/X11/fox-1.7.79 20:27 .0 % make CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /usr/src/X11/fox-1.7.79/missing aclocal-1.15 /usr/src/X11/fox-1.7.79/missing: line 81: aclocal-1.15: command not found WARNING: 'aclocal-1.15' is missing on your system. You should only need it if you modified 'acinclude.m4' or 'configure.ac' or m4 files included by 'configure.ac'. The 'aclocal' program is part of the GNU Automake package: <http://www.gnu.org/software/automake> It also requires GNU Autoconf, GNU m4 and Perl in order to run: <http://www.gnu.org/software/autoconf> <http://www.gnu.org/software/m4/> <http://www.perl.org/> make: *** [Makefile:415: aclocal.m4] Error 127 Thanks for your help -- Basile Starynkevitch<[email protected]> (only mine opinions / les opinions sont miennes uniquement) 92340 Bourg-la-Reine, France web page: starynkevitch.net/Basile/ _______________________________________________ Foxgui-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/foxgui-users