1 | Installation of certain Harwell subroutines for IPOPT. |
---|
2 | |
---|
3 | ********************************************************************* |
---|
4 | Note: It is YOUR RESPONSIBILITY to ensure that you are entitled to |
---|
5 | download and use this third party package. |
---|
6 | ********************************************************************* |
---|
7 | |
---|
8 | Information on the Harwell Subroutine Library (HSL) is available at |
---|
9 | |
---|
10 | http://www.cse.clrc.ac.uk/nag/hsl/ |
---|
11 | |
---|
12 | Some of the required HSL routines are available in the HSL Archive. |
---|
13 | The subroutines in the HSL Archive are free for non-commercial |
---|
14 | purposes (make sure you read the license). |
---|
15 | |
---|
16 | The sparse symmetric linear solvers that you can use in Ipopt are MA57 |
---|
17 | (if you have access for a commercial copy of the HSL library or are an |
---|
18 | academic who wants to use the "HSL 2007 for Researchers" library) |
---|
19 | and/or MA27 (if you have only access to the HSL Archive). In |
---|
20 | addition, you should get MC19 (from the ASL archive). |
---|
21 | |
---|
22 | Different ways to use the HSL routines in Ipopt: |
---|
23 | ------------------------------------------------ |
---|
24 | |
---|
25 | 1. If you download the HSL sources when you configure and compile |
---|
26 | Ipopt, those files will be compiled and included into the Ipopt |
---|
27 | library and executable. |
---|
28 | |
---|
29 | 2. You can also compile Ipopt without the HSL source files. In this |
---|
30 | case, Ipopt will be built without the HSL routines, but it will be |
---|
31 | possible to load a shared library at runtime that contains the HSL |
---|
32 | routines. For this, you need to provide this shared library. You |
---|
33 | can use the Makefiles in this ThirdParty/HSL directory to generate |
---|
34 | this shared library. For details, please look at the |
---|
35 | |
---|
36 | "Compiling a shared library with HSL" |
---|
37 | |
---|
38 | below in this file. |
---|
39 | |
---|
40 | Instructions on how to download files from the HSL Archive or HSL 2007: |
---|
41 | ----------------------------------------------------------------------- |
---|
42 | |
---|
43 | If you need to download subroutines from the HSL Archive or from the |
---|
44 | HSL2007 for Researchers website, this is how it goes: |
---|
45 | |
---|
46 | In order to download the HSL Archive subroutines (like ma27 and mc19), |
---|
47 | you need to register at the HSL Archive website |
---|
48 | |
---|
49 | http://hsl.rl.ac.uk/archive/hslarchive.html |
---|
50 | |
---|
51 | or the HSL 2007 for Researchers website: |
---|
52 | |
---|
53 | http://hsl.rl.ac.uk/hsl2007/hsl20074researchers.html |
---|
54 | |
---|
55 | After that you can log in and go to the page that lists all the |
---|
56 | available HSL packages for download. If you then click on the name of |
---|
57 | the desired routine (like MA27), you get to a download page, where one |
---|
58 | of the button reads "Download Package (comments removed)". |
---|
59 | |
---|
60 | Click on that button (leave the precision choice at default "Double |
---|
61 | Precision"). This brings up a webpage which contains the code for the |
---|
62 | subroutine as text. All you have to do now is to save this page (all |
---|
63 | of it, even if there are more than one subroutines in it) into the a |
---|
64 | file called "ma27ad.f". (If "Save page to..." doesn't work, you can |
---|
65 | copy the content of this page into an editor and save it there.) |
---|
66 | |
---|
67 | Similarly, if you want to get the MC19 routine, do the same steps as above |
---|
68 | and safe the context in a file called "mc19ad.f" . |
---|
69 | |
---|
70 | For neither MA27 or MC19 it is necessary to download any dependencies. |
---|
71 | |
---|
72 | If you want to use MA57, please make sure that all source code for |
---|
73 | MA57 ***including dependencies*** is in a file called ma57ad.f. |
---|
74 | Currently, the dependencies are the files: |
---|
75 | |
---|
76 | fd15ad.f |
---|
77 | mc21ad.f |
---|
78 | mc34ad.f |
---|
79 | mc47ad.f |
---|
80 | mc59ad.f |
---|
81 | mc64ad.f |
---|
82 | mc71ad.f |
---|
83 | |
---|
84 | plus possibly a dummy file (metis.f) for METIS. However, it is |
---|
85 | strongly suggested that you use METIS (look at the ThirdParty/Metis |
---|
86 | directory for instructions, or use the --with-metis configure flag to |
---|
87 | specify a procompiled Metis library). |
---|
88 | |
---|
89 | |
---|
90 | Instructions on where to put the source code: |
---|
91 | --------------------------------------------- |
---|
92 | |
---|
93 | Copy the source files for the required HSL routines into this |
---|
94 | directory before running the `configure' script. The configuration |
---|
95 | script will detect which source files you have and prepare the |
---|
96 | Makefile accordingly. |
---|
97 | |
---|
98 | |
---|
99 | Compiling a shared library with HSL |
---|
100 | =================================== |
---|
101 | |
---|
102 | Note: This has not yet been successfully tested on all platforms. It |
---|
103 | should work on most UNIX systems (including Linux), and also on |
---|
104 | Cygwin and MSys. So far, it does not seem to work on AIX. |
---|
105 | |
---|
106 | If you already built an Ipopt executable or library, you can still add |
---|
107 | the functionality of the HSL routines without recompiling Ipopt. The |
---|
108 | following describes the mechanism that Ipopt uses to use a Harwell |
---|
109 | Subroutine: |
---|
110 | |
---|
111 | 1. If the Ipopt binary/library had been compiled with HSL files |
---|
112 | present, those subroutines are always available. |
---|
113 | |
---|
114 | 2. If you are selecting a Harwell subroutine (such as MA27 or MA57 as |
---|
115 | argument to the "linear_solver" option) which has not been available |
---|
116 | when Ipopt had been compiled, Ipopt will attempt to load a shared |
---|
117 | library containing this routine. The name of the shared library |
---|
118 | depends on the operating system: |
---|
119 | |
---|
120 | - Windows (Cygwin/MSys/MSVC): libhsl.dll |
---|
121 | - Darwin: libhsl.dylib |
---|
122 | - UNIX (including Linux): libhsl.so |
---|
123 | |
---|
124 | If this library is not found, or the selected routine is not |
---|
125 | available in this shared library, Ipopt will abort with an error |
---|
126 | message. |
---|
127 | |
---|
128 | An easy way to generate this shared library is to use the "configure" |
---|
129 | script in this directory, using the following instructions: |
---|
130 | |
---|
131 | 1. Put the HSL routines that are available to you into this directory |
---|
132 | (see above for the proper names, and how to get them). |
---|
133 | |
---|
134 | 2. Run the configure script of ThirdParty/HSL (not the one in the |
---|
135 | Ipopt base directory!). As arguments, you would essentially |
---|
136 | provide the same flags as you would usually when you compile Ipopt, |
---|
137 | but you need to add the flag "--enable-loadable-library". Since |
---|
138 | you are compiling a shared library, you cannot specify the |
---|
139 | "--disable-shared" flag. |
---|
140 | |
---|
141 | 3. Then just run "make install". If it works, this should give you |
---|
142 | the shared library in the "lib" subdirectory in the directory where |
---|
143 | you run the ThirdParty/HSL/configure script. |
---|
144 | |
---|
145 | 4. To use the shared library, you need to make sure that Ipopt will |
---|
146 | find it when it is looking for it. On most UNIX systems, you need |
---|
147 | to put the shared library into a directory in the LD_LIBRARY_PATH |
---|
148 | search path, and on Windows it needs to be in the PATH. |
---|