aoles / EBImage

:art: Image processing toolbox for R
70 stars 28 forks source link

Installation error common.h:5:18: fatal error: tiff.h: No such file or directory #2

Closed englianhu closed 8 years ago

englianhu commented 8 years ago

I tried to install but failed ##issue:https://gist.github.com/alstat/3bec32e1ad17515d7b3a#gistcomment-1570124 https://stat.ethz.ch/pipermail/r-sig-debian/2012-November/002012.html

$ sudo su - -c "R -e \"biocLite('EBImage')\""               
R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> biocLite('EBImage')
Error: could not find function "biocLite"
Execution halted
$ sudo su - -c "R -e \"source('http://bioconductor.org/biocLite.R');biocLite('EBImage')\""

R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> source('http://bioconductor.org/biocLite.R');biocLite('EBImage')
Bioconductor version 3.1 (BiocInstaller 1.18.4), ?biocLite for help
BioC_mirror: http://bioconductor.org
Using Bioconductor version 3.1 (BiocInstaller 1.18.4), R version 3.2.1.
Installing package(s) ‘EBImage’
also installing the dependencies ‘tiff’, ‘fftwtools’

trying URL 'http://cran.rstudio.com/src/contrib/tiff_0.1-5.tar.gz'
Content type 'application/x-gzip' length 28925 bytes (28 KB)
==================================================
downloaded 28 KB

trying URL 'http://cran.rstudio.com/src/contrib/fftwtools_0.9-7.tar.gz'
Content type 'application/x-gzip' length 145998 bytes (142 KB)
==================================================
downloaded 142 KB

trying URL 'http://bioconductor.org/packages/3.1/bioc/src/contrib/EBImage_4.10.1.tar.gz'
Content type 'application/x-gzip' length 4117025 bytes (3.9 MB)
==================================================
downloaded 3.9 MB

* installing *source* package ‘tiff’ ...
** package ‘tiff’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c common.c -o common.o
In file included from common.c:1:0:
- common.h:5:18: fatal error: tiff.h: No such file or directory
- #include <tiff.h>
-                   ^
- compilation terminated.
- make: *** [common.o] Error 1
- ERROR: compilation failed for package ‘tiff’
- * removing ‘/usr/lib64/R/library/tiff’
* installing *source* package ‘fftwtools’ ...
** package ‘fftwtools’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c fftwtools.c -o fftwtools.o
- fftwtools.c:28:18: fatal error: fftw3.h: No such file or directory
-  #include<fftw3.h>
-                   ^
- compilation terminated.
- make: *** [fftwtools.o] Error 1
- ERROR: compilation failed for package ‘fftwtools’
- * removing ‘/usr/lib64/R/library/fftwtools’
- ERROR: dependencies ‘tiff’, ‘fftwtools’ are not available for package ‘EBImage’
- * removing ‘/usr/lib64/R/library/EBImage’

The downloaded source packages are in
        ‘/tmp/RtmptJBtDD/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Old packages: 'ggdendro', 'jsonlite', 'networkD3', 'raster', 'shinydashboard',
  'shinyjs', 'sp', 'tidyr', 'VennDiagram'
Warning messages:
- 1: In install.packages(pkgs = doing, lib = lib, ...) :
-  installation of package ‘tiff’ had non-zero exit status
- 2: In install.packages(pkgs = doing, lib = lib, ...) :
-  installation of package ‘fftwtools’ had non-zero exit status
- 3: In install.packages(pkgs = doing, lib = lib, ...) :
-  installation of package ‘EBImage’ had non-zero exit status

install libtiff

$ sudo yum install libtiff
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.i3d.net
 * epel: mirrors.coreix.net
 * extras: mirror.i3d.net
 * updates: mirror.i3d.net
Package libtiff-4.0.3-14.el7.x86_64 already installed and latest version
Nothing to do

install tiffafter check that libtiff-4 has been installed.

$ sudo su - -c "R -e \"install.packages(c('tiff'), dep=TRUE, repos='http://cran.rstudio.com')\""

R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages(c('tiff'), dep=TRUE, repos='http://cran.rstudio.com')
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/tiff_0.1-5.tar.gz'
Content type 'application/x-gzip' length 28925 bytes (28 KB)
==================================================
downloaded 28 KB

