@@ -17,7 +17,7 @@ import (
1717const (
1818 rootEnvKey = "ONEAPI_ROOT"
1919
20- baseURL = "https://software .intel.com/en- us/oneapi/"
20+ baseURL = "https://www .intel.com/content/www/ us/en/developer/tools/ oneapi/overview "
2121
2222 formatStr = `The following tools are needed to build this sample but are not locally installed: (%s)
2323You may continue and view the sample without the prerequisites. To install the missing prerequisites, visit:
@@ -28,11 +28,10 @@ You may continue and view the sample without the prerequisites. To install the m
2828 compilerReg = "compiler\\ |(.*)"
2929)
3030
31- //CheckDeps as
31+ // CheckDeps as
3232func CheckDeps (dependencies []string , root string ) (msg string , errCode int ) {
3333 //dependencies are both "normal" component dependencies ( ["mkl", "vtune"])
3434 //and "special" dependencies ( ["pkg|mraa", "compiler|icc"])
35-
3635 componentDeps , specialDeps := separatethSheepsGoats (dependencies )
3736
3837 componentMsg , componentErrCode := checkComponentDeps (componentDeps , root )
@@ -145,30 +144,30 @@ func checkCompilerDeps(compilerDeps []string, root string) (msg string, errCode
145144 var missing []string
146145
147146 winCompilers := map [string ]string {
148- "icc" : "windows/ bin/intel64/icl.exe" ,
149- "fortran" : "windows/ bin/intel64/ifort.exe" ,
150- "dpcpp" : "windows/ bin/dpcpp.exe" ,
151- "icpc" : "windows/ bin/intel64/icpc.exe" ,
152- "icx" : "windows/ bin/icx.exe" ,
153- "icpcx" : "windows/ bin/icpcx.exe" ,
154- "ifx" : "windows/ bin/ifx.exe" ,
147+ "icc" : "bin/intel64/icl.exe" ,
148+ "fortran" : "bin/intel64/ifort.exe" ,
149+ "dpcpp" : "bin/dpcpp.exe" ,
150+ "icpc" : "bin/intel64/icpc.exe" ,
151+ "icx" : "bin/icx.exe" ,
152+ "icpcx" : "bin/icpcx.exe" ,
153+ "ifx" : "bin/ifx.exe" ,
155154 }
156155 linCompilers := map [string ]string {
157- "icc" : "linux/ bin/intel64/icc" ,
158- "fortran" : "linux/ bin/intel64/ifort" ,
159- "dpcpp" : "linux/ bin/dpcpp" ,
160- "icpc" : "linux/ bin/intel64/icpc" ,
161- "icx" : "linux/ bin/icx" ,
162- "icpcx" : "linux/ bin/icpcx" ,
163- "ifx" : "linux/ bin/ifx" ,
156+ "icc" : "bin/intel64/icc" ,
157+ "fortran" : "bin/intel64/ifort" ,
158+ "dpcpp" : "bin/dpcpp" ,
159+ "icpc" : "bin/intel64/icpc" ,
160+ "icx" : "bin/icx" ,
161+ "icpcx" : "bin/icpcx" ,
162+ "ifx" : "bin/ifx" ,
164163 }
165164 macCompilers := map [string ]string {
166- "icpc" : "mac/ bin/intel64/icpc" ,
167- "icc" : "mac/ bin/intel64/icc" ,
168- "ifort" : "mac/ bin/intel64/ifort" ,
169- "icx" : "mac/ bin/icx" ,
170- "icpcx" : "mac/ bin/icpcx" ,
171- "ifx" : "mac/ bin/ifx" ,
165+ "icpc" : "bin/intel64/icpc" ,
166+ "icc" : "bin/intel64/icc" ,
167+ "ifort" : "bin/intel64/ifort" ,
168+ "icx" : "bin/icx" ,
169+ "icpcx" : "bin/icpcx" ,
170+ "ifx" : "bin/ifx" ,
172171 }
173172
174173 compilerRoot := GetCompilerRoot (root )
@@ -220,19 +219,28 @@ func checkSpecialDeps(specialDependencies []string, root string) (msg string, er
220219 return msg , errCode
221220}
222221
223- //GetOneAPIRoot gets the root the OneAPI installation
224- //based on the ONEAPI_ROOT
222+ // GetOneAPIRoot gets the root the OneAPI installation
223+ // based on the ONEAPI_ROOT
225224func GetOneAPIRoot () (path string , err error ) {
226225 root , ok := os .LookupEnv (rootEnvKey )
226+
227227 if ! ok {
228228 return "" , fmt .Errorf ("%s not defined. Be sure to run oneapi environment script ( source setvars.sh )" , rootEnvKey )
229229 }
230+
231+ tmp := filepath .Dir (root )
232+ tmp = strings .ToLower (filepath .Base (tmp ))
233+ if tmp == "oneapi" {
234+ return filepath .Dir (root ), nil
235+ }
236+
230237 return root , nil
231238}
232239
233240// CMPLR_ROOT was, for awhile, always defined in the environment. But no longer.
234241func GetCompilerRoot (root string ) (compilerRoot string ) {
235- return filepath .Join (root , "compiler" , "latest" )
242+ compilerRoot = filepath .Join (root , "compiler" , "latest" )
243+ return compilerRoot
236244}
237245
238246type suiteComponent struct {
@@ -265,7 +273,7 @@ func GenerateMessage(missing []string) string {
265273
266274 //5. return message with url.
267275
268- //baseURL := "https://software .intel.com/en- us/oneapi" // this is captured in format String
276+ //baseURL := "https://www .intel.com/content/www/ us/en/developer/tools/ oneapi/overview " // this is captured in format String
269277 var slug string
270278 fallbackMsg := fmt .Sprintf (formatStr , strings .Join (missing , " " ), baseURL , slug )
271279
@@ -342,7 +350,7 @@ func readSomeJSON(path string, something interface{}) error {
342350 return nil
343351}
344352
345- //keeping the same interface as the file reading function for now.
353+ // keeping the same interface as the file reading function for now.
346354func parseSomeJSON (str string , something interface {}) error {
347355 json .Unmarshal ([]byte (str ), something )
348356 return nil
0 commit comments