Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Darktable: GCC with grphite support (closed)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Sun Jan 21, 2024 11:35 am    Post subject: Darktable: GCC with grphite support (closed) Reply with quote

I wanted to put Darktable on the pc. Did an emerge and it complained that it needed GCC with "USE=graphite" support. Ok, so I changed my package.use for gcc to:
Code:
sys-devel/gcc vtv,pgo, lto, graphite

Followed by
Code:
emerge --newuse sys-devel/gcc

That went without remakrs.

So I did a "emerge darktable" again and now I still get the remark that it need gcc with graphite support. I don't know what I can do to tell it that I have just recompiled gcc with graphite support...
_________________
Expert in non-working solutions


Last edited by Spanik on Tue Jan 23, 2024 2:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Sun Jan 21, 2024 12:08 pm    Post subject: Reply with quote

Did a check with equery:
Code:
equery hasuse graphite
 * Searching for USE flag graphite ...
[I--] [??] cross-avr/gcc-12.3.1_p20230526:12
[I-O] [ -] cross-avr/gcc-13.2.1_p20230826:13
[IP-] [  ] media-libs/harfbuzz-8.2.0:0/6.0.0
[I--] [??] sys-devel/gcc-12.3.1_p20230526:12
[IP-] [  ] sys-devel/gcc-13.2.1_p20230826:13

So that looks ok to me.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
krumpf
Apprentice
Apprentice


Joined: 15 Jul 2018
Posts: 175

PostPosted: Sun Jan 21, 2024 12:21 pm    Post subject: Reply with quote

I got curious, so I tried compiling media-gfx/darktable
And indeed it failed miserably, * Please switch to a version of sys-devel/gcc built with USE=graphite, or use a different compiler.

Then I tried building it using clang as compiler, and it worked.
So I suggest you try it, to do so : (it requires clang compiler to be installed on system, which should be the case if you're using mesa, or firefox/thunderbird)

Create a /etc/portage/env/compiler-clang file, with follwing content
Code:
CC="clang"
CXX="clang++"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"
CFLAGS="-O2 -pipe -march=native"
CXXFLAGS="${CFLAGS}"


Then create a /etc/portage/package.env/compilers, with
Code:
media-gfx/darktable compiler-clang


And then try building darktable again, it should complete.
Back to top
View user's profile Send private message
krumpf
Apprentice
Apprentice


Joined: 15 Jul 2018
Posts: 175

PostPosted: Sun Jan 21, 2024 12:28 pm    Post subject: Reply with quote

Also, as far as I know, USE flags have to be space separated, not with a comma.
Edit ; just tried with added comma, if the comma is in contact with USE flag, the flag won't be recognized
E.g. : USE="vtv, lto, pgo" --> only pgo will work, because "vtv," and "lto," don't exist.

You should try equery uses gcc to check if graphite flag has been applied.
On a personal note: the pgo flag isn't really useful, unless you spend a lot of time profiling whatever you compile (and it doubles gcc building time)
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Sun Jan 21, 2024 2:08 pm    Post subject: Reply with quote

Code:
equery uses sys-devel/gcc
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for sys-devel/gcc-13.2.1_p20230826:
 U I
 - - ada                            : Build the ADA language (GNAT) frontend
 - - d                              : Enable support for the D programming language
 - - debug                          : Enables GCC's 'checking' facility via --enable-checking=yes,extra,rtl. This adds checks to various compiler passes for integrity and input validation. This can help catch possible miscompilations
                                      early as well as latent bugs which could become real problems in future, but at the cost of slower compile times when using GCC. Unrelated to backtraces.
 - - default-stack-clash-protection : Build packages with stack clash protection on by default as a hardening measure. This enables -fstack-clash-protection by default which protects against large memory allocations allowing stack
                                      smashing. May cause slightly increased codesize, but modern compilers have been adapted to optimize well for this case, as this mitigation is now quite common. See
                                      https://developers.redhat.com/blog/2020/05/22/stack-clash-mitigation-in-gcc-part-3 and https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt.
 - - default-znow                   : Request full relocation on start from ld.so by default. This sets the -z,now (BIND_NOW) flag by default on all linker invocations. By resolving all dynamic symbols at application startup, parts of
                                      the program can be made read-only as a hardening measure. This is closely related to RELRO which is also separately enabled by default. In some applications with many unresolved symbols (heavily
                                      plugin based, for example), startup time may be impacted.
 - - doc                            : Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
 + + fortran                        : Add support for fortran
 - - go                             : Build the GCC Go language frontend.
 + + graphite                       : Add support for the framework for loop optimizations based on a polyhedral intermediate representation
 - - hardened                       : Activate default security enhancements for toolchain (gcc, glibc, binutils)
 - - jit                            : Enable libgccjit so other applications can embed gcc for Just-In-Time compilation.
 + + lto                            : Build using Link Time Optimizations (LTO). Note that GCC is always built with support for building other programs with LTO. This USE flag is for whether GCC itself is built and optimized with LTO.
 - - modula2                        : Build the GCC Modula-2 language frontend.
 + + nls                            : Add Native Language Support (using gettext - GNU locale utilities)
 - - objc                           : Build support for the Objective C code language
 - - objc++                         : Build support for the Objective C++ language
 - - objc-gc                        : Build support for the Objective C code language Garbage Collector
 + + openmp                         : Build support for the OpenMP (support parallel computing), requires >=sys-devel/gcc-4.2 built with USE="openmp"
 + + pgo                            : Build GCC using Profile Guided Optimization (PGO). GCC will build itself and then analyze the just-built binary and then rebuild itself using the data obtained from analysis of codepaths taken. It
                                      does not affect whether GCC itself supports PGO when building other software. This substantially increases the build time needed for building GCC itself.
 + + sanitize                       : Build support for various sanitizer functions (ASAN/TSAN/etc...) to find runtime problems in applications.
 + + ssp                            : Build packages with stack smashing protection on by default
 - - systemtap                      : enable systemtap static probe points
 - - test                           : Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)
 - - valgrind                       : Enable annotations for accuracy. May slow down runtime slightly. Safe to use even if not currently using dev-util/valgrind
 - - vanilla                        : Do not add extra patches which change default behaviour; DO NOT USE THIS ON A GLOBAL SCALE as the severity of the meaning changes drastically
 + + vtv                            : Build support for virtual table verification (a C++ hardening feature). This does not control whether GCC defaults to using VTV> Note that actually using VTV breaks ABI and hence the whole system
                                      must be built with -fvtable-verify.
 - - zstd         

