@@ -23,6 +23,36 @@ echo_and_restore() {
2323}
2424alias print=' { save_flags="$-"; set +x; } 2> /dev/null; echo_and_restore'
2525
26+ # append-path VAR PATH
27+ append-path () {
28+ var=$1
29+ path=$2
30+ if [ " ${! var} " != " " ]; then
31+ eval $var +=:$path
32+ else
33+ eval $var +=$path
34+ fi
35+ }
36+
37+ # prepend-path VAR PATH
38+ prepend-path () {
39+ var=$1
40+ path=$2
41+ if [ " ${! var} " != " " ]; then
42+ eval $var =$path :${! var}
43+ else
44+ eval $var =$path
45+ fi
46+ }
47+
48+ # remove-path VAR PATH
49+ remove-path () {
50+ var=$1
51+ path=$2
52+ val=$( echo ${! var} | perl -pe " s%:$path |$path :?%%" )
53+ eval $var =$val
54+ }
55+
2656
2757# -------------------------------------------------------------------------------
2858quiet source /etc/profile
@@ -32,8 +62,40 @@ export top=$(pwd)
3262
3363shopt -s expand_aliases
3464
35- quiet module load intel-oneapi-mkl
36- print " MKLROOT=${MKLROOT} "
65+ print " maker = '${maker} '"
66+ print " device = '${device} '"
67+ print " blas = '${blas} '"
68+ print " blas_int = '${blas_int} '"
69+ print " bla_vendor = '${bla_vendor} '"
70+ print " check = '${check} '"
71+
72+ export CPATH LIBRARY_PATH LD_LIBRARY_PATH
73+
74+ if [ " ${blas} " = " mkl" ] || [[ " ${bla_vendor} " = Intel* ]]; then
75+ # See also Intel compiler below.
76+ quiet module load intel-oneapi-mkl
77+ print " MKLROOT=${MKLROOT} "
78+
79+ elif [ " ${blas} " = " openblas" -o " ${bla_vendor} " = " OpenBLAS" ]; then
80+ # 2025-04: This is int32 version.
81+ # The openblas/0.3.27/gcc-11.4.1-y3rjih module has libopenblas64_.so
82+ quiet module load openblas/0.3.27/gcc-11.4.1-jfkp5p
83+
84+ quiet append-path CPATH ${ICL_OPENBLAS_ROOT} /include
85+ quiet append-path LIBRARY_PATH ${ICL_OPENBLAS_ROOT} /lib
86+ quiet append-path LD_LIBRARY_PATH ${ICL_OPENBLAS_ROOT} /lib
87+
88+ elif [ " ${blas} " = " blis" -o " ${bla_vendor} " = " AOCL" -o " ${bla_vendor} " = " FLAME" ]; then
89+ quiet module load amd-aocl
90+
91+ quiet append-path CPATH ${ICL_AMDBLIS_ROOT} /include/blis
92+ quiet append-path LIBRARY_PATH ${ICL_AMDBLIS_ROOT} /lib
93+ quiet append-path LD_LIBRARY_PATH ${ICL_AMDBLIS_ROOT} /lib
94+
95+ quiet append-path CPATH ${ICL_AMDLIBFLAME_ROOT} /include
96+ quiet append-path LIBRARY_PATH ${ICL_AMDLIBFLAME_ROOT} /lib
97+ quiet append-path LD_LIBRARY_PATH ${ICL_AMDLIBFLAME_ROOT} /lib
98+ fi
3799
38100quiet module load python
39101quiet which python
@@ -49,18 +111,11 @@ export gpu_backend=none
49111export color=no
50112export CXXFLAGS=" -Werror -Wno-unused-command-line-argument"
51113
52- # Test int64 build with make/cuda and cmake/amd.
53- # Test int32 build with cmake/cuda and make/amd and all others.
54- if [ " ${maker} " = " make" -a " ${device} " = " gpu_nvidia" ]; then
55- export blas_int=int64
56- elif [ " ${maker} " = " cmake" -a " ${device} " = " gpu_amd" ]; then
57- export blas_int=int64
58- else
59- export blas_int=int32
60- fi
61-
62114# ----------------------------------------------------------------- Compiler
63- if [ " ${device} " = " gpu_intel" ]; then
115+ if [ " ${device} " = " gpu_intel" ] || [[ " ${bla_vendor} " = Intel* ]]; then
116+ # Re: bla_vendor = Intel*, apparently, CMake can't find MKL using g++,
117+ # only using Intel icpx.
118+ # This is one reason BLAS++ implements its own BLASFinder.
64119 print " ======================================== Load Intel oneAPI compiler"
65120 quiet module load intel-oneapi-compilers
66121else
0 commit comments