Skip to content

Commit 3673b77

Browse files
add CI for AcesContainer (#142)
* adds CI to use the optional AcesContainer library with ctlrender * adds FindAcesContainer.cmake module
1 parent d084184 commit 3673b77

File tree

9 files changed

+361
-4
lines changed

9 files changed

+361
-4
lines changed

.github/workflows/mac_release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
- name: install openexr
2929
run: brew install openexr
3030

31+
- name: install aces_container
32+
run: brew install aces_container
33+
3134
- uses: actions/checkout@v3
3235

3336
- name: Configure CMake
@@ -203,6 +206,9 @@ jobs:
203206
- name: install openexr
204207
run: brew install openexr
205208

209+
- name: install aces_container
210+
run: brew install aces_container
211+
206212
- uses: actions/checkout@v3
207213

208214
- name: Configure CMake

.github/workflows/ubuntu_address_sanitizer.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,18 @@ jobs:
9999
- name: install libtiff
100100
run: sudo apt-get install libtiff-dev -y
101101

102+
- name: install aces_container
103+
run: |
104+
cd ..
105+
git clone https://github.com/ampas/aces_container.git &&
106+
cmake -S aces_container -B aces_container/build -DCMAKE_CXX_FLAGS="-Wno-c++11-narrowing" &&
107+
cmake --build aces_container/build &&
108+
sudo cmake --install aces_container/build
109+
110+
- name: install pkg-config to help find aces_container
111+
run: |
112+
sudo apt-get -y install pkg-config
113+
102114
- uses: actions/checkout@v3
103115

104116
- name: Configure CMake

.github/workflows/ubuntu_debug.yml

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ jobs:
6969
make &&
7070
sudo make install
7171
72+
- name: install aces_container
73+
run: |
74+
cd ..
75+
git clone https://github.com/ampas/aces_container.git &&
76+
cmake -S aces_container -B aces_container/build -DCMAKE_CXX_FLAGS="-Wno-c++11-narrowing" &&
77+
cmake --build aces_container/build &&
78+
sudo cmake --install aces_container/build
79+
80+
- name: install pkg-config to help find aces_container
81+
run: |
82+
sudo apt-get -y install pkg-config
83+
7284
- uses: actions/checkout@v3
7385

7486
- name: Configure CMake
@@ -124,6 +136,18 @@ jobs:
124136
make &&
125137
sudo make install
126138
139+
- name: install aces_container
140+
run: |
141+
cd ..
142+
git clone https://github.com/ampas/aces_container.git &&
143+
cmake -S aces_container -B aces_container/build -DCMAKE_CXX_FLAGS="-Wno-c++11-narrowing" &&
144+
cmake --build aces_container/build &&
145+
sudo cmake --install aces_container/build
146+
147+
- name: install pkg-config to help find aces_container
148+
run: |
149+
sudo apt-get -y install pkg-config
150+
127151
- uses: actions/checkout@v3
128152

129153
- name: Configure CMake
@@ -171,6 +195,18 @@ jobs:
171195
make &&
172196
sudo make install
173197
198+
- name: install aces_container
199+
run: |
200+
cd ..
201+
git clone https://github.com/ampas/aces_container.git &&
202+
cmake -S aces_container -B aces_container/build -DCMAKE_CXX_FLAGS="-Wno-c++11-narrowing" &&
203+
cmake --build aces_container/build &&
204+
sudo cmake --install aces_container/build
205+
206+
- name: install pkg-config to help find aces_container
207+
run: |
208+
sudo apt-get -y install pkg-config
209+
174210
- uses: actions/checkout@v3
175211

176212
- name: Configure CMake
@@ -189,6 +225,11 @@ jobs:
189225
# Run valgrind using a bash script
190226
run: pwd && ls && bash ../resources/test/scripts/run_valgrind.sh
191227

228+
- name: Run Valgrind on aces container unit tests
229+
working-directory: ${{github.workspace}}/build
230+
# Run valgrind using a bash script
231+
run: pwd && ls && bash ../resources/test/scripts/run_valgrind_aces_container.sh
232+
192233
valgrind-openexr3:
193234
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
194235
# You can convert this to a matrix build if you need cross-platform coverage.
@@ -233,6 +274,18 @@ jobs:
233274
make &&
234275
sudo make install
235276
277+
- name: install aces_container
278+
run: |
279+
cd ..
280+
git clone https://github.com/ampas/aces_container.git &&
281+
cmake -S aces_container -B aces_container/build -DCMAKE_CXX_FLAGS="-Wno-c++11-narrowing" &&
282+
cmake --build aces_container/build &&
283+
sudo cmake --install aces_container/build
284+
285+
- name: install pkg-config to help find aces_container
286+
run: |
287+
sudo apt-get -y install pkg-config
288+
236289
- uses: actions/checkout@v3
237290

238291
- name: Configure CMake
@@ -246,13 +299,14 @@ jobs:
246299
cd ${{ github.workspace }}
247300
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
248301
249-
#- name: Make unit tests
250-
# working-directory: ${{github.workspace}}/build
251-
# run: make check
252-
253302
- name: Run Valgrind on unit tests
254303
working-directory: ${{github.workspace}}/build
255304
# Run valgrind using a bash script
256305
run: pwd && ls && bash ../resources/test/scripts/run_valgrind.sh
257306

307+
- name: Run Valgrind on aces container unit tests
308+
working-directory: ${{github.workspace}}/build
309+
# Run valgrind using a bash script
310+
run: pwd && ls && bash ../resources/test/scripts/run_valgrind_aces_container.sh
311+
258312

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2+
# file Copyright.txt or https://cmake.org/licensing for details.
3+
4+
#[=======================================================================[.rst:
5+
FindAcesContainer
6+
-------
7+
8+
Finds the AcesContainer library.
9+
10+
Imported Targets
11+
^^^^^^^^^^^^^^^^
12+
13+
This module provides the following imported targets, if found:
14+
15+
``AcesContainer::AcesContainer``
16+
The AcesContainer library
17+
18+
Result Variables
19+
^^^^^^^^^^^^^^^^
20+
21+
This will define the following variables:
22+
23+
``AcesContainer_FOUND``
24+
True if the system has the AcesContainer library.
25+
``AcesContainer_VERSION``
26+
The version of the AcesContainer library which was found.
27+
``AcesContainer_INCLUDE_DIRS``
28+
Include directories needed to use AcesContainer.
29+
``AcesContainer_LIBRARIES``
30+
Libraries needed to link to AcesContainer.
31+
32+
Cache Variables
33+
^^^^^^^^^^^^^^^
34+
35+
The following cache variables may also be set:
36+
37+
``AcesContainer_INCLUDE_DIR``
38+
The directory containing ``AcesContainer.h``.
39+
``AcesContainer_LIBRARY``
40+
The path to the AcesContainer library.
41+
42+
#]=======================================================================]
43+
44+
cmake_minimum_required(VERSION 3.12)
45+
include(GNUInstallDirs)
46+
47+
message(STATUS "running FindAcesContainer.cmake")
48+
49+
# https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#find-modules
50+
51+
find_package(PkgConfig)
52+
pkg_check_modules(PC_AcesContainer QUIET AcesContainer)
53+
54+
find_path(AcesContainer_INCLUDE_DIR
55+
NAMES aces_Writer.h
56+
#PATHS ${PC_AcesContainer_INCLUDE_DIRS}
57+
PATHS /usr/local/include/
58+
PATH_SUFFIXES aces
59+
)
60+
find_library(AcesContainer_LIBRARY
61+
NAMES AcesContainer
62+
#PATHS ${PC_AcesContainer_LIBRARY_DIRS}
63+
PATHS /usr/local/lib/
64+
)
65+
66+
find_library(AcesContainer_LIBRARY_RELEASE
67+
NAMES AcesContainer
68+
PATHS ${PC_AcesContainer_LIBRARY_DIRS}/Release
69+
)
70+
find_library(AcesContainer_LIBRARY_DEBUG
71+
NAMES AcesContainer
72+
PATHS ${PC_AcesContainer_LIBRARY_DIRS}/Debug
73+
)
74+
75+
include(SelectLibraryConfigurations)
76+
select_library_configurations(AcesContainer)
77+
78+
set(AcesContainer_VERSION ${PC_AcesContainer_VERSION})
79+
80+
include(FindPackageHandleStandardArgs)
81+
find_package_handle_standard_args(AcesContainer
82+
FOUND_VAR AcesContainer_FOUND
83+
REQUIRED_VARS
84+
AcesContainer_LIBRARY
85+
AcesContainer_INCLUDE_DIR
86+
VERSION_VAR AcesContainer_VERSION
87+
)
88+
89+
if(AcesContainer_FOUND)
90+
set(AcesContainer_LIBRARIES ${AcesContainer_LIBRARY})
91+
set(AcesContainer_INCLUDE_DIRS ${AcesContainer_INCLUDE_DIR})
92+
set(AcesContainer_DEFINITIONS ${PC_AcesContainer_CFLAGS_OTHER})
93+
endif()
94+
95+
if(AcesContainer_FOUND AND NOT TARGET AcesContainer::AcesContainer)
96+
add_library(AcesContainer::AcesContainer UNKNOWN IMPORTED)
97+
set_target_properties(AcesContainer::AcesContainer PROPERTIES
98+
IMPORTED_LOCATION "${AcesContainer_LIBRARY}"
99+
INTERFACE_COMPILE_OPTIONS "${PC_AcesContainer_CFLAGS_OTHER}"
100+
INTERFACE_INCLUDE_DIRECTORIES "${AcesContainer_INCLUDE_DIR}"
101+
)
102+
endif()
103+
104+
if(AcesContainer_FOUND)
105+
if (NOT TARGET AcesContainer::AcesContainer)
106+
add_library(AcesContainer::AcesContainer UNKNOWN IMPORTED)
107+
endif()
108+
if (AcesContainer_LIBRARY_RELEASE)
109+
set_property(TARGET AcesContainer::AcesContainer APPEND PROPERTY
110+
IMPORTED_CONFIGURATIONS RELEASE
111+
)
112+
set_target_properties(AcesContainer::AcesContainer PROPERTIES
113+
IMPORTED_LOCATION_RELEASE "${AcesContainer_LIBRARY_RELEASE}"
114+
)
115+
endif()
116+
if (AcesContainer_LIBRARY_DEBUG)
117+
set_property(TARGET AcesContainer::AcesContainer APPEND PROPERTY
118+
IMPORTED_CONFIGURATIONS DEBUG
119+
)
120+
set_target_properties(AcesContainer::AcesContainer PROPERTIES
121+
IMPORTED_LOCATION_DEBUG "${AcesContainer_LIBRARY_DEBUG}"
122+
)
123+
endif()
124+
set_target_properties(AcesContainer::AcesContainer PROPERTIES
125+
INTERFACE_COMPILE_OPTIONS "${PC_AcesContainer_CFLAGS_OTHER}"
126+
INTERFACE_INCLUDE_DIRECTORIES "${AcesContainer_INCLUDE_DIR}"
127+
)
128+
endif()
129+
130+
mark_as_advanced(
131+
AcesContainer_INCLUDE_DIR
132+
AcesContainer_LIBRARY
133+
)
134+
135+
# compatibility variables
136+
set(AcesContainer_VERSION_STRING ${AcesContainer_VERSION})
137+
138+
139+

ctlrender/CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,26 @@ else()
5151
endif()
5252

5353
find_package(AcesContainer)
54+
if( AcesContainer_FOUND )
55+
message( STATUS "find_package(AcesContainer) - AcesContainer_FOUND is true")
56+
else()
57+
message( STATUS "find_package(AcesContainer) - AcesContainer_FOUND is false")
58+
endif()
59+
5460
if (TARGET AcesContainer::AcesContainer)
61+
message( STATUS "find_package(AcesContainer) - TARGET AcesContainer::AcesContainer is true:" )
62+
else()
63+
message( STATUS "find_package(AcesContainer) - TARGET AcesContainer::AcesContainer is false")
64+
endif()
65+
66+
if( AcesContainer_FOUND OR TARGET AcesContainer::AcesContainer)
67+
68+
message( STATUS " AcesContainer_VERSION : ${AcesContainer_VERSION}" )
69+
message( STATUS " AcesContainer_INCLUDE_DIRS : ${AcesContainer_INCLUDE_DIRS}" )
70+
message( STATUS " AcesContainer_LIBRARIES : ${AcesContainer_LIBRARIES}" )
71+
message( STATUS " AcesContainer_INCLUDE_DIR : ${AcesContainer_INCLUDE_DIR}" )
72+
message( STATUS " AcesContainer_LIBRARY : ${AcesContainer_LIBRARY}" )
73+
5574
target_compile_definitions(ctlrender
5675
PRIVATE
5776
-DHAVE_ACESFILE=1
@@ -60,6 +79,11 @@ if (TARGET AcesContainer::AcesContainer)
6079
PRIVATE
6180
AcesContainer::AcesContainer
6281
)
82+
message( STATUS "AcesContainer found")
83+
message( STATUS " ctlrender will support writing AcesContainer files" )
84+
else()
85+
message( STATUS "AcesContainer not found - TARGET AcesContainer::AcesContainer is false and AcesContainer_FOUND is false")
86+
message( STATUS " ctlrender will not support writing AcesContainer files" )
6387
endif()
6488

6589
install(TARGETS ctlrender DESTINATION ${CMAKE_INSTALL_BINDIR})
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM ubuntu:22.04
2+
3+
RUN apt-get update
4+
5+
# disable interactive install
6+
ENV DEBIAN_FRONTEND noninteractive
7+
8+
# install developement tools
9+
RUN apt-get -y install cmake
10+
RUN apt-get -y install g++
11+
RUN apt-get -y install git
12+
13+
RUN apt-get -y install valgrind
14+
15+
# install CTL dependencies
16+
RUN apt-get -y install libopenexr-dev
17+
RUN apt-get -y install libtiff-dev
18+
19+
# install aces_container
20+
WORKDIR /usr/src/
21+
RUN git clone https://github.com/ampas/aces_container.git
22+
#WORKDIR /usr/src/aces_container/build
23+
#RUN cmake ..
24+
#RUN make
25+
#RUN make install
26+
RUN cmake -S aces_container -B aces_container/build -DCMAKE_CXX_FLAGS="-Wno-c++11-narrowing"
27+
RUN cmake --build aces_container/build
28+
RUN cmake --install aces_container/build
29+
30+
RUN apt-get -y install pkg-config
31+
32+
# Make sudo dummy replacement, so we don't weaken docker security
33+
#RUN echo "#!/bin/bash\n\$@" > /usr/bin/sudo
34+
#RUN chmod +x /usr/bin/sudo
35+
36+
# copy CTL repo into docker
37+
WORKDIR /usr/src/CTL
38+
COPY . .
39+
40+
# install ACES AcesContainer using install script
41+
#WORKDIR /usr/src/
42+
#RUN bash ./CTL/resources/scripts/install_aces_container.bash
43+
44+
# build CTL
45+
WORKDIR /usr/src/CTL/build
46+
#RUN cmake -D CMAKE_PREFIX_PATH=/usr/local/lib/CMake/AcesContainer ..
47+
RUN cmake ..
48+
RUN make
49+
RUN make install
50+
51+
52+
53+
# finalize docker environment
54+
WORKDIR /usr/src/CTL
55+

0 commit comments

Comments
 (0)