* installing *source* package ‘tiff’ ...
** package ‘tiff’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c common.c -o common.o
In file included from common.c:1:0:
- common.h:5:18: fatal error: tiff.h: No such file or directory
- #include <tiff.h>
-                   ^
- compilation terminated.
- make: *** [common.o] Error 1
- ERROR: compilation failed for package ‘tiff’
- * removing ‘/usr/lib64/R/library/tiff’

The downloaded source packages are in
        ‘/tmp/RtmpWvPeb0/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
- In install.packages(c("tiff"), dep = TRUE, repos = "http://cran.rstudio.com") :
-   installation of package ‘tiff’ had non-zero exit status
aoles commented 8 years ago

Thank you for your detailed report!

EBImage depends on a number of third-party packages, including tiff and fftwtools. In order to install these packages from sources you need development versions of the libtiff and fftw system libraries which contain the header files necessary for compilation, i.e., tiff.h and fftw3.h, respectively. On redhat linux distributions these are libtiff-devel and fftw-devel. To install them use

sudo yum install libtiff-devel fftw-devel

Once the libraries are installed you should be able to install EBImage along with its dependencies by typing in the R console

source("https://bioconductor.org/biocLite.R")
biocLite("EBImage")
englianhu commented 8 years ago

finally successfullly installed. Thx alot @aoles

tcgriffith commented 7 years ago

I would like to add that in Ubuntu 16.04 LTS, packages for tiff and fftw are: libtiff5-dev and libfftw3-dev, so:

sudo apt-get install libfftw3-dev libtiff5-dev

should do the trick.

meteorwen commented 7 years ago

installed libtiff-devel fftw-devel but error it:

> source("https://bioconductor.org/biocLite.R")
Bioconductor version 3.5 (BiocInstaller 1.26.1), ?biocLite for help
> biocLite("EBImage")
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.5 (BiocInstaller 1.26.1), R 3.4.1 (2017-06-30).
Installing package(s) ‘EBImage’
trying URL 'https://bioconductor.org/packages/3.5/bioc/src/contrib/EBImage_4.18.1.tar.gz'
Content type 'application/x-gzip' length 5340965 bytes (5.1 MB)
==================================================
downloaded 5.1 MB

* installing *source* package ‘EBImage’ ...
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG   -I/usr/local/include   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC   -c EBImage.c -o EBImage.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG   -I/usr/local/include   -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC   -c clahe.c -o clahe.o
clahe.c:132: error: redefinition of typedef ‘kz_pixel_t’
clahe.h:16: note: previous declaration of ‘kz_pixel_t’ was here
make: *** [clahe.o] Error 1
ERROR: compilation failed for package ‘EBImage’
* removing ‘/home/dsg/R/x86_64-redhat-linux-gnu-library/3.4/EBImage’

The downloaded source packages are in
    ‘/tmp/RtmpGhplkB/downloaded_packages’
Warning message:
In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘EBImage’ had non-zero exit status

Do you need to install opencv?

aoles commented 6 years ago

Thanks for your report @meteorwen , this is now fixed in version 4.18.2 which should be available from Bioconductor within the next 48 hours. You can also install directly from here by running

devtools::install_github("aoles/EBImage", ref="RELEASE_3_5")
AmmarMalik93 commented 5 years ago

I would like to add that in Ubuntu 16.04 LTS, packages for tiff and fftw are: libtiff5-dev and libfftw3-dev, so:

sudo apt-get install libfftw3-dev libtiff5-dev

should do the trick.

Thanks :) This worked for me as well.

iivario commented 2 years ago

Was stuck on 'EBImage' installation in debian 10 with error:

"/usr/bin/ld: /usr/local/lib/libfftw3.a(hc2hc-direct.o): relocation R_X86_64_PC32 against symbol fftw_mksolver_hc2hc_hook' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: nonrepresentable section on output collect2: error: ld returned 1 exit status make: *** [/usr/share/R/share/make/shlib.mk:10: fftwtools.so] Error 1 ERROR: compilation failed for package ‘fftwtools’ removing ‘/usr/local/lib/R/site-library/fftwtools’

Found solution in https://github.com/sgaure/chebpol/issues/1 "must build fftw3 library with '--enable-shared' flag to install"