|
| 1 | +# # BEGIN_ICS_COPYRIGHT8 **************************************** |
| 2 | +# |
| 3 | +# Copyright (c) 2015-2024, Intel Corporation |
| 4 | +# |
| 5 | +# Redistribution and use in source and binary forms, with or without |
| 6 | +# modification, are permitted provided that the following conditions are met: |
| 7 | +# |
| 8 | +# * Redistributions of source code must retain the above copyright notice, |
| 9 | +# this list of conditions and the following disclaimer. |
| 10 | +# * Redistributions in binary form must reproduce the above copyright |
| 11 | +# notice, this list of conditions and the following disclaimer in the |
| 12 | +# documentation and/or other materials provided with the distribution. |
| 13 | +# * Neither the name of Intel Corporation nor the names of its contributors |
| 14 | +# may be used to endorse or promote products derived from this software |
| 15 | +# without specific prior written permission. |
| 16 | +# |
| 17 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 18 | +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 | +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 | +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE |
| 21 | +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 22 | +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 23 | +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 24 | +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 25 | +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | +# |
| 28 | +# END_ICS_COPYRIGHT8 **************************************** |
| 29 | +# |
| 30 | +# -- High Performance Computing Linpack Benchmark (HPL) |
| 31 | +# HPL - 2.2 - February 24, 2016 |
| 32 | +# Antoine P. Petitet |
| 33 | +# University of Tennessee, Knoxville |
| 34 | +# Innovative Computing Laboratory |
| 35 | +# (C) Copyright 2000-2008 All Rights Reserved |
| 36 | +# |
| 37 | +# -- Copyright notice and Licensing terms: |
| 38 | +# |
| 39 | +# Redistribution and use in source and binary forms, with or without |
| 40 | +# modification, are permitted provided that the following conditions |
| 41 | +# are met: |
| 42 | +# |
| 43 | +# 1. Redistributions of source code must retain the above copyright |
| 44 | +# notice, this list of conditions and the following disclaimer. |
| 45 | +# |
| 46 | +# 2. Redistributions in binary form must reproduce the above copyright |
| 47 | +# notice, this list of conditions, and the following disclaimer in the |
| 48 | +# documentation and/or other materials provided with the distribution. |
| 49 | +# |
| 50 | +# 3. All advertising materials mentioning features or use of this |
| 51 | +# software must display the following acknowledgement: |
| 52 | +# This product includes software developed at the University of |
| 53 | +# Tennessee, Knoxville, Innovative Computing Laboratory. |
| 54 | +# |
| 55 | +# 4. The name of the University, the name of the Laboratory, or the |
| 56 | +# names of its contributors may not be used to endorse or promote |
| 57 | +# products derived from this software without specific written |
| 58 | +# permission. |
| 59 | +# |
| 60 | +# -- Disclaimer: |
| 61 | +# |
| 62 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 63 | +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 64 | +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 65 | +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY |
| 66 | +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 67 | +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 68 | +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 69 | +# DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 70 | +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 71 | +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 72 | +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 73 | +# ###################################################################### |
| 74 | +# |
| 75 | +# ---------------------------------------------------------------------- |
| 76 | +# - shell -------------------------------------------------------------- |
| 77 | +# ---------------------------------------------------------------------- |
| 78 | +# |
| 79 | +SHELL = /bin/sh |
| 80 | +# |
| 81 | +CD = cd |
| 82 | +CP = cp |
| 83 | +LN_S = ln -sf |
| 84 | +MKDIR = mkdir -p |
| 85 | +RM = /bin/rm -f |
| 86 | +TOUCH = touch |
| 87 | +# |
| 88 | +# ---------------------------------------------------------------------- |
| 89 | +# - Platform identifier ------------------------------------------------ |
| 90 | +# ---------------------------------------------------------------------- |
| 91 | +# |
| 92 | +ARCH = ICS.Linux.MKL-gcc |
| 93 | +# |
| 94 | +# ---------------------------------------------------------------------- |
| 95 | +# - HPL Directory Structure / HPL library ------------------------------ |
| 96 | +# ---------------------------------------------------------------------- |
| 97 | +# |
| 98 | +TOPdir = $(HPL_HOME_DIR) |
| 99 | +INCdir = $(TOPdir)/include |
| 100 | +BINdir = $(TOPdir)/bin/$(ARCH) |
| 101 | +LIBdir = $(TOPdir)/lib/$(ARCH) |
| 102 | +# |
| 103 | +HPLlib = $(LIBdir)/libhpl.a |
| 104 | +# |
| 105 | +# ---------------------------------------------------------------------- |
| 106 | +# - Message Passing library (MPI) -------------------------------------- |
| 107 | +# ---------------------------------------------------------------------- |
| 108 | +# MPinc tells the C compiler where to find the Message Passing library |
| 109 | +# header files, MPlib is defined to be the name of the library to be |
| 110 | +# used. The variable MPdir is only used for defining MPinc and MPlib. |
| 111 | +# |
| 112 | +MPdir = |
| 113 | +MPinc = |
| 114 | +MPlib = |
| 115 | + |
| 116 | +# |
| 117 | +# ---------------------------------------------------------------------- |
| 118 | +# - Linear Algebra library (BLAS or VSIPL) ----------------------------- |
| 119 | +# ---------------------------------------------------------------------- |
| 120 | +# LAinc tells the C compiler where to find the Linear Algebra library |
| 121 | +# header files, LAlib is defined to be the name of the library to be |
| 122 | +# used. The variable LAdir is only used for defining LAinc and LAlib. |
| 123 | + |
| 124 | +ifndef MKLROOT |
| 125 | +MKLROOT = $(shell if [ -e /opt/intel/oneapi/mkl/latest/lib ]; then echo /opt/intel/oneapi/mkl/latest; else echo /opt/intel/mkl; fi) |
| 126 | +endif |
| 127 | +LAdir = $(MKLROOT) |
| 128 | +ifndef LAinc |
| 129 | +LAinc = -I$(LAdir)/include |
| 130 | +endif |
| 131 | +ifndef LAlib |
| 132 | +ifneq (,$(wildcard $(LAdir)/lib/libmkl_core.a)) |
| 133 | +# Flags generated using https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html |
| 134 | +LAlib = -L$(LAdir)/lib \ |
| 135 | + -Wl,--start-group \ |
| 136 | + $(LAdir)/lib/libmkl_intel_lp64.a \ |
| 137 | + $(LAdir)/lib/libmkl_gnu_thread.a \ |
| 138 | + $(LAdir)/lib/libmkl_core.a \ |
| 139 | + -Wl,--end-group -lgomp -lpthread -lm -ldl |
| 140 | +else ifneq (,$(wildcard $(LAdir)/lib/intel64/libmkl_core.a)) |
| 141 | +LAlib = -L$(LAdir)/lib/intel64 \ |
| 142 | + -Wl,--start-group \ |
| 143 | + $(LAdir)/lib/intel64/libmkl_intel_lp64.a \ |
| 144 | + $(LAdir)/lib/intel64/libmkl_gnu_thread.a \ |
| 145 | + $(LAdir)/lib/intel64/libmkl_core.a \ |
| 146 | + -Wl,--end-group -lgomp -lpthread -lm -ldl |
| 147 | +endif |
| 148 | +endif |
| 149 | + |
| 150 | +# |
| 151 | +# ---------------------------------------------------------------------- |
| 152 | +# - F77 / C interface -------------------------------------------------- |
| 153 | +# ---------------------------------------------------------------------- |
| 154 | +# You can skip this section if and only if you are not planning to use |
| 155 | +# a BLAS library featuring a Fortran 77 interface. Otherwise, it is |
| 156 | +# necessary to fill out the F2CDEFS variable with the appropriate |
| 157 | +# options. **One and only one** option should be chosen in **each** of |
| 158 | +# the 3 following categories: |
| 159 | +# |
| 160 | +# 1) name space (How C calls a Fortran 77 routine) |
| 161 | +# |
| 162 | +# -DAdd_ : all lower case and a suffixed underscore (Suns, |
| 163 | +# Intel, ...), [default] |
| 164 | +# -DNoChange : all lower case (IBM RS6000), |
| 165 | +# -DUpCase : all upper case (Cray), |
| 166 | +# -DAdd__ : the FORTRAN compiler in use is f2c. |
| 167 | +# |
| 168 | +# 2) C and Fortran 77 integer mapping |
| 169 | +# |
| 170 | +# -DF77_INTEGER=int : Fortran 77 INTEGER is a C int, [default] |
| 171 | +# -DF77_INTEGER=long : Fortran 77 INTEGER is a C long, |
| 172 | +# -DF77_INTEGER=short : Fortran 77 INTEGER is a C short. |
| 173 | +# |
| 174 | +# 3) Fortran 77 string handling |
| 175 | +# |
| 176 | +# -DStringSunStyle : The string address is passed at the string loca- |
| 177 | +# tion on the stack, and the string length is then |
| 178 | +# passed as an F77_INTEGER after all explicit |
| 179 | +# stack arguments, [default] |
| 180 | +# -DStringStructPtr : The address of a structure is passed by a |
| 181 | +# Fortran 77 string, and the structure is of the |
| 182 | +# form: struct {char *cp; F77_INTEGER len;}, |
| 183 | +# -DStringStructVal : A structure is passed by value for each Fortran |
| 184 | +# 77 string, and the structure is of the form: |
| 185 | +# struct {char *cp; F77_INTEGER len;}, |
| 186 | +# -DStringCrayStyle : Special option for Cray machines, which uses |
| 187 | +# Cray fcd (fortran character descriptor) for |
| 188 | +# interoperation. |
| 189 | +# |
| 190 | +F2CDEFS = |
| 191 | +# |
| 192 | +# ---------------------------------------------------------------------- |
| 193 | +# - HPL includes / libraries / specifics ------------------------------- |
| 194 | +# ---------------------------------------------------------------------- |
| 195 | +# |
| 196 | +HPL_INCLUDES = -I$(INCdir) -I$(INCdir)/$(ARCH) $(LAinc) $(MPinc) |
| 197 | +HPL_LIBS = $(HPLlib) $(LAlib) $(MPlib) |
| 198 | + |
| 199 | +# |
| 200 | +# - Compile time options ----------------------------------------------- |
| 201 | +# |
| 202 | +# -DHPL_COPY_L force the copy of the panel L before bcast; |
| 203 | +# -DHPL_CALL_CBLAS call the cblas interface; |
| 204 | +# -DHPL_CALL_VSIPL call the vsip library; |
| 205 | +# -DHPL_DETAILED_TIMING enable detailed timers; |
| 206 | +# |
| 207 | +# By default HPL will: |
| 208 | +# *) not copy L before broadcast, |
| 209 | +# *) call the BLAS Fortran 77 interface, |
| 210 | +# *) not display detailed timing information. |
| 211 | +# |
| 212 | +# HPL_OPTS = |
| 213 | + |
| 214 | +# |
| 215 | +# ---------------------------------------------------------------------- |
| 216 | +# |
| 217 | +HPL_DEFS = $(F2CDEFS) $(HPL_OPTS) $(HPL_INCLUDES) |
| 218 | +# |
| 219 | +# ---------------------------------------------------------------------- |
| 220 | +# - Compilers / linkers - Optimization flags --------------------------- |
| 221 | +# ---------------------------------------------------------------------- |
| 222 | +# |
| 223 | +CC = $(MPICC) |
| 224 | +CCNOOPT = $(HPL_DEFS) |
| 225 | +CCFLAGS = $(HPL_DEFS) -fomit-frame-pointer -O3 -funroll-loops -DMKL_ILP64 -m64 |
| 226 | +# |
| 227 | +LINKER = $(MPICC) |
| 228 | +LINKFLAGS = $(CCFLAGS) |
| 229 | +# |
| 230 | +ARCHIVER = ar |
| 231 | +ARFLAGS = r |
| 232 | +RANLIB = echo |
| 233 | +# |
| 234 | +# ---------------------------------------------------------------------- |
0 commit comments