CTL script function cannot be enabled in self build ART on Ubuntu

Hi, Alberto

On Ubuntu 24.04, I compiled ART from latest source code. Compiling process ended successfully, and I couldn’t any fatal error messages in it, however CTL script function cannot be enabled in self build binary and I couldn’t find any messages about CTL interpreter in compiling process.

Of course, I installed CTL interpreter in advance, and your binary operates normally with CTL function and also “ctlrender -help” command operates normally.

And it is first self building after adding CTL script support to ART.

How can I check compile process of my build?

In following link, I put the messages in compiling process.

Thank you for your advice.

Hi,
did you set ENABLE_CTL=1 in CMakeCache.txt? I don’t see anything in the output suggesting that you did… If that’s not enough, you should probably also set CTL_INCLUDE_DIR directly (at least that’s what I have to do on my ubuntu-based machine, I don’t know why and I don’t have the energy to fight against CMake anymore…)

HTH

Hello @yasuo, I build ART myself as well on Xubuntu 24.04 and my cmake is as follows, works well.

cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TCMALLOC="OFF" -DENABLE_LIBRAW="ON" -DENABLE_MIMALLOC="ON" -DENABLE_OCIO="True" -DENABLE_CTL="True" -DCTL_INCLUDE_DIR=/usr/local/include/CTL'

Do you mean changing the entry of cmake in build-art?

If I add any change to build-art, I encounter messages below.

CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.

and…

CMake Error: The source directory “/home/yohnishi/programs/code-art/build” does not appear to contain CMakeLists.txt.

Maybe you need to check the directory paths in your build script, or where you run it from?
I had to modify the original build-art script because the behaviour didn’t satisfy me, including the directory names.
Here’s the content of my build-art script:

#!/usr/bin/env bash
# By Morgan Hardwood
# Version 2019-09-05
# This script gets the latest source code for the given program and compiles it.

# The name of the program, used for the folder names:
prog="ART"

# The name of the compiled executable:
exe="ART"

# The name of the sub-folder, if any, relative to the folder into which the
# compiled executable is placed.
# e.g. If the executable ends up in:
#   ~/programs/someProgram/foo/bar/someExecutable
# then set it to:
#   exeRelativePath="foo/bar"
# or if the executable ends up in
#   ~/programs/someProgram/someExecutable
# then leave it empty:
# exeRelativePath=""
exeRelativePath=""

# The path to the repository:
repo="https://bitbucket.org/agriggio/art.git"

# No touching below this line, with the exception of the "Compile" section
# -----------------------------------------------------------------------------

# The name of the project's standard branch, typically "master":
master="master"

buildOnly="false"
buildType="release"

# Removes the trailing forward-slash if one is present
exeRelativePath="${exeRelativePath/%\/}"
# Append forward-slash to exeRelativePath only if it is not empty.
exePath="${exeRelativePath:+${exeRelativePath}/}${exe}"

# Command-line arguments
OPTIND=1
while getopts "bdh?-" opt; do
    case "${opt}" in
        b)  buildOnly="true"
            ;;
        d)  buildType="debug"
            ;;
        h|\?|-) printf '%s\n' "This script gets the latest source code for ${prog} and compiles it." \
                "" \
                "  -b" \
                "     Optional. If specified, the script only compiles the source, it does not try to update the source. If not specified, the source will be updated first." \
                "  -d" \
                "     Optional. Compile a \"debug\" build. If not specified, a \"release\" build will be made." \
                ""
        exit 0
        ;;
    esac
done
shift $((OPTIND-1))
[ "$1" = "--" ] && shift

printf '%s\n' "" "Program name: ${prog}" "Build type: ${buildType}" "Build without updating: ${buildOnly}" ""

# Clone if needed
cloned="false"
updates="false"
if [[ ! -d "$HOME/Sources/${prog}" ]]; then
    mkdir -p "$HOME/Sources" || exit 1
    git clone "$repo" "$HOME/Sources/${prog}" || exit 1
    pushd "$HOME/Sources/${prog}" 1>/dev/null || exit 1
    cloned="true"
else
    pushd "$HOME/Sources/${prog}" 1>/dev/null || exit 1
    git checkout master
    git fetch
    if [[ $(git rev-parse HEAD) != $(git rev-parse '@{u}') ]]; then
        updates="true"
    fi
fi

# Pull updates if necessary
if [[ "$updates" = "true" && "$buildOnly" = "false" ]]; then
    git pull || exit 1
fi

# Find out which branch git is on
branch="$(git rev-parse --abbrev-ref HEAD)"

