Building Julia with Intel MKL and Intel LIBM on macOS

Hi all,

Where do I find good instructions on how to compile Julia (1.4.0) with Intel MKL and Intel LIBM on macOS (Catalina 10.15.4)?

Unfortunately, the “guide” here doesn’t work for me. After installing the Intel Parallel Studio XE (including MKL and LIBM), sourcing source /opt/intel/mkl/bin/mklvars.sh intel64 ilp64 and make I get:

➜  julia-mkl git:(release-1.4) ✗ make
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   497  100   497    0     0    378      0  0:00:01  0:00:01 --:--:--   378
100  379k  100  379k    0     0   159k      0  0:00:02  0:00:02 --:--:-- 1890k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   497  100   497    0     0    704      0 --:--:-- --:--:-- --:--:--   704
100 14905  100 14905    0     0  11690      0  0:00:01  0:00:01 --:--:-- 11690
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   465  100   465    0     0    735      0 --:--:-- --:--:-- --:--:--   735
100 50.1M  100 50.1M    0     0  2633k      0  0:00:19  0:00:19 --:--:-- 5076k
patching file SuiteSparse_config/SuiteSparse_config.h
patching file SuiteSparse_config/SuiteSparse_config.mk
ar: creating archive libsuitesparseconfig.a
a - SuiteSparse_config.o

----------------------------------------------------------------
SuiteSparse package compilation options:
----------------------------------------------------------------

