2016-03-16 17 views
8

Mac'te xgboost yüklemeye çalışıyorum. Ben olsun ben sadece make (-j4 olmadan) çalıştırırsanızxgboost'u yükleme hatası Mac - ar: belirtilen arşiv üyesi yok

c++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -DDISABLE_OPENMP -o xgboost build/cli_main.o build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit_empty.a -pthread -lm 
ar crv lib/libxgboost.a 
c++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -DDISABLE_OPENMP -shared -o lib/libxgboost.so build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit_empty.a -pthread -lm 
ar: no archive members specified 
usage: ar -d [-TLsv] archive file ... 
    ar -m [-TLsv] archive file ... 
    ar -m [-abiTLsv] position archive file ... 
    ar -p [-TLsv] archive [file ...] 
    ar -q [-cTLsv] archive file ... 
    ar -r [-cuTLsv] archive file ... 
    ar -r [-abciuTLsv] position archive file ... 
    ar -t [-TLsv] archive [file ...] 
    ar -x [-ouTLsv] archive [file ...] 
make: *** [lib/libxgboost.a] Error 1 
make: *** Waiting for unfinished jobs.... 
clang: warning: argument unused during compilation: '-pthread' 
clang: warning: argument unused during compilation: '-pthread' 

: Ben github talimatları uyguladım ama make -j4 çalıştırdığınızda bir hata alıyorum bu neden olduğunu

$ make 
ar crv lib/libxgboost.a 
ar: no archive members specified 
usage: ar -d [-TLsv] archive file ... 
    ar -m [-TLsv] archive file ... 
    ar -m [-abiTLsv] position archive file ... 
    ar -p [-TLsv] archive [file ...] 
    ar -q [-cTLsv] archive file ... 
    ar -r [-cuTLsv] archive file ... 
    ar -r [-abciuTLsv] position archive file ... 
    ar -t [-TLsv] archive [file ...] 
    ar -x [-ouTLsv] archive [file ...] 
make: *** [lib/libxgboost.a] Error 1 

konusunda fikrin ve nasıl tamir edebilirim?

$ man ar 

AR(1)      BSD General Commands Manual     AR(1) 

NAME 
    ar -- create and maintain library archives 

SYNOPSIS 

... 
... 

Darwin       July 27, 2005       Darwin 

herhangi bir fikir nasıl OS X yeni sürüme ar güncellemek için: mac arşiv programı ar (2005) çok eski olduğu için bence

Ben yanlış olabilir rağmen mi?

ifndef config 
ifneq ("$(wildcard ./config.mk)","") 
     config = config.mk 
else 
     config = make/config.mk 
endif 
endif 

ifndef DMLC_CORE 
     DMLC_CORE = dmlc-core 
endif 

ifndef RABIT 
     RABIT = rabit 
endif 

ROOTDIR = $(CURDIR) 

ifeq ($(OS), Windows_NT) 
     UNAME="Windows" 
else 
     UNAME=$(shell uname) 
endif 

include $(config) 
ifeq ($(USE_OPENMP), 0) 
     export NO_OPENMP = 1 
endif 
include $(DMLC_CORE)/make/dmlc.mk 

# include the plugins 
include $(XGB_PLUGINS) 

# use customized config file 
ifndef CC 
export CC = $(if $(shell which gcc-5),gcc-5,gcc) 
endif 
ifndef CXX 
export CXX = $(if $(shell which g++-5),g++-5,g++) 
endif 

export LDFLAGS= -pthread -lm $(ADD_LDFLAGS) $(DMLC_LDFLAGS) $(PLUGIN_LDFLAGS) 
export CFLAGS= -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude $(ADD_CFLAGS) $(PLUGIN_CFLAGS) 
CFLAGS += -I$(DMLC_CORE)/include -I$(RABIT)/include 
#java include path 
export JAVAINCFLAGS = -I${JAVA_HOME}/include -I./java 

ifndef LINT_LANG 
     LINT_LANG= "all" 
endif 

ifneq ($(UNAME), Windows) 
     CFLAGS += -fPIC 
     XGBOOST_DYLIB = lib/libxgboost.so 
