Skip to content

g++: error: dmlc-core/libdmlc.a: No such file or directory #909

@ichdream

Description

@ichdream

I take the next tutorial to install xgboost,however,when i the command "make -j4" ,i come across something wrong,why?
thanks.


git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git submodule init
git submodule update
cp make/mingw64.mk config.mk
make -j4


the erro log is:


g++: error: dmlc-core/libdmlc.a: No such file or directory
g++: error: rabit/lib/librabit_empty.a: No such file or directory
Makefile:120: recipe for target 'lib/libxgboost.dll' failed
mingw32-make: *** [lib/libxgboost.dll] Error 1

Activity

thirdwing

thirdwing commented on Mar 4, 2016

@thirdwing
Member

It seems you don't show all the errors to us.

Can you just use make and show us the error message?

funkindy

funkindy commented on Mar 5, 2016

@funkindy

Same here:

_g++: error: dmlc-core/libdmlc.a: No such file or directory
g++: error: rabit/lib/librabit_empty.a: No such file or directory
Makefile:120: recipe for target 'lib/libxgboost.dll' failed
mingw32-make: *** [lib/libxgboost.dll] Error 1
mingw32-make: *** Waiting for unfinished jobs....
_

Installing on Win10 x64. Doing with the latest MinGW version.

UPDATE
solved accidentally:
1)Go to C:\mingw\mingw64\bin (your Mingw bin path)
2)Make a copy mingw32-make.exe -> make.exe (you got to have both of them in the bin path)
3) This:
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git submodule init
git submodule update
cp make/mingw64.mk config.mk
make -j4

I guess something is wrong with the alias, thats why we need make.exe exactly.

tqchen

tqchen commented on Mar 7, 2016

@tqchen
Member

This was because we called make inside the Makefile @thirdwing Maybe we should update the instruction, or enable some kind of env variable in Makefile to use mingw32-make instead

thirdwing

thirdwing commented on Mar 7, 2016

@thirdwing
Member

In our latest tutorial https://github.com/dmlc/xgboost/blob/master/doc/build.md#building-on-windows

I have already added alias make='mingw32-make'

tqchen

tqchen commented on Mar 7, 2016

@tqchen
Member

I see, if this is an common issue, let us add a trouble shooting section, to remind user to add the alias

pakchoi

pakchoi commented on Mar 11, 2016

@pakchoi

After alias make='mingw32-make', I still get the same error...
System env: windows10 + mingw-w64
Here is my log:


g++: error: dmlc-core/libdmlc.a: No such file or directory
makefile:128: recipe for target 'xgboost' failed
mingw32-make: *** [xgboost] Error 1
mingw32-make: *** Waiting for unfinished jobs....
makefile:120: recipe for target 'lib/libxgboost.dll' failed
mingw32-make: *** [lib/libxgboost.dll] Error 1
a - build/learner.o
a - build/logging.o
a - build/common/common.o
a - build/c_api/c_api_error.o
a - build/c_api/c_api.o
a - build/data/simple_dmatrix.o
a - build/data/sparse_page_raw_format.o
a - build/data/data.o
a - build/data/simple_csr_source.o
a - build/data/sparse_page_writer.o
a - build/data/sparse_page_source.o
a - build/data/sparse_page_dmatrix.o
a - build/gbm/gbm.o
a - build/gbm/gblinear.o
a - build/gbm/gbtree.o
a - build/metric/multiclass_metric.o
a - build/metric/elementwise_metric.o
a - build/metric/rank_metric.o
a - build/metric/metric.o
a - build/objective/regression_obj.o
a - build/objective/rank_obj.o
a - build/objective/objective.o
a - build/objective/multiclass_obj.o
a - build/tree/tree_model.o
a - build/tree/updater_colmaker.o
a - build/tree/updater_skmaker.o
a - build/tree/updater_sync.o
a - build/tree/updater_refresh.o
a - build/tree/updater_histmaker.o
a - build/tree/tree_updater.o
a - build/tree/updater_prune.o

thirdwing

thirdwing commented on Mar 11, 2016

@thirdwing
Member

Can you show me the full log?

funkindy

funkindy commented on Mar 11, 2016

@funkindy

