# Windows - Build From Source Errors

**URL:** <https://discourse.julialang.org/t/windows-build-from-source-errors/9549>\
**Category:** New to Julia\
**Tags:** mkl\
**Created:** [March 6, 2018, 9:25pm UTC](https://discourse.julialang.org/t/windows-build-from-source-errors/9549 "2018-03-06T21:25:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alphasig329](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alphasig329/32/9794_2.png) [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Post date:** [March 6, 2018, 9:25pm UTC](https://discourse.julialang.org/t/windows-build-from-source-errors/9549/1 "2018-03-06T21:25:22Z")

</div>

I have been beating my head repeatedly on my desk for a week trying to install Julia from source on my Windows machine. I know that Windows stinks, but its a work computer and I have to make do with what I got. I have Intel’s Parallel Studio XE installed so I am trying to utilize Intel’s Math Kernal Library. Also, I have the CUDA GPU toolkit that I would like to exploit in my work. I have followed the manual for installing Julia from source ([https://github.com/JuliaLang/julia](https://github.com/JuliaLang/julia)) as well as the platform specific instructions ([https://github.com/JuliaLang/julia/blob/master/README.windows.md](https://github.com/JuliaLang/julia/blob/master/README.windows.md)), but I keep getting errors.

For the Intel MKL, I modified my Make.user file as such:

XC\_HOST = x86\_64-w64-mingw32  
USEICC = 0  
USEIFC = 0  
USE\_INTEL\_MKL = 1  
USE\_INTEL\_FFT = 1  
USE\_INTEL\_LIBM = 1  
USE\_INTEL\_JITEVENTS = 1

When I toggle the Intel compilers on, then I get an error (icc: command not found) using cygwin64. I did the best googling I could, but just got pages about setting the Intel environment variables. The documentation for setting these in Windows in sparse and I felt that I did so, but I could be horribly wrong. If I toggled the Intel compilers off I get the following error:

```
make[5]: Leaving directory '/cygdrive/c/users/JMB/julia/deps/scratch/SuiteSparse-4.4.5/SPQR/Lib'
make[4]: Leaving directory '/cygdrive/c/users/JMB/julia/deps/scratch/SuiteSparse-4.4.5/SPQR'
make[3]: Leaving directory '/cygdrive/c/users/JMB/julia/deps/scratch/SuiteSparse-4.4.5'
/usr/lib/gcc/x86_64-w64-mingw32/6.4.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lmkl_rt
/usr/lib/gcc/x86_64-w64-mingw32/6.4.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lmkl_rt
collect2: error: ld returned 1 exit status
make[2]: *** [/cygdrive/c/users/JMB/julia/deps/suitesparse.mk:54: /cygdrive/c/users/JMB/julia/usr/manifest/suitesparse] Error 1
make[2]: Leaving directory '/cygdrive/c/users/JMB/julia/deps'
make[1]: *** [Makefile:81: julia-deps] Error 2
make[1]: Leaving directory '/cygdrive/c/users/JMB/julia'
make: *** [Makefile:57: /cygdrive/c/users/JMB/julia/doc/_build/html/en/index.html] Error 2

```

As for the CUDA GPU toolkit, I was using the standard Windows binaries and trying to use the various CUDA packages available, but was told that I needed an updated version of LLVM and recommended that I build Julia from source with an updated LLVM which started this whole process. So I added a toggle in my Make.user file for

XC\_HOST = x86\_64-w64-mingw32  
USE\_SYSTEM\_LLVM = 1

CMakeFiles/libssh2.dir/objects.a(misc.c.obj):misc.c:(.text+0x156): undefined reference to `__imp_recv' CMakeFiles/libssh2.dir/objects.a(misc.c.obj):misc.c:(.text+0x172): undefined reference to `\_\_imp\_WSAGetLastError’  
CMakeFiles/libssh2.dir/objects.a(misc.c.obj):misc.c:(.text+0x1b6): undefined reference to `__imp_send' CMakeFiles/libssh2.dir/objects.a(misc.c.obj):misc.c:(.text+0x1d2): undefined reference to `\_\_imp\_WSAGetLastError’  
CMakeFiles/libssh2.dir/objects.a(session.c.obj):session.c:(.text+0x453): undefined reference to `__imp_select' CMakeFiles/libssh2.dir/objects.a(session.c.obj):session.c:(.text+0x56d): undefined reference to `\_\_imp\_getsockopt’  
collect2: error: ld returned 1 exit status  
make[5]: \*\*\* [src/CMakeFiles/libssh2.dir/build.make:656: src/libssh2.dll] Error 1  
make[4]: \*\*\* [CMakeFiles/Makefile2:86: src/CMakeFiles/libssh2.dir/all] Error 2  
make[3]: \*\*\* [CMakeFiles/Makefile2:98: src/CMakeFiles/libssh2.dir/rule] Error 2  
make[2]: \*\*\* [Makefile:195: libssh2] Error 2  
make[1]: \*\*\* [/cygdrive/c/users/JMB/julia/deps/libssh2.mk:44: scratch/libssh2-30e9c1347e3b8baa2951db612f05e6d87fc8e2f2/build-compiled] Error 2  
make: \*\*\* [Makefile:81: julia-deps] Error 2

At this point, I’m broken as a human and a researcher. There is little documentation for this and even fewer for Windows. Is there any recommendations to fix my errors or is this attempt on Windows a useless gesture? Sorry for the long post.

Thanks,

JMB

---

<div class="post-metadata">

**Author:** ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)\
**Post date:** [March 7, 2018, 12:01am UTC](https://discourse.julialang.org/t/windows-build-from-source-errors/9549/2 "2018-03-07T00:01:54Z")

</div>

Building on Windows is notoriously difficult and it requires a precise dance with MinGW and compilers. I have no advice to offer there besides “I am sorry”.

Since you mentioned that your original goal is to use CUDA and therefore I assume CUDAnative.hl and CuArrays.jl it might be better for your to use the 0.7 nightlies [https://julialang.org/downloads/nightlies.html](https://julialang.org/downloads/nightlies.html) (which should be about 9 days old).

The nightlies (at least on Linux) have support for LLVM.jl (a dependency of CUDAnative.jl) and you should not need to build Julia from scratch. If you run into issues with that please let us/me know!

---

<div class="post-metadata">

**Author:** ![alphasig329](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alphasig329/32/9794_2.png) [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Post date:** [March 7, 2018, 1:42pm UTC](https://discourse.julialang.org/t/windows-build-from-source-errors/9549/3 "2018-03-07T13:42:03Z")

</div>

Thank you for the response. I’ll go with the nightly builds for now to use CUDA. Hopefully there will be better troubleshooting documentation for MKL build in the future.

---

<div class="post-metadata">

**Author:** ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)\
**Post date:** [March 7, 2018, 1:47pm UTC](https://discourse.julialang.org/t/windows-build-from-source-errors/9549/4 "2018-03-07T13:47:08Z")

</div>

MKL on Linux works well, but I think there are very few people who want to use MKL and Windows.
