Failing to install mclust R package on Ubuntu 16.04












0















I am unable to install "mclust" R package on my Ubuntu 16.04.
I have a following issue:



> install.packages("mclust")

>Installing package into ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.4’
>(as ‘lib’ is unspecified)
>trying URL 'https://cloud.r-project.org/src/contrib/mclust_5.4.2.tar.gz'
>Content type 'application/x-gzip' length 2699941 bytes (2.6 MB)
>==================================================
>downloaded 2.6 MB

>* installing *source* package ‘mclust’ ...
>** package ‘mclust’ successfully unpacked and MD5 sums checked
>** libs
>gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
>gfortran -fpic -g -O2 -fstack-protector-strong -c mclust.f -o mclust.o
>gfortran -fpic -g -O2 -fstack-protector-strong -c mclustaddson.f -o mclustaddson.o
>g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o mclust.so init.o mclust.o mclustaddson.o -llapack -lblas -lgfortran
-lm -lquadmath -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
>/usr/bin/x86_64-linux-gnu-ld: /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a(memory.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
>/usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a: error adding symbols: Bad value
>collect2: error: ld returned 1 exit status
>/usr/share/R/share/make/shlib.mk:6: recipe for target 'mclust.so' failed
>make: *** [mclust.so] Error 1
>ERROR: compilation failed for package ‘mclust’
>* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.4/mclust’
>Warning in install.packages :
> installation of package ‘mclust’ had non-zero exit status

>The downloaded source packages are in
> ‘/tmp/Rtmppg0XWs/downloaded_packages’

>sessionInfo()

>R version 3.4.4 (2018-03-15)
>Platform: x86_64-pc-linux-gnu (64-bit)
>Running under: Ubuntu 16.04.5 LTS

>atrix products: default
>BLAS: /usr/lib/libblas/libblas.so.3.6.0
>LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

>locale:
> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=ru_RU.UTF-8
> [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=en_US.UTF-8
> [7] LC_PAPER=ru_RU.UTF-8 LC_NAME=C LC_ADDRESS=C
>[10] LC_TELEPHONE=C LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C

>attached base packages:
>[1] stats graphics grDevices utils datasets methods base

>loaded via a namespace (and not attached):
>[1] compiler_3.4.4 tools_3.4.4 yaml_2.2.0


I have tried updating libgfortran and gcc-6 to the latest version, running apt-get update and upgrade.
Thank you in advance for your help.



Edit:
As per request of Norbert: Output of dpkg -S /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a



dpkg-query: no path found matching pattern /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a


Although, folder /usr/lib/gcc/x86_64-linux-gnu/6/ contains a link to /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a
Output for dpkg -S /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a



libgfortran-5-dev:amd64: /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a


Edit2: Moving the /usr/lib/gcc/x86_64-linux-gnu/6/ to a different location results in a following error:



Installing package into ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)

trying URL 'https://cloud.r-project.org/src/contrib/mclust_5.4.2.tar.gz'

Content type 'application/x-gzip' length 2699941 bytes (2.6 MB)

==================================================

downloaded 2.6 MB



* installing *source* package ‘mclust’ ...

** package ‘mclust’ successfully unpacked and MD5 sums checked

** libs

gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -g -c init.c -o init.o

gcc: error trying to exec 'cc1': execvp: No such file or directory

/usr/lib/R/etc/Makeconf:162: recipe for target 'init.o' failed

make: *** [init.o] Error 1

ERROR: compilation failed for package ‘mclust’

* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5/mclust’

Warning in install.packages :

installation of package ‘mclust’ had non-zero exit status



The downloaded source packages are in

‘/tmp/RtmpU0X2uP/downloaded_packages’


Edit3:
I have also tried to update R to 3.5.2. Error message remains the same, here is the new sessioinfo:



R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=ru_RU.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=ru_RU.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] BiocManager_1.30.4 compiler_3.5.2 tools_3.5.2 yaml_2.2.0


Edit4: I also have a very similiar error while installing igraph package:



/usr/bin/x86_64-linux-gnu-ld: /usr/lib/gcc/x86_64-linux- gnu/6/libgfortran.a(etime.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'igraph.so' failed
make: *** [igraph.so] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5/igraph’
Warning in install.packages :
installation of package ‘igraph’ had non-zero exit status


Edit5: I have also tried running install.packages("mclust",lib="/home/ivan/R/x86_64-pc-linux-gnu-library/3.5") through Rscript with sudo and it results in the same error.










share|improve this question

























  • Please add output of dpkg -S /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a to the question. I do not have such file on clean installation of 16.04 and R configured with my guide. So let's determine its package.

    – N0rbert
    Jan 16 at 21:09











  • Ok, I have done that.

    – I.N.Vlasov
    Jan 17 at 9:13











  • I can recommend to move the folder /usr/lib/gcc/x86_64-linux-gnu/6/ to other location and retry.

    – N0rbert
    Jan 17 at 12:12











  • Ok, I have also tried that. Output is too long for a comment field, put it in the body of question.

    – I.N.Vlasov
    Jan 18 at 9:44











  • I can't reproduce your issue. Have you ever upgraded your Ubuntu between versions (for example 12.04 -> 14.04 -> 16.04)?

    – N0rbert
    Jan 18 at 20:56
















0















I am unable to install "mclust" R package on my Ubuntu 16.04.
I have a following issue:



> install.packages("mclust")

>Installing package into ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.4’
>(as ‘lib’ is unspecified)
>trying URL 'https://cloud.r-project.org/src/contrib/mclust_5.4.2.tar.gz'
>Content type 'application/x-gzip' length 2699941 bytes (2.6 MB)
>==================================================
>downloaded 2.6 MB

>* installing *source* package ‘mclust’ ...
>** package ‘mclust’ successfully unpacked and MD5 sums checked
>** libs
>gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
>gfortran -fpic -g -O2 -fstack-protector-strong -c mclust.f -o mclust.o
>gfortran -fpic -g -O2 -fstack-protector-strong -c mclustaddson.f -o mclustaddson.o
>g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o mclust.so init.o mclust.o mclustaddson.o -llapack -lblas -lgfortran
-lm -lquadmath -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
>/usr/bin/x86_64-linux-gnu-ld: /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a(memory.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
>/usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a: error adding symbols: Bad value
>collect2: error: ld returned 1 exit status
>/usr/share/R/share/make/shlib.mk:6: recipe for target 'mclust.so' failed
>make: *** [mclust.so] Error 1
>ERROR: compilation failed for package ‘mclust’
>* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.4/mclust’
>Warning in install.packages :
> installation of package ‘mclust’ had non-zero exit status

>The downloaded source packages are in
> ‘/tmp/Rtmppg0XWs/downloaded_packages’

>sessionInfo()

>R version 3.4.4 (2018-03-15)
>Platform: x86_64-pc-linux-gnu (64-bit)
>Running under: Ubuntu 16.04.5 LTS

>atrix products: default
>BLAS: /usr/lib/libblas/libblas.so.3.6.0
>LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

>locale:
> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=ru_RU.UTF-8
> [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=en_US.UTF-8
> [7] LC_PAPER=ru_RU.UTF-8 LC_NAME=C LC_ADDRESS=C
>[10] LC_TELEPHONE=C LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C

>attached base packages:
>[1] stats graphics grDevices utils datasets methods base

>loaded via a namespace (and not attached):
>[1] compiler_3.4.4 tools_3.4.4 yaml_2.2.0


I have tried updating libgfortran and gcc-6 to the latest version, running apt-get update and upgrade.
Thank you in advance for your help.



Edit:
As per request of Norbert: Output of dpkg -S /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a



dpkg-query: no path found matching pattern /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a


Although, folder /usr/lib/gcc/x86_64-linux-gnu/6/ contains a link to /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a
Output for dpkg -S /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a



libgfortran-5-dev:amd64: /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a


Edit2: Moving the /usr/lib/gcc/x86_64-linux-gnu/6/ to a different location results in a following error:



Installing package into ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)

trying URL 'https://cloud.r-project.org/src/contrib/mclust_5.4.2.tar.gz'

Content type 'application/x-gzip' length 2699941 bytes (2.6 MB)

==================================================

downloaded 2.6 MB



* installing *source* package ‘mclust’ ...

** package ‘mclust’ successfully unpacked and MD5 sums checked

** libs

gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -g -c init.c -o init.o

gcc: error trying to exec 'cc1': execvp: No such file or directory

/usr/lib/R/etc/Makeconf:162: recipe for target 'init.o' failed

make: *** [init.o] Error 1

ERROR: compilation failed for package ‘mclust’

* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5/mclust’

Warning in install.packages :

installation of package ‘mclust’ had non-zero exit status



The downloaded source packages are in

‘/tmp/RtmpU0X2uP/downloaded_packages’


Edit3:
I have also tried to update R to 3.5.2. Error message remains the same, here is the new sessioinfo:



R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=ru_RU.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=ru_RU.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] BiocManager_1.30.4 compiler_3.5.2 tools_3.5.2 yaml_2.2.0


Edit4: I also have a very similiar error while installing igraph package:



/usr/bin/x86_64-linux-gnu-ld: /usr/lib/gcc/x86_64-linux- gnu/6/libgfortran.a(etime.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'igraph.so' failed
make: *** [igraph.so] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5/igraph’
Warning in install.packages :
installation of package ‘igraph’ had non-zero exit status


Edit5: I have also tried running install.packages("mclust",lib="/home/ivan/R/x86_64-pc-linux-gnu-library/3.5") through Rscript with sudo and it results in the same error.










share|improve this question

























  • Please add output of dpkg -S /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a to the question. I do not have such file on clean installation of 16.04 and R configured with my guide. So let's determine its package.

    – N0rbert
    Jan 16 at 21:09











  • Ok, I have done that.

    – I.N.Vlasov
    Jan 17 at 9:13











  • I can recommend to move the folder /usr/lib/gcc/x86_64-linux-gnu/6/ to other location and retry.

    – N0rbert
    Jan 17 at 12:12











  • Ok, I have also tried that. Output is too long for a comment field, put it in the body of question.

    – I.N.Vlasov
    Jan 18 at 9:44











  • I can't reproduce your issue. Have you ever upgraded your Ubuntu between versions (for example 12.04 -> 14.04 -> 16.04)?

    – N0rbert
    Jan 18 at 20:56














0












0








0


0






I am unable to install "mclust" R package on my Ubuntu 16.04.
I have a following issue:



> install.packages("mclust")

>Installing package into ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.4’
>(as ‘lib’ is unspecified)
>trying URL 'https://cloud.r-project.org/src/contrib/mclust_5.4.2.tar.gz'
>Content type 'application/x-gzip' length 2699941 bytes (2.6 MB)
>==================================================
>downloaded 2.6 MB

>* installing *source* package ‘mclust’ ...
>** package ‘mclust’ successfully unpacked and MD5 sums checked
>** libs
>gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
>gfortran -fpic -g -O2 -fstack-protector-strong -c mclust.f -o mclust.o
>gfortran -fpic -g -O2 -fstack-protector-strong -c mclustaddson.f -o mclustaddson.o
>g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o mclust.so init.o mclust.o mclustaddson.o -llapack -lblas -lgfortran
-lm -lquadmath -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
>/usr/bin/x86_64-linux-gnu-ld: /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a(memory.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
>/usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a: error adding symbols: Bad value
>collect2: error: ld returned 1 exit status
>/usr/share/R/share/make/shlib.mk:6: recipe for target 'mclust.so' failed
>make: *** [mclust.so] Error 1
>ERROR: compilation failed for package ‘mclust’
>* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.4/mclust’
>Warning in install.packages :
> installation of package ‘mclust’ had non-zero exit status

>The downloaded source packages are in
> ‘/tmp/Rtmppg0XWs/downloaded_packages’

>sessionInfo()

>R version 3.4.4 (2018-03-15)
>Platform: x86_64-pc-linux-gnu (64-bit)
>Running under: Ubuntu 16.04.5 LTS

>atrix products: default
>BLAS: /usr/lib/libblas/libblas.so.3.6.0
>LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

>locale:
> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=ru_RU.UTF-8
> [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=en_US.UTF-8
> [7] LC_PAPER=ru_RU.UTF-8 LC_NAME=C LC_ADDRESS=C
>[10] LC_TELEPHONE=C LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C

>attached base packages:
>[1] stats graphics grDevices utils datasets methods base

>loaded via a namespace (and not attached):
>[1] compiler_3.4.4 tools_3.4.4 yaml_2.2.0


I have tried updating libgfortran and gcc-6 to the latest version, running apt-get update and upgrade.
Thank you in advance for your help.



Edit:
As per request of Norbert: Output of dpkg -S /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a



dpkg-query: no path found matching pattern /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a


Although, folder /usr/lib/gcc/x86_64-linux-gnu/6/ contains a link to /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a
Output for dpkg -S /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a



libgfortran-5-dev:amd64: /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a


Edit2: Moving the /usr/lib/gcc/x86_64-linux-gnu/6/ to a different location results in a following error:



Installing package into ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)

trying URL 'https://cloud.r-project.org/src/contrib/mclust_5.4.2.tar.gz'

Content type 'application/x-gzip' length 2699941 bytes (2.6 MB)

==================================================

downloaded 2.6 MB



* installing *source* package ‘mclust’ ...

** package ‘mclust’ successfully unpacked and MD5 sums checked

** libs

gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -g -c init.c -o init.o

gcc: error trying to exec 'cc1': execvp: No such file or directory

/usr/lib/R/etc/Makeconf:162: recipe for target 'init.o' failed

make: *** [init.o] Error 1

ERROR: compilation failed for package ‘mclust’

* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5/mclust’

Warning in install.packages :

installation of package ‘mclust’ had non-zero exit status



The downloaded source packages are in

‘/tmp/RtmpU0X2uP/downloaded_packages’


Edit3:
I have also tried to update R to 3.5.2. Error message remains the same, here is the new sessioinfo:



R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=ru_RU.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=ru_RU.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] BiocManager_1.30.4 compiler_3.5.2 tools_3.5.2 yaml_2.2.0


Edit4: I also have a very similiar error while installing igraph package:



/usr/bin/x86_64-linux-gnu-ld: /usr/lib/gcc/x86_64-linux- gnu/6/libgfortran.a(etime.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'igraph.so' failed
make: *** [igraph.so] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5/igraph’
Warning in install.packages :
installation of package ‘igraph’ had non-zero exit status


Edit5: I have also tried running install.packages("mclust",lib="/home/ivan/R/x86_64-pc-linux-gnu-library/3.5") through Rscript with sudo and it results in the same error.










share|improve this question
















I am unable to install "mclust" R package on my Ubuntu 16.04.
I have a following issue:



> install.packages("mclust")

>Installing package into ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.4’
>(as ‘lib’ is unspecified)
>trying URL 'https://cloud.r-project.org/src/contrib/mclust_5.4.2.tar.gz'
>Content type 'application/x-gzip' length 2699941 bytes (2.6 MB)
>==================================================
>downloaded 2.6 MB

>* installing *source* package ‘mclust’ ...
>** package ‘mclust’ successfully unpacked and MD5 sums checked
>** libs
>gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
>gfortran -fpic -g -O2 -fstack-protector-strong -c mclust.f -o mclust.o
>gfortran -fpic -g -O2 -fstack-protector-strong -c mclustaddson.f -o mclustaddson.o
>g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o mclust.so init.o mclust.o mclustaddson.o -llapack -lblas -lgfortran
-lm -lquadmath -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
>/usr/bin/x86_64-linux-gnu-ld: /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a(memory.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
>/usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a: error adding symbols: Bad value
>collect2: error: ld returned 1 exit status
>/usr/share/R/share/make/shlib.mk:6: recipe for target 'mclust.so' failed
>make: *** [mclust.so] Error 1
>ERROR: compilation failed for package ‘mclust’
>* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.4/mclust’
>Warning in install.packages :
> installation of package ‘mclust’ had non-zero exit status

>The downloaded source packages are in
> ‘/tmp/Rtmppg0XWs/downloaded_packages’

>sessionInfo()

>R version 3.4.4 (2018-03-15)
>Platform: x86_64-pc-linux-gnu (64-bit)
>Running under: Ubuntu 16.04.5 LTS

>atrix products: default
>BLAS: /usr/lib/libblas/libblas.so.3.6.0
>LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

>locale:
> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=ru_RU.UTF-8
> [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=en_US.UTF-8
> [7] LC_PAPER=ru_RU.UTF-8 LC_NAME=C LC_ADDRESS=C
>[10] LC_TELEPHONE=C LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C

>attached base packages:
>[1] stats graphics grDevices utils datasets methods base

>loaded via a namespace (and not attached):
>[1] compiler_3.4.4 tools_3.4.4 yaml_2.2.0


I have tried updating libgfortran and gcc-6 to the latest version, running apt-get update and upgrade.
Thank you in advance for your help.



Edit:
As per request of Norbert: Output of dpkg -S /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a



dpkg-query: no path found matching pattern /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a


Although, folder /usr/lib/gcc/x86_64-linux-gnu/6/ contains a link to /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a
Output for dpkg -S /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a



libgfortran-5-dev:amd64: /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.a


Edit2: Moving the /usr/lib/gcc/x86_64-linux-gnu/6/ to a different location results in a following error:



Installing package into ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)

trying URL 'https://cloud.r-project.org/src/contrib/mclust_5.4.2.tar.gz'

Content type 'application/x-gzip' length 2699941 bytes (2.6 MB)

==================================================

downloaded 2.6 MB



* installing *source* package ‘mclust’ ...

** package ‘mclust’ successfully unpacked and MD5 sums checked

** libs

gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -g -c init.c -o init.o

gcc: error trying to exec 'cc1': execvp: No such file or directory

/usr/lib/R/etc/Makeconf:162: recipe for target 'init.o' failed

make: *** [init.o] Error 1

ERROR: compilation failed for package ‘mclust’

* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5/mclust’

Warning in install.packages :

installation of package ‘mclust’ had non-zero exit status



The downloaded source packages are in

‘/tmp/RtmpU0X2uP/downloaded_packages’


Edit3:
I have also tried to update R to 3.5.2. Error message remains the same, here is the new sessioinfo:



R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=ru_RU.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=ru_RU.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] BiocManager_1.30.4 compiler_3.5.2 tools_3.5.2 yaml_2.2.0


Edit4: I also have a very similiar error while installing igraph package:



/usr/bin/x86_64-linux-gnu-ld: /usr/lib/gcc/x86_64-linux- gnu/6/libgfortran.a(etime.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'igraph.so' failed
make: *** [igraph.so] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/home/ivan/R/x86_64-pc-linux-gnu-library/3.5/igraph’
Warning in install.packages :
installation of package ‘igraph’ had non-zero exit status


Edit5: I have also tried running install.packages("mclust",lib="/home/ivan/R/x86_64-pc-linux-gnu-library/3.5") through Rscript with sudo and it results in the same error.







compiling gcc r






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 21 at 8:43







I.N.Vlasov

















asked Jan 16 at 11:51









I.N.VlasovI.N.Vlasov

12




12













  • Please add output of dpkg -S /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a to the question. I do not have such file on clean installation of 16.04 and R configured with my guide. So let's determine its package.

    – N0rbert
    Jan 16 at 21:09











  • Ok, I have done that.

    – I.N.Vlasov
    Jan 17 at 9:13











  • I can recommend to move the folder /usr/lib/gcc/x86_64-linux-gnu/6/ to other location and retry.

    – N0rbert
    Jan 17 at 12:12











  • Ok, I have also tried that. Output is too long for a comment field, put it in the body of question.

    – I.N.Vlasov
    Jan 18 at 9:44











  • I can't reproduce your issue. Have you ever upgraded your Ubuntu between versions (for example 12.04 -> 14.04 -> 16.04)?

    – N0rbert
    Jan 18 at 20:56



















  • Please add output of dpkg -S /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a to the question. I do not have such file on clean installation of 16.04 and R configured with my guide. So let's determine its package.

    – N0rbert
    Jan 16 at 21:09











  • Ok, I have done that.

    – I.N.Vlasov
    Jan 17 at 9:13











  • I can recommend to move the folder /usr/lib/gcc/x86_64-linux-gnu/6/ to other location and retry.

    – N0rbert
    Jan 17 at 12:12











  • Ok, I have also tried that. Output is too long for a comment field, put it in the body of question.

    – I.N.Vlasov
    Jan 18 at 9:44











  • I can't reproduce your issue. Have you ever upgraded your Ubuntu between versions (for example 12.04 -> 14.04 -> 16.04)?

    – N0rbert
    Jan 18 at 20:56

















Please add output of dpkg -S /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a to the question. I do not have such file on clean installation of 16.04 and R configured with my guide. So let's determine its package.

– N0rbert
Jan 16 at 21:09





Please add output of dpkg -S /usr/lib/gcc/x86_64-linux-gnu/6/libgfortran.a to the question. I do not have such file on clean installation of 16.04 and R configured with my guide. So let's determine its package.

– N0rbert
Jan 16 at 21:09













Ok, I have done that.

– I.N.Vlasov
Jan 17 at 9:13





Ok, I have done that.

– I.N.Vlasov
Jan 17 at 9:13













I can recommend to move the folder /usr/lib/gcc/x86_64-linux-gnu/6/ to other location and retry.

– N0rbert
Jan 17 at 12:12





I can recommend to move the folder /usr/lib/gcc/x86_64-linux-gnu/6/ to other location and retry.

– N0rbert
Jan 17 at 12:12













Ok, I have also tried that. Output is too long for a comment field, put it in the body of question.

– I.N.Vlasov
Jan 18 at 9:44





Ok, I have also tried that. Output is too long for a comment field, put it in the body of question.

– I.N.Vlasov
Jan 18 at 9:44













I can't reproduce your issue. Have you ever upgraded your Ubuntu between versions (for example 12.04 -> 14.04 -> 16.04)?

– N0rbert
Jan 18 at 20:56





I can't reproduce your issue. Have you ever upgraded your Ubuntu between versions (for example 12.04 -> 14.04 -> 16.04)?

– N0rbert
Jan 18 at 20:56










1 Answer
1






active

oldest

votes


















0














So in case somebody ever encounters the same problem - I have fixed it by removing gcc, r, and build essentials packages, then reinstalling them, then reinstalling R according to R 3.5.0 for Ubuntu, answer of @krlmlr.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1110241%2ffailing-to-install-mclust-r-package-on-ubuntu-16-04%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    So in case somebody ever encounters the same problem - I have fixed it by removing gcc, r, and build essentials packages, then reinstalling them, then reinstalling R according to R 3.5.0 for Ubuntu, answer of @krlmlr.






    share|improve this answer




























      0














      So in case somebody ever encounters the same problem - I have fixed it by removing gcc, r, and build essentials packages, then reinstalling them, then reinstalling R according to R 3.5.0 for Ubuntu, answer of @krlmlr.






      share|improve this answer


























        0












        0








        0







        So in case somebody ever encounters the same problem - I have fixed it by removing gcc, r, and build essentials packages, then reinstalling them, then reinstalling R according to R 3.5.0 for Ubuntu, answer of @krlmlr.






        share|improve this answer













        So in case somebody ever encounters the same problem - I have fixed it by removing gcc, r, and build essentials packages, then reinstalling them, then reinstalling R according to R 3.5.0 for Ubuntu, answer of @krlmlr.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 28 at 12:30









        I.N.VlasovI.N.Vlasov

        12




        12






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1110241%2ffailing-to-install-mclust-r-package-on-ubuntu-16-04%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Mouse cursor on multiple screens with different PPI

            Agildo Ribeiro

            Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”