# Set build and install folder names
if [[ $branch = $master && $buildType = release ]]; then
    buildDir="$HOME/Sources/${prog}/build"
    installDir="$HOME/Photo-apps/${prog}"
else
    buildDir="$HOME/Sources/${prog}/build-${branch}-${buildType}"
    installDir="$HOME/Photo-apps/${prog}-${branch}-${buildType}"
fi

existsExe="false"
if [[ -e "${installDir}/${exePath}" ]]; then
    existsExe="true"
fi

# Quit if no updates and build-only flag not set
if [[ "$cloned" = "false" && "$buildOnly" = "false" && "$updates" = "false" && "$existsExe" = "true" ]]; then
    printf '%s\n' "No updates, nothing to do."
    exit 0
fi

# Determine CPU count
cpuCount="fail"
if command -v nproc >/dev/null 2>&1; then
    cpuCount="$(nproc --all)"
fi
if [[ ! ( $cpuCount -ge 1 && $cpuCount -le 64 ) ]]; then
    cpuCount=1
fi

# Prepare folders
rm -rf "${installDir}"
mkdir -p "${buildDir}" "${installDir}" || exit 1
cd "${buildDir}" || exit 1

# -----------------------------------------------------------------------------
# Compile

# See:
# http://rawpedia.rawtherapee.com/Linux#Compile_RawTherapee
# -mptwrite

cmake \
    -DCMAKE_BUILD_TYPE="$buildType" \
    -DCACHE_NAME_SUFFIX="-dev" \
    -DPROC_TARGET_NUMBER=2 \
    -DBUILD_BUNDLE="ON" \
    -DBUNDLE_BASE_INSTALL_DIR="${installDir}" \
    -DENABLE_LIBRAW="ON" \
    -DWITH_LTO="ON" \
    -DWITH_SYSTEM_KLT="OFF" \
    -DENABLE_OCIO="ON" \
    -DENABLE_CTL="ON" \
    -DCTL_INCLUDE_DIR="/usr/include/CTL" \
    .. || exit 1

make --jobs="$cpuCount" install || exit 1

# Finished
printf '%s\n' "" "To run ${prog} type:" "${installDir}/${exePath}" ""

popd 1>/dev/null

To compile ART, I first delete or rename the directory in which the previous build was installed ($HOME/Photo-apps/ART in my case) and then I run build-art outside of the ART source folder.

No, I don’t use the build-art script.
My way:

$ git clone https://bitbucket.org/agriggio/art.git ~/apps
$ cd ~/apps/art
$ cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TCMALLOC="OFF" -DENABLE_LIBRAW="ON" -DENABLE_MIMALLOC="ON" -DENABLE_OCIO="True" -DENABLE_CTL="True" -DCTL_INCLUDE_DIR=/usr/local/include/CTL
$ sudo make -j5 install

Next time I say:

$ cd ~/apps/art && git pull

to check if there is new code. If so, things are downloaded, then I say again cmake etc + sudo make -j5 install.

Hi, Sébastien

Thank you for your advice.
Arranging CTL interpreter directory, your script works perfect.
However, this build doesn’t identify ~/.config/ART as user setting directory.
Where is the user setting directory, or is there any way to specify the directory?

Hi, Paul

Thank you.
With your advice, I could build ART successfully.

By the way, I encountered messages below in building process.

CMake Warning:
Manually-specified variables were not used by the project:

ENABLE_MIMALLOC
ENABLE_TCMALLOC

It seems that these KEYs are not used any more in current version.

You’re welcome Yasuo.
About those warnings: I’m a very lazy person and I don’t care about them, for now at least. If the compile/make process works, it’s OK for me. :smiley:

I’m not at my linux computer right now, but if remember correctly, the -DCACHE_NAME_SUFFIX="-dev" implies that the cache and config directories will be named ~/.cache/ART-dev and ~/.config/ART-dev respectively.

So if you want to have ~/.config/ART, try setting -DCACHE_NAME_SUFFIX="".

1 Like

Thank you very much. It works perfect!

Thanks.

By the way, is it better to change following lines in CMakeList.txt

(Lines 186 to 188)

to as bellow, isn’t it?

(Lines 186 to 188)

No, why?

In Ubuntu, If we build ART with simply make install command, instead of using build-art script, ART build will be installed in /usr/local/bin directory. If we add this change to CMakeList.txt it will be installed in /usr/local/bin/ART.

Is it preferable that Existing ART and ART-cli under /usr/local/bin/ART directory than directly under /usr/local/bin ?

Maybe I think so because I am not used to the Linux way of doing things.

The current behaviour is consistent with the unix way, I would not change it. If you want an “isolated” installation, just set a different prefix dir (e.g. I use /opt/ART FWIW)

1 Like