Still not OK for darktable. I'll try with clang...
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Sun Jan 21, 2024 2:11 pm    Post subject: Reply with quote

Switching to clang gave:
Code:
emerge darktable

 * IMPORTANT: 11 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

Calculating dependencies... done!
Dependency resolution took 3.62 s (backtrack: 0/20).


>>> Verifying ebuild manifests

>>> Running pre-merge checks for media-gfx/darktable-4.4.2

>>> Emerging (1 of 1) media-gfx/darktable-4.4.2::gentoo
>>> Downloading 'http://distfiles.gentoo.org/distfiles/71/darktable-4.4.2.tar.xz'
--2024-01-21 15:10:23--  http://distfiles.gentoo.org/distfiles/71/darktable-4.4.2.tar.xz
Resolving distfiles.gentoo.org... 2a02:6ea0:c700::17, 2a02:6ea0:c700::18, 2a02:6ea0:c700::11, ...
Connecting to distfiles.gentoo.org|2a02:6ea0:c700::17|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6033932 (5.8M) [application/x-xz]
Saving to: ‘/var/cache/distfiles/darktable-4.4.2.tar.xz.__download__’

/var/cache/distfile 100%[===================>]   5.75M  9.42MB/s    in 0.6s   

2024-01-21 15:10:25 (9.42 MB/s) - ‘/var/cache/distfiles/darktable-4.4.2.tar.xz.__download__’ saved [6033932/6033932]

 * darktable-4.4.2.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                [ ok ]
>>> Unpacking source...
>>> Unpacking darktable-4.4.2.tar.xz to /var/tmp/portage/media-gfx/darktable-4.4.2/work
>>> Source unpacked in /var/tmp/portage/media-gfx/darktable-4.4.2/work
>>> Preparing source in /var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2 ...
 * Source directory (CMAKE_USE_DIR): "/var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2"
 * Build directory  (BUILD_DIR):     "/var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2_build"
 * Applying darktable-3.4.0_jsonschema-automagic.patch ...                                                                                                                                                                           [ ok ]
 * Applying darktable-3.4.1_libxcf-cmake.patch ...                                                                                                                                                                                   [ ok ]
 * Applying darktable-4.2.1_cmake-musl.patch ...                                                                                                                                                                                     [ ok ]
 * Applying darktable-4.4.2_fix-has-attribute-musl.patch ...                                                                                                                                                                         [ ok ]
 * Hardcoded definition(s) removed in src/external/libxcf/CMakeLists.txt:
 *    SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, option
 * Hardcoded definition(s) removed in CMakeLists.txt:
 *      SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build,
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2 ...
 * Source directory (CMAKE_USE_DIR): "/var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2"
 * Build directory  (BUILD_DIR):     "/var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2_build"
