dgl icon indicating copy to clipboard operation
dgl copied to clipboard

Cant't build the source in windows because of "is not able to compile a simple test program."

Open tryagain3 opened this issue 6 years ago • 7 comments

Hi team,

I followed the instruction from https://docs.dgl.ai/install/index.html#windows

when i run the below command:

cmake -DCMAKE_CXX_FLAGS="-DDMLC_LOG_STACK_TRACE=0 -DDGL_EXPORTS" -DCMAKE_MAKE_PROGRAM=mingw32-make .. -G "MSYS Makefiles"

it failed with below error

-- The C compiler identification is GNU 5.3.0 -- The CXX compiler identification is GNU 5.3.0 -- Check for working C compiler: C:/ProgramData/Anaconda3/Library/mingw-w64/bin/gcc.exe -- Check for working C compiler: C:/ProgramData/Anaconda3/Library/mingw-w64/bin/gcc.exe -- broken CMake Error at C:/ProgramData/Anaconda3/Library/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message): The C compiler

"C:/ProgramData/Anaconda3/Library/mingw-w64/bin/gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: D:/code/dgl/build/CMakeFiles/CMakeTmp

Run Build Command(s):mingw32-make cmTC_0dcff/fast
mingw32-make -f CMakeFiles/cmTC_0dcff.dir/build.make CMakeFiles/cmTC_0dcff.dir/build
mingw32-make[1]: Entering directory 'D:/code/dgl/build/CMakeFiles/CMakeTmp'
CMakeFiles/cmTC_0dcff.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_0dcff.dir/testCCompiler.c.obj' failed
process_begin: CreateProcess(NULL, sh.exe -c "/C/ProgramData/Anaconda3/Library/bin/cmake.exe -E cmake_echo_color --switch= --progress-dir=/D/code/dgl/build/CMakeFiles/CMakeTmp/CMakeFiles --progress-num=1 Building C object CMakeFiles/cmTC_0dcff.dir/testCCompiler.c.obj", ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make[1]: *** [CMakeFiles/cmTC_0dcff.dir/testCCompiler.c.obj] Error 2
mingw32-make[1]: Leaving directory 'D:/code/dgl/build/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_0dcff/fast' failed
mingw32-make: *** [cmTC_0dcff/fast] Error 2

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:5 (project)

-- Configuring incomplete, errors occurred! See also "D:/code/dgl/build/CMakeFiles/CMakeOutput.log". See also "D:/code/dgl/build/CMakeFiles/CMakeError.log".

tryagain3 avatar Mar 21 '20 04:03 tryagain3

Hi,

We currently no longer support MinGW build. Please use MSBuild instead.

We will update the installation instructions accordingly.

BarclayII avatar Mar 23 '20 07:03 BarclayII

Thanks and I tried to follow MSBuild instead. but still failed when run. (I changed "Visual Studio 15 2017 Win64" to "Visual Studio 16 2019 Win64". because i am using vs 2019)

cmake -DCMAKE_CXX_FLAGS="/DDGL_EXPORTS" -DCMAKE_CONFIGURATION_TYPES="Release" .. -G "Visual Studio 16 2019 Win64"

shared the full error message

CMake Error: Could not create named generator Visual Studio 16 2019 Win64

Generators Visual Studio 16 2019 = Generates Visual Studio 2019 project files. Use -A option to specify architecture. Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files. Optional [arch] can be "Win64" or "IA64". Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files. Optional [arch] can be "Win64" or "IA64". Borland Makefiles = Generates Borland makefiles.

  • NMake Makefiles = Generates NMake makefiles. NMake Makefiles JOM = Generates JOM makefiles. Green Hills MULTI = Generates Green Hills MULTI files (experimental, work-in-progress). MSYS Makefiles = Generates MSYS makefiles. MinGW Makefiles = Generates a make file for use with mingw32-make. Unix Makefiles = Generates standard UNIX makefiles. Ninja = Generates build.ninja files. Watcom WMake = Generates Watcom WMake makefiles. CodeBlocks - MinGW Makefiles = Generates CodeBlocks project files. CodeBlocks - NMake Makefiles = Generates CodeBlocks project files. CodeBlocks - NMake Makefiles JOM = Generates CodeBlocks project files. CodeBlocks - Ninja = Generates CodeBlocks project files. CodeBlocks - Unix Makefiles = Generates CodeBlocks project files. CodeLite - MinGW Makefiles = Generates CodeLite project files. CodeLite - NMake Makefiles = Generates CodeLite project files. CodeLite - Ninja = Generates CodeLite project files. CodeLite - Unix Makefiles = Generates CodeLite project files. Sublime Text 2 - MinGW Makefiles = Generates Sublime Text 2 project files. Sublime Text 2 - NMake Makefiles = Generates Sublime Text 2 project files. Sublime Text 2 - Ninja = Generates Sublime Text 2 project files. Sublime Text 2 - Unix Makefiles = Generates Sublime Text 2 project files. Kate - MinGW Makefiles = Generates Kate project files. Kate - NMake Makefiles = Generates Kate project files. Kate - Ninja = Generates Kate project files. Kate - Unix Makefiles = Generates Kate project files. Eclipse CDT4 - NMake Makefiles = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - MinGW Makefiles = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

D:\code\dgl\build>

tryagain3 avatar Mar 23 '20 17:03 tryagain3

Thanks and I tried to follow MSBuild instead. but still failed when run. (I changed "Visual Studio 15 2017 Win64" to "Visual Studio 16 2019 Win64". because i am using vs 2019)

cmake -DCMAKE_CXX_FLAGS="/DDGL_EXPORTS" -DCMAKE_CONFIGURATION_TYPES="Release" .. -G "Visual Studio 16 2019 Win64"

shared the full error message

CMake Error: Could not create named generator Visual Studio 16 2019 Win64

Generators Visual Studio 16 2019 = Generates Visual Studio 2019 project files. Use -A option to specify architecture. Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files. Optional [arch] can be "Win64" or "IA64". Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files. Optional [arch] can be "Win64" or "IA64". Borland Makefiles = Generates Borland makefiles.

* NMake Makefiles              = Generates NMake makefiles.
  NMake Makefiles JOM          = Generates JOM makefiles.
  Green Hills MULTI            = Generates Green Hills MULTI files
  (experimental, work-in-progress).
  MSYS Makefiles               = Generates MSYS makefiles.
  MinGW Makefiles              = Generates a make file for use with
  mingw32-make.
  Unix Makefiles               = Generates standard UNIX makefiles.
  Ninja                        = Generates build.ninja files.
  Watcom WMake                 = Generates Watcom WMake makefiles.
  CodeBlocks - MinGW Makefiles = Generates CodeBlocks project files.
  CodeBlocks - NMake Makefiles = Generates CodeBlocks project files.
  CodeBlocks - NMake Makefiles JOM
  = Generates CodeBlocks project files.
  CodeBlocks - Ninja           = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles  = Generates CodeBlocks project files.
  CodeLite - MinGW Makefiles   = Generates CodeLite project files.
  CodeLite - NMake Makefiles   = Generates CodeLite project files.
  CodeLite - Ninja             = Generates CodeLite project files.
  CodeLite - Unix Makefiles    = Generates CodeLite project files.
  Sublime Text 2 - MinGW Makefiles
  = Generates Sublime Text 2 project files.
  Sublime Text 2 - NMake Makefiles
  = Generates Sublime Text 2 project files.
  Sublime Text 2 - Ninja       = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
  = Generates Sublime Text 2 project files.
  Kate - MinGW Makefiles       = Generates Kate project files.
  Kate - NMake Makefiles       = Generates Kate project files.
  Kate - Ninja                 = Generates Kate project files.
  Kate - Unix Makefiles        = Generates Kate project files.
  Eclipse CDT4 - NMake Makefiles
  = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - MinGW Makefiles
  = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Ninja         = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

D:\code\dgl\build>

This is my experiment in windows: 1)md build 2)cd build 3)cmake -DUSE_CUDA=OFF -DUSE_OPENMP=ON -DCUDA_ARCH_NAME=All -DCMAKE_CXX_FLAGS="/DDGL_EXPORTS" -DCMAKE_CONFIGURATION_TYPES="Release" -DDMLC_FORCE_SHARED_CRT=ON .. -G "Visual Studio 15 2017 Win64" 4)msbuild dgl.sln /p:Configuration=Release /p:Platform=x64 5)cd ..\python 6)python setup.py install you can try it

xhcgit avatar Mar 30 '20 06:03 xhcgit

Thanks and i am using VS 2019, how should i set the below parameter? -G "Visual Studio 15 2017 Win64"

tryagain3 avatar Mar 30 '20 17:03 tryagain3

Thanks and i am using VS 2019, how should i set the below parameter? -G "Visual Studio 15 2017 Win64"

You can use "cmake --help" show the detail in Generators(VS 2019 is difference, I recommend you install VS 2017), and if you want to build the gpu version DGL, you can set -DUSE_CUDA=ON (if your cuda version is 10, you should update cmake in cmake.org, otherwise you will meet error).

xhcgit avatar Mar 30 '20 18:03 xhcgit

This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you

github-actions[bot] avatar Apr 20 '22 01:04 github-actions[bot]

This issue is closed due to lack of activity. Feel free to reopen it if you still have questions.

github-actions[bot] avatar Apr 29 '22 01:04 github-actions[bot]