1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ #
16+ # WARNING: This is an automatically generated file. Consider changing the
17+ # sources instead. You can find the source templates and scripts at:
18+ # https://github.com/googleapis/google-cloud-cpp-common/ci/templates
19+ #
20+
1521ARG DISTRO_VERSION=7
1622FROM centos:${DISTRO_VERSION} AS devtools
1723ARG NCPU=4
1824
19- # Please keep the formatting in these commands, it is optimized to cut & paste
20- # into the README.md file.
21-
2225## [START INSTALL.md]
2326
2427# First install the development tools and OpenSSL. The development tools
25- # distributed with CentOS (notably CMake) are too old to build
26- # `google-cloud-cpp` . In these instructions, we use `cmake3` obtained from
28+ # distributed with CentOS 7 (notably CMake) are too old to build
29+ # the project . In these instructions, we use `cmake3` obtained from
2730# [Software Collections](https://www.softwarecollections.org/).
2831
2932# ```bash
@@ -48,40 +51,22 @@ ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
4851ENV PATH=/usr/local/bin:${PATH}
4952# ```
5053
51- # #### crc32c
52-
53- # There is no CentOS package for this library. To install it use:
54-
55- # ```bash
56- WORKDIR /var/tmp/build
57- RUN wget -q https://github.com/google/crc32c/archive/1.0.6.tar.gz && \
58- tar -xf 1.0.6.tar.gz && \
59- cd crc32c-1.0.6 && \
60- cmake \
61- -DCMAKE_BUILD_TYPE=Release \
62- -DBUILD_SHARED_LIBS=yes \
63- -DCRC32C_BUILD_TESTS=OFF \
64- -DCRC32C_BUILD_BENCHMARKS=OFF \
65- -DCRC32C_USE_GLOG=OFF \
66- -H. -Bcmake-out/crc32c && \
67- cmake --build cmake-out/crc32c --target install -- -j ${NCPU:-4} && \
68- ldconfig
69- # ```
70-
7154# #### Protobuf
7255
73- # Likewise, manually install protobuf:
56+ # We need to install a version of Protobuf that is recent enough to support the
57+ # Google Cloud Platform proto files:
7458
7559# ```bash
7660WORKDIR /var/tmp/build
77- RUN wget -q https://github.com/google/protobuf/archive/v3.6 .1.tar.gz && \
78- tar -xf v3.6 .1.tar.gz && \
79- cd protobuf-3.6 .1/cmake && \
61+ RUN wget -q https://github.com/google/protobuf/archive/v3.9 .1.tar.gz && \
62+ tar -xf v3.9 .1.tar.gz && \
63+ cd protobuf-3.9 .1/cmake && \
8064 cmake \
8165 -DCMAKE_BUILD_TYPE=Release \
8266 -DBUILD_SHARED_LIBS=yes \
8367 -Dprotobuf_BUILD_TESTS=OFF \
8468 -H. -Bcmake-out && \
69+ cmake --build cmake-out -- -j ${NCPU:-4} && \
8570 cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
8671 ldconfig
8772# ```
@@ -96,39 +81,58 @@ WORKDIR /var/tmp/build
9681RUN wget -q https://github.com/c-ares/c-ares/archive/cares-1_14_0.tar.gz && \
9782 tar -xf cares-1_14_0.tar.gz && \
9883 cd c-ares-cares-1_14_0 && \
99- ./buildconf && \
100- ./configure && \
101- make -j ${NCPU:-4} && \
84+ ./buildconf && ./configure && make -j ${NCPU:-4} && \
10285 make install && \
10386 ldconfig
10487# ```
10588
10689# #### gRPC
10790
108- # Can be manually installed using:
91+ # We also need a version of gRPC that is recent enough to support the Google
92+ # Cloud Platform proto files. We manually install it using:
10993
11094# ```bash
11195WORKDIR /var/tmp/build
112- RUN wget -q https://github.com/grpc/grpc/archive/v1.19 .1.tar.gz && \
113- tar -xf v1.19 .1.tar.gz && \
114- cd grpc-1.19 .1 && \
96+ RUN wget -q https://github.com/grpc/grpc/archive/v1.23 .1.tar.gz && \
97+ tar -xf v1.23 .1.tar.gz && \
98+ cd grpc-1.23 .1 && \
11599 make -j ${NCPU:-4} && \
116100 make install && \
117101 ldconfig
118102# ```
119103
104+ # #### crc32c
105+
106+ # The project depends on the Crc32c library, we need to compile this from
107+ # source:
108+
109+ # ```bash
110+ WORKDIR /var/tmp/build
111+ RUN wget -q https://github.com/google/crc32c/archive/1.0.6.tar.gz && \
112+ tar -xf 1.0.6.tar.gz && \
113+ cd crc32c-1.0.6 && \
114+ cmake \
115+ -DCMAKE_BUILD_TYPE=Release \
116+ -DBUILD_SHARED_LIBS=yes \
117+ -DCRC32C_BUILD_TESTS=OFF \
118+ -DCRC32C_BUILD_BENCHMARKS=OFF \
119+ -DCRC32C_USE_GLOG=OFF \
120+ -H. -Bcmake-out && \
121+ cmake --build cmake-out -- -j ${NCPU:-4} && \
122+ cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
123+ ldconfig
124+ # ```
125+
120126# #### googleapis
121127
122- # There is no CentOS package for this library. To install it, use :
128+ # We need a recent version of the Google Cloud Platform proto C++ libraries :
123129
124130# ```bash
125131WORKDIR /var/tmp/build
126132RUN wget -q https://github.com/googleapis/cpp-cmakefiles/archive/v0.1.5.tar.gz && \
127133 tar -xf v0.1.5.tar.gz && \
128134 cd cpp-cmakefiles-0.1.5 && \
129- cmake \
130- -DBUILD_SHARED_LIBS=YES \
131- -H. -Bcmake-out && \
135+ cmake -DBUILD_SHARED_LIBS=YES -H. -Bcmake-out && \
132136 cmake --build cmake-out -- -j ${NCPU:-4} && \
133137 cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
134138 ldconfig
@@ -144,54 +148,51 @@ WORKDIR /var/tmp/build
144148RUN wget -q https://github.com/google/googletest/archive/release-1.10.0.tar.gz && \
145149 tar -xf release-1.10.0.tar.gz && \
146150 cd googletest-release-1.10.0 && \
147- cmake \
148- -DCMAKE_BUILD_TYPE="Release" \
149- -DBUILD_SHARED_LIBS=yes \
150- -H. -Bcmake-out && \
151+ cmake -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=yes -H. -Bcmake-out && \
151152 cmake --build cmake-out -- -j ${NCPU:-4} && \
152153 cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
153154 ldconfig
154155# ```
155156
156157# #### google-cloud-cpp-common
157158
158- # We need to install the Google Cloud C++ common libraries:
159+ # The project also depends on google-cloud-cpp-common, the libraries shared by
160+ # all the Google Cloud C++ client libraries:
159161
160162# ```bash
161163WORKDIR /var/tmp/build
162- ## Compile without the tests because we are testing google-cloud-cpp, not the
163- ## common libraries, but we need the testing_utils because we use it in the
164- ## google-cloud-cpp tests.
165164RUN wget -q https://github.com/googleapis/google-cloud-cpp-common/archive/v0.16.0.tar.gz && \
166165 tar -xf v0.16.0.tar.gz && \
167166 cd google-cloud-cpp-common-0.16.0 && \
168167 cmake -H. -Bcmake-out \
169- -DBUILD_TESTING=OFF \
170- -DGOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL=ON && \
168+ -DBUILD_TESTING=OFF \
169+ -DGOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL=ON && \
171170 cmake --build cmake-out -- -j ${NCPU:-4} && \
172- cmake --build cmake-out --target install && \
171+ cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
173172 ldconfig
174173# ```
175174
176175FROM devtools AS install
177176ARG NCPU=4
178177
179- # #### google-cloud-cpp
178+ # #### Compile and install the main project
180179
181- # Finally we can install `google-cloud-cpp`.
180+ # We can now compile, test, and install `google-cloud-cpp`.
182181
183182# ```bash
184- WORKDIR /var/tmp/ build/google-cloud-cpp
185- COPY . /var/tmp/ build/google-cloud-cpp
183+ WORKDIR /home/ build/project
184+ COPY . /home/ build/project
186185RUN cmake -H. -Bcmake-out
187- RUN cmake --build cmake-out -- -j ${NCPU:-4}
188- WORKDIR /var/tmp/ build/google-cloud-cpp /cmake-out
189- RUN ctest --output-on-failure
186+ RUN cmake --build cmake-out -- -j " ${NCPU:-4}"
187+ WORKDIR /home/ build/project /cmake-out
188+ RUN ctest -LE integration-tests - -output-on-failure
190189RUN cmake --build . --target install
191190# ```
192191
193192## [END INSTALL.md]
194193
194+ ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig
195+
195196# Verify that the installed files are actually usable
196197WORKDIR /home/build/test-install-plain-make
197198COPY ci/test-install /home/build/test-install-plain-make
0 commit comments