{ "cells": [ { "cell_type": "markdown", "id": "7613f51f", "metadata": {}, "source": [ "# Compiling OTB from source" ] }, { "cell_type": "markdown", "id": "55d7746d", "metadata": {}, "source": [ "We used the instructions in this webpage: [compiling OTB](https://www.orfeo-toolbox.org/CookBook/CompilingOTBFromSource.html#compiling-otb-from-source)\n", "\n", "We went through SuperBuild installation : Build OTB and all dependencies\n", "\n", "- Only change the following command in the instructions to this:\n", "\n", "\n", "```$ cmake -D OTB_USE_SHARK=ON CMAKE_INSTALL_PREFIX=~/OTB/install ../otb/SuperBuild``` to turn on SHARK after compiling." ] }, { "cell_type": "markdown", "id": "4e55733c", "metadata": {}, "source": [ "During the procedure we get some **errors**, and we solved them as follow:" ] }, { "cell_type": "markdown", "id": "7269a957", "metadata": {}, "source": [ "**1. SWIG installation**\n", "\n", "run this command ```$sudo apt install SWIG```" ] }, { "cell_type": "markdown", "id": "27e33b25", "metadata": {}, "source": [ "**2. Error for EXPAT**\n", "\n", "The old version of EXPAT (expat-2.3.0.tar.gz)is no longer available with previous url, so we manually downloaded from [here](https://github.com/libexpat/libexpat/releases/download/R_2_3_0/expat-2.3.0.tar.gz) and replaced it in this directory: ```/home/user/OTB/build/EXPAT/src```" ] }, { "cell_type": "markdown", "id": "18ea4f3b", "metadata": {}, "source": [ "**3. SQLITE version incompatibility**\n", "\n", "--> delete sqlite.zip in this directory: ```/home/user/OTB/build/SQLITE/src```\n", "\n", "--> delete all the lines inside \".log\" files in this directory ```/home/user/OTB/build/SQLITE/src/SQLITE-stamp``` to install sqlite again\n", "\n", "--> change the url in this file: ```/home/user/OTB/build/SQLITE/src/SQLITE-stamp/SQLITE-urlinfo.txt```\n", "\n", "from [http://www.sqlite.org/2015/sqlite-amalgamation-3080801.zip](http://www.sqlite.org/2015/sqlite-amalgamation-3080801.zip)\n", "\n", "to [https://www.sqlite.org/src/zip/0c55d179/SQLite-0c55d179.zip](https://www.sqlite.org/src/zip/0c55d179/SQLite-0c55d179.zip)" ] }, { "cell_type": "markdown", "id": "0896ea21", "metadata": {}, "source": [ "- I highly recommand **not** to add the OTB directory to PATH because of some gdal confusions, instead you can run it from it's directory everytime; like this:\n", "\n", "```~/OTB/superbuild_install/bin/otbcli_KMeansClassification```" ] }, { "cell_type": "markdown", "id": "bfe2c2c9", "metadata": {}, "source": [ "You can use the instructions on this [page](https://www.orfeo-toolbox.org/CookBook/Applications/app_KMeansClassification.html#) for better understanding of KMeansClassification with otb" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" } }, "nbformat": 4, "nbformat_minor": 5 }