0

I am connected to a server via ssh and do not have root privileges. I ultimately need to install openslide. apt-get is not present, yum requires root privilege so I was going for make/install from the source code of openslide.

I needed to install openjpeg as a dependency however they support cmake and it requires root privelege as well at some point :/ as in their installation guide

Is there any way around?

PS: I need openslide to read very large (~1.5 GB) tif files in python

Uğur Dinç
  • 303
  • 3
  • 16
  • "I needed to install openjpeg as a dependency however they support cmake and it requires root privelege as well at some point" - By itself, CMake doesn't require root privileges. They are required if you install the project under system-wide installation prefix, which is by default. You may change installation prefix with `CMAKE_INSTALL_PREFIX` variable, it is noted in the [guide](https://github.com/uclouvain/openjpeg/blob/master/INSTALL.md) you refer to. – Tsyvarev Feb 25 '19 at 09:27
  • Thank you so much, it worked this way. – Uğur Dinç Feb 25 '19 at 09:34
  • Now openslide can't find openjpeg libraries. I am not familiar with ubuntu coding, any suggestions how to specify openjpeg location for openslide? – Uğur Dinç Feb 25 '19 at 09:48
  • When build `openslide`, you need to specify installation prefix used for `openjpeg` in the `CMAKE_PREFIX_PATH` variable: since the prefix is no longer a default one, CMake needs a hint for using this prefix when search the library. – Tsyvarev Feb 25 '19 at 09:56
  • I couldn't find where to specify it. Thanks though – Uğur Dinç Feb 25 '19 at 14:47
  • Oh, [openslide](https://github.com/openslide/openslide) seems do not use CMake for build. Then `CMAKE_PREFIX_PATH` is not applicable for it. You need to somehow hint autotools about your openjpeg installation prefix. – Tsyvarev Feb 25 '19 at 14:53
  • Can it be somewhere here? https://github.com/openslide/openslide/blob/master/configure.ac – Uğur Dinç Feb 25 '19 at 14:55
  • I am not so familiar with autotools for understand its `configure.ac`. But this [SO question](https://stackoverflow.com/questions/517580/library-resolution-with-autoconf) seems to be what you are looking for. – Tsyvarev Feb 25 '19 at 14:57
  • You have been so kind and helpful Tsyvarev, thanks so much. I will try right away – Uğur Dinç Feb 25 '19 at 15:06
  • 1
    typing export PKG_CONFIG_PATH=/path/to/openjpeg/lib/pkgconfig directly at the command line to speficy pkgconfig file of openjpeg worked. Thanks very much for your help. https://lists.andrew.cmu.edu/pipermail/openslide-users/2014-May/000788.html – Uğur Dinç Feb 25 '19 at 15:32
  • For future reference: installing openslide-python this way is the magical solution to solve ALL problems if you have conda https://anaconda.org/bioconda/openslide-python – Uğur Dinç Feb 25 '19 at 20:43

1 Answers1

2
  1. download openjepg from https://github.com/uclouvain/openjpeg/releases/download/v2.3.1/openjpeg-v2.3.1-linux-x86_64.tar.gz
  2. unzip the downloaded file, and modify the pkgconfig/libjpeg2.pc, set the “prefix” to be the correct path, so that compiler can find relevant include and lib path
  3. download openslide from https://github.com/openslide/openslide/releases/download/v3.4.1/openslide-3.4.1.tar.gz
  4. unzip the downloaded file, and cd into the unziped folder
  5. run ./configure -prefix=/the/path/you/would/like/openslide/to/be/installed PKG_CONFIG_PATH=/the/path/you/save/openjpeg/openjpeg-v2.3.1-linux-x86_64/lib/pkgconfig
  6. run make & make install
  7. add /the/path/you/would/like/openslide/to/be/installed/lib into “LD_LIBRARY_PATH” (vi ~/.bashrc, add export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/the/path/you/would/like/openslide/to/be/installed/lib)
Jun Jiang
  • 21
  • 2