Building with Intel MKL on a KNL system

I’ve been trying to build 0.6 with Intel MKL on a Knights Landing system. (I posted a question back in October about this too.) I wonder if anyone has done this successfully who might be able to share how they made it work.

My makefile contains:

LLVM_VER=4.0.0
USE_INTEL_MKL=1
USEICC=1
USEIFC=1
USE_INTEL_LIBM=1

I run
make -C deps get-llvm
first, but the build has always failed.
I saved the entire output of the build process if that would be useful, but

make debug

returns the following:

[  0%] Built target LLVMDemangle
[  6%] Built target LLVMSupport
[  6%] Built target LLVMTableGen
[  9%] Built target obj.llvm-tblgen
[  9%] Built target llvm-tblgen
[  9%] Built target AttributeCompatFuncTableGen
[  9%] Built target intrinsics_gen
[ 14%] Built target LLVMCore
[ 14%] Built target LLVMIRReader
[ 25%] Built target LLVMCodeGen
[ 29%] Built target LLVMSelectionDAG
[ 30%] Built target LLVMAsmPrinter
[ 30%] Built target LLVMMIRParser
[ 30%] Built target LLVMGlobalISel
[ 30%] Built target LLVMBitReader
[ 30%] Built target LLVMBitWriter
[ 35%] Built target LLVMTransformUtils
[ 35%] Built target LLVMInstrumentation
[ 37%] Built target LLVMInstCombine
[ 40%] Built target LLVMScalarOpts
[ 41%] Built target LLVMipo
[ 41%] Built target LLVMVectorize
[ 41%] Built target LLVMHello_exports
[ 41%] Built target LLVMHello
[ 43%] Built target LLVMObjCARCOpts
[ 43%] Built target LLVMCoroutines
[ 43%] Built target LLVMLinker
[ 50%] Built target LLVMAnalysis
[ 50%] Built target LLVMLTO
[ 54%] Built target LLVMMC
[ 56%] Built target LLVMMCParser
[ 56%] Built target LLVMMCDisassembler
[ 58%] Built target LLVMObject
[ 58%] Built target LLVMObjectYAML
[ 58%] Built target LLVMOption
[ 59%] Built target LLVMDebugInfoDWARF
[ 59%] Built target LLVMDebugInfoMSF
[ 61%] Built target LLVMDebugInfoCodeView
[ 66%] Built target LLVMDebugInfoPDB
[ 67%] Built target LLVMSymbolize
[ 69%] Built target LLVMExecutionEngine
[ 70%] Built target LLVMInterpreter
[ 70%] Built target LLVMMCJIT
[ 72%] Built target LLVMOrcJIT
[ 74%] Built target LLVMRuntimeDyld
[ 74%] Built target LLVMTarget
[ 74%] Built target NVPTXCommonTableGen
[ 75%] Built target LLVMNVPTXCodeGen
[ 75%] Built target LLVMNVPTXInfo
[ 75%] Built target LLVMNVPTXAsmPrinter
[ 75%] Built target LLVMNVPTXDesc
[ 75%] Built target X86CommonTableGen
[ 77%] Built target LLVMX86CodeGen
[ 77%] Built target LLVMX86AsmParser
[ 79%] Built target LLVMX86Disassembler
[ 80%] Built target LLVMX86AsmPrinter
[ 80%] Built target LLVMX86Desc
[ 80%] Built target LLVMX86Info
[ 80%] Built target LLVMX86Utils
[ 82%] Built target LLVMAsmParser
[ 82%] Built target LLVMLineEditor
[ 82%] Built target LLVMProfileData
[ 82%] Built target LLVMCoverage
[ 82%] Built target LLVMPasses
[ 82%] Built target LibOptionsTableGen
[ 82%] Built target LLVMLibDriver
[ 82%] Built target LLVMXRay
[ 82%] Built target FileCheck
[ 82%] Built target llvm-PerfectShuffle
[ 82%] Built target count
[ 82%] Built target not
[ 82%] Built target yaml-bench
[ 82%] Built target gtest
[ 82%] Built target gtest_main
[ 82%] Built target LLVM
[ 82%] Built target LTO_exports
[ 83%] Built target LTO
[ 83%] Linking CXX executable ../../bin/llvm-ar
/opt/apps/gcc/5.4.0/bin/ld: ../../bin/llvm-ar: hidden symbol `__intel_cpu_feature_indicator_x' in /opt/intel/compilers_and_libraries_2017.4.196/linux/compiler/lib/intel64_lin/libirc.a(cpu_feature_disp.o) is referenced by DSO
/opt/apps/gcc/5.4.0/bin/ld: final link failed: Bad value
make[4]: *** [bin/llvm-ar] Error 1
make[3]: *** [tools/llvm-ar/CMakeFiles/llvm-ar.dir/all] Error 2
make[2]: *** [all] Error 2
make[1]: *** [scratch/llvm-4.0.0/build_Release/build-compiled] Error 2
make: *** [julia-deps] Error 2

If anyone can point me in the right direction, or if I can provide a more useful set of error messages, that would be great. Thanks!

Can you PM me your email address? I’ll reach out to someone in that group who may be able to help.

You should be able to build everything with gcc, but still keep MKL,
i.e. remove the

At some point the build worked with Intel compilers, but it’s never been particularly stable.

1 Like

Thanks. That worked! I appreciate your help.

In case anyone else is trying to build on Stampede or Stampede 2 in the future, this is exactly what I did:

# This is on the login node
		git clone git://github.com/JuliaLang/julia.git
		cd julia
		git checkout v0.6.0
		vi Make.user
		# See contents below
		make -C deps get-llvm
		idev -m 60 # request time on compute node

# This is on the compute node
		source /opt/intel/compilers_and_libraries/linux/mkl/bin/mklvars.sh intel64
		module load cmake/3.7.1
		make -j 68 

The contents of Make.user :

LLVM_VER=4.0.0
USE_INTEL_MKL=1
USE_INTEL_LIBM=1
4 Likes

Did you ask support to add a Julia module? That would be nice to have on there.

I will certainly email them. There are a few Julia users in my department who might be interested, at least.

1 Like

I am trying to follow these instructions, but getting the following error when running make:

WARNING: sha512 checksum for llvm-4.0.0.src.tar.xz not found in deps/checksums/, autogenerating...
can't find file to patch at input line 14
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From f23277bb91a4925ba8763337137a3123a7600557 Mon Sep 17 00:00:00 2001
|From: Valentin Churavy <v.churavy@gmail.com>
|Date: Tue, 16 Jan 2018 17:29:05 -0500
|Subject: [PATCH] add JL prefix to all LLVM version suffixes
|
|---
| tools/llvm-shlib/simple_version_script.map.in | 2 +-
| 1 file changed, 1 insertion(+), 1 deletion(-)
|
|diff --git a/tools/llvm-shlib/simple_version_script.map.in b/tools/llvm-shlib/simple_version_script.map.in
|index e9515fe7862..af082581627 100644
|--- a/tools/llvm-shlib/simple_version_script.map.in
|+++ b/tools/llvm-shlib/simple_version_script.map.in
--------------------------
File to patch: Skip this patch? [y] n
File to patch: n
n: No such file or directory
Skip this patch? [y] y
Skipping patch.
1 out of 1 hunk ignored
make[1]: *** [[...]/julia/deps/srccache/llvm-4.0.0/llvm-symver-jlprefix.patch-applied] Error 1
make: *** [julia-deps] Error 2

The instructions are about a year outdated. Current master should work fine without special settings.