From 04e1e22450b9164fb21dfdb65ab425ff46c94490 Mon Sep 17 00:00:00 2001
From: Raffaele Gaetano <raffaele.gaetano@cirad.fr>
Date: Wed, 7 Jun 2023 10:58:30 +0200
Subject: [PATCH] WIP: first working dockerfile for Moringa OTB build

---
 docker/dockerfile.otb | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/docker/dockerfile.otb b/docker/dockerfile.otb
index 195a3fc..36ce85b 100644
--- a/docker/dockerfile.otb
+++ b/docker/dockerfile.otb
@@ -33,6 +33,7 @@ RUN apt-get update \
         vim \
         wget \
         zip \
+        libopenmpi-dev \
     && apt-get clean && rm -rf /var/lib/apt/lists/*
 
 # OTB branch to clone
@@ -55,7 +56,7 @@ RUN cd /tmp/build \
         -DCMAKE_BUILD_TYPE="Release" \
         -DDOWNLOAD_LOCATION=/tmp/SuperBuild-archives \
         -DCMAKE_INSTALL_PREFIX=/opt/otb \
-    && make OTB_DEPENDS -j7
+    && make OTB_DEPENDS -j20
 
 RUN cd /tmp/otb/Modules/Remote \
     && rm -f otbGRM.remote.cmake \
@@ -88,9 +89,12 @@ RUN cd /tmp/otb/Modules/Remote \
         -DModule_SertitObject=OFF \
         -DOTB_WRAP_PYTHON=ON \
         -DPYTHON_EXECUTABLE=/usr/bin/python3 \
-        -DCMAKE_INSTALL_PREFIX=/opt/otb \
+        -DCMAKE_INSTALL_PREFIX=/opt/otb
+
+RUN sed -i 's/SetDocName/\/\/SetDocName/g' /tmp/otb/Modules/Remote/OTBPhenology/app/otbSigmoFitting.cxx \
+    && sed -i 's/SetDocName/\/\/SetDocName/g' /tmp/otb/Modules/Remote/otb-slic/app/otbSLIC.cxx \
     && cd /tmp/build \
-    && make -j7 \
+    && make -j20 \
     && rm -rf /tmp/* /root/.cache /opt/otb/bin/otbgui_*
 
 # Persistent environment variables
-- 
GitLab