Skip to content

about M1 MacOS X compilation guidelines  #5

@nomar500

Description

@nomar500

Hi,

(compilation newbie, here)

On my M1 mac, I've been trying to compile dcamprof

Here's what I came up with (note my non-existant knowledge about compilation flags in general and about M1 arm64 compilation subtleties in particular).

export CC="$(which clang)"
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp"
export CFLAGS="-Wall -std=c99 -g -O2 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -fopenmp"
export CFLAGS="$CFLAGS -I$(brew --prefix libomp)/include -I$(brew --prefix little-cms2)/include -I$(brew --prefix libtiff)/include $OPTFLAGS"
export LDFLAGS="$LDFLAGS -Wl,-rpath,$(brew --prefix libomp)/lib -L$(brew --prefix libomp)/lib -lomp -L$(brew --prefix little-cms2)/lib -llcms2 -L$(brew --prefix libtiff)/lib -ltiff"

then, from inside the dcamprof/src folder, where the Makefile lies, I:

  • comment out the same flags I’ve just exported in bash,
  • run make
unfold sample output
/usr/bin/clang -o dcamprof.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" dcamprof.c
/usr/bin/clang -o nmsimplex.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" nmsimplex.c
/usr/bin/clang -o profio.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" profio.c
/usr/bin/clang -o argyllio.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" argyllio.c
/usr/bin/clang -o tps.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" tps.c
/usr/bin/clang -o colmath.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" colmath.c
/usr/bin/clang -o matopt.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" matopt.c
/usr/bin/clang -o lut.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" lut.c
/usr/bin/clang -o lut3d.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" lut3d.c
/usr/bin/clang -o look.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" look.c
/usr/bin/clang -o dngref.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" dngref.c
/usr/bin/clang -o gamut.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" gamut.c
/usr/bin/clang -o spectrum.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" spectrum.c
/usr/bin/clang -o jsonio.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" jsonio.c
/usr/bin/clang -o cJSON.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" cJSON.c
/usr/bin/clang -o interp.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" interp.c
/usr/bin/clang -o bisection.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" bisection.c
/usr/bin/clang -o icclut.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" icclut.c
/usr/bin/clang -o dnglut.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" dnglut.c
/usr/bin/clang -o glare.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" glare.c
/usr/bin/clang -o target.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" target.c
/usr/bin/clang -o xyz2spec.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" xyz2spec.c
/usr/bin/clang -o observers.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" observers.c
/usr/bin/clang -o spectraldb.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" spectraldb.c
/usr/bin/clang -o tifio.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" tifio.c
tifio.c:329:22: warning: 'uint8' is deprecated [-Wdeprecated-declarations]
        static const uint8 prophoto_icc[] =
                     ^
/opt/homebrew/opt/libtiff/include/tiff.h:78:45: note: 'uint8' has been explicitly marked deprecated here
typedef TIFF_MSC_DEPRECATED uint8_t  uint8  TIFF_GCC_DEPRECATED;
                                            ^
/opt/homebrew/opt/libtiff/include/tiff.h:66:44: note: expanded from macro 'TIFF_GCC_DEPRECATED'
#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
                                           ^
1 warning generated.
/usr/bin/clang -o elog.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" elog.c
/usr/bin/clang -o wcompat.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" wcompat.c
/usr/bin/clang -o strbuf.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" strbuf.c
/usr/bin/clang -o spectraldb_munsell.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" spectraldb_munsell.c
/usr/bin/clang -o spectraldb_cc24.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" spectraldb_cc24.c
/usr/bin/clang -o spectraldb_kuopio_natural.o -c -I.  -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/little-cms2/include -I/opt/homebrew/opt/libtiff/include   -DDCAMPROF_VERSION=\"1.0.6\" spectraldb_kuopio_natural.c
/usr/bin/clang -o dcamprof  -Wl,-rpath,/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/libomp/lib -lomp -L/opt/homebrew/opt/little-cms2/lib -llcms2 -L/opt/homebrew/opt/libtiff/lib -ltiff dcamprof.o nmsimplex.o profio.o argyllio.o tps.o colmath.o matopt.o lut.o lut3d.o look.o dngref.o gamut.o spectrum.o jsonio.o cJSON.o interp.o bisection.o icclut.o dnglut.o glare.o target.o xyz2spec.o observers.o spectraldb.o tifio.o elog.o wcompat.o strbuf.o spectraldb_munsell.o spectraldb_cc24.o spectraldb_kuopio_natural.o -llcms2 -ltiff -lm

Here's the thread in pixls.us: https://discuss.pixls.us/t/solved-dcamprof-compilation-for-m1-mac-arm64/30295/8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions