[R-pkg-devel] win-builder, compiling C code, make[1]: ar: Command not found

Gillian Sharer gillian at iris.washington.edu
Sat Oct 8 02:30:54 CEST 2016


It’s solved! Changing ‘ar’ to ‘$(AR)’ in the Makefile along with adding AR="$(AR)" to @(cd libmseed && $(MAKE) static CC="$(CC)" CFLAGS="$(CFLAGS)") in the Makevars.win fixed the problem.

Thank you!
Gillian Sharer

> On Oct 7, 2016, at 3:50 PM, William Dunlap <wdunlap at tibco.com> wrote:
> 
> Do you have a Makefile in the directory yourPackage/src/libmseed?
> If so, how does it call 'ar' or '$(AR)'?
> 
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
> 
> On Fri, Oct 7, 2016 at 3:44 PM, Gillian Sharer <gillian at iris.washington.edu> wrote:
> Thank you for your response. I apologize for asking basic questions, but I’m new to this. On my local machine (mac osx) the $R_HOME/etc/Makeconf AR=ar and $BINPREF is not set. I have ar in my path.
> 
> I’m uploading the package to http://win-builder.r-project.org/ using devtools::build_win. Am I right in thinking the path in question is on the Windows machine? I don’t have access to the Windows Makeconf file, so do I need to set something in the Makevars.win file?
> 
> I tried adding this to the src/Makevars.win file:
> AR=$(BINPREF)ar
> 
> Then I tried:
> BINPREF=/mingw_$(WIN)/bin/
> AR=$(BINPREF)ar
> 
> And:
> BINPREF=d:/Compiler/gcc-4.9.3/mingw_32/bin/
> AR=$(BINPREF)ar
> 
> None of these changed the win-builder results. Do I have the wrong path or is Makevars.win the wrong place to set this?
> 
> Thanks,
> Gillian Sharer
> 
> 
> > On Oct 7, 2016, at 12:24 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> >
> > On 07/10/2016 3:06 PM, Gillian Sharer wrote:
> >> Hi,
> >>
> >> I tried to submit a package to win-builder with C code and it won’t compile. I get this result:
> >>
> >>   ar -crs libmseed.a fileutils.o genutils.o gswap.o lmplatform.o lookup.o msrutils.o pack.o packdata.o traceutils.o    tracelist.o parseutils.o unpack.o unpackdata.o selection.o logging.o
> >>   make[1]: ar: Command not found
> >>   make[1]: *** [libmseed.a] Error 127
> >>   make[1]: Leaving directory `/cygdrive/d/temp/RtmpUvWmaH/R.INSTALL3e847db06d40/IRISSeismic/src- i386/libmseed'
> >>   make: *** [libmseed/libmseed.a] Error 2
> >>   Warning: running command 'make -f "Makevars.win" -f "D:/RCompile/recent/R/etc/i386/Makeconf" -f   "D:/RCompile/recent/R/etc/i386/Makevars.site" -f "D:/RCompile/recent/R/share/make/winshlib.mk"   SHLIB="IRISSeismic.dll" OBJECTS="parseMiniSEED.o"' had status 2
> >>   ERROR: compilation failed for package ‘IRISSeismic'
> >>
> >> It says it can’t find the command ar, which I don’t understand. This was my original Makevars.win file:
> >>
> >>   PKG_CFLAGS=
> >>   PKG_CPPFLAGS=-Ilibmseed
> >>   PKG_LIBS=-Llibmseed -lmseed
> >>   $(SHLIB): libmseed/libmseed.a
> >>   libmseed/libmseed.a:
> >>      @(cd libmseed && $(MAKE) static CC="$(CC)" CFLAGS="$(CFLAGS)”)
> >>   clean:
> >>      @(cd libmseed && $(MAKE) clean)
> >>
> >> and I also tried it using the following with the same results:
> >>
> >>   libmseed/libmseed.a:
> >>      @(cd libmseed && $(MAKE) static CC="$(CC)" CFLAGS="$(CFLAGS)” AR="$(AR)")
> >>
> >> A google search turned up nothing and a stackoverflow question has not had any responses yet. Is there something I’m missing? And is there any other relevant information I can provide? I don’t have much experience compiling C code, but it works on Mac OSX and Linux.
> >
> > It's just what it said:  you don't have ar on your path.  Normally the $(AR) variable is set to $(BINPREF)ar.  Perhaps you've changed R_HOME/etc/Makeconf so that isn't true, or have overridden BINPREF with a value different from the default.
> >
> > Duncan Murdoch
> >
> >
> 
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 



More information about the R-package-devel mailing list