Ich möchte mein R-Paket an CRAN, die Rcpp
und RcppGSL
senden. Mein Problem ist, dass ich kein Paket erstellen kann, die R CMD check
in Win-Builder übergeben. Mein Verständnis ist, dass, weil das i386
Paket gebaut wird, aber nicht installiert und überprüft während R CMD check
. Das x64
-Paket erstellt und übergibt die Prüfungen (wenn ich die Überprüfung mit --no - multiarch). Mein Verständnis ist ein bisschen fehlerhaft, da ich nur begrenzte Zeit hatte, um diese Windows-Build überhaupt für 64-Bit arbeiten zu lassen. Dies ist der Makevars.win.gen
nicht möglich, R CMD-Prüfung in Windows wegen i386 Build
PKG_CPPFLAGS = $(GSL_CFLAGS) -I"$(LIB_GSL)/include" -I"$(LIB_GSL)/include/gsl" -I../inst/include -I../inst -Wall -Wno-unused-but-set-variable -Wno-long-long -Wno-sign-compare -Wno-deprecated -pedantic -pthread -fPIC -O2 -g
ARCH=x64
ifeq "$(WIN)" "64"
ARCH= i386
else
ARCH= x64
endif
RCPPGSL_LDFLAGS = `$(R_HOME)/bin/$(R_ARCH_BIN)/Rscript -e "RcppGSL:::LdFlags()"`
GRAPHM_OBJ = ./algorithm_ca.o ./algorithm_ext.o ./algorithm_fsol.o ./algorithm_iden.o ./algorithm_lp.o ./algorithm.o ./algorithm_path.o ./algorithm_qcv.o ./algorithm_rand.o ./algorithm_rank.o ./algorithm_umeyama.o ./algorithm_unif.o ./experiment.o ./graph.o ./hungarian.o ./rpc.o
GRAPHM_OBJ_REL = $(addprefix ./graphm/,$(GRAPHM_OBJ))
PKG_LIBS = $(LDFLAGS) -L"$(LIB_GSL)\lib"$(R_ARCH_BIN) $(RCPPGSL_LDFLAGS) $(GSL_LIBS) -lgsl -lgslcblas
CXX ?= g++
SHVER= 1
VPATH= ./graphm:./graphm-0.52
SOURCES= graphmatch_rcpp.cpp RcppExports.cpp
OBJECTS= $(SOURCES:.cpp=.o) $(GRAPHM_OBJ_REL)
#all: $(SHLIB) $(OBJECTS)
$(SHLIB): $(OBJECTS)
#all: $(ALLFILES) ../inst/libgraphm.a
# cd graphm && $(MAKE)
# $(CXX) $(CXXFLAGS) $(OBJECTS) ../inst/libgraphm.a $(PKG_LIBS)
./experiment.o: experiment.cpp experiment.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c experiment.cpp -o ./experiment.o
./rpc.o: rpc.cpp rpc.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c rpc.cpp -o ./rpc.o
./graph.o: graph.cpp graph.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c graph.cpp -o ./graph.o
./hungarian.o: hungarian.cpp hungarian.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c hungarian.cpp -o ./hungarian.o
./algorithm.o: algorithm.cpp algorithm.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm.cpp -o ./algorithm.o
#graph matching algorithms
./algorithm_ca.o: algorithm_ca.cpp algorithm_ca.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm_ca.cpp -o ./algorithm_ca.o
./algorithm_path.o: algorithm_path.cpp algorithm_path.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm_path.cpp -o ./algorithm_path.o
./algorithm_ext.o: algorithm_ext.cpp algorithm_ext.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm_ext.cpp -o ./algorithm_ext.o
./algorithm_fsol.o: algorithm_fsol.cpp algorithm_fsol.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm_fsol.cpp -o ./algorithm_fsol.o
./algorithm_iden.o: algorithm_iden.cpp algorithm_iden.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm_iden.cpp -o ./algorithm_iden.o
./algorithm_lp.o: algorithm_lp.cpp algorithm_lp.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm_lp.cpp -o ./algorithm_lp.o
./algorithm_qcv.o: algorithm_qcv.cpp algorithm_qcv.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm_qcv.cpp -o ./algorithm_qcv.o
./algorithm_rand.o: algorithm_rand.cpp algorithm_rand.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm_rand.cpp -o ./algorithm_rand.o
./algorithm_rank.o: algorithm_rank.cpp algorithm_rank.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm_rank.cpp -o ./algorithm_rank.o
./algorithm_umeyama.o: algorithm_umeyama.cpp algorithm_umeyama.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm_umeyama.cpp -o ./algorithm_umeyama.o
./algorithm_unif.o: algorithm_unif.cpp algorithm_unif.h
cd graphm && $(CXX) $(PKG_CPPFLAGS) -I"$(LIB_GSL)\include" -c algorithm_unif.cpp -o ./algorithm_unif.o
ALLOBJ: $(OBJECTS) $(GRAPHM_OBJ)
ALLFILES: $(OBJECTS) $(GRAPHM_OBJ_REL) ../inst/libgraphm.a
../inst/libgraphm.a: RcppExports.o $(GRAPHM_OBJ)
ar -rvs ../inst/libgraphm.a $(GRAPHM_OBJ_REL)
clean: cleana cleanb
cleana:
rm $(OBJECTS)
cleanb:
rm $(GRAPHM_OBJ_REL)
#.PHONY: all test clean
Übrigens habe ich dieses configure.win verwende die richtigen Flags Makevars.win zu passieren. Aber das ist wirklich unnötig, da ich @ GSL_LIBS @ von Makevars.win.gen entfernt habe. Ist dies der Grund, warum i386 Build nicht während der R CMD-Prüfung installiert wurde?
ifeq "$(WIN)" "64"
R_ARCH_BIN="/x64"
else
R_ARCH_BIN="/i386"
endif
GSL_CFLAGS=`"${R_HOME}/bin$(R_ARCH_BIN)/Rscript.exe" -e "require(RcppGSL);RcppGSL:::CFlags()"`
GSL_LIBS=`"${R_HOME}/bin$(R_ARCH_BIN)/Rscript.exe" -e "require(RcppGSL);RcppGSL:::LdFlags()"`
sed -e "s|@[email protected]|${GSL_LIBS}|" \
-e "s|@[email protected]|${GSL_CFLAGS}|" \
src/Makevars.win.gen > src/Makevars.win
Alle Zusatzinformationen, die für den Aufbau einer Multi-Bogen R Paket relevant ist, die Bibliotheken würde geschätzt auf vorgefertigten Fenster abhängig ist.
Ein Teil der Komplikation ist auf die C-Bibliothek zurückzuführen, die um das Paket gewickelt ist. Ich möchte das Paket gleichzeitig mit der C-Bibliothek erstellen. Der Rest der Komplikation ist auf mein schwaches Verständnis des nativen Code- und R-Paket-Aufbauprozesses zurückzuführen, den ich versuche zu lösen. –
Ich wollte das kommentieren.Das Makefile sieht das Teil aus, aber deine Frage hat nicht gesagt! Aber Ihre Schwierigkeiten sind, denke ich, fast vollständig darauf zurückzuführen. Versuchen Sie, dies so einfach wie möglich zu vereinfachen - schließen Sie einfach all diese Bibliothek in 'src /' ein. –
(und ich habe den Zeilenumbruch manuell hinzugefügt). Was meinst du damit ? –