Compiling mxnet for C++ from source on Windows

My goal is to compile mxnet from source to get the mxnet.dll and mxnet.lib and then use mxnet with C++ under Windows. I have to note that this is the first time I am trying to compile a library from source and so far it hasn’t been much fun.

The compilation takes about 5-6 hours. When it’s complete i get the following error:

LINK : fatal error LNK1248: image size (97588000) exceeds maximum allowable size (80000000)

After researching about this error i found out that this is a limit the Windows compiler sets and i don’t think I can do anything about it.

There is another issue here with a similar question, but i don’t know what to do with the answer “try buildingin in the Release configuration”

Does this reduce the size of the image and where can i find the “Release configuration”.

I have done some research on the internet, but couldn’t find much information/resources about compiling for C++ on Window so this is forum is my last resort.

Here are the steps i have gone through with my attempts an compiling from source:

  • Downloaded CMake
  • Downloaded OpenCV
  • Downloaded OpenBlas
  • Set the environment variables: set OpenCV_DIR=C:\Program Files\opencv\build and
    set OpenBLAS_HOME=C:\Program Files\OpenBLAS
  • Downloaded CUDA and cuDNN
  • Cloned the git-repository: git clone https://github.com/apache/incubator-mxnet.git --recursive
  • Set the environment variables for cuDNN: set DCUDNN_INCLUDE=C:\Program Files\cuda\include and set DCUDNN_LIBRARY=C:\Program Files\cuda\lib\x64\cudnn.lib and set LD_LIBRARY_PATH=D:\.....\mxnet\lib
  • Created a “build” directory in the folder
  • Use Cmake: cmake -G "Visual Studio 15 2017 Win64" -T cuda=10.1,host=x64 -DUSE_CPP_PACKAGE=1 -DUSE_CUDA=1 -DUSE_CUDNN=1 -DUSE_NVRTC=1 -DUSE_OPENCV=1 -DUSE_OPENMP=1 -DUSE_BLAS=open -DUSE_LAPACK=1 -DUSE_DIST_KVSTORE=0 -DCUDA_ARCH_LIST=Common -DCUDA_TOOLSET=10.1 -DCUDNN_INCLUDE="C:\Program Files\cuda\include" -DCUDNN_LIBRARY="C:\Program Files\cuda\lib\x64\cudnn.lib" "D:\.....\mxnet"
  • Building the library with msbuild mxnet.sln /p:Configuration=Release;Platform=x64 /maxcpucount

So my questions are:

  • What is the “Release configuration” and where can i get it?
  • Is it possible to get the libmxnet.dll without compiling the source myself?
  • The fact that i can’t change some windows settings to successfully compile the library with my given steps seems strange to me. Have i interpreted this error wrong? and can i do something about it?

Any help would be much appreciated!