SuiteSparse Version:      5.4.0
SuiteSparse top folder:   /Users/crstnbr/compiled/julia-mkl/deps/scratch/SuiteSparse-5.4.0
Package:                  LIBRARY=         libsuitesparseconfig
Version:                  VERSION=         5.4.0
SO version:               SO_VERSION=      5
System:                   UNAME=           Darwin
Install directory:        INSTALL=         /Users/crstnbr/compiled/julia-mkl/deps/scratch/SuiteSparse-5.4.0
Install libraries in:     INSTALL_LIB=     /Users/crstnbr/compiled/julia-mkl/deps/scratch/SuiteSparse-5.4.0/lib
Install include files in: INSTALL_INCLUDE= /Users/crstnbr/compiled/julia-mkl/deps/scratch/SuiteSparse-5.4.0/include
Install documentation in: INSTALL_DOC=     /Users/crstnbr/compiled/julia-mkl/deps/scratch/SuiteSparse-5.4.0/share/doc/suitesparse-5.4.0
Optimization level:       OPTIMIZATION=    -O3
parallel make jobs:       JOBS=            1
BLAS library:             BLAS=            -L/opt/intel/compilers_and_libraries_2020.1.216/mac/mkl/lib/ -lmkl_rt
LAPACK library:           LAPACK=          -L/opt/intel/compilers_and_libraries_2020.1.216/mac/mkl/lib/ -lmkl_rt
Intel TBB library:        TBB=
Other libraries:          LDLIBS=          -lm -lirc
static library:           AR_TARGET=       libsuitesparseconfig.a
shared library (full):    SO_TARGET=       libsuitesparseconfig.5.4.0.dylib
shared library (main):    SO_MAIN=         libsuitesparseconfig.5.dylib
shared library (short):   SO_PLAIN=        libsuitesparseconfig.dylib
shared library options:   SO_OPTS=         -L/Users/crstnbr/compiled/julia-mkl/deps/scratch/SuiteSparse-5.4.0/lib -Wl,-rpath,@loader_path/ -dynamiclib -compatibility_version 5 -current_version 5.4.0 -shared -undefined dynamic_lookup
shared library name tool: SO_INSTALL_NAME= install_name_tool -id
ranlib, for static libs:  RANLIB=          ranlib
static library command:   ARCHIVE=         ar rv
copy file:                CP=              cp -f
move file:                MV=              mv -f
remove file:              RM=              rm -f
pretty (for Tcov tests):  PRETTY=          grep -v "^#" | indent -bl -nce -bli0 -i4 -sob -l120
C compiler:               CC=              clang -stdlib=libc++ -mmacosx-version-min=10.8 -m64
C++ compiler:             CXX=             clang++ -stdlib=libc++ -mmacosx-version-min=10.8 -m64
CUDA compiler:            NVCC=            echo
CUDA root directory:      CUDA_PATH=
OpenMP flags:             CFOPENMP=
C/C++ compiler flags:     CF=              -D_GNU_SOURCE   -O3 -fexceptions -fPIC -fno-common
LD flags:                 LDFLAGS=         -L/Users/crstnbr/compiled/julia-mkl/deps/scratch/SuiteSparse-5.4.0/lib -Wl,-rpath,@loader_path/
Fortran compiler:         F77=             gfortran -mmacosx-version-min=10.8 -m64
Fortran flags:            F77FLAGS=
Intel MKL root:           MKLROOT=         /opt/intel/compilers_and_libraries_2020.1.216/mac/mkl
Auto detect Intel icc:    AUTOCC=          yes
UMFPACK config:           UMFPACK_CONFIG=  -DLONGBLAS=long long
CHOLMOD config:           CHOLMOD_CONFIG=  -DLONGBLAS=long long -DNPARTITION
SuiteSparseQR config:     SPQR_CONFIG=     -DLONGBLAS=long long
CUDA library:             CUDART_LIB=
CUBLAS library:           CUBLAS_LIB=
METIS and CHOLMOD/Partition configuration:
Your METIS library:       MY_METIS_LIB=
Your metis.h is in:       MY_METIS_INC=
METIS is used via the CHOLMOD/Partition module, configured as follows.
If the next line has -DNPARTITION then METIS will not be used:
CHOLMOD Partition config:  -DNPARTITION
CHOLMOD Partition libs:    -lccolamd -lcamd
CHOLMOD Partition include: -I/Users/crstnbr/compiled/julia-mkl/deps/scratch/SuiteSparse-5.4.0/CCOLAMD/Include -I/Users/crstnbr/compiled/julia-mkl/deps/scratch/SuiteSparse-5.4.0/CAMD/Include
ar: creating archive libamd.a
a - amd_i_aat.o
a - amd_i_1.o
a - amd_i_2.o
a - amd_i_dump.o
a - amd_i_postorder.o
a - amd_i_defaults.o
a - amd_i_post_tree.o
a - amd_i_order.o
a - amd_i_control.o
a - amd_i_info.o
a - amd_i_valid.o
a - amd_i_preprocess.o
a - amd_l_aat.o
a - amd_l_1.o
a - amd_l_2.o
a - amd_l_dump.o
a - amd_l_postorder.o
a - amd_l_defaults.o
a - amd_l_post_tree.o
a - amd_l_order.o
a - amd_l_control.o
a - amd_l_info.o
a - amd_l_valid.o
a - amd_l_preprocess.o
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libamd.a(amd_i_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libamd.a(amd_l_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libamd.a(amd_i_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libamd.a(amd_l_dump.o) has no symbols
ar: creating archive libcamd.a
a - camd_i_aat.o
a - camd_i_1.o
a - camd_i_2.o
a - camd_i_dump.o
a - camd_i_postorder.o
a - camd_i_defaults.o
a - camd_i_order.o
a - camd_i_control.o
a - camd_i_info.o
a - camd_i_valid.o
a - camd_i_preprocess.o
a - camd_l_aat.o
a - camd_l_1.o
a - camd_l_2.o
a - camd_l_dump.o
a - camd_l_postorder.o
a - camd_l_defaults.o
a - camd_l_order.o
a - camd_l_control.o
a - camd_l_info.o
a - camd_l_valid.o
a - camd_l_preprocess.o
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcamd.a(camd_i_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcamd.a(camd_l_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcamd.a(camd_i_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcamd.a(camd_l_dump.o) has no symbols
ar: creating archive libccolamd.a
a - ccolamd.o
a - ccolamd_l.o
ar: creating archive libcolamd.a
a - colamd.o
a - colamd_l.o
ar: creating archive libcholmod.a
a - cholmod_aat.o
a - cholmod_add.o
a - cholmod_band.o
a - cholmod_change_factor.o
a - cholmod_common.o
a - cholmod_complex.o
a - cholmod_copy.o
a - cholmod_dense.o
a - cholmod_error.o
a - cholmod_factor.o
a - cholmod_memory.o
a - cholmod_sparse.o
a - cholmod_transpose.o
a - cholmod_triplet.o
a - cholmod_version.o
a - cholmod_check.o
a - cholmod_read.o
a - cholmod_write.o
a - cholmod_amd.o
a - cholmod_analyze.o
a - cholmod_colamd.o
a - cholmod_etree.o
a - cholmod_factorize.o
a - cholmod_postorder.o
a - cholmod_rcond.o
a - cholmod_resymbol.o
a - cholmod_rowcolcounts.o
a - cholmod_rowfac.o
a - cholmod_solve.o
a - cholmod_spsolve.o
a - cholmod_drop.o
a - cholmod_horzcat.o
a - cholmod_norm.o
a - cholmod_scale.o
a - cholmod_sdmult.o
a - cholmod_ssmult.o
a - cholmod_submatrix.o
a - cholmod_vertcat.o
a - cholmod_symmetry.o
a - cholmod_rowadd.o
a - cholmod_rowdel.o
a - cholmod_updown.o
a - cholmod_super_numeric.o
a - cholmod_super_solve.o
a - cholmod_super_symbolic.o
a - cholmod_ccolamd.o
a - cholmod_csymamd.o
a - cholmod_metis.o
a - cholmod_nesdis.o
a - cholmod_camd.o
a - cholmod_l_aat.o
a - cholmod_l_add.o
a - cholmod_l_band.o
a - cholmod_l_change_factor.o
a - cholmod_l_common.o
a - cholmod_l_complex.o
a - cholmod_l_copy.o
a - cholmod_l_dense.o
a - cholmod_l_error.o
a - cholmod_l_factor.o
a - cholmod_l_memory.o
a - cholmod_l_sparse.o
a - cholmod_l_transpose.o
a - cholmod_l_triplet.o
a - cholmod_l_version.o
a - cholmod_l_check.o
a - cholmod_l_read.o
a - cholmod_l_write.o
a - cholmod_l_amd.o
a - cholmod_l_analyze.o
a - cholmod_l_colamd.o
a - cholmod_l_etree.o
a - cholmod_l_factorize.o
a - cholmod_l_postorder.o
a - cholmod_l_rcond.o
a - cholmod_l_resymbol.o
a - cholmod_l_rowcolcounts.o
a - cholmod_l_rowfac.o
a - cholmod_l_solve.o
a - cholmod_l_spsolve.o
a - cholmod_l_drop.o
a - cholmod_l_horzcat.o
a - cholmod_l_norm.o
a - cholmod_l_scale.o
a - cholmod_l_sdmult.o
a - cholmod_l_ssmult.o
a - cholmod_l_submatrix.o
a - cholmod_l_vertcat.o
a - cholmod_l_symmetry.o
a - cholmod_l_rowadd.o
a - cholmod_l_rowdel.o
a - cholmod_l_updown.o
a - cholmod_l_super_numeric.o
a - cholmod_l_super_solve.o
a - cholmod_l_super_symbolic.o
a - cholmod_l_ccolamd.o
a - cholmod_l_csymamd.o
a - cholmod_l_metis.o
a - cholmod_l_nesdis.o
a - cholmod_l_camd.o
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcholmod.a(cholmod_metis.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcholmod.a(cholmod_nesdis.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcholmod.a(cholmod_l_metis.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcholmod.a(cholmod_l_nesdis.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcholmod.a(cholmod_metis.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcholmod.a(cholmod_nesdis.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcholmod.a(cholmod_l_metis.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcholmod.a(cholmod_l_nesdis.o) has no symbols
ar: creating archive libumfpack.a
a - umf_i_analyze.o
a - umf_i_apply_order.o
a - umf_i_colamd.o
a - umf_i_free.o
a - umf_i_fsize.o
a - umf_i_is_permutation.o
a - umf_i_malloc.o
a - umf_i_realloc.o
a - umf_i_report_perm.o
a - umf_i_singletons.o
a - umf_i_cholmod.o
a - umf_l_analyze.o
a - umf_l_apply_order.o
a - umf_l_colamd.o
a - umf_l_free.o
a - umf_l_fsize.o
a - umf_l_is_permutation.o
a - umf_l_malloc.o
a - umf_l_realloc.o
a - umf_l_report_perm.o
a - umf_l_singletons.o
a - umf_l_cholmod.o
a - umfpack_gn_timer.o
a - umfpack_gn_tictoc.o
a - umf_di_lhsolve.o
a - umf_di_uhsolve.o
a - umf_di_triplet_map_nox.o
a - umf_di_triplet_nomap_x.o
a - umf_di_triplet_nomap_nox.o
a - umf_di_triplet_map_x.o
a - umf_di_assemble_fixq.o
a - umf_di_store_lu_drop.o
a - umf_di_assemble.o
a - umf_di_blas3_update.o
a - umf_di_build_tuples.o
a - umf_di_create_element.o
a - umf_di_dump.o
a - umf_di_extend_front.o
a - umf_di_garbage_collection.o
a - umf_di_get_memory.o
a - umf_di_init_front.o
a - umf_di_kernel.o
a - umf_di_kernel_init.o
a - umf_di_kernel_wrapup.o
a - umf_di_local_search.o
a - umf_di_lsolve.o
a - umf_di_ltsolve.o
a - umf_di_mem_alloc_element.o
a - umf_di_mem_alloc_head_block.o
a - umf_di_mem_alloc_tail_block.o
a - umf_di_mem_free_tail_block.o
a - umf_di_mem_init_memoryspace.o
a - umf_di_report_vector.o
a - umf_di_row_search.o
a - umf_di_scale_column.o
a - umf_di_set_stats.o
a - umf_di_solve.o
a - umf_di_symbolic_usage.o
a - umf_di_transpose.o
a - umf_di_tuple_lengths.o
a - umf_di_usolve.o
a - umf_di_utsolve.o
a - umf_di_valid_numeric.o
a - umf_di_valid_symbolic.o
a - umf_di_grow_front.o
a - umf_di_start_front.o
a - umf_di_store_lu.o
a - umf_di_scale.o
a - umfpack_di_wsolve.o
a - umfpack_di_col_to_triplet.o
a - umfpack_di_defaults.o
a - umfpack_di_free_numeric.o
a - umfpack_di_free_symbolic.o
a - umfpack_di_get_numeric.o
a - umfpack_di_get_lunz.o
a - umfpack_di_get_symbolic.o
a - umfpack_di_get_determinant.o
a - umfpack_di_numeric.o
a - umfpack_di_qsymbolic.o
a - umfpack_di_report_control.o
a - umfpack_di_report_info.o
a - umfpack_di_report_matrix.o
a - umfpack_di_report_numeric.o
a - umfpack_di_report_perm.o
a - umfpack_di_report_status.o
a - umfpack_di_report_symbolic.o
a - umfpack_di_report_triplet.o
a - umfpack_di_report_vector.o
a - umfpack_di_solve.o
a - umfpack_di_symbolic.o
a - umfpack_di_transpose.o
a - umfpack_di_triplet_to_col.o
a - umfpack_di_scale.o
a - umfpack_di_load_numeric.o
a - umfpack_di_save_numeric.o
a - umfpack_di_load_symbolic.o
a - umfpack_di_save_symbolic.o
a - umf_dl_lhsolve.o
a - umf_dl_uhsolve.o
a - umf_dl_triplet_map_nox.o
a - umf_dl_triplet_nomap_x.o
a - umf_dl_triplet_nomap_nox.o
a - umf_dl_triplet_map_x.o
a - umf_dl_assemble_fixq.o
a - umf_dl_store_lu_drop.o
a - umf_dl_assemble.o
a - umf_dl_blas3_update.o
a - umf_dl_build_tuples.o
a - umf_dl_create_element.o
a - umf_dl_dump.o
a - umf_dl_extend_front.o
a - umf_dl_garbage_collection.o
a - umf_dl_get_memory.o
a - umf_dl_init_front.o
a - umf_dl_kernel.o
a - umf_dl_kernel_init.o
a - umf_dl_kernel_wrapup.o
a - umf_dl_local_search.o
a - umf_dl_lsolve.o
a - umf_dl_ltsolve.o
a - umf_dl_mem_alloc_element.o
a - umf_dl_mem_alloc_head_block.o
a - umf_dl_mem_alloc_tail_block.o
a - umf_dl_mem_free_tail_block.o
a - umf_dl_mem_init_memoryspace.o
a - umf_dl_report_vector.o
a - umf_dl_row_search.o
a - umf_dl_scale_column.o
a - umf_dl_set_stats.o
a - umf_dl_solve.o
a - umf_dl_symbolic_usage.o
a - umf_dl_transpose.o
a - umf_dl_tuple_lengths.o
a - umf_dl_usolve.o
a - umf_dl_utsolve.o
a - umf_dl_valid_numeric.o
a - umf_dl_valid_symbolic.o
a - umf_dl_grow_front.o
a - umf_dl_start_front.o
a - umf_dl_store_lu.o
a - umf_dl_scale.o
a - umfpack_dl_wsolve.o
a - umfpack_dl_col_to_triplet.o
a - umfpack_dl_defaults.o
a - umfpack_dl_free_numeric.o
a - umfpack_dl_free_symbolic.o
a - umfpack_dl_get_numeric.o
a - umfpack_dl_get_lunz.o
a - umfpack_dl_get_symbolic.o
a - umfpack_dl_get_determinant.o
a - umfpack_dl_numeric.o
a - umfpack_dl_qsymbolic.o
a - umfpack_dl_report_control.o
a - umfpack_dl_report_info.o
a - umfpack_dl_report_matrix.o
a - umfpack_dl_report_numeric.o
a - umfpack_dl_report_perm.o
a - umfpack_dl_report_status.o
a - umfpack_dl_report_symbolic.o
a - umfpack_dl_report_triplet.o
a - umfpack_dl_report_vector.o
a - umfpack_dl_solve.o
a - umfpack_dl_symbolic.o
a - umfpack_dl_transpose.o
a - umfpack_dl_triplet_to_col.o
a - umfpack_dl_scale.o
a - umfpack_dl_load_numeric.o
a - umfpack_dl_save_numeric.o
a - umfpack_dl_load_symbolic.o
a - umfpack_dl_save_symbolic.o
a - umf_zi_lhsolve.o
a - umf_zi_uhsolve.o
a - umf_zi_triplet_map_nox.o
a - umf_zi_triplet_nomap_x.o
a - umf_zi_triplet_nomap_nox.o
a - umf_zi_triplet_map_x.o
a - umf_zi_assemble_fixq.o
a - umf_zi_store_lu_drop.o
a - umf_zi_assemble.o
a - umf_zi_blas3_update.o
a - umf_zi_build_tuples.o
a - umf_zi_create_element.o
a - umf_zi_dump.o
a - umf_zi_extend_front.o
a - umf_zi_garbage_collection.o
a - umf_zi_get_memory.o
a - umf_zi_init_front.o
a - umf_zi_kernel.o
a - umf_zi_kernel_init.o
a - umf_zi_kernel_wrapup.o
a - umf_zi_local_search.o
a - umf_zi_lsolve.o
a - umf_zi_ltsolve.o
a - umf_zi_mem_alloc_element.o
a - umf_zi_mem_alloc_head_block.o
a - umf_zi_mem_alloc_tail_block.o
a - umf_zi_mem_free_tail_block.o
a - umf_zi_mem_init_memoryspace.o
a - umf_zi_report_vector.o
a - umf_zi_row_search.o
a - umf_zi_scale_column.o
a - umf_zi_set_stats.o
a - umf_zi_solve.o
a - umf_zi_symbolic_usage.o
a - umf_zi_transpose.o
a - umf_zi_tuple_lengths.o
a - umf_zi_usolve.o
a - umf_zi_utsolve.o
a - umf_zi_valid_numeric.o
a - umf_zi_valid_symbolic.o
a - umf_zi_grow_front.o
a - umf_zi_start_front.o
a - umf_zi_store_lu.o
a - umf_zi_scale.o
a - umfpack_zi_wsolve.o
a - umfpack_zi_col_to_triplet.o
a - umfpack_zi_defaults.o
a - umfpack_zi_free_numeric.o
a - umfpack_zi_free_symbolic.o
a - umfpack_zi_get_numeric.o
a - umfpack_zi_get_lunz.o
a - umfpack_zi_get_symbolic.o
a - umfpack_zi_get_determinant.o
a - umfpack_zi_numeric.o
a - umfpack_zi_qsymbolic.o
a - umfpack_zi_report_control.o
a - umfpack_zi_report_info.o
a - umfpack_zi_report_matrix.o
a - umfpack_zi_report_numeric.o
a - umfpack_zi_report_perm.o
a - umfpack_zi_report_status.o
a - umfpack_zi_report_symbolic.o
a - umfpack_zi_report_triplet.o
a - umfpack_zi_report_vector.o
a - umfpack_zi_solve.o
a - umfpack_zi_symbolic.o
a - umfpack_zi_transpose.o
a - umfpack_zi_triplet_to_col.o
a - umfpack_zi_scale.o
a - umfpack_zi_load_numeric.o
a - umfpack_zi_save_numeric.o
a - umfpack_zi_load_symbolic.o
a - umfpack_zi_save_symbolic.o
a - umf_zl_lhsolve.o
a - umf_zl_uhsolve.o
a - umf_zl_triplet_map_nox.o
a - umf_zl_triplet_nomap_x.o
a - umf_zl_triplet_nomap_nox.o
a - umf_zl_triplet_map_x.o
a - umf_zl_assemble_fixq.o
a - umf_zl_store_lu_drop.o
a - umf_zl_assemble.o
a - umf_zl_blas3_update.o
a - umf_zl_build_tuples.o
a - umf_zl_create_element.o
a - umf_zl_dump.o
a - umf_zl_extend_front.o
a - umf_zl_garbage_collection.o
a - umf_zl_get_memory.o
a - umf_zl_init_front.o
a - umf_zl_kernel.o
a - umf_zl_kernel_init.o
a - umf_zl_kernel_wrapup.o
a - umf_zl_local_search.o
a - umf_zl_lsolve.o
a - umf_zl_ltsolve.o
a - umf_zl_mem_alloc_element.o
a - umf_zl_mem_alloc_head_block.o
a - umf_zl_mem_alloc_tail_block.o
a - umf_zl_mem_free_tail_block.o
a - umf_zl_mem_init_memoryspace.o
a - umf_zl_report_vector.o
a - umf_zl_row_search.o
a - umf_zl_scale_column.o
a - umf_zl_set_stats.o
a - umf_zl_solve.o
a - umf_zl_symbolic_usage.o
a - umf_zl_transpose.o
a - umf_zl_tuple_lengths.o
a - umf_zl_usolve.o
a - umf_zl_utsolve.o
a - umf_zl_valid_numeric.o
a - umf_zl_valid_symbolic.o
a - umf_zl_grow_front.o
a - umf_zl_start_front.o
a - umf_zl_store_lu.o
a - umf_zl_scale.o
a - umfpack_zl_wsolve.o
a - umfpack_zl_col_to_triplet.o
a - umfpack_zl_defaults.o
a - umfpack_zl_free_numeric.o
a - umfpack_zl_free_symbolic.o
a - umfpack_zl_get_numeric.o
a - umfpack_zl_get_lunz.o
a - umfpack_zl_get_symbolic.o
a - umfpack_zl_get_determinant.o
a - umfpack_zl_numeric.o
a - umfpack_zl_qsymbolic.o
a - umfpack_zl_report_control.o
a - umfpack_zl_report_info.o
a - umfpack_zl_report_matrix.o
a - umfpack_zl_report_numeric.o
a - umfpack_zl_report_perm.o
a - umfpack_zl_report_status.o
a - umfpack_zl_report_symbolic.o
a - umfpack_zl_report_triplet.o
a - umfpack_zl_report_vector.o
a - umfpack_zl_solve.o
a - umfpack_zl_symbolic.o
a - umfpack_zl_transpose.o
a - umfpack_zl_triplet_to_col.o
a - umfpack_zl_scale.o
a - umfpack_zl_load_numeric.o
a - umfpack_zl_save_numeric.o
a - umfpack_zl_load_symbolic.o
a - umfpack_zl_save_symbolic.o
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libumfpack.a(umf_di_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libumfpack.a(umf_dl_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libumfpack.a(umf_zi_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libumfpack.a(umf_zl_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libumfpack.a(umf_di_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libumfpack.a(umf_dl_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libumfpack.a(umf_zi_dump.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libumfpack.a(umf_zl_dump.o) has no symbols
ar: creating archive libspqr.a
a - spqr_rmap.o
a - SuiteSparseQR_C.o
a - SuiteSparseQR_expert.o
a - spqr_parallel.o
a - spqr_kernel.o
a - spqr_analyze.o
a - spqr_assemble.o
a - spqr_cpack.o
a - spqr_csize.o
a - spqr_fcsize.o
a - spqr_debug.o
a - spqr_front.o
a - spqr_factorize.o
a - spqr_freenum.o
a - spqr_freesym.o
a - spqr_freefac.o
a - spqr_fsize.o
a - spqr_maxcolnorm.o
a - spqr_rconvert.o
a - spqr_rcount.o
a - spqr_rhpack.o
a - spqr_rsolve.o
a - spqr_stranspose1.o
a - spqr_stranspose2.o
a - spqr_hpinv.o
a - spqr_1fixed.o
a - spqr_1colamd.o
a - SuiteSparseQR.o
a - spqr_1factor.o
a - spqr_cumsum.o
a - spqr_shift.o
a - spqr_happly.o
a - spqr_panel.o
a - spqr_happly_work.o
a - SuiteSparseQR_qmult.o
a - spqr_trapezoidal.o
a - spqr_larftb.o
a - spqr_append.o
a - spqr_type.o
a - spqr_tol.o
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libspqr.a(spqr_parallel.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libspqr.a(spqr_debug.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libspqr.a(spqr_parallel.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libspqr.a(spqr_debug.o) has no symbols
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   527  100   527    0     0    750      0 --:--:-- --:--:-- --:--:--   749
100  434k  100  434k    0     0   243k      0  0:00:01  0:00:01 --:--:-- 2217k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   513  100   513    0     0    777      0 --:--:-- --:--:-- --:--:--   777
100 81450  100 81450    0     0  56133      0  0:00:01  0:00:01 --:--:--  136k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   499  100   499    0     0    740      0 --:--:-- --:--:-- --:--:--   739
100  7946  100  7946    0     0   6486      0  0:00:01  0:00:01 --:--:--  6486
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   519  100   519    0     0    585      0 --:--:-- --:--:-- --:--:--   585
100  137M  100  137M    0     0  3348k      0  0:00:42  0:00:42 --:--:-- 5433k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   503  100   503    0     0    692      0 --:--:-- --:--:-- --:--:--   691
100 1222k  100 1222k    0     0   579k      0  0:00:02  0:00:02 --:--:-- 1784k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   495  100   495    0     0    689      0 --:--:-- --:--:-- --:--:--   688
100  534k  100  534k    0     0   296k      0  0:00:01  0:00:01 --:--:-- 1037k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   505  100   505    0     0    780      0 --:--:-- --:--:-- --:--:--   779
100  993k  100  993k    0     0   495k      0  0:00:02  0:00:02 --:--:-- 1465k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   503  100   503    0     0    712      0 --:--:-- --:--:-- --:--:--   711
100  214k  100  214k    0     0   128k      0  0:00:01  0:00:01 --:--:--  558k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   505  100   505    0     0    719      0 --:--:-- --:--:-- --:--:--   718
100  633k  100  633k    0     0   325k      0  0:00:01  0:00:01 --:--:-- 1238k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   505  100   505    0     0    723      0 --:--:-- --:--:-- --:--:--   723
100  700k  100  700k    0     0   359k      0  0:00:01  0:00:01 --:--:-- 1105k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   459  100   459    0     0    918      0 --:--:-- --:--:-- --:--:--   916
100  218k  100  218k    0     0   150k      0  0:00:01  0:00:01 --:--:--  742k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   497  100   497    0     0    727      0 --:--:-- --:--:-- --:--:--   726
100  388k  100  388k    0     0   216k      0  0:00:01  0:00:01 --:--:-- 1840k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   497  100   497    0     0    695      0 --:--:-- --:--:-- --:--:--   695
100  151k  100  151k    0     0  89891      0  0:00:01  0:00:01 --:--:--  170k
ar: creating archive libutf8proc.a
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   499  100   499    0     0    519      0 --:--:-- --:--:-- --:--:--   518
100  131k  100  131k    0     0  62123      0  0:00:02  0:00:02 --:--:--  175k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   501  100   501    0     0    735      0 --:--:-- --:--:-- --:--:--   734
100  713k  100  713k    0     0   375k      0  0:00:01  0:00:01 --:--:-- 1111k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   497  100   497    0     0   1000      0 --:--:-- --:--:-- --:--:--   997
100  4183  100  4183    0     0   3761      0  0:00:01  0:00:01 --:--:-- 2042k
WARNING: using mismatched version for 5.4.0:
  want
Creating usr/etc/julia/startup.jl
Copying in usr/share/man/man1/julia.1
/Users/crstnbr/compiled/julia-mkl/contrib/install.sh 755 /Users/crstnbr/compiled/julia-mkl/contrib/julia-config.jl /Users/crstnbr/compiled/julia-mkl/usr/share/julia/
PATH="/Users/crstnbr/bin:/Applications/Julia-1.4.app/Contents/Resources/julia/bin:/Users/crstnbr/opt/anaconda3/bin:/Users/crstnbr/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/Users/crstnbr/compiled/julia-mkl/usr/tools" PATCHELF="/Users/crstnbr/compiled/julia-mkl/usr/tools/patchelf" /Users/crstnbr/compiled/julia-mkl/contrib/fixup-libgfortran.sh --verbose /Users/crstnbr/compiled/julia-mkl/usr/lib
Discovered traces of libgfortran within .
Got SONAMES of
    PERL base/pcre_h.jl
    PERL base/errno_h.jl
    PERL base/build_h.jl.phony
    PERL base/file_constants.jl
    PERL base/uv_constants.jl
    PERL base/version_git.jl.phony
make[1]: *** [/Users/crstnbr/compiled/julia-mkl/usr/lib/julia/libimf.dylib] Error 1
make: *** [julia-base] Error 2

I realize that this is using clang and gfortan. Trying to set USEICC=1 and USEIFC=1 fails with error USE_LIBCPP only supported with clang. Try setting USE_LIBCPP=0.

I wonder why using MKL and Intel’s LIBM isn’t as straightforward as on Linux, where I never had any issues.

Any thoughts, comments, suggestions?

Thanks in advance,
Carsten

Alright, I found https://github.com/JuliaLang/julia/issues/33691 and the instructions therein worked for me. Unfortunately it is not exactly straightforward, see the compilation below.

Build Julia with Intel MKL and Intel LIBM on macOS

  1. Install Intel Parallel Studio XE (includes both MKL and LIBM)

  2. git clone git://github.com/JuliaLang/julia.git
    cd julia
    git checkout v1.4.0
    source /opt/intel/bin/compilervars.sh intel64
    
  3. echo "USE_INTEL_MKL = 1" >> Make.user
    echo "USE_INTEL_LIBM = 1" >> Make.user
    
  4. For MKL:

    mkdir -p usr/lib/julia # This didn't exist yet in fresh clone
    ln -s /opt/intel/mkl/lib/libmkl_rt.dylib usr/lib/julia/libmkl_rt.dylib
    ln -s /opt/intel/compilers_and_libraries_2020.1.216/mac/compiler/lib/libirc.dylib usr/lib/julia/libirc.dylib
    
  5. For LIBM:

    ln -s /opt/intel/compilers_and_libraries_2020.1.216/mac/compiler/lib/libimf.dylib usr/lib/julia/libimf.dylib
    ln -s /opt/intel/compilers_and_libraries_2020.1.216/mac/compiler/lib/libintlc.dylib usr/lib/julia/libintlc.dylib
    
  6. make -j 4

  7. Enjoy!

Quick benchmark

Julia 1.4.0 binaries

julia> using LinearAlgebra

julia> using BenchmarkTools

julia> A = rand(1000,1000); B = rand(1000,1000);

julia> @btime $A * $B;
  8.085 ms (2 allocations: 7.63 MiB)

julia> @btime eigen($A);
  720.718 ms (52 allocations: 31.58 MiB)

julia> x = rand(1_000_000);

julia> @btime sinh.($x);
  15.212 ms (2 allocations: 7.63 MiB)

Julia 1.4.0 build with MKL/LIBM

julia> A = rand(1000,1000); B = rand(1000,1000);

julia> @btime $A * $B;
  7.419 ms (2 allocations: 7.63 MiB)

julia> 7.419 / 8.085 # compared to binaries
0.917625231910946

julia> @btime eigen($A);
  455.751 ms (46 allocations: 33.53 MiB)

julia> 455.751 / 720.718 # compared to binaries
0.6323568996472961

julia> x = rand(1_000_000);

julia> @btime sinh.($x);
  10.025 ms (2 allocations: 7.63 MiB)

julia> 10.025 / 15.212 # compared to binaries
0.6590191953720748
4 Likes

Thanks for letting know how you were able to build successfully.

For MKL, did you try https://github.com/JuliaComputing/MKL.jl?

Hi have tried it a few years back, when it had a bunch of caveats and wasn’t 100% there yet. It seems like the situation has improved a lot and probably MKL.jl is the best solution for regular users nowadays. In my case, I also want libimf (Intel Math Library) and am playing around with JIT event flags, so including MKL during building seems more straightforward (if it weren’t for the issues above). I want to give it another try though.

1 Like

Mind trying something like

julia> using BenchmarkTools, SpecialFunctions

julia> @btime erf(1.5)
  27.200 ns (0 allocations: 0 bytes)
0.9661051464753108

with and without libimf?

Unfortunately, precompilation of SpecialFunctions.jl fails for the mkl/libimf Julia - apparently a problem with CompilerSupportLibraries_jll.

FWIW, on SpecialFunctions#master I get

julia> using SpecialFunctions
[ Info: Precompiling SpecialFunctions [276daf66-3868-5448-9aa4-cd146d93841b]
ERROR: LoadError: LoadError: InitError: could not load library "/Users/crstnbr/.julia-mkl/artifacts/7c9ef733699a1d86b8a6073ed08a4457e3e790f7/lib/libgfortran.5.dylib"
dlopen(/Users/crstnbr/.julia-mkl/artifacts/7c9ef733699a1d86b8a6073ed08a4457e3e790f7/lib/libgfortran.5.dylib, 1): Library not loaded: @rpath/libquadmath.0.dylib
  Referenced from: /Users/crstnbr/.julia-mkl/artifacts/7c9ef733699a1d86b8a6073ed08a4457e3e790f7/lib/libgfortran.5.dylib
  Reason: image not found
Stacktrace:
 [1] dlopen(::String, ::UInt32; throw_error::Bool) at /Users/crstnbr/compiled/julia-mkl/usr/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109
 [2] dlopen at /Users/crstnbr/compiled/julia-mkl/usr/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109 [inlined] (repeats 2 times)
 [3] __init__() at /Users/crstnbr/.julia-mkl/packages/CompilerSupportLibraries_jll/kmL78/src/wrappers/x86_64-apple-darwin14-libgfortran5.jl:86
 [4] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:697
 [5] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:781
 [6] _require(::Base.PkgId) at ./loading.jl:1006
 [7] require(::Base.PkgId) at ./loading.jl:927
 [8] require(::Module, ::Symbol) at ./loading.jl:922
 [9] include(::Module, ::String) at ./Base.jl:377
 [10] include(::String) at /Users/crstnbr/.julia-mkl/packages/OpenSpecFun_jll/HMSwk/src/OpenSpecFun_jll.jl:1
 [11] top-level scope at /Users/crstnbr/.julia-mkl/packages/OpenSpecFun_jll/HMSwk/src/OpenSpecFun_jll.jl:50
 [12] include(::Module, ::String) at ./Base.jl:377
 [13] top-level scope at none:2
 [14] eval at ./boot.jl:331 [inlined]
 [15] eval(::Expr) at ./client.jl:449
 [16] top-level scope at ./none:3
during initialization of module CompilerSupportLibraries_jll
in expression starting at /Users/crstnbr/.julia-mkl/packages/OpenSpecFun_jll/HMSwk/src/wrappers/x86_64-apple-darwin14-libgfortran5.jl:4
in expression starting at /Users/crstnbr/.julia-mkl/packages/OpenSpecFun_jll/HMSwk/src/OpenSpecFun_jll.jl:43
ERROR: LoadError: Failed to precompile OpenSpecFun_jll [efe28fd5-8261-553b-a9e1-b2916fc3738e] to /Users/crstnbr/.julia-mkl/compiled/v1.4/OpenSpecFun_jll/TDl1L_DHaWG.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1272
 [3] _require(::Base.PkgId) at ./loading.jl:1029
 [4] require(::Base.PkgId) at ./loading.jl:927
 [5] require(::Module, ::Symbol) at ./loading.jl:922
 [6] include(::Module, ::String) at ./Base.jl:377
 [7] top-level scope at none:2
 [8] eval at ./boot.jl:331 [inlined]
 [9] eval(::Expr) at ./client.jl:449
 [10] top-level scope at ./none:3
in expression starting at /Users/crstnbr/.julia-mkl/packages/SpecialFunctions/LCiT7/src/SpecialFunctions.jl:3
ERROR: Failed to precompile SpecialFunctions [276daf66-3868-5448-9aa4-cd146d93841b] to /Users/crstnbr/.julia-mkl/compiled/v1.4/SpecialFunctions/78gOt_DHaWG.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1272
 [3] _require(::Base.PkgId) at ./loading.jl:1029
 [4] require(::Base.PkgId) at ./loading.jl:927
 [5] require(::Module, ::Symbol) at ./loading.jl:922

Hmm, I don’t know what “image not found” means. Was that a symbol it was trying to find in libgfortran?

You could try export JULIA_SPECIALFUNCTIONS_BUILD_SOURCE=true to see if you can get it to build from source. Not important if you don’t use SpecialFunctions or any library that depends on it (like Distributions, which also depends on ARPACK, which consistently has MKL-related problems).