else 
     XGBOOST_DYLIB = lib/libxgboost.dll 
endif 

ifeq ($(UNAME), Linux) 
     LDFLAGS += -lrt 
     JAVAINCFLAGS += -I${JAVA_HOME}/include/linux 
endif 

ifeq ($(UNAME), Darwin) 
     JAVAINCFLAGS += -I${JAVA_HOME}/include/darwin 
endif 

ifeq ($(USE_OPENMP), 1) 
     CFLAGS += -fopenmp 
else 
     CFLAGS += -DDISABLE_OPENMP 
endif 


# specify tensor path 
.PHONY: clean all lint clean_all doxygen rcpplint pypack Rpack Rbuild Rcheck java 


all: lib/libxgboost.a $(XGBOOST_DYLIB) xgboost 

$(DMLC_CORE)/libdmlc.a: $(wildcard $(DMLC_CORE)/src/*.cc $(DMLC_CORE)/src/*/*.cc) 
     + cd $(DMLC_CORE); make libdmlc.a config=$(ROOTDIR)/$(config); cd $(ROOTDIR) 

$(RABIT)/lib/$(LIB_RABIT): $(wildcard $(RABIT)/src/*.cc) 
     + cd $(RABIT); make lib/$(LIB_RABIT); cd $(ROOTDIR) 

jvm: jvm-packages/lib/libxgboost4j.so 

SRC = $(wildcard src/*.cc src/*/*.cc) 
ALL_OBJ = $(patsubst src/%.cc, build/%.o, $(SRC)) $(PLUGIN_OBJS) 
AMALGA_OBJ = amalgamation/xgboost-all0.o 
LIB_DEP = $(DMLC_CORE)/libdmlc.a $(RABIT)/lib/$(LIB_RABIT) 
ALL_DEP = $(filter-out build/cli_main.o, $(ALL_OBJ)) $(LIB_DEP) 
CLI_OBJ = build/cli_main.o 

build/%.o: src/%.cc 
     @mkdir -p $(@D) 
     $(CXX) $(CFLAGS) -MM -MT build/$*.o $< >build/$*.d 
     $(CXX) -c $(CFLAGS) -c $< -o [email protected] 

build_plugin/%.o: plugin/%.cc 
     @mkdir -p $(@D) 
     $(CXX) $(CFLAGS) -MM -MT build_plugin/$*.o $< >build_plugin/$*.d 
     $(CXX) -c $(CFLAGS) -c $< -o [email protected] 

# The should be equivalent to $(ALL_OBJ) except for build/cli_main.o 
amalgamation/xgboost-all0.o: amalgamation/xgboost-all0.cc 
     $(CXX) -c $(CFLAGS) -c $< -o [email protected] 

# Equivalent to lib/libxgboost_all.so 
lib/libxgboost_all.so: $(AMALGA_OBJ) $(LIB_DEP) 
     @mkdir -p $(@D) 
     $(CXX) $(CFLAGS) -shared -o [email protected] $(filter %.o %.a, $^) $(LDFLAGS) 

lib/libxgboost.a: $(ALL_DEP) 
     @mkdir -p $(@D) 
     ar crv [email protected] $(filter %.o, $?) 

lib/libxgboost.dll lib/libxgboost.so: $(ALL_DEP) 
     @mkdir -p $(@D) 
     $(CXX) $(CFLAGS) -shared -o [email protected] $(filter %.o %a, $^) $(LDFLAGS) 

jvm-packages/lib/libxgboost4j.so: jvm-packages/xgboost4j/src/native/xgboost4j.cpp $(ALL_DEP) 
     @mkdir -p $(@D) 
     $(CXX) $(CFLAGS) $(JAVAINCFLAGS) -shared -o [email protected] $(filter %.cpp %.o %.a, $^) $(LDFLAGS) 

xgboost: $(CLI_OBJ) $(ALL_DEP) 
     $(CXX) $(CFLAGS) -o [email protected] $(filter %.o %.a, $^) $(LDFLAGS) 

rcpplint: 
     python2 dmlc-core/scripts/lint.py xgboost ${LINT_LANG} R-package/src 

lint: rcpplint 
     python2 dmlc-core/scripts/lint.py xgboost ${LINT_LANG} include src plugin 

clean: 
     $(RM) -rf build build_plugin lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o xgboost 

clean_all: clean 
     cd $(DMLC_CORE); make clean; cd $(ROODIR) 
     cd $(RABIT); make clean; cd $(ROODIR) 

doxygen: 
     doxygen doc/Doxyfile 

# create standalone python tar file. 
pypack: ${XGBOOST_DYLIB} 
pypack: ${XGBOOST_DYLIB} 
     cp ${XGBOOST_DYLIB} python-package/xgboost 
     cd python-package; tar cf xgboost.tar xgboost; cd .. 

# Script to make a clean installable R package. 
Rpack: 
     make clean_all 
     rm -rf xgboost xgboost*.tar.gz 
     cp -r R-package xgboost 
     rm -rf xgboost/src/*.o xgboost/src/*.so xgboost/src/*.dll 
     rm -rf xgboost/src/*/*.o 
     rm -rf xgboost/demo/*.model xgboost/demo/*.buffer xgboost/demo/*.txt 
     rm -rf xgboost/demo/runall.R 
     cp -r src xgboost/src/src 
     cp -r include xgboost/src/include 
     cp -r amalgamation xgboost/src/amalgamation 
     mkdir -p xgboost/src/rabit 
     cp -r rabit/include xgboost/src/rabit/include 
     cp -r rabit/src xgboost/src/rabit/src 
     rm -rf xgboost/src/rabit/src/*.o 
     mkdir -p xgboost/src/dmlc-core 
     cp -r dmlc-core/include xgboost/src/dmlc-core/include 
     cp -r dmlc-core/src xgboost/src/dmlc-core/src 
     cp ./LICENSE xgboost 
     cat R-package/src/Makevars|sed '2s/.*/PKGROOT=./' | sed '3s/.*/ENABLE_STD_THREAD=0/' > xgboost/src/Makevars 
     cp xgboost/src/Makevars xgboost/src/Makevars.win 

Rbuild: 
     make Rpack 
     R CMD build --no-build-vignettes xgboost 
     rm -rf xgboost 

Rcheck: 
     make Rbuild 
     R CMD check xgboost*.tar.gz 

-include build/*.d 
-include build/*/*.d 
-include build_plugin/*/*.d 

Çok teşekkürler: Burada

referans için makefile olduğunu.

+1

'Makefile' kırık görünüyor. Gördüğünüz gibi 'ar crv lib/libxgboost.a' kütüphaneye eklenecek herhangi bir nesne dosyası belirtmez. – trojanfoe

+0

Yorum için teşekkürler. Bana nasıl devam edeceğine dair bazı ipuçları verebilir misin? Gelişmiş bir linux kullanıcısı değilim ... – user2725109

+0

-j4' olmadan çalıştırın ve çalışıp çalışmadığını görün. Pek iyi yazılmamış makailler paralel inşa güvenli değildir. Ayrıca yeryüzünde o github bağlantısına ne oldu? Yanlış şeyi mi yapıştırdın? –

cevap

1
brew install clang-omp 
export CC=clang-omp 
export CXX=clang-omp++ 
cd python-package 
sudo python setup.py install 
pip install xgboost 
0

Başarılı bir şekilde linux makineye yükledim, make dosyasıyla ilgili bir sorun yok, ar sürümüm 2.24, bu yüzden doğru anladınız, binutils çok eski, https://www.gnu.org/software/binutils/ adresine gidin ve 2.24 versiyonunu indirin .
özü ve dizini değiştirin:

./configure 
make 
sudo make install 
+0

Merhaba, Linux'a değil, OS X'e yüklemeye çalışıyorum. Gönderdiğiniz bağlantıyı kullanarak binutils'i yükledim, ancak 'make' çalıştırmayı denediğimde hala hata alıyorum. Ayrıca binutils kurdu rağmen, ben 'ar' sürümü değişmemiş sanırım (yukarıdaki aynı sürümü/tarih gösterir) – user2725109