cmake -C /var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_CURVE_TOOLS=no -DBUILD_NOISE_TOOLS=no -DBUILD_PRINT=yes -DCUSTOM_CFLAGS=ON -DDONT_USE_INTERNAL_LUA=ON -DRAWSPEED_ENABLE_LTO=no -DRAWSPEED_ENABLE_WERROR=OFF -DRAWSPEED_MUSL_SYSTEM=no -DTESTBUILD_OPENCL_PROGRAMS=OFF -DUSE_AVIF=no -DUSE_CAMERA_SUPPORT=no -DUSE_COLORD=no -DUSE_GMIC=OFF -DUSE_GRAPHICSMAGICK=no -DUSE_JXL=no -DUSE_KWALLET=yes -DUSE_LIBSECRET=no -DUSE_LUA=no -DUSE_MAP=no -DUSE_NLS=yes -DUSE_OPENCL=no -DUSE_OPENEXR=no -DUSE_OPENJPEG=no -DUSE_OPENMP=yes -DUSE_PORTMIDI=no -DUSE_SDL2=no -DUSE_WEBP=yes -DWANT_JSON_VALIDATION=no -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2_build/gentoo_toolchain.cmake /var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2
loading initial cache file /var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2_build/gentoo_common_config.cmake
-- The CXX compiler identification is Clang 16.0.6
-- The C compiler identification is Clang 16.0.6
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/lib/llvm/16/bin/clang++
-- Check for working CXX compiler: /usr/lib/llvm/16/bin/clang++ - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:60 (message):
  The C++ compiler

    "/usr/lib/llvm/16/bin/clang++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2_build/CMakeFiles/CMakeScratch/TryCompile-SWozql'
   
    Run Build Command(s): /usr/bin/ninja -v cmTC_bc169
    [1/2] /usr/lib/llvm/16/bin/clang++    -O2 -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2 -mavx -msse3  -fPIE -MD -MT CMakeFiles/cmTC_bc169.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_bc169.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_bc169.dir/testCXXCompiler.cxx.o -c /var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2_build/CMakeFiles/CMakeScratch/TryCompile-SWozql/testCXXCompiler.cxx
    [2/2] : && /usr/lib/llvm/16/bin/clang++ -O2 -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2 -mavx -msse3 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed -Wl,-z,relro,-z,now CMakeFiles/cmTC_bc169.dir/testCXXCompiler.cxx.o -o cmTC_bc169   && :
    FAILED: cmTC_bc169
    : && /usr/lib/llvm/16/bin/clang++ -O2 -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2 -mavx -msse3 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed -Wl,-z,relro,-z,now CMakeFiles/cmTC_bc169.dir/testCXXCompiler.cxx.o -o cmTC_bc169   && :
    clang-16: error: invalid linker name in argument '-fuse-ld=lld'
    ninja: build stopped: subcommand failed.
   
   

 

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:23 (project)


-- Configuring incomplete, errors occurred!
 * ERROR: media-gfx/darktable-4.4.2::gentoo failed (configure phase):
 *   cmake failed
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_configure
 *   environment, line 2662:  Called cmake_src_configure
 *   environment, line 1360:  Called die
 * The specific snippet of code:
 *       "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed";
 *
 * If you need support, post the output of `emerge --info '=media-gfx/darktable-4.4.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-gfx/darktable-4.4.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-gfx/darktable-4.4.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-gfx/darktable-4.4.2/temp/environment'.
 * Working directory: '/var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2_build'
 * S: '/var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2'

>>> Failed to emerge media-gfx/darktable-4.4.2, Log file:

>>>  '/var/tmp/portage/media-gfx/darktable-4.4.2/temp/build.log'

 * Messages for package media-gfx/darktable-4.4.2:

 * ERROR: media-gfx/darktable-4.4.2::gentoo failed (configure phase):
 *   cmake failed
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_configure
 *   environment, line 2662:  Called cmake_src_configure
 *   environment, line 1360:  Called die
 * The specific snippet of code:
 *       "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed";
 *
 * If you need support, post the output of `emerge --info '=media-gfx/darktable-4.4.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-gfx/darktable-4.4.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-gfx/darktable-4.4.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-gfx/darktable-4.4.2/temp/environment'.
 * Working directory: '/var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2_build'
 * S: '/var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2'