I as said previously only adding 'alias make='mingw32-make' is not enough.
The thing that helped me is making a copy of file mingw\bin\mingw32-make.exe -> make.exe so that bin path contains both of them.

I dont know exactly why but i guess alias doesnt make sense when making dependencies.

thirdwing

thirdwing commented on Mar 11, 2016

@thirdwing
Member

So, Alex, can you help to update the document by sending a PR?
On Mar 11, 2016 12:14 AM, "Alex Tro" notifications@github.com wrote:

I as said previously only adding 'alias make='mingw32-make' is not enough.
The thing that helped me is making a copy of file
mingw\bin\mingw32-make.exe -> make.exe so that bin path contains both of
them.

I dont know exactly why but i guess when alias doesnt make sense when
making dependencies.


Reply to this email directly or view it on GitHub
#909 (comment).

funkindy

funkindy commented on Mar 11, 2016

@funkindy

Sure, but do we need any confirmation from pakchoi/smb that this really is a useful tip? (ama newbie here)

maxceem

maxceem commented on Mar 16, 2016

@maxceem

It really helped me. And I can confirm that just putting alias didn't help me. I had the same error.

Diyago

Diyago commented on Mar 16, 2016

@Diyago

I've copied make.exe to my path file, added alias - the error still persist for me. Last minigw version, win7, 64bit:
This is my error listing:

$ mingw32-make
cd dmlc-core; make libdmlc.a config=C:/Users/****/xgboost/config.mk; cd C:/User                                                      s/****/xgboost
C:/MinGW/bin/make.exe: error while loading shared libraries: ?: cannot open shar                                                      ed object file: No such file or directory
cd rabit; make lib/librabit_empty.a; cd C:/Users/****/xgboost
C:/MinGW/bin/make.exe: error while loading shared libraries: ?: cannot open shar                                                      ed object file: No such file or directory
ar crv lib/libxgboost.a
g++ -m64 -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iincl                                                      ude -DDMLC_ENABLE_STD_THREAD=0  -Idmlc-core/include -Irabit/include -fopenmp -sh                                                      ared -o lib/libxgboost.dll build/learner.o build/logging.o build/common/common.o                                                       build/c_api/c_api_error.o build/c_api/c_api.o build/data/simple_dmatrix.o build                                                      /data/sparse_page_raw_format.o build/data/data.o build/data/simple_csr_source.o                                                       build/data/sparse_page_writer.o build/data/sparse_page_source.o build/data/spars                                                      e_page_dmatrix.o build/gbm/gbm.o build/gbm/gblinear.o build/gbm/gbtree.o build/m                                                      etric/multiclass_metric.o build/metric/elementwise_metric.o build/metric/rank_me                                                      tric.o build/metric/metric.o build/objective/regression_obj.o build/objective/ra                                                      nk_obj.o build/objective/objective.o build/objective/multiclass_obj.o build/tree                                                      /tree_model.o build/tree/updater_colmaker.o build/tree/updater_skmaker.o build/t                                                      ree/updater_sync.o build/tree/updater_refresh.o build/tree/updater_histmaker.o b                                                      uild/tree/tree_updater.o build/tree/updater_prune.o dmlc-core/libdmlc.a rabit/li                                                      b/librabit_empty.a -pthread -lm  -fopenmp
g++: error: dmlc-core/libdmlc.a: No such file or directory
g++: error: rabit/lib/librabit_empty.a: No such file or directory
Makefile:120: recipe for target 'lib/libxgboost.dll' failed
mingw32-make: *** [lib/libxgboost.dll] Error 1
maxceem

maxceem commented on Mar 17, 2016

@maxceem

Try to run building as in documentation:

$ cp make/mingw64.mk config.mk
$ make -j4
BaydinAlexey

BaydinAlexey commented on Mar 17, 2016

@BaydinAlexey

TDM version of minigw doesnt have any mingw\bin\mingw32-make.exe file, so how can fix the problem with missing libdmlc.a and librabit_empty.a files?

pakchoi

pakchoi commented on Mar 18, 2016

@pakchoi

After making a copy, the complie errors are gone. But when import xgb, I get this:


