Merge remote-tracking branch 'origin/6.1'
[scilab.git] / scilab / modules / dynamic_link / macros / detectmsifort64tools.sci
1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) DIGITEO - Allan CORNET
3 //
4 // Copyright (C) 2012 - 2016 - Scilab Enterprises
5 //
6 // This file is hereby licensed under the terms of the GNU GPL v2.0,
7 // pursuant to article 5.3.4 of the CeCILL v.2.1.
8 // This file was originally licensed under the terms of the CeCILL v2.1,
9 // and continues to be available under such terms.
10 // For more information, see the COPYING file which you should have received
11 // along with this program.
12
13 //=============================================================================
14 function bOK = detectmsifort64tools()
15
16     bOK = %F;
17     if getos() == "Windows" & win64() then
18         IFORTPATH = "";
19         ifortcomp = findmsifortcompiler();
20         if ifortcomp <> "unknown" then
21             select ifortcomp,
22             case  "ifort14" then
23                 IFORTPATH = getenv("IFORT_COMPILER14","");
24
25             case  "ifort13" then
26                 IFORTPATH = getenv("IFORT_COMPILER13","");
27
28             case  "ifort12" then
29                 IFORTPATH = getenv("IFORT_COMPILER12","");
30
31             case  "ifort11" then
32                 IFORTPATH = getenv("IFORT_COMPILER11","");
33
34             case  "ifort10" then
35                 IFORTPATH = getenv("IFORT_COMPILER10","");
36
37             case  "ifort9" then
38                 IFORTPATH = getenv("IFORT_COMPILER9","");
39
40             else
41                 show = displayWarningmsifort();
42                 if show then
43                     TXT = gettext("Intel Fortran Compiler 9, 10, 11 or 12 Compiler not found.");
44                     warning(TXT);
45                     clear TXT;
46                     disableWarningmsifort();
47                 end
48                 bOK = %F;
49                 return
50             end
51         end
52
53         select ifortcomp,
54         case  "ifort14" then
55             IFORTSPATHEMT64 = IFORTPATH + "compiler\lib\intel64";
56         case  "ifort13" then
57             IFORTSPATHEMT64 = IFORTPATH + "compiler\lib\intel64";
58         case  "ifort12" then
59             IFORTSPATHEMT64 = IFORTPATH + "compiler\lib\intel64";
60         case  "ifort11" then
61             IFORTSPATHEMT64 = IFORTPATH + "lib\intel64";
62         else
63             IFORTSPATHEMT64 = IFORTPATH + "em64t";
64         end
65
66         if isdir(IFORTSPATHEMT64) then
67             bOK = %T;
68         end
69     end
70
71 endfunction
72 //=============================================================================
73 function show = displayWarningmsifort()
74     settings_filename = "/.settings_warning_msif";
75     settings_file = pathconvert(SCIHOME+settings_filename,%f,%t);
76     w = fileinfo(settings_file);
77     show = %t;
78     if isfile(settings_file) then
79         show = grep(mgetl(settings_file),"displayWarningIFx64=no")==[]
80     end
81 endfunction
82 //=============================================================================
83 function disableWarningmsifort()
84     settings_filename = "/.settings_warning_msif";
85     settings_file = pathconvert(SCIHOME+settings_filename,%f,%t);
86     mputl("displayWarningIFx64=no",settings_file);
87 endfunction
88 //=============================================================================