|
1 | | -# syntax = nexus3.acadiasoft.net:4445/docker/dockerfile:experimental |
2 | | -ARG quantlib_version=${QL_TAG} |
3 | | -ARG cmake_build_type=${CMAKE_BUILD_TYPE} |
4 | | -FROM env_quantlib:${quantlib_version} |
| 1 | +# syntax = docker/dockerfile:1.2 |
| 2 | +ARG debian_tag |
| 3 | +FROM debian:${debian_tag} |
5 | 4 |
|
6 | 5 | MAINTAINER Quaternion Risk Management |
7 | | -LABEL Description="Build ORE and add to the QuantLib build environment" |
| 6 | +LABEL Description="Build QuantLib and add to the Boost build environment" |
8 | 7 |
|
9 | 8 | # Argument for number of cores to use while building |
10 | 9 | ARG num_cores |
11 | 10 |
|
12 | | -# install Eigen |
13 | | -RUN apt-get install -f -y libeigen3-dev |
| 11 | +# Argument that chooses cmake build type |
| 12 | +ARG cmake_build_type |
14 | 13 |
|
15 | | -# Copy ORE sources for libs and app |
| 14 | +RUN apt-get update \ |
| 15 | + && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential libbz2-dev autoconf libtool cmake ninja-build zlib1g-dev opencl-headers ocl-icd-opencl-dev libboost-all-dev doxygen graphviz ccache libeigen3-dev \ |
| 16 | + && apt-get clean |
| 17 | + |
| 18 | +# Exclusions are performed by .dockerignore |
| 19 | +COPY QuantLib /ore/QuantLib |
| 20 | +COPY CMakeLists.txt /ore/CMakeLists.txt |
| 21 | +COPY QuantLib /ore/QuantLib |
16 | 22 | COPY QuantExt /ore/QuantExt |
17 | 23 | COPY OREData /ore/OREData |
18 | 24 | COPY OREAnalytics /ore/OREAnalytics |
19 | 25 | COPY App /ore/App |
20 | 26 | COPY ThirdPartyLibs /ore/ThirdPartyLibs |
21 | 27 | COPY ORETest /ore/ORETest |
22 | 28 | COPY cmake /ore/cmake |
23 | | -COPY Docker /ore/Docker |
24 | 29 |
|
25 | | -# Need the dos2unix all if building from Windows because the shell |
26 | | -# scripts fail if there are CRLF present in the files |
| 30 | +ENV PATH="/usr/lib/ccache:$PATH" |
| 31 | +ENV CCACHE_DIR="/ccache" |
| 32 | +ENV CCACHE_MAXSIZE="10G" |
| 33 | +# needed if QL_USE_PCH is ON |
| 34 | +#ENV CCACHE_SLOPPINESS="pch_defines,time_macros,pch_defines,time_macros,include_file_mtime,include_file_ctim" |
| 35 | + |
| 36 | +# - add -fpch-preprocess to CMAKE_CXX_FLAGS when QL_USE_PCH is set to ON |
27 | 37 | RUN cd /ore \ |
28 | | - && find -regex ".*\.\(sh\|in\|ac\|am\)" -exec dos2unix {} ';' \ |
29 | | - && cp Docker/CMakeLists_ORE.txt CMakeLists.txt \ |
30 | 38 | && mkdir -p build.ore && cd build.ore \ |
31 | | - && cmake .. -DQL_USE_PCH=OFF -DORE_BUILD_DOC=ON -DCMAKE_BUILD_TYPE=${cmake_build_type} -DCMAKE_CXX_FLAGS="-mavx2" -DORE_ENABLE_PARALLEL_UNIT_TEST_RUNNER=ON -DORE_USE_ZLIB=ON -D ORE_ENABLE_OPENCL=ON |
32 | | - |
| 39 | + && cmake .. -GNinja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQL_USE_PCH=OFF -DORE_BUILD_DOC=ON -DCMAKE_BUILD_TYPE=${cmake_build_type} -DCMAKE_CXX_FLAGS="-D BOOST_ENABLE_ASSERT_HANDLER -mavx2" -DQL_ENABLE_SESSIONS=ON -DQL_ENABLE_PARALLEL_UNIT_TEST_RUNNER=ON -DQL_BUILD_EXAMPLES=OFF -DQL_BUILD_BENCHMARK=OFF -DORE_ENABLE_PARALLEL_UNIT_TEST_RUNNER=ON -DORE_USE_ZLIB=ON -D ORE_ENABLE_OPENCL=ON |
| 40 | + |
33 | 41 | WORKDIR /ore/build.ore |
34 | 42 | RUN --mount=type=cache,target=/ccache/ ccache -z \ |
35 | | - && make -j ${num_cores} \ |
| 43 | + && cmake --build . -- -j ${num_cores} install \ |
36 | 44 | && ccache -s \ |
37 | | - && make install \ |
38 | 45 | && make doc_quantext 2>&1 | grep -v "ignoring unsupported tag" \ |
39 | 46 | && make doc_ored 2>&1 | grep -v "ignoring unsupported tag" \ |
40 | 47 | && make doc_orea 2>&1 | grep -v "ignoring unsupported tag" |
41 | | - |
| 48 | + |
42 | 49 | WORKDIR / |
43 | 50 | RUN mkdir -p html \ |
44 | 51 | && mkdir /html/ored && cp -r /ore/OREData/doc/html/* /html/ored \ |
|
0 commit comments