Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation error on windows: omp.h not found #841

Closed
bishwarup307 opened this issue Feb 18, 2016 · 5 comments
Closed

installation error on windows: omp.h not found #841

bishwarup307 opened this issue Feb 18, 2016 · 5 comments

Comments

@bishwarup307
Copy link

I am trying to install the xgboost python package on windows 8 (64 bit) following the instructions given here: http://stackoverflow.com/questions/33749735/how-to-install-xgboost-package-in-python-windows-platform/35480673#35480673 and http://xgboost.readthedocs.org/en/latest/build.html#building-on-windows.

After I run the command: make -j4, i get the following error:
dmlc-core/include/dmlc/omp.h:9:17: fatal error: omp.h: No such file or directory
I am executing the commands on a Cygwin shell. Any suggestions?

@bishwarup307 bishwarup307 changed the title installation error: omp.h not found installation error on windows: omp.h not found Feb 18, 2016
@FACE1E55
Copy link

@bishwarup307 I'm not sure if it works fine, but here is somethng to try.
I had similar issue and it disappeared after I did the following:

  • delete dmlc-core directory
  • git clone https://github.com/dmlc/dmlc-core
  • cd dmlc-core
  • make, or mingw32-make, or anything
    Then continue with installing xgboost.
    Hope it works for you.

@Diyago
Copy link

Diyago commented Mar 17, 2016

I have the same error as @bishwarup307 . Tried @FACE1E55 solution, but I get such error:

$ cd dmlc-core

sbt-ashrapov-ir@IDF3-9040043 MINGW32 ~/xgboost/dmlc-core ((1db0792...))
$ mingw32-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
src/io/line_split.cc:1:0: warning: -fPIC ignored for target (all code is position independent)
 // Copyright by Contributors
 ^
In file included from c:\users\\minigw\lib\gcc\mingw32\4.9.3\include\c++\cmath:44:0,
                 from c:\users\\minigw\lib\gcc\mingw32\4.9.3\include\c++\random:38,
                 from c:\users\\minigw\lib\gcc\mingw32\4.9.3\include\c++\bits\stl_algo.h:66,
                 from c:\users\\minigw\lib\gcc\mingw32\4.9.3\include\c++\algorithm:62,
                 from src/io/line_split.cc:4:
c:\users\\minigw\include\math.h: In function 'float hypotf(float, float)':
c:\users\\minigw\include\math.h:635:30: error: '_hypot' was not declared in this scope
 { return (float)(_hypot (x, y)); }
                              ^
Makefile:75: recipe for target 'line_split.o' failed
mingw32-make: *** [line_split.o] Error 1

@luthfianto
Copy link

luthfianto commented Jul 10, 2016

Experienced the same error with gcc-6-win-64 and make (not mingw32-make)

λ make -j4
g++ -m64 -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++ -m64 -c -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude -DDMLC_ENABLE_STD_THREAD=0  -Idmlc-core/include -Irabit/include -fopenmp -c src/learner.cc -o build/learner.o
In file included from include/xgboost/./base.h:10:0,
                 from include/xgboost/logging.h:13,
                 from src/learner.cc:7:
dmlc-core/include/dmlc/omp.h:9:17: fatal error: omp.h: No such file or directory
 #include <omp.h>
                 ^
compilation terminated.
make: *** [Makefile:99: build/learner.o] Error 1

Looks like this compiler doesn't compiled with OpenMP. I'll just switch to TDM-GCC even it's only GCC 5

@luthfianto
Copy link

Well, ran into another error with TDM-GCC

λ make -j4
g++ -m64 -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/c_api/c_api_error.o src/c_api/c_api_error.cc >build/c_api/c_api_error.d
g++ -m64 -c -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude -DDMLC_ENABLE_STD_THREAD=0  -Idmlc-core/include -Irabit/include -fopenmp -c src/c_api/c_api_error.cc -o build/c_api/c_api_error.o
In file included from C:/TDM-GCC-64/x86_64-w64-mingw32/include/locale.h:12:0,
                 from C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/clocale:42,
                 from C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/x86_64-w64-mingw32/bits/c++locale.h:41,
                 from C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/bits/localefwd.h:40,
                 from C:/TDM-GCC-64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/c++/string:43,
                 from dmlc-core/include/dmlc/base.h:154,
                 from src/c_api/./c_api_error.h:9,
                 from src/c_api/c_api_error.cc:6:
C:/TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:450:83: error: 'FILE* std::fopen(const char*, const char*)' should have been declared inside 'std'
   FILE *fopen64(const char * __restrict__ filename,const char * __restrict__  mode);
                                                                                   ^
C:/TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:450:83: error: 'FILE* std::fopen(const char*, const char*)' conflicts with a previous declaration
C:/TDM-GCC-64/x86_64-w64-mingw32/include/stdio.h:449:17: note: previous declaration 'FILE* fopen(const char*, const char*)'
   FILE *__cdecl fopen(const char * __restrict__ _Filename,const char * __restrict__ _Mode) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
                 ^
Makefile:97: recipe for target 'build/c_api/c_api_error.o' failed
mingw32-make: *** [build/c_api/c_api_error.o] Error 1

Months ago it was just fine installing with TDM-GCC. Where does this error looks from?

@luthfianto
Copy link

Now I installed xgboost just fine

The takeaway:

  • If you encountered an error with omp/libgomp. Make sure you installed a compiler with OpenMP/libgomp support. (TDM-GCC with OpenMP option ticked/enabled at installation works fine).
  • If you encountered an error like mine above, actually you have no problem with your compiler anymore. Please refer to Should I MAKE dmlc-core first? Or directly MAKE xgboost? Window7 + mingw64 #1299 (comment) because there's some issues with MinGW inconsistencies or whatever

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants