source: ThirdParty/HSL/trunk/INSTALL.HSL @ 949

Last change on this file since 949 was 949, checked in by andreasw, 14 years ago

added instructions on how to build a shared library containing HSL

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