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

Dear Expert,

when I try to install tm am getting

1: In install.packages("tm") :
installation of package ‘slam’ had non-zero exit status
2: In install.packages("tm") :
installation of package ‘tm’ had non-zero exit status

slam is also not installing.

Kindly help me to resolve this issue.

Welcome to the community!

Have you tried the suggestions in this thread:

Hello Yarnabrina,

I tried the suggestions, But am still facing the same error.

Kind Regards,
sm.s

Could you post the whole error message you are getting? We need more information to help you.

Hello Andresrcs.

Selection: 65
also installing the dependency ‘slam’

trying URL 'https://cran.revolutionanalytics.com/src/contrib/slam_0.1-45.tar.gz'
Content type 'application/octet-stream' length 53813 bytes (52 KB)

downloaded 52 KB

trying URL 'https://cran.revolutionanalytics.com/src/contrib/tm_0.7-6.tar.gz'
Content type 'application/octet-stream' length 508463 bytes (496 KB)

downloaded 496 KB

  • installing source package ‘slam’ ...
    ** package ‘slam’ successfully unpacked and MD5 sums checked
    ** libs
    gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include -fpic -fmessage- length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-s trong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -c apply.c -o apply.o
    gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include -fpic -fmessage- length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-s trong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -c dll.c -o dll.o
    gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include -fpic -fmessage- length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-s trong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -c grouped.c -o grouped.o
    gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include -fpic -fmessage- length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-s trong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -c sparse.c -o sparse.o
    gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include -fpic -fmessage- length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-s trong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -c util.c -o util.o
    gcc -shared -L/usr/lib64/R/lib -L/usr/local/lib64 -o slam.so apply.o dll.o group ed.o sparse.o util.o -L/usr/lib64/R/lib -lRblas -lgfortran -lm -lquadmath -L/usr /lib64/R/lib -lR
    /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lgfortran
    collect2: error: ld returned 1 exit status
    make: *** [/usr/lib64/R/share/make/shlib.mk:6: slam.so] Error 1
    ERROR: compilation failed for package ‘slam’
  • removing ‘/usr/lib64/R/library/slam’
    ERROR: dependency ‘slam’ is not available for package ‘tm’
  • removing ‘/usr/lib64/R/library/tm’

The downloaded source packages are in
‘/tmp/Rtmp3sh53r/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("tm") :
installation of package ‘slam’ had non-zero exit status
2: In install.packages("tm") :
installation of package ‘tm’ had non-zero exit status

Kind Regards,
sm.s

There is a problem with your systems configuration, R is not being able to find the gfortran package, how did you install R? did you install r-base-dev?

I don't know the equivalent commands for suse but you could try purging the gfortran package and reinstalling, this would be the command for debian/ubuntu dpkg --purge gfortran; apt-get install gfortran. Also verify if your versions of g++, gcc and gfortran match

Note: Just in case, all this has to be done in the system terminal not in R console.

Hello Andresrcs,

Thanks for the reply, As you mentioned the problem is with gfortran,I Installed gfortran it resolved the issue.

Kind Regards,
sm.s

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.