_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
krumpf
Apprentice
Apprentice


Joined: 15 Jul 2018
Posts: 175

PostPosted: Sun Jan 21, 2024 9:10 pm    Post subject: Reply with quote

It does work for me.
Code:
# emerge -aqv darktable
[ebuild  N    ] media-gfx/darktable-4.4.2  USE="nls openmp -avif -colord -cups -doc -gamepad -geolocation -gphoto2 -graphicsmagick -heif -jpeg2k -jpegxl -keyring -kwallet -lto -lua -midi -opencl -openexr -test -tools -webp" CPU_FLAGS_X86="avx sse3" L10N="-de -es -fr -he -hu -ja -pl -pt-BR -sl -sq -uk -zh-CN -zh-TW" LUA_SINGLE_TARGET="lua5-4"

Would you like to merge these packages? [Yes/No] y
>>> Verifying ebuild manifests
>>> Running pre-merge checks for media-gfx/darktable-4.4.2
>>> Emerging (1 of 1) media-gfx/darktable-4.4.2::gentoo
>>> Installing (1 of 1) media-gfx/darktable-4.4.2::gentoo
>>> Recording media-gfx/darktable in "world" favorites file...
>>> Completed (1 of 1) media-gfx/darktable-4.4.2::gentoo
>>> Jobs: 1 of 1 complete                           Load avg: 9.01, 3.85, 2.41

 * Messages for package media-gfx/darktable-4.4.2:

 *
 * When updating a major version,
 * please bear in mind that your edits will be preserved during this process,
 * but it will not be possible to downgrade any more.
 *
 * It will not be possible to downgrade!
 *

But it failed when I tried adding USE=lto
Other than that, I don't understand why it doesn't build on your machine.
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Tue Jan 23, 2024 9:51 am    Post subject: Reply with quote

I upgraded Clang from 16.x to 17.0.6 but still the same issue. Looks like it is more clang related than something else:

Code:
-- The CXX compiler identification is Clang 17.0.6
-- The C compiler identification is Clang 17.0.6
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/lib/llvm/17/bin/clang++
-- Check for working CXX compiler: /usr/lib/llvm/17/bin/clang++ - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:60 (message):
  The C++ compiler

    "/usr/lib/llvm/17/bin/clang++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2_build/CMakeFiles/CMakeScratch/TryCompile-FuiMpG'
   
    Run Build Command(s): /usr/bin/ninja -v cmTC_63248
    [1/2] /usr/lib/llvm/17/bin/clang++    -O2 -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2 -mavx -msse3  -fPIE -MD -MT CMakeFiles/cmTC_63248.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_63248.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_63248.dir/testCXXCompiler.cxx.o -c /var/tmp/portage/media-gfx/darktable-4.4.2/work/darktable-4.4.2_build/CMakeFiles/CMakeScratch/TryCompile-FuiMpG/testCXXCompiler.cxx
    [2/2] : && /usr/lib/llvm/17/bin/clang++ -O2 -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2 -mavx -msse3 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed -Wl,-z,relro,-z,now CMakeFiles/cmTC_63248.dir/testCXXCompiler.cxx.o -o cmTC_63248   && :
    FAILED: cmTC_63248
    : && /usr/lib/llvm/17/bin/clang++ -O2 -march=native -fstack-protector-strong -D_FORTIFY_SOURCE=2 -mavx -msse3 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed -Wl,-z,relro,-z,now CMakeFiles/cmTC_63248.dir/testCXXCompiler.cxx.o -o cmTC_63248   && :
    clang++: error: invalid linker name in argument '-fuse-ld=lld'
    ninja: build stopped: subcommand failed.
     

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:23 (project)

_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Tue Jan 23, 2024 2:32 pm    Post subject: Reply with quote

Looks like a problem with GCC, I'll put it at a more appropriate part of the forum.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum