Building questions

On Ubuntu 22.04

Since 4.4.* version is still not available in OBS repositories, finally decided to build on my own. Basic build was smooth, no issues, even executable seems to be starting.

Build commands specify install directory while building. Can this directory be in my home directory?

I noticed OpenCL support was disabled in menu option. Is it caused because of hardware or build settings? If it’s because of build settings, what do I need to do to enable?

I’m building on a “build” machine which is not my usual workstation. I’d like to create a DEB file or other form of distributable package so that I can copy the build settings on my work machine? I can copy the executable, but not sure if I need to copy other files and which directory these files need to reside

The build target can be any writable directory. I also use one inside my home.

Did you install the opencl development libraries on the build machine? And the runtime libraries on the target?

I think that’s what I missed - installing optional dependencies. I knew it was too smooth and I must missing something.

Hello,
Here is what I did under Ubuntu 22.04.2 LTS :

# Pré-requis : installation des dépendances
###########################################
sed -e '/^#\sdeb-src /s/^# *//;t;d' "/etc/apt/sources.list" \
  | sudo tee /etc/apt/sources.list.d/darktable-sources-tmp.list > /dev/null \
  && (
    sudo apt update
    sudo apt build-dep darktable
  )
sudo rm /etc/apt/sources.list.d/darktable-sources-tmp.list

# Prérequis : Outils
####################
sudo apt install autoconf automake autopoint appstream build-essential checkinstall cmake exiv2 extra-cmake-modules g++-12 git git-all intltool m4 make meson nasm ninja-build patch pkg-config tar xsltproc

# Prérequis : Dépendances
#########################
sudo apt install libavif-dev libcurl4-gnutls-dev libexiv2-27 libexiv2-dev libgmic1 libgtk-3-dev libheif1 libimath-3-1-29 libjpeg-dev libjson-glib-dev liblcms2-dev liblensfun-dev libportmidi-dev libpugixml-dev libraw20 librsvg2-dev libsqlite3-dev libtiff5-dev libxml2-dev libxml2-utils

# Clônage du dépôt GIT
######################
git clone --recurse-submodules --depth 1 https://github.com/darktable-org/darktable.git
cd darktable
git fetch --tags
git checkout tags/release-4.4.2

# Récupération des sous-modules
###############################
git submodule update --init

# Build manuel
##############
mkdir build/
cd build/
export CC=gcc-12
export CXX=g++-12
cmake -DCMAKE_INSTALL_PREFIX=/usr/ ..
make
sudo checkinstall

It will build and install dt in usr, just like the official version. Replace /usr/ with the place you want it to be installed in.
The checkinstall command instead of make install will create the .deb file you need into the build directory in addition to installing it.
I do not use OpenCL, so you might have to add the missing dependancies if needed.
When trying to run the .deb on another machine, it might as well complain about missing dependancies, so you might have to install them and retry.
apt-cache search name_of_the_missing_package will help finding them.

JFYI darktable on OBS - #20 by LebedevRI

Thank you @darix. The repo was not updated yesterday and hence I started looking at the build. Read some threads about gcc 12 not being available etc and thought it might net updated.

Your post is going to save me some headaches as things were getting interesting. I am not getting following error

The following packages have unmet dependencies:
libexiv2-dev : Depends: libexiv2-27 (= 0.27.5-3ubuntu1) but 0.27.5-3.1 is to be installed
E: Unable to correct problems, you have held broken packages.

the exiv2 library in the repository should fullfill that no?

That’s what I thought, but it’s missing something. I need to look at the logs more carefully and see if any steps are missed. I do know it complained about repo not being signed, not entirely sure if it makes difference.

So far I have also updated dt by waiting for the latest .deb file, as this was for me the easiest way.

Since this time it took a while until version 4.4.1 for Ubuntu 22.04 (I have Linux Mint as operating system) was available, I thought about installing dt from source. But to be honest, my knowledge about sw and Linux is less than meager, so I didn’t dare to do it.

Nevertheless I have started this experiment cautiously by downloading the darktable-4.4.2.tar.xz from the darktable.org webpage, I have extracted it, and read the README.md file.

Maybe there is someone out there who can answer my questions and support me in my attempt:

1.) is it sufficient just to copy and paste step by step all the commands described in the README document into a terminal window?

2.) can I leave the extracted tar.xz in the folder „downloads“ or do have to move all the files to different folder?

3.) what happens to the already existing darktable version 4.4.1 which is now running on my computer by the .deb file?

4.) what else is important to know?

I’m really interested in trying this approach, but I’m afraid of the risk of breaking a lot of things that are already working.

Thx in advance
Christoph

Not sure about this one, I am not sure if the tarball includes rawspeed (cannot check because I am on mobile) but I recommend just trying it. Nothing can break until the point where you install something, just don’t use the installation flags of the build script for testing if it works.

You need to extract it into an empty folder, it does not matter where this folder is.

You can set a prefix path as option for the build script which makes sense to use, e.g. to install in /opt/darktable-test. To run this version, you then need to use the full path. While testing, make sure that it does not use your production library, and an additional backup before makes sense.

Backup makes sense anyway. Otherwise the critical stages are described above: Installation and running.

I forgot to mention that the obs repos for 22.04 were updated last night. Not entirely sure from your message if you are aware …

thx for your response.
I know that it was updated last night, but I want give this approach a try

1 Like

Chris
I come back to you as I am stuck somewhere in the middle with my own personal challenge Unfortunately so far I was not able to build dt from source. What am I doing wrong?
I am kindly asking you to support:
See below the CMakeError log file. Not sure if this is sufficient for your valuable analyses.
Would be great If you could give me the right direction :grinning:

thx a lot in advance
Chris

Performing C SOURCE FILE Test HAVE_THREAD_RWLOCK_ARCH_T_NR_READERS failed with the following output:
Change Dir: /home/chris/darktable/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_271d9/fast && /usr/bin/gmake -f CMakeFiles/cmTC_271d9.dir/build.make CMakeFiles/cmTC_271d9.dir/build
gmake[1]: Entering directory ‘/home/chris/darktable/build/CMakeFiles/CMakeTmp’
Building C object CMakeFiles/cmTC_271d9.dir/src.c.o
/usr/bin/cc -DHAVE_THREAD_RWLOCK_ARCH_T_NR_READERS -fPIE -o CMakeFiles/cmTC_271d9.dir/src.c.o -c /home/chris/darktable/build/CMakeFiles/CMakeTmp/src.c
/home/chris/darktable/build/CMakeFiles/CMakeTmp/src.c: In function ‘main’:
/home/chris/darktable/build/CMakeFiles/CMakeTmp/src.c:6:55: error: ‘struct __pthread_rwlock_arch_t’ has no member named ‘__nr_readers’; did you mean ‘__readers’?
6 | (void)sizeof(((struct __pthread_rwlock_arch_t *)0)->__nr_readers);
| ^~~~~~~~~~~~
| __readers
gmake[1]: *** [CMakeFiles/cmTC_271d9.dir/build.make:78: CMakeFiles/cmTC_271d9.dir/src.c.o] Error 1
gmake[1]: Leaving directory ‘/home/chris/darktable/build/CMakeFiles/CMakeTmp’
gmake: *** [Makefile:127: cmTC_271d9/fast] Error 2

Source file was:

#include <pthread.h>

int main()
{
(void)sizeof(((struct __pthread_rwlock_arch_t *)0)->__nr_readers);
return 0;
}

Performing C SOURCE FILE Test C_COMPILER_UNDERSTANDS_-Wthread-safety failed with the following output:
Change Dir: /home/chris/darktable/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_107b5/fast && /usr/bin/gmake -f CMakeFiles/cmTC_107b5.dir/build.make CMakeFiles/cmTC_107b5.dir/build
gmake[1]: Entering directory ‘/home/chris/darktable/build/CMakeFiles/CMakeTmp’
Building C object CMakeFiles/cmTC_107b5.dir/src.c.o
/usr/bin/cc -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wold-style-declaration -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wold-style-declaration -fPIE -DC_COMPILER_UNDERSTANDS_-Wthread-safety -Wthread-safety -o CMakeFiles/cmTC_107b5.dir/src.c.o -c /home/chris/darktable/build/CMakeFiles/CMakeTmp/src.c
cc: error: unrecognized command-line option ‘-Wthread-safety’
gmake[1]: *** [CMakeFiles/cmTC_107b5.dir/build.make:78: CMakeFiles/cmTC_107b5.dir/src.c.o] Error 1
gmake[1]: Leaving directory ‘/home/chris/darktable/build/CMakeFiles/CMakeTmp’
gmake: *** [Makefile:127: cmTC_107b5/fast] Error 2

Source file was:
int main(void) { return 0; }
Performing C++ SOURCE FILE Test CXX_COMPILER_UNDERSTANDS_-Wthread-safety failed with the following output:
Change Dir: /home/chris/darktable/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_7d676/fast && /usr/bin/gmake -f CMakeFiles/cmTC_7d676.dir/build.make CMakeFiles/cmTC_7d676.dir/build
gmake[1]: Entering directory ‘/home/chris/darktable/build/CMakeFiles/CMakeTmp’
Building CXX object CMakeFiles/cmTC_7d676.dir/src.cxx.o
/usr/bin/c++ -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -fPIE -DCXX_COMPILER_UNDERSTANDS_-Wthread-safety -Wthread-safety -o CMakeFiles/cmTC_7d676.dir/src.cxx.o -c /home/chris/darktable/build/CMakeFiles/CMakeTmp/src.cxx
c++: error: unrecognized command-line option ‘-Wthread-safety’
gmake[1]: *** [CMakeFiles/cmTC_7d676.dir/build.make:78: CMakeFiles/cmTC_7d676.dir/src.cxx.o] Error 1
gmake[1]: Leaving directory ‘/home/chris/darktable/build/CMakeFiles/CMakeTmp’
gmake: *** [Makefile:127: cmTC_7d676/fast] Error 2

Source file was:
int main() { return 0; }

Hm, I cannot read something from your log file, but I am not familiar with cmake at all so this is expected. Maybe you can elaborate a bit on the steps you do that eventually lead to this error?

Chris,
does this help more?

Building directory: /home/chris/darktable/build
Installation prefix: /opt/darktable-test
Build type: Release
Build generator: Unix Makefiles
Build tasks: 16

– Building SSE2-optimized codepaths: ON
CMake Error at cmake/compiler-versions.cmake:40 (message):
GNU C compiler version 11.4.0 is too old and is unsupported. Version 12+
is required.
Call Stack (most recent call first):
CMakeLists.txt:156 (include)

CMake Error at cmake/compiler-versions.cmake:43 (message):
GNU C++ compiler version 11.4.0 is too old and is unsupported. Version 12+
is required.
Building directory: /home/chris/darktable/build
Installation prefix: /opt/darktable-test
Build type: Release
Build generator: Unix Makefiles
Build tasks: 16

– Building SSE2-optimized codepaths: ON
CMake Error at cmake/compiler-versions.cmake:40 (message):
GNU C compiler version 11.4.0 is too old and is unsupported. Version 12+
is required.
Call Stack (most recent call first):
CMakeLists.txt:156 (include)

CMake Error at cmake/compiler-versions.cmake:43 (message):
GNU C++ compiler version 11.4.0 is too old and is unsupported. Version 12+
is required.
Call Stack (most recent call first):
CMakeLists.txt:156 (include)

– Performing Test C_COMPILER_UNDERSTANDS_-Wno-error=varargs
– Performing Test C_COMPILER_UNDERSTANDS_-Wno-error=varargs - Success
– Performing Test CXX_COMPILER_UNDERSTANDS_-Wno-error=varargs
– Performing Test CXX_COMPILER_UNDERSTANDS_-Wno-error=varargs - Success
– Performing Test C_COMPILER_UNDERSTANDS_-Wno-error=address-of-packed-member
– Performing Test C_COMPILER_UNDERSTANDS_-Wno-error=address-of-packed-member - Success
– Performing Test CXX_COMPILER_UNDERSTANDS_-Wno-error=address-of-packed-member
– Performing Test CXX_COMPILER_UNDERSTANDS_-Wno-error=address-of-packed-member - Success
– Looking for external programs
– Found perl
– Missing intltool-merge
– Found desktop-file-validate
– Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
– Found LLVM 14.0.0
CMake Warning at CMakeLists.txt:348 (message):
Could not find appropriate clang compiler

CMake Warning at CMakeLists.txt:349 (message):
Test-compilation of OpenCL programs can not be done.

– Test-compilation of OpenCL programs is disabled.
– Found jsonschema
– Found xsltproc
– Found xmllint
– Found exiftool
CMake Error at CMakeLists.txt:411 (message):
Some external programs couldn’t be found

– Configuring incomplete, errors occurred!
See also “/home/chris/darktable/build/CMakeFiles/CMakeOutput.log”.
See also “/home/chris/darktable/build/CMakeFiles/CMakeError.log”.
chris@chris-XPS-8940:~/darktable$
Call Stack (most recent call first):
CMakeLists.txt:156 (include)

– Performing Test C_COMPILER_UNDERSTANDS_-Wno-error=varargs
– Performing Test C_COMPILER_UNDERSTANDS_-Wno-error=varargs - Success
– Performing Test CXX_COMPILER_UNDERSTANDS_-Wno-error=varargs
– Performing Test CXX_COMPILER_UNDERSTANDS_-Wno-error=varargs - Success
– Performing Test C_COMPILER_UNDERSTANDS_-Wno-error=address-of-packed-member
– Performing Test C_COMPILER_UNDERSTANDS_-Wno-error=address-of-packed-member - Success
– Performing Test CXX_COMPILER_UNDERSTANDS_-Wno-error=address-of-packed-member
– Performing Test CXX_COMPILER_UNDERSTANDS_-Wno-error=address-of-packed-member - Success
– Looking for external programs
– Found perl
– Missing intltool-merge
– Found desktop-file-validate
– Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
– Found LLVM 14.0.0
CMake Warning at CMakeLists.txt:348 (message):
Could not find appropriate clang compiler

CMake Warning at CMakeLists.txt:349 (message):
Test-compilation of OpenCL programs can not be done.

– Test-compilation of OpenCL programs is disabled.
– Found jsonschema
– Found xsltproc
– Found xmllint
– Found exiftool
CMake Error at CMakeLists.txt:411 (message):
Some external programs couldn’t be found

– Configuring incomplete, errors occurred!
See also “/home/chris/darktable/build/CMakeFiles/CMakeOutput.log”.
See also “/home/chris/darktable/build/CMakeFiles/CMakeError.log”.
chris@chris-XPS-8940:~/darktable$

and

First thing you need to do is to install gcc and g++ version 12 or higher and make it the default for your system.

1 Like

thx - I will update

Also

P.S. Please don’t just paste huge logs as plain text. Either attach them as files, use pastebin, or for relatively short ones, please format as code.