3

When I install the package "maps", there's a warning in the installation:

ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
Undefined symbols for architecture x86_64:
  "___sprintf_chk", referenced from:
      _to_ascii in Gmake-02a515.o
  "___stack_chk_fail", referenced from:
      _to_ascii in Gmake-02a515.o
    ....

  "_strlen", referenced from:
      _to_ascii in Gmake-02a515.o
ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [<builtin>: Gmake] Error 1
make[1]: Leaving directory '/private/var/folders/l4/tmczrb0d7259bm_cqcy02y9w0000gn/T/Rtmpnbfu8d/R.INSTALLa802101e8d4/maps/src'
make: *** [Makefile:58: gmake] Error 2
ERROR: compilation failed for package ‘maps’
* removing ‘/anaconda3/lib/R/library/maps’
Warning in install.packages :
  installation of package ‘maps’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/l4/tmczrb0d7259bm_cqcy02y9w0000gn/T/RtmpISL1l9/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

And when I run

library(maps)

it gives the following error:

Error in library(maps) : there is no package called ‘maps’
camille
  • 16,432
  • 18
  • 38
  • 60
  • 1
    Curious, I've never seen this happen. Have you tried the good-ole windows fix: restart R? – r2evans Nov 28 '19 at 05:46
  • 1
    It is weird. I don't have the same issue with other libraries. Yes I have restarted R. – Fatemeh Asgarinejad Nov 28 '19 at 05:53
  • 1
    Perhaps stupid question, but I have to ask: are there any warnings (even seemingly innocuous) in the installation? (Often questions about installation problems either (a) include all the text, and we can see where it looks odd, or (b) does not include any of the intermediate warnings/errors, in which case it's clear the asker does not know to read the installation messages/warnings/errors.) Have you tried installing it again? – r2evans Nov 28 '19 at 05:56
  • Oh! Yes it has. Warning in install.packages : installation of package ‘maps’ had non-zero exit status --------------- Yes, I have tried reinstalling as well. – Fatemeh Asgarinejad Nov 28 '19 at 05:56
  • 3
    I have always found it odd that the non-zero exit status pops up as a **Warning** and not an error. I have yet to see a non-zero exit status produce a properly-installed package (though perhaps it is feasible). So to be able to help you, we're going to need to see that interim text, as it is now clear that it did not install successfully. – r2evans Nov 28 '19 at 05:58
  • Thank you so much for your time. I'll try to fix it though I have no idea. – Fatemeh Asgarinejad Nov 28 '19 at 06:00
  • 1
    If you [edit your question](https://stackoverflow.com/posts/59082237/edit) and insert the interim text, perhaps we can help. – r2evans Nov 28 '19 at 06:01
  • Thanks, I added the text. – Fatemeh Asgarinejad Nov 28 '19 at 07:43
  • Oof, that's more than I'm going to be able to help with. I'm not fluent in "conda" interaction with R packages (nor macosx), unfortunately. (Though ultimately the file `libSystem.tbd` looks to be the source of the problem.) Good luck! – r2evans Nov 28 '19 at 07:51
  • 1
    By the way, I really appreciate your time. – Fatemeh Asgarinejad Nov 28 '19 at 08:00
  • 2
    I see messages from clang. R is usually compiled using gcc. Compiling packages with clang while r is compiled with gcc will give issues (such as missing symbols). – Jan van der Laan Nov 30 '19 at 13:58
  • 1
    I assume you are using the "install.packages()" command? Would be worth adding the code so that others could try to reproduce the error. One other thought is: do you have any other packages loaded in the background, for instance, with .Rprofile? That can cause issues. Also, check your packages folder for anything with 'maps' in the folder name, delete, run R without any packages loaded, and try installing maps again. – Grubbmeister Dec 05 '19 at 00:24
  • @Grubbmeister Yes I am using "install.packages()". I have installed other packages easily. Thank you so much. I deleted Rstudio and installed it again, now it's working but in the next time I'll follow your response. – Fatemeh Asgarinejad Dec 05 '19 at 01:18
  • I've gotten non-zero exit status before due to a corrupt file from the DL and unpacking process. I ended up going into `R/R-3.X.X/library` and deleting the package folder then reinstalling the package. Hard to say if this will work for you, but worth a try next time this happens. – Mxblsdl Dec 06 '19 at 23:16

1 Answers1

1

Please can you just do PIP pip install maps It looks like its trying to build source code and then install it.

Jin Thakur
  • 2,711
  • 18
  • 15
  • Thanks for your response. I've done that and it didn't solve the issue. I had to remove my RStudio and install it again and the problem solved. – Fatemeh Asgarinejad Dec 06 '19 at 20:27