I need to install the following library from github
https://github.com/dmlc/dmlc-core
However I do not know how to do it and there are no instructions. How can I do it?
After having typed "make" in the terminal, this is the output that I got but I'm not able to say whether I successfully installed the library or not.
**make**
g++ -c -O3 -Wall -msse2 -Wno-unknown-pragmas -Iinclude -std=c++0x -fopenmp -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -o line_split.o src/io/line_split.cc
g++ -c -O3 -Wall -msse2 -Wno-unknown-pragmas -Iinclude -std=c++0x -fopenmp -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -o recordio_split.o src/io/recordio_split.cc
g++ -c -O3 -Wall -msse2 -Wno-unknown-pragmas -Iinclude -std=c++0x -fopenmp -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -o input_split_base.o src/io/input_split_base.cc
g++ -c -O3 -Wall -msse2 -Wno-unknown-pragmas -Iinclude -std=c++0x -fopenmp -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -o io.o src/io.cc
g++ -c -O3 -Wall -msse2 -Wno-unknown-pragmas -Iinclude -std=c++0x -fopenmp -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -o local_filesys.o src/io/local_filesys.cc
g++ -c -O3 -Wall -msse2 -Wno-unknown-pragmas -Iinclude -std=c++0x -fopenmp -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -o data.o src/data.cc
In file included from include/dmlc/data.h:16:0,
from src/data.cc:5:
include/dmlc/./registry.h:218:22: warning: ‘dmlc::__make_ParserFactoryReg_uint32_t_libsvm__’ defined but not used [-Wunused-variable]
static EntryType & __make_ ## EntryTypeName ## _ ## Name ## __ = \
^
include/dmlc/data.h:303:3: note: in expansion of macro ‘DMLC_REGISTRY_REGISTER’
DMLC_REGISTRY_REGISTER(::dmlc::ParserFactoryReg<IndexType>, \
^
src/data.cc:136:1: note: in expansion of macro ‘DMLC_REGISTER_DATA_PARSER’
DMLC_REGISTER_DATA_PARSER(uint32_t, libsvm, data::CreateLibSVMParser<uint32_t>)
^
include/dmlc/./registry.h:218:22: warning: ‘dmlc::__make_ParserFactoryReg_uint64_t_libsvm__’ defined but not used [-Wunused-variable]
static EntryType & __make_ ## EntryTypeName ## _ ## Name ## __ = \
^
include/dmlc/data.h:303:3: note: in expansion of macro ‘DMLC_REGISTRY_REGISTER’
DMLC_REGISTRY_REGISTER(::dmlc::ParserFactoryReg<IndexType>, \
^
src/data.cc:137:1: note: in expansion of macro ‘DMLC_REGISTER_DATA_PARSER’
DMLC_REGISTER_DATA_PARSER(uint64_t, libsvm, data::CreateLibSVMParser<uint64_t>)
^
include/dmlc/./registry.h:218:22: warning: ‘dmlc::__make_ParserFactoryReg_uint32_t_csv__’ defined but not used [-Wunused-variable]
static EntryType & __make_ ## EntryTypeName ## _ ## Name ## __ = \
^
include/dmlc/data.h:303:3: note: in expansion of macro ‘DMLC_REGISTRY_REGISTER’
DMLC_REGISTRY_REGISTER(::dmlc::ParserFactoryReg<IndexType>, \
^
src/data.cc:139:1: note: in expansion of macro ‘DMLC_REGISTER_DATA_PARSER’
DMLC_REGISTER_DATA_PARSER(uint32_t, csv, data::CreateCSVParser<uint32_t>);
^
In file included from include/dmlc/./registry.h:14:0,
from include/dmlc/data.h:16,
from src/data.cc:5:
include/dmlc/././parameter.h:254:43: warning: ‘dmlc::data::__make__CSVParserParamParamManager__’ defined but not used [-Wunused-variable]
static ::dmlc::parameter::ParamManager &__make__ ## PType ## ParamManager__ =
^
src/data.cc:93:1: note: in expansion of macro ‘DMLC_REGISTER_PARAMETER’
DMLC_REGISTER_PARAMETER(CSVParserParam);
^
g++ -c -O3 -Wall -msse2 -Wno-unknown-pragmas -Iinclude -std=c++0x -fopenmp -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -o recordio.o src/recordio.cc
g++ -c -O3 -Wall -msse2 -Wno-unknown-pragmas -Iinclude -std=c++0x -fopenmp -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -o config.o src/config.cc
ar cr libdmlc.a line_split.o recordio_split.o input_split_base.o io.o local_filesys.o data.o recordio.o config.o
Read
man git
to learn how to clone (get a copy of) the repository, thencd
to the directory with the files.Read the
README.md
file, and because there is aMakefile
I would, after readingMakefile
, typemake
, as advised byREADME.md
.GitHub is a service for hosting Git repositories. So, the first step to install a project in one of the repositories is to clone it, which will create a local copy of all repository's contents on your computer. Example:
GitHub repositories generally store the source code of their project. That means that it might need to be built/compiled before proper installation. There is no one single common standard for projects being enforced on GitHub, so answer to the question in title "How can I install a library from github?" can vary a lot from project to project. The repository owners are free to use their preferred build and installation flows.
That said, it can be expected the projects to have documentation with instructions of how to build and install the project to make life easier for its users and other developers, in a README.md file at top directory or in some other obvious place.
Moving on to the specific repository in the question details
dmlc-core
, there doesn't appear to be any explicit building instructions in the README.md, but the top directory does have a Makefile. Makefiles contain directives for Make utility on how to build the project, which itself is usually used for building C/C++ projects(which this one appears to be). In general executingmake
from the directory where the Makefile is located.During the build process, you might see compiler warnings and errors. Errors usually lead to build failure. Resolving them likely would require familiarizing yourself with the code and fixing them. Warnings are often indicators of bad practices being employed in code that could lead to bugs. Good developers will usually document reasons why they do things like that when they have to. If you can't find the reason, you can either trust the code and take responsibility for your choice or abandon ship.
From the contents of the Makefile I gather that its main build target is
libdmlc.a
. Technically, it doesn't matter where you put it, so you can consider installation to be complete when build is successful, thought the recommended location where to put it on Ubuntu appears to be under/usr/local/
.Now that you have the file available, you can consider it installed and ready for usage.
Example, Ubuntu 16.04 - 64 :
When you run
make
, it's successful when the librarylibdmlc.a
gets created in the top directory.Cmake :
mkdir build
andcd build/ && cmake ../ && make
→ The librarylibdmlccore.a
is created, in the build folder. Same size (1.3MB) aslibdmlc.a
, so probably no difference.