blob: d6dcfb19e735b512b72ce3fcf4eb701bc093e0e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
// Copyright (C) 2015 - IIT Bombay - FOSSEE
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution. The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
// Author: Harpreet Singh
// Organization: FOSSEE, IIT Bombay
// Email: toolbox@scilab.in
mprintf("Start FOSSEE Optimization Toolbox\n");
if ( isdef("sym_open") ) then
warning("Library is already loaded");
return;
end
etc_tlbx = get_absolute_file_path("FOSSEE_Optimization_Toolbox.start");
etc_tlbx = getshortpathname(etc_tlbx);
root_tlbx = strncpy( etc_tlbx, length(etc_tlbx)-length("\etc\") );
//Load functions library
// =============================================================================
mprintf("\tLoad macros\n");
pathmacros = pathconvert( root_tlbx ) + "macros" + filesep();
symphony_lib = lib(pathmacros);
clear pathmacros;
// load gateways
// =============================================================================
mprintf("\tLoad gateways\n");
[a, opt] = getversion();
Version = opt(2);
ilib_verbose(0);
if getos()=="Windows" then
error(msprintf(gettext("Module is not for Windows.")));
else
lib_path = root_tlbx + "/thirdparty/linux/lib/" + Version;
link(lib_path + "/libCoinUtils.so");
link(lib_path + "/libClp.so");
link(lib_path + "/libClpSolver.so");
link(lib_path + "/libOsi.so");
link(lib_path + "/libOsiCommonTests.so");
link(lib_path + "/libOsiClp.so");
link(lib_path + "/libCgl.so");
link(lib_path + "/libSym.so");
link(lib_path + "/libOsiSym.so");
try
link(lib_path + "/libcoinblas.so");
catch
if(~isfile('/usr/lib/x86_64-linux-gnu/libstdc++.so.6') | ~isfile('/usr/lib/x86_64-linux-gnu/libgfortran.so.3')) then
errmsg = msprintf(gettext("%s: Please install gfortran"), "FOSSEE_Optimization_Toolbox");
error(errmsg);
end
unix_s('export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libgfortran.so.3')
end
link(lib_path + "/libcoinblas.so");
link(lib_path + "/libcoinlapack.so");
link(lib_path + "/libcoinmumps.so");
link(lib_path + "/libipopt.so");
end
exec(pathconvert(root_tlbx + filesep() + "sci_gateway" + filesep() + "loader_gateway.sce",%f));
// Load and add help chapter
// =============================================================================
if ( %t ) then
if or(getscilabmode() == ["NW";"STD"]) then
mprintf("\tLoad help\n");
path_addchapter = pathconvert(root_tlbx+"/jar");
if ( isdir(path_addchapter) <> [] ) then
add_help_chapter("FOSSEE_Optimization_Toolbox", path_addchapter, %F);
clear add_help_chapter;
end
clear path_addchapter;
end
end
// add demos
// =============================================================================
if ( %t ) then
if or(getscilabmode() == ["NW";"STD"]) then
mprintf("\tLoad demos\n");
pathdemos = pathconvert(root_tlbx+"/demos/sci_FOSSEE_Optimization_Toolbox.dem.gateway.sce",%f,%t);
add_demo("FOSSEE_Optimization_Toolbox",pathdemos);
clear pathdemos ;
end
end
// =============================================================================
clear root_tlbx;
clear etc_tlbx;
|