Traceback (most recent call last):
File "test_basic.py", line 3, in
import xgboost as xgb
File "C:\Users\pakchoi\Anaconda2\lib\site-packages\xgboost-0.4-py2.7.egg\xgboost__init__.py", line 11, in
from .core import DMatrix, Booster
File "C:\Users\pakchoi\Anaconda2\lib\site-packages\xgboost-0.4-py2.7.egg\xgboost\core.py", line 83, in
LIB = load_lib()
File "C:\Users\pakchoi\Anaconda2\lib\site-packages\xgboost-0.4-py2.7.egg\xgboost\core.py", line 77, in load_lib
lib = ctypes.cdll.LoadLibrary(lib_path[0])
File "C:\Users\pakchoi\Anaconda2\lib\ctypes__init
.py", line 443, in LoadLibrary
return self.dlltype(name)
File "C:\Users\pakchoi\Anaconda2\lib\ctypes__init
.py", line 365, in init
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 127]

pakchoi

pakchoi commented on Mar 20, 2016

@pakchoi
Diyago

Diyago commented on Mar 21, 2016

@Diyago

@pakchoi , thank you for your work. It works fine on x64, but not in 32 bit.

$ mingw32-make
g++  -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude                        -DDMLC_ENABLE_STD_THREAD=0  -Idmlc-core/include -Irabit/include -fopenmp -MM -MT                        build/learner.o src/learner.cc >build/learner.d
g++  -c -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclu                       de -DDMLC_ENABLE_STD_THREAD=0  -Idmlc-core/include -Irabit/include -fopenmp -c s                       rc/learner.cc -o build/learner.o
In file included from rabit/include/rabit/./internal/../serializable.h:11:0,
                 from rabit/include/rabit/./internal/engine.h:10,
                 from rabit/include/rabit/rabit.h:28,
                 from include/xgboost/learner.h:11,
                 from src/learner.cc:8:
rabit/include/rabit/./internal/.././internal/utils.h: In function 'FILE* rabit::                       utils::FopenCheck(const char*, const char*)':
rabit/include/rabit/./internal/.././internal/utils.h:158:38: error: 'fopen64' wa                       s not declared in this scope
   std::FILE *fp = fopen64(fname, flag);
                                      ^
In file included from dmlc-core/include/dmlc/registry.h:14:0,
                 from include/xgboost/./gbm.h:11,
                 from include/xgboost/learner.h:16,
                 from src/learner.cc:8:
src/learner.cc: At global scope:
dmlc-core/include/dmlc/./parameter.h:254:43: warning: 'xgboost::__make__LearnerM                       odelParamParamManager__' defined but not used [-Wunused-variable]
   static ::dmlc::parameter::ParamManager &__make__ ## PType ## ParamManager__ =                        \
                                           ^
src/learner.cc:107:1: note: in expansion of macro 'DMLC_REGISTER_PARAMETER'
 DMLC_REGISTER_PARAMETER(LearnerModelParam);
 ^
dmlc-core/include/dmlc/./parameter.h:254:43: warning: 'xgboost::__make__LearnerT                       rainParamParamManager__' defined but not used [-Wunused-variable]
   static ::dmlc::parameter::ParamManager &__make__ ## PType ## ParamManager__ =                        \
                                           ^
src/learner.cc:108:1: note: in expansion of macro 'DMLC_REGISTER_PARAMETER'
 DMLC_REGISTER_PARAMETER(LearnerTrainParam);
 ^
Makefile:97: recipe for target 'build/learner.o' failed
mingw32-make: *** [build/learner.o] Error 1
souljourner

souljourner commented on Feb 20, 2017

@souljourner

same error trying to build multi-threaded XGB on mac. I dont think we use the mingw32-make. Any suggestions? Thanks very much.

Natural209X

Natural209X commented on Feb 23, 2017

@Natural209X

same error on ubuntu w/ MKL, HDFS, distributed enabled.

abhijithch

abhijithch commented on Mar 8, 2017

@abhijithch

Facing the same error on POWER8 machine and centos 7. I have removed the -msse2 flag in the Makefile, as was suggested here.

erseema

erseema commented on May 5, 2017

@erseema

