bug#42067: [PATCH] gnu: darktable: Add optional dependencies.
diff mbox series

Message ID 87eepxa5zu.fsf@gnu.org
State New
Headers show
Series
  • bug#42067: [PATCH] gnu: darktable: Add optional dependencies.
Related show

Checks

Context Check Description
cbaines/applying patch fail View Laminar job

Commit Message

Ludovic Courtès June 29, 2020, 9:59 p.m. UTC
Hi,

Vinicius Monego <monego@posteo.net> skribis:

> [arguments]: Fix opencl-c.h path.
> [native-inputs]: Add opencl-headers, make LLVM version specific.
> [inputs]: Add gmic.

I adjusted the commit log and applied the tiny change below.

>           (add-before 'configure 'prepare-build-environment
>             (lambda* (#:key inputs #:allow-other-keys)
> -             (setenv "CC" "clang") (setenv "CXX" "clang++")))
> +             (setenv "CC" "clang") (setenv "CXX" "clang++")

BTW, why are we building with Clang?

Thanks!

Ludo’.

Comments

Vinicius Monego June 30, 2020, 2:42 a.m. UTC | #1
Hello Ludo,

> 
> BTW, why are we building with Clang?
> 

This was briefly discussed in the version update thread (2020-
06/msg00651). To be more descriptive:

DT 3+ requires GCC/Clang 8+ and will fail to build with the default GCC
7.5.0. We have to load a newer version of GCC, or use Clang. Marius
attempted to build it with gcc-9 and "ran into other problems" although
I have succesfully built DT3 with the same compiler and version a while
ago.

Meanwhile, DT's CMakeLists.txt checks for LLVM to enable "test-
compilation of OpenCL programs". If LLVM is not found, this test-
compilation is skipped. If LLVM is found, it checks for Clang, and the
required opencl header is located inside Clang's directory. Because we
"have to have" Clang this way, it made more sense to me to compile with
it.

Anyways, OpenCL is optional. To build with GCC only, we would have to
load the gcc module and skip the test-compilation. It may be possible
to use both gcc and clang, but that would add redundancy.
Ludovic Courtès June 30, 2020, 10:05 a.m. UTC | #2
Hi Vinicius,

Vinicius Monego <monego@posteo.net> skribis:

>> BTW, why are we building with Clang?
>> 
>
> This was briefly discussed in the version update thread (2020-
> 06/msg00651). To be more descriptive:

Oh sorry, I have overlooked that.

> DT 3+ requires GCC/Clang 8+ and will fail to build with the default GCC
> 7.5.0. We have to load a newer version of GCC, or use Clang. Marius
> attempted to build it with gcc-9 and "ran into other problems" although
> I have succesfully built DT3 with the same compiler and version a while
> ago.
>
> Meanwhile, DT's CMakeLists.txt checks for LLVM to enable "test-
> compilation of OpenCL programs". If LLVM is not found, this test-
> compilation is skipped. If LLVM is found, it checks for Clang, and the
> required opencl header is located inside Clang's directory. Because we
> "have to have" Clang this way, it made more sense to me to compile with
> it.
>
> Anyways, OpenCL is optional. To build with GCC only, we would have to
> load the gcc module and skip the test-compilation. It may be possible
> to use both gcc and clang, but that would add redundancy.

What’s the “test-compilation of OpenCL programs”?  Are we just talking
about the test suite?

Either way, I guess my main points are (1) it’d be nice to add a comment
on why we’re using Clang, and (2) if we can use GCC instead, that should
be our default choice.  I’m not saying we should address this right
away, but we should keep it in mind.

Thanks,
Ludo’.

Patch
diff mbox series

diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm
index 5b5e057b65..09767f464e 100644
--- a/gnu/packages/photo.scm
+++ b/gnu/packages/photo.scm
@@ -486,8 +486,9 @@  photographic equipment.")
              ;; Darktable looks for opencl-c.h in the LLVM dir. Guix installs
              ;; it to the Clang dir. We fix this by patching CMakeLists.txt.
              (substitute* "CMakeLists.txt"
-                          (("\\$\\{LLVM_INSTALL_PREFIX\\}")
-                           (assoc-ref %build-inputs "clang")))))
+               (("\\$\\{LLVM_INSTALL_PREFIX\\}")
+                (assoc-ref %build-inputs "clang")))
+             #t))
          (add-before 'configure 'set-LDFLAGS-and-CPATH
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (setenv "LDFLAGS"