1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) DIGITEO - Allan CORNET
4 // This file must be used under the terms of the CeCILL.
5 // This source file is licensed as described in the file COPYING, which
6 // you should have received as part of this distribution. The terms
7 // are also available at
8 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10 //=============================================================================
11 function bOK = configure_msifort()
13 //=============================================================================
14 // functions defined only in configure_ifort
15 //=============================================================================
16 function ifpath = getIFpath(ifversion)
19 ifpath = getenv("IFORT_COMPILER9", "");
21 ifpath = getenv("IFORT_COMPILER10", "");
23 ifpath = getenv("IFORT_COMPILER11", "");
25 ifpath = getenv("IFORT_COMPILER12", "");
27 ifpath = getenv("IFORT_COMPILER13", "");
32 //=============================================================================
33 function bOK = set_commons_ifort12(ifpath, machinepath)
34 // intel fortran directories changed (AGAIN !!!) with version 12
36 ENV_PATH = getenv("PATH", "");
37 // example set PATH=%IFORT_COMPILER12%\Bin\intel64;
38 PATH_TO_ADD = ifpath + "bin" + filesep() + machinepath;
39 if isdir(PATH_TO_ADD) then
40 ENV_PATH = PATH_TO_ADD + pathsep() + ENV_PATH;
41 err = setenv("PATH", ENV_PATH);
42 if (err == %F) then bOK = %F,return,end
49 // example set INCLUDE=%IFORT_COMPILER12%\compiler\include\intel64;
50 ENV_INCLUDE = getenv("INCLUDE", "");
51 PATH_TO_ADD = ifpath + "compiler" + filesep() + "include" + filesep() + machinepath;
52 if isdir(PATH_TO_ADD) then
53 ENV_INCLUDE = PATH_TO_ADD + pathsep() + ENV_INCLUDE;
54 err = setenv("INCLUDE", ENV_INCLUDE);
55 if (err == %F) then bOK = %F,return,end
62 // example set LIB=%IFORT_COMPILER12%\compiler\lib\intel64;
63 ENV_LIB = getenv("LIB", "");
64 PATH_TO_ADD = ifpath + "compiler" + filesep() + "lib" + filesep() + machinepath;
65 if isdir(PATH_TO_ADD) then
66 ENV_LIB = PATH_TO_ADD + pathsep() + ENV_LIB;
67 err = setenv("LIB", ENV_LIB);
68 if (err == %F) then bOK = %F,return,end
76 //=============================================================================
77 function bOK = set_commons_ifort11(ifpath, machinepath)
78 // intel fortran directories changed with version 11
80 ENV_PATH = getenv("PATH", "");
81 // example set PATH=%IFORT_COMPILER11%\Bin\intel64;
82 PATH_TO_ADD = ifpath + "bin" + filesep() + machinepath;
83 if isdir(PATH_TO_ADD) then
84 ENV_PATH = PATH_TO_ADD + pathsep() + ENV_PATH;
85 err = setenv("PATH", ENV_PATH);
86 if (err == %F) then bOK = %F,return,end
93 // example set INCLUDE=%IFORT_COMPILER11%\include\intel64;
94 ENV_INCLUDE = getenv("INCLUDE", "");
95 PATH_TO_ADD = ifpath + "include" + filesep() + machinepath;
96 if isdir(PATH_TO_ADD) then
97 ENV_INCLUDE = PATH_TO_ADD + pathsep() + ENV_INCLUDE;
98 err = setenv("INCLUDE", ENV_INCLUDE);
99 if (err == %F) then bOK = %F,return,end
106 // example set LIB=%IFORT_COMPILER10%\lib\intel64;
107 ENV_LIB = getenv("LIB", "");
108 PATH_TO_ADD = ifpath + "lib" + filesep() + machinepath;
109 if isdir(PATH_TO_ADD) then
110 ENV_LIB = PATH_TO_ADD + pathsep() + ENV_LIB;
111 err = setenv("LIB", ENV_LIB);
112 if (err == %F) then bOK = %F,return,end
120 //=============================================================================
121 function bOK = set_commons_msi9and10(ifpath,machinepath)
124 // example set PATH=%IFORT_COMPILER10%\EM64T\Bin;
125 ENV_PATH = getenv("PATH", "");
126 PATH_TO_ADD = ifpath + machinepath + filesep() + "bin";
127 if isdir(PATH_TO_ADD) then
128 ENV_PATH = PATH_TO_ADD + pathsep() + ENV_PATH;
129 err = setenv("PATH", ENV_PATH);
130 if (err == %F) then bOK = %F,return,end
137 // example set INCLUDE=%IFORT_COMPILER10%\EM64T\Include;
138 ENV_INCLUDE = getenv("INCLUDE", "");
139 PATH_TO_ADD = ifpath + machinepath + filesep() + "Include";
140 if isdir(PATH_TO_ADD) then
141 ENV_INCLUDE = PATH_TO_ADD + pathsep() + ENV_INCLUDE;
142 err = setenv("INCLUDE", ENV_INCLUDE);
143 if (err == %F) then bOK = %F,return,end
150 // example set LIB=%IFORT_COMPILER10%\EM64T\Lib;
151 ENV_LIB = getenv("LIB", "");
152 PATH_TO_ADD = ifpath + machinepath + filesep() + "Lib";
153 if isdir(PATH_TO_ADD) then
154 ENV_LIB = PATH_TO_ADD + pathsep() + ENV_LIB;
155 err = setenv("LIB", ENV_LIB);
156 if (err == %F) then bOK = %F,return,end
164 //=============================================================================
166 if getos() == "Windows" then
167 ifortcompiler = findmsifortcompiler();
168 if ifortcompiler <> "unknown" then
169 if_path = getIFpath(ifortcompiler);
174 machinepath = "ia32";
176 select ifortcompiler,
178 machinepath = "intel64";
180 machinepath = "intel64";
182 machinepath = "intel64";
184 machinepath = "EM64T";
188 select ifortcompiler,
190 bOK = set_commons_ifort12(if_path, machinepath);
192 bOK = set_commons_ifort12(if_path, machinepath);
194 bOK = set_commons_ifort11(if_path, machinepath);
196 bOK = set_commons_msi9and10(if_path, machinepath);
198 bOK = set_commons_msi9and10(if_path, machinepath);
206 //=============================================================================