I am getting this error. I followed all steps:
$ git clone --recursive https://github.com/dmlc/xgboost
$ cd xgboost
$ git submodule init
$ git submodule update
$ cd dmlc-core
$ make -j4
$ cd ../rabit
$ make lib/librabit_empty.a -j4
$ cd ..
$ cp make/mingw64.mk config.mk
$ make -j4

when I run last command ; it throws error:
In file included from src/data/./simple_dmatrix.h:15:0,
from src/data/simple_dmatrix.cc:11:
src/data/././sparse_batch_page.h:238:46: error: 'function' is not a member of 's td'
std::function<SparsePage::Format* ()> > {
^~~~~~~~
src/data/././sparse_batch_page.h:238:46: note: suggested alternative: 'is_functi on'
std::function<SparsePage::Format* ()> > {
^~~~~~~~
is_function
src/data/././sparse_batch_page.h:238:46: error: 'function' is not a member of 's td'
src/data/././sparse_batch_page.h:238:46: note: suggested alternative: 'is_functi on'
std::function<SparsePage::Format* ()> > {
^~~~~~~~
is_function
src/data/././sparse_batch_page.h:238:77: error: template argument 2 is invalid
std::function<SparsePage::Format* ()> > {
^
src/data/././sparse_batch_page.h:238:79: error: expected '{' before '>' token
std::function<SparsePage::Format* ()> > {
^
src/data/././sparse_batch_page.h:238:79: error: expected unqualified-id before ' >' token
In file included from dmlc-core/include/dmlc/././parameter.h:25:0,
from dmlc-core/include/dmlc/./registry.h:14,
from dmlc-core/include/dmlc/data.h:16,
from include/xgboost/data.h:11,
from src/data/simple_dmatrix.cc:7:
dmlc-core/include/dmlc/./././optional.h: In instantiation of 'dmlc::optional: :~optional() [with T = int]':
dmlc-core/include/dmlc/././parameter.h:513:7: required from here
dmlc-core/include/dmlc/./././optional.h:60:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
reinterpret_cast<T*>(&val)->~T();
^~~~~~~~~~~~~~~~
dmlc-core/include/dmlc/./././optional.h: In instantiation of 'const T& dmlc::opt ional::value() const [with T = int]':
dmlc-core/include/dmlc/././parameter.h:872:9: required from here
dmlc-core/include/dmlc/./././optional.h:106:12: warning: dereferencing type-punn ed pointer will break strict-aliasing rules [-Wstrict-aliasing]
return reinterpret_cast<const T>(&val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dmlc-core/include/dmlc/./././optional.h: In instantiation of 'const T& dmlc::opt ional::operator*() const [with T = int]':
dmlc-core/include/dmlc/./././optional.h:134:11: required from 'std::ostream& d mlc::operator<<(std::ostream&, const dmlc::optional&) [with T = int; std::ost ream = std::basic_ostream]'
dmlc-core/include/dmlc/././parameter.h:877:13: required from here
dmlc-core/include/dmlc/./././optional.h:97:12: warning: dereferencing type-punne d pointer will break strict-aliasing rules [-Wstrict-aliasing]
return reinterpret_cast<const T>(&val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:117: recipe for target 'build/data/simple_dmatrix.o' failed
mingw32-make: *** [build/data/simple_dmatrix.o] Error 1
mingw32-make: *** Waiting for unfinished jobs....

llmercury

llmercury commented on May 5, 2017

@llmercury

@erseema, exactly the same issue. Exhausted. Waiting for a fix......

erseema

erseema commented on May 6, 2017

@erseema

@llmercury , I managed to get Xgboost installed.
Follow the steps from here.
https://dnc1994.com/2016/03/installing-xgboost-on-windows/

Also, before this install MINGW from here. (don';t forget to check OpenMp checkbox)
.http://tdm-gcc.tdragon.net/download

(If you aren't able to run wget command then directly download Makefile form the link given on the blogpost (link shared above).

Hope u get it installed now!

locked as resolved and limited conversation to collaborators on Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @maxceem@pakchoi@thirdwing@tqchen@abhijithch

        Issue actions

          g++: error: dmlc-core/libdmlc.a: No such file or directory · Issue #909 · dmlc/xgboost