张杰部落格
博客信息

xgboost4j spark 打包libxgboost4j.so的命令

发布时间:『 2020-01-07 20:26』  博客类别:Hadoop/Spark  阅读(457) 评论(0)

1、 首先安装gcc 4.9.3

安装步骤见:https://imzhangjie.cn/article/171.html

2、然后到达xgboost的源码目录执行:

make config=make/config.mk

3、最后编译libxgboost4j.so

#在jvm-packages目录下创建lib目录
mkdir jvm-packages/lib/

g++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -fopenmp -I$JAVA_HOME/include -I$JAVA_HOME/include/linux -I./java -shared -o jvm-packages/lib/libxgboost4j.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/common/hist_util.o build/common/host_device_vector.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/linear/linear_updater.o build/linear/updater_coordinate.o build/linear/updater_shotgun.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/predictor/cpu_predictor.o build/predictor/predictor.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_fast_hist.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.a jvm-packages/xgboost4j/src/native/xgboost4j.cpp -pthread -lm  -fopenmp -lrt  -lrt

然后再jvm-packages/lib目录下找到libxgboost4j.so的代码库。

关键字:   xgboost4j  
评论信息
暂无评论
发表评论
验证码: 
Powered by IMZHANGJIE.CN Copyright © 2015-2021 粤ICP备14056181号