[R] Rcmd SHLIB
Gabriel Lawson
gagongabe at earthlink.net
Wed Mar 3 04:19:16 CET 2004
Thanks again for the help. I went through readme.package a couple of times,
but I still get the error below. It seems to be a little closer as I am no
longer seeing CreateProcess in the output.
Beneath the error, I have pasted my modified MkRules. I think I am messing
up/missing one or more of the paths in it, but I filled in all those that
seemed obvious to me. Anyone spot anything wrong?
gabe
C:\Program Files\R\rw1081\src\gnuwin32>make libR.a
dlltool -k --as as --dllname R.dll --def R.exp --output-lib libR.a
make: *** [libR.a] Error 255
#-*- Makefile -*-
## This files contains tabs: make sure your editor leaves them unchanged.
## ===== configuration macros for building packages or R ===============
# Alternatives MINGW (mingw), CROSS (Linux)
BUILD=MINGW
HELP = YES
ifeq ($(strip $(BUILD)),CROSS)
WINHELP = NO
else
WINHELP = CHM # NO, CHM, BOTH
endif
## ============== configuration macros for building R ===================
LEA_MALLOC=YES
# Set to YES and specify the path if you want to use the ATLAS BLAS.
USE_ATLAS=NO
ATLAS_PATH=/R/ATLAS/lib/WinNT_PIIISSE1
# Where does 'HTML Help Workshop' live? (unused if compiled HTML help is
# not requested. Spaces allowed.)
HHWDIR=C:/Program Files/HTML Help Workshop
# Where does Tcl/Tk live? Spaces allowed.
#TCL_HOME = $(RHOME)/Tcl
TCL_HOME = C:/PROGRA~1/R/rw1081/Tcl
TCL_VERSION = 84
## ====== configuration macros for building installers ===========
# location where Inno Setup 4.x was installed
ISDIR=C:/packages/Inno4
## =================== cross-compilation settings =================
ifeq ($(strip $(BUILD)),CROSS)
# Next two might be i386-mingw32msvc- or i586- depending on the
cross-compiler.
#BINPREF=mingw32-
BINPREF=C:/MinGW/bin
# Set this to where the mingw32 include files are. It must be accurate.
#HEADER=/users/ripley/R/cross-tools/mingw32/include
HEADER=C:/MinGW/include
endif
# path (possibly full path) to same version of R on the host system
#R_EXE=R
R_EXE=C:/PROGRA~1/R/rw1081/bin/R.exe
## =============== end of user-customizable parts ===================
ifeq ($(strip $(BUILD)),MINGW)
BINPREF=
MINGW32CFLAG=
MINGW32LDFLAG=
FLIBS=-lg2c
AWK=gawk
## only safe for gcc >= 3.1
DEPARG=-MM
endif
ifeq ($(strip $(BUILD)),CROSS)
MINGW32CFLAG=-isystem $(HEADER)
MINGW32LDFLAG=
FLIBS=-lg2c
AWK=awk
## BDR's build of cross-compiler is 2.95.3
DEPARG=-M
endif
PERL=perl
RM=rm -f
SED=sed
ECHO=echo
CP=cp
MKDIR=mkdir
CAT=cat
CC=$(BINPREF)gcc $(MINGW32CFLAG)
CXX=$(BINPREF)g++ $(MINGW32CFLAG)
F77=$(BINPREF)g77
AS=$(BINPREF)as
DLL_LDMAIN=gcc
DLL=$(BINPREF)$(DLL_LDMAIN) $(MINGW32LDFLAG)
DLLTOOL=$(BINPREF)dlltool -k --as $(AS)
LINKER=$(BINPREF)gcc $(MINGW32LDFLAG)
AR=$(BINPREF)ar
RANLIB=$(BINPREF)ranlib
NM=$(BINPREF)nm
CPP=$(CC) -E
RESCOMP=$(BINPREF)windres
.SUFFIXES: .c .cc .cpp .C .f .o .a .def .exp .dll .exe .d
.c.d:
@echo "making $@ from $<"
@$(CC) $(DEPARG) $(CFLAGS) $($*-CFLAGS) $< -o $@
.cc.d:
@echo "making $@ from $<"
@$(CXX) $(DEPARG) $(CXXFLAGS) $($*-CXXFLAGS) $< -o $@
.cpp.d:
@echo "making $@ from $<"
@$(CXX) $(DEPARG) $(CXXFLAGS) $($*-CXXFLAGS) $< -o $@
.C.d:
@echo "making $@ from $<"
@$(CXX) $(DEPARG) $(CXXFLAGS) $($*-CXXFLAGS) $< -o $@
.c.o:
$(CC) $(CFLAGS) $($*-CFLAGS) -c $< -o $@
.f.o:
$(F77) $(FFLAGS) $($*-FFLAGS) -c $< -o $@
.cc.o:
$(CXX) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@
.cpp.o:
$(CXX) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@
.C.o:
$(CXX) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@
%.exe:
$(LINKER) $(LINKFLAGS) $($*-LINKFLAGS) -o $@ $^ $($*-LIBS) $(LIBS)
%.dll:
# @$(ECHO) ------- Building $@ from $^ --------
@$(ECHO) LIBRARY $* > $*.def
@$(ECHO) EXPORTS >> $*.def
@$(NM) $^ > Defs
@$(SED) -n '/^........ [BCDRT] _/s/^........ [BCDRT] _/ /p' Defs >> $*.def
@$(RM) Defs
$(DLL) --shared $(DLLFLAGS) $($*-DLLFLAGS) -o $@ $*.def $^ $($*-DLLLIBS)
$(DLLLIBS)
@$(RM) $*.def
lib%.a: %.def
@$(ECHO) -------- Building $@ from $^ --------
$(DLLTOOL) $(DLLTOOLFLAGS) $($*-DLLTOOLFLAGS) --dllname $*.dll --def
$*.def --output-lib lib$*.a
%.a:
# @$(ECHO) -------- Building $@ from $^ --------
$(AR) cr $@ $^
$(RANLIB) $@
%.o: %.rc
$(RESCOMP) $(RESFLAGS) $($*-RESFLAGS) -i $< -o $@
----- Original Message -----
From: "Prof Brian Ripley" <ripley at stats.ox.ac.uk>
To: "Gabriel Lawson" <gagongabe at earthlink.net>
Cc: <r-help at stat.math.ethz.ch>
Sent: Sunday, February 29, 2004 11:24 PM
Subject: Re: [R] Rcmd SHLIB
> On Sun, 29 Feb 2004, Gabriel Lawson wrote:
>
> > Thanks tons. If you get a moment and feel like answering another
question:
> > Regarding the readme.packages file excerpt below: How can I set the
R_HOME
> > path? Is it always the R install directory? Also, is creating libR.a
and
>
> It is where you installed R.
>
> > libRblas.a a neccessary step in creating ANY dll for use with R?
>
> No, but it is a necessary step to using the supplied tools and it is
> needed for many DLLs.
>
> > BEWARE: Don't expect this to work if the path to R_HOME contains spaces.
> >
> > It may work, but we don't recommend it.
> >
>
> --
> Brian D. Ripley, ripley at stats.ox.ac.uk
> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel: +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865 272595
>
>
More information about the R-help
mailing list