Compiling ART on OSX

Hi all,

I am trying to compile ART on OSX, but get an error while compiling. My compiler is:

Apple clang version 12.0.0 (clang-1200.0.32.21)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I run the following commands:

git checkout master

mkdir build & cd Build

cmake … -DCMAKE_BUILD_TYPE=“release” -DPROC_TARGET_NUMBER=“2” -DCACHE_NAME_SUFFIX=“5.8-dev” -DCMAKE_C_COMPILER=“clang” -DCMAKE_CXX_COMPILER=“clang++” -DWITH_LTO=“ON” -DLENSFUNDBDIR=“/Applications/RawTherapee.app/Contents/Resources/share/lensfun” -DCMAKE_BUILD_TYPE=Release -DOpenMP_C_FLAGS=-fopenmp=libomp -DOpenMP_CXX_FLAGS=-fopenmp=libomp -DOpenMP_C_LIB_NAMES=“libomp” -DOpenMP_CXX_LIB_NAMES=“libomp” -DOpenMP_libomp_LIBRARY=“/usr/local/lib/libomp.dylib” -DOpenMP_CXX_FLAGS=“-Wno-pass-failed -Wno-deprecated-register -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include” -DOpenMP_CXX_LIB_NAMES=“libomp” -DOpenMP_C_FLAGS=“-Wno-pass-failed -Wno-deprecated-register -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include” -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_EXE_LINKER_FLAGS=“-L/usr/local/opt/libffi/lib -L/usr/local/lib” -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15”

make -j$(sysctl -n hw.ncpu) install

I get the following error:

/Users/myname/programs/code-art/rtengine/rcd_demosaic.cc:195:44: error: value of type ‘attribute((vector_size(4 *
sizeof(int)))) int’ (vector of 4 ‘int’ values) is not contextually convertible to ‘bool’
const vfloat VH_Disc = vabsf(0.5f - VH_Central_Value) < vabsf(0.5f - VH_Neighbourhood_Value) ? VH_Neighbourhoo…
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Seems similar to what is reported here. Is this a bug? Any clue how to solve this?

Thanks in advance for your help!

In RT this is fixed. Perhaps ART should port the fix from RT…

1 Like

Thanks! added that if statement to the .cc file, but now I get an undeclared variable error for ‘zd5v’. Probably have to change something more in the code? Or can I better copy that full .cc file from RT? Not a programmer myself, so please tell me if I better wait for the whole code to be updated :wink:

/Users/myname/programs/code-art/rtengine/rcd_demosaic.cc:196:66: error: use of undeclared identifier ‘zd5v’
const vfloat VH_Disc = vself(vmaskf_lt(vabsf(zd5v - VH_Central_Value), vabsf(zd5v - VH_Neighbourhood_Value)), …
^
/Users/myname/programs/code-art/rtengine/rcd_demosaic.cc:196:98: error: use of undeclared identifier ‘zd5v’
const vfloat VH_Disc = vself(vmaskf_lt(vabsf(zd5v - VH_Central_Value), vabsf(zd5v - VH_Neighbourhood_Value)), …
^
2 errors generated.

I tell you :wink:

Should be fixed now, thanks

Thanks so much for fixing that! It worked. Unfortunately, I get another error at a later stage during compiling. Any idea what his going on? It seems the path to ar is set wrong (/opt/local/bin/ar does not exist, should be /usr/bin/ar). I tried to add the following for cmake:

-DCMAKE_AR=“/usr/bin/ar” -DCMAKE_RANLIB=“/usr/bin/ranlib”

But cmake output reports this:

– Binutils version detected as less than 2.29 - setting CMake parameters to enable LTO linking:
CMAKE_AR=“/opt/local/bin/ar”
CMAKE_RANLIB=“/opt/local/bin/ranlib”

Should I with LTO to OFF? Does that hurt?

Original error message:

[ 44%] Linking CXX static library librtengine.a

cd /Users/myname/programs/code-art/build/rtengine && /usr/local/Cellar/cmake/3.19.1/bin/cmake -P CMakeFiles/rtengine.dir/cmake_clean_target.cmake

cd /Users/myname/programs/code-art/build/rtengine && /usr/local/Cellar/cmake/3.19.1/bin/cmake -E cmake_link_script CMakeFiles/rtengine.dir/link.txt --verbose=1

/opt/local/bin/ar qc librtengine.a CMakeFiles/rtengine.dir/badpixels.cc.o CMakeFiles/rtengine.dir/CA_correct_RT.cc.o CMakeFiles/rtengine.dir/FTblockDN.cc.o CMakeFiles/rtengine.dir/PF_correct_RT.cc.o CMakeFiles/rtengine.dir/alpha.cc.o CMakeFiles/rtengine.dir/ahd_demosaic_RT.cc.o CMakeFiles/rtengine.dir/amaze_demosaic_RT.cc.o CMakeFiles/rtengine.dir/cJSON.c.o CMakeFiles/rtengine.dir/calc_distort.cc.o CMakeFiles/rtengine.dir/camconst.cc.o CMakeFiles/rtengine.dir/cfa_linedn_RT.cc.o CMakeFiles/rtengine.dir/ciecam02.cc.o CMakeFiles/rtengine.dir/clutstore.cc.o CMakeFiles/rtengine.dir/color.cc.o CMakeFiles/rtengine.dir/colortemp.cc.o CMakeFiles/rtengine.dir/coord.cc.o CMakeFiles/rtengine.dir/cplx_wavelet_dec.cc.o CMakeFiles/rtengine.dir/curves.cc.o CMakeFiles/rtengine.dir/dcp.cc.o CMakeFiles/rtengine.dir/dcraw.cc.o CMakeFiles/rtengine.dir/dcrop.cc.o CMakeFiles/rtengine.dir/demosaic_algos.cc.o CMakeFiles/rtengine.dir/dfmanager.cc.o CMakeFiles/rtengine.dir/diagonalcurves.cc.o CMakeFiles/rtengine.dir/dual_demosaic_RT.cc.o CMakeFiles/rtengine.dir/dynamicprofile.cc.o CMakeFiles/rtengine.dir/eahd_demosaic.cc.o CMakeFiles/rtengine.dir/fast_demo.cc.o CMakeFiles/rtengine.dir/ffmanager.cc.o CMakeFiles/rtengine.dir/flatcurves.cc.o CMakeFiles/rtengine.dir/gauss.cc.o CMakeFiles/rtengine.dir/green_equil_RT.cc.o CMakeFiles/rtengine.dir/hilite_recon.cc.o CMakeFiles/rtengine.dir/hphd_demosaic_RT.cc.o CMakeFiles/rtengine.dir/iccjpeg.cc.o CMakeFiles/rtengine.dir/iccstore.cc.o CMakeFiles/rtengine.dir/iimage.cc.o CMakeFiles/rtengine.dir/image16.cc.o CMakeFiles/rtengine.dir/image8.cc.o CMakeFiles/rtengine.dir/imagedata.cc.o CMakeFiles/rtengine.dir/imagedimensions.cc.o CMakeFiles/rtengine.dir/imagefloat.cc.o CMakeFiles/rtengine.dir/imageio.cc.o CMakeFiles/rtengine.dir/improccoordinator.cc.o CMakeFiles/rtengine.dir/improcfun.cc.o CMakeFiles/rtengine.dir/impulse_denoise.cc.o CMakeFiles/rtengine.dir/init.cc.o CMakeFiles/rtengine.dir/iplab2rgb.cc.o CMakeFiles/rtengine.dir/ipresize.cc.o CMakeFiles/rtengine.dir/ipsharpen.cc.o CMakeFiles/rtengine.dir/iptransform.cc.o CMakeFiles/rtengine.dir/rtjpeg.cc.o CMakeFiles/rtengine.dir/klt/convolve.cc.o CMakeFiles/rtengine.dir/klt/error.cc.o CMakeFiles/rtengine.dir/klt/klt.cc.o CMakeFiles/rtengine.dir/klt/klt_util.cc.o CMakeFiles/rtengine.dir/klt/pnmio.cc.o CMakeFiles/rtengine.dir/klt/pyramid.cc.o CMakeFiles/rtengine.dir/klt/selectGoodFeatures.cc.o CMakeFiles/rtengine.dir/klt/storeFeatures.cc.o CMakeFiles/rtengine.dir/klt/trackFeatures.cc.o CMakeFiles/rtengine.dir/klt/writeFeatures.cc.o CMakeFiles/rtengine.dir/labimage.cc.o CMakeFiles/rtengine.dir/lcp.cc.o CMakeFiles/rtengine.dir/lmmse_demosaic.cc.o CMakeFiles/rtengine.dir/loadinitial.cc.o CMakeFiles/rtengine.dir/myfile.cc.o CMakeFiles/rtengine.dir/panasonic_decoders.cc.o CMakeFiles/rtengine.dir/pipettebuffer.cc.o CMakeFiles/rtengine.dir/pixelshift.cc.o CMakeFiles/rtengine.dir/previewimage.cc.o CMakeFiles/rtengine.dir/processingjob.cc.o CMakeFiles/rtengine.dir/procparams.cc.o CMakeFiles/rtengine.dir/profilestore.cc.o CMakeFiles/rtengine.dir/rawimage.cc.o CMakeFiles/rtengine.dir/rawimagesource.cc.o CMakeFiles/rtengine.dir/rcd_demosaic.cc.o CMakeFiles/rtengine.dir/refreshmap.cc.o CMakeFiles/rtengine.dir/rt_algo.cc.o CMakeFiles/rtengine.dir/rt_polygon.cc.o CMakeFiles/rtengine.dir/rtthumbnail.cc.o CMakeFiles/rtengine.dir/simpleprocess.cc.o CMakeFiles/rtengine.dir/ipspot.cc.o CMakeFiles/rtengine.dir/slicer.cc.o CMakeFiles/rtengine.dir/stdimagesource.cc.o CMakeFiles/rtengine.dir/utils.cc.o CMakeFiles/rtengine.dir/rtlensfun.cc.o CMakeFiles/rtengine.dir/tmo_fattal02.cc.o CMakeFiles/rtengine.dir/iplocalcontrast.cc.o CMakeFiles/rtengine.dir/histmatching.cc.o CMakeFiles/rtengine.dir/pdaflinesfilter.cc.o CMakeFiles/rtengine.dir/gamutwarning.cc.o CMakeFiles/rtengine.dir/iptoneequalizer.cc.o CMakeFiles/rtengine.dir/ipsoftlight.cc.o CMakeFiles/rtengine.dir/xtrans_demosaic.cc.o CMakeFiles/rtengine.dir/vng4_demosaic_RT.cc.o CMakeFiles/rtengine.dir/guidedfilter.cc.o CMakeFiles/rtengine.dir/ipdehaze.cc.o CMakeFiles/rtengine.dir/ipcolorcorrection.cc.o CMakeFiles/rtengine.dir/lj92.c.o CMakeFiles/rtengine.dir/ipsmoothing.cc.o CMakeFiles/rtengine.dir/iplogenc.cc.o CMakeFiles/rtengine.dir/labmasks.cc.o CMakeFiles/rtengine.dir/ipgrain.cc.o CMakeFiles/rtengine.dir/ipdenoise.cc.o CMakeFiles/rtengine.dir/iptextureboost.cc.o CMakeFiles/rtengine.dir/metadata.cc.o CMakeFiles/rtengine.dir/iplabadjustments.cc.o CMakeFiles/rtengine.dir/perspectivecorrection.cc.o CMakeFiles/rtengine.dir/iphsl.cc.o CMakeFiles/rtengine.dir/ipchmixer.cc.o CMakeFiles/rtengine.dir/ipexposure.cc.o CMakeFiles/rtengine.dir/iprgbcurves.cc.o CMakeFiles/rtengine.dir/ipbw.cc.o CMakeFiles/rtengine.dir/ipsaturation.cc.o CMakeFiles/rtengine.dir/ipfilmsim.cc.o CMakeFiles/rtengine.dir/iptonecurve.cc.o CMakeFiles/rtengine.dir/deconvautoradius.cc.o CMakeFiles/rtengine.dir/filmnegativeproc.cc.o CMakeFiles/rtengine.dir/filmnegativethumb.cc.o CMakeFiles/rtengine.dir/canon_cr3_decoder.cc.o CMakeFiles/rtengine.dir/pyramids.cc.o CMakeFiles/rtengine.dir/rawimage_gainmap.cc.o CMakeFiles/rtengine.dir/subprocess.cc.o CMakeFiles/rtengine.dir/bayer_bilinear_demosaic.cc.o CMakeFiles/rtengine.dir/gainmap.cc.o CMakeFiles/rtengine.dir/base64.cc.o CMakeFiles/rtengine.dir/imgiomanager.cc.o

Error running link command: No such file or directory

make[2]: *** [rtengine/librtengine.a] Error 2

make[1]: *** [rtengine/CMakeFiles/rtengine.dir/all] Error 2

make: *** [all] Error 2

The following cmake command worked, and I am able to get an executable. Unfortunately, when I move it to /Applications and run it, the executable crashes. I experience the same issue with compiling RT as reported here. Really puzzled why I am able to finish the compiling process, but end up with a faulty executable? Any ideas?

I use the following commands:

cmake … -DCMAKE_BUILD_TYPE=“release” -DPROC_TARGET_NUMBER=“2” -DCACHE_NAME_SUFFIX=“5.8-dev” -DCMAKE_C_COMPILER=“clang” -DCMAKE_CXX_COMPILER=“clang++” -DWITH_LTO=“OFF” -DLENSFUNDBDIR=“/Applications/RawTherapee.app/Contents/Resources/share/lensfun” -DOpenMP_C_FLAGS=-fopenmp=libomp -DOpenMP_CXX_FLAGS=-fopenmp=libomp -DOpenMP_C_LIB_NAMES=“libomp” -DOpenMP_CXX_LIB_NAMES=“libomp” -DOpenMP_libomp_LIBRARY=“/usr/local/lib/libomp.dylib” -DOpenMP_CXX_FLAGS=“-Wno-pass-failed -Wno-deprecated-register -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include” -DOpenMP_CXX_LIB_NAMES=“libomp” -DOpenMP_C_FLAGS=“-Wno-pass-failed -Wno-deprecated-register -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include” -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_EXE_LINKER_FLAGS=“-L/usr/local/opt/libffi/lib -L/usr/local/lib” -DCMAKE_AR=“/usr/bin/ar” -DCMAKE_RANLIB=“/usr/bin/ranlib” -DCMAKE_OSX_DEPLOYMENT_TARGET=“10.15”

make -j$(sysctl -n hw.ncpu) install

sudo make macosx_bundle

Unfortunately I don’t have access to osx, so I won’t be able to help… :frowning:

1 Like

Please include a crash report.

Hi Hiram,

Thanks for getting back to me. Here is the crash report:

EXECRASH.txt (77.8 KB)

Other outputs:

CMAKE.txt (4.7 KB)
MAKE.txt (987.5 KB)
BUNDLE.txt (17.6 KB)

Hope this helps you getting some pointers to what could be wrong, as this happens with both RT and ART.

I tried to compile for generic processor, but same thing happens. Did get some errors during sudo make macosx_bundle. Same happens when I use `-DPROC_TARGET_NUMBER=“1” instead of “2”, but they aren’t listed in the BUNDLE.txt in the previous reply:

BUNDLE_ERRORS.txt (132.6 KB)

Hi, I just got a new Mac mini (M1 Silicon) and I wouldn’t mind helping for OS X compilation.
For information, I just installed the official RT 5.8 Mac Os build and, while it’s not blazingly fast, at least it works and doesn’t crash.
Is there any pointer as to how what steps I should follow? I’m brand new with Mac OS.

That would be great!
I can’t be of any help unfortunately, but maybe @HIRAM has some tips?

I’ve tested the ART v 1.5 build for OSX knot for Big Sur), and placed it in the Applications directory. I also had to force MacOS to allow running.
With those steps ART runs almost fine, except that it doesn’t show any file in the file browser. But if I right click on an image in the Mac OS finder and ask it to open with ART, then I can process and export the file.

An addition to my post above: when an image is exported in a folder, then the images become visible in ART’s file browser. Quite strange…

For information, to allow running ART as it is an unsigned application, I ran this command in the Applications folder:

sudo xattr -rd com.apple.quarantine art.app

Hi Sebastien, if you collect more tips and/or manage to make more progress please let me know, it would be good to have this info in the wiki

I’m not sure about installing and running both ART and RT on the same Mac. The Info.plists are having some overlapping data which could definitely lead to some undefined results.

Hi, do you have any hints on what should be changed on the ART side to avoid the clash? Thanks!

Will do!