src/Pure/Admin/build_csdp.scala
author wenzelm
Fri, 08 Apr 2022 16:42:52 +0200
changeset 75421 3c710067b178
parent 75394 42267c650205
child 76518 b30b8e23383c
permissions -rw-r--r--
back to more ambitious scala-3.1.1 (see 8b7497992301);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
     1
/*  Title:      Pure/Admin/build_csdp.scala
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
     3
72437
efc5ae4b4ac8 tuned messages;
wenzelm
parents: 72431
diff changeset
     4
Build Isabelle CSDP component from official download.
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
     5
*/
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
     6
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
     7
package isabelle
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
     8
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
     9
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75205
diff changeset
    10
object Build_CSDP {
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    11
  // Note: version 6.2.0 does not quite work for the "sos" proof method
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    12
  val default_download_url = "https://github.com/coin-or/Csdp/archive/releases/6.1.1.tar.gz"
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    13
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    14
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    15
  /* flags */
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    16
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75205
diff changeset
    17
  sealed case class Flags(platform: String, CFLAGS: String = "", LIBS: String = "") {
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    18
    val changed: List[(String, String)] =
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    19
      List("CFLAGS" -> CFLAGS, "LIBS" -> LIBS).filter(p => p._2.nonEmpty)
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    20
72438
wenzelm
parents: 72437
diff changeset
    21
    def print: Option[String] =
wenzelm
parents: 72437
diff changeset
    22
      if (changed.isEmpty) None
wenzelm
parents: 72437
diff changeset
    23
      else
73712
3eba8d4b624b clarified signature;
wenzelm
parents: 73566
diff changeset
    24
        Some("  * " + platform + ":\n" + changed.map(p => "    " + Properties.Eq(p))
72438
wenzelm
parents: 72437
diff changeset
    25
          .mkString("\n"))
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    26
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75205
diff changeset
    27
    def change(path: Path): Unit = {
73714
wenzelm
parents: 73712
diff changeset
    28
      def change_line(line: String, p: (String, String)): String =
wenzelm
parents: 73712
diff changeset
    29
        line.replaceAll(p._1 + "=.*", Properties.Eq(p))
75205
wenzelm
parents: 75202
diff changeset
    30
      File.change_lines(path) { _.map(line => changed.foldLeft(line)(change_line)) }
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    31
    }
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    32
  }
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    33
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    34
  val build_flags: List[Flags] =
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    35
    List(
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    36
      Flags("arm64-linux",
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    37
        CFLAGS = "-O3 -ansi -Wall -DNOSHORTS -DBIT64 -DUSESIGTERM -DUSEGETTIME -I../include",
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    38
        LIBS = "-static -L../lib -lsdp -llapack -lblas -lgfortran -lm"),
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    39
      Flags("x86_64-linux",
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    40
        CFLAGS = "-O3 -ansi -Wall -DNOSHORTS -DBIT64 -DUSESIGTERM -DUSEGETTIME -I../include",
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    41
        LIBS = "-static -L../lib -lsdp -llapack -lblas -lgfortran -lquadmath -lm"),
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    42
      Flags("x86_64-darwin",
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    43
        CFLAGS = "-O3 -Wall -DNOSHORTS -DBIT64 -DUSESIGTERM -DUSEGETTIME -I../include",
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    44
        LIBS = "-L../lib -lsdp -llapack -lblas -lm"),
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    45
      Flags("x86_64-windows"))
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    46
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    47
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    48
  /* build CSDP */
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    49
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    50
  def build_csdp(
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    51
    download_url: String = default_download_url,
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    52
    verbose: Boolean = false,
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    53
    progress: Progress = new Progress,
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
    54
    target_dir: Path = Path.current,
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75205
diff changeset
    55
    mingw: MinGW = MinGW.none
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75205
diff changeset
    56
  ): Unit = {
72424
10c07d224035 tuned signature;
wenzelm
parents: 72423
diff changeset
    57
    mingw.check
72423
f8aa2efce869 more explicit MinGW context;
wenzelm
parents: 72418
diff changeset
    58
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
    59
    Isabelle_System.with_tmp_dir("build") { tmp_dir =>
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    60
      /* component */
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    61
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    62
      val Archive_Name = """^.*?([^/]+)$""".r
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    63
      val Version = """^[^0-9]*([0-9].*)\.tar.gz$""".r
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    64
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    65
      val archive_name =
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    66
        download_url match {
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    67
          case Archive_Name(name) => name
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    68
          case _ => error("Failed to determine source archive name from " + quote(download_url))
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    69
        }
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    70
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    71
      val version =
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    72
        archive_name match {
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    73
          case Version(version) => version
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    74
          case _ => error("Failed to determine component version from " + quote(archive_name))
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    75
        }
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    76
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    77
      val component_name = "csdp-" + version
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    78
      val component_dir = Isabelle_System.new_directory(target_dir + Path.basic(component_name))
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    79
      progress.echo("Component " + component_dir)
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    80
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    81
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    82
      /* platform */
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    83
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    84
      val platform_name =
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    85
        proper_string(Isabelle_System.getenv("ISABELLE_WINDOWS_PLATFORM64")) orElse
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    86
        proper_string(Isabelle_System.getenv("ISABELLE_PLATFORM64")) getOrElse
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    87
        error("No 64bit platform")
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    88
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    89
      val platform_dir = Isabelle_System.make_directory(component_dir + Path.basic(platform_name))
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    90
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    91
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    92
      /* download source */
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    93
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    94
      val archive_path = tmp_dir + Path.basic(archive_name)
73566
4e6b31ed7197 clarified signature: avoid tmp file;
wenzelm
parents: 73359
diff changeset
    95
      Isabelle_System.download_file(download_url, archive_path, progress = progress)
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    96
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    97
      Isabelle_System.bash("tar xzf " + File.bash_path(archive_path), cwd = tmp_dir.file).check
72442
90868036d693 clarified signature;
wenzelm
parents: 72440
diff changeset
    98
      val source_name = File.get_dir(tmp_dir)
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    99
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   100
      Isabelle_System.bash(
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   101
        "tar xzf " + archive_path + " && mv " + Bash.string(source_name) + " src",
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   102
        cwd = component_dir.file).check
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   103
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   104
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   105
      /* build */
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   106
72440
d0ba71b3297e tuned messages;
wenzelm
parents: 72438
diff changeset
   107
      progress.echo("Building CSDP for " + platform_name + " ...")
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   108
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   109
      val build_dir = tmp_dir + Path.basic(source_name)
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   110
      build_flags.find(flags => flags.platform == platform_name) match {
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   111
        case None => error("No build flags for platform " + quote(platform_name))
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   112
        case Some(flags) =>
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   113
          File.find_files(build_dir.file, pred = file => file.getName == "Makefile").
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   114
            foreach(file => flags.change(File.path(file)))
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   115
      }
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   116
72428
b7351ffe0dbc clarified signature: allow complex bash script;
wenzelm
parents: 72425
diff changeset
   117
      progress.bash(mingw.bash_script("make"), cwd = build_dir.file, echo = verbose).check
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   118
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   119
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   120
      /* install */
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   121
73317
df49ca5da9d0 clarified modules: more like ML;
wenzelm
parents: 72763
diff changeset
   122
      Isabelle_System.copy_file(build_dir + Path.explode("LICENSE"), component_dir)
df49ca5da9d0 clarified modules: more like ML;
wenzelm
parents: 72763
diff changeset
   123
      Isabelle_System.copy_file(build_dir + Path.explode("solver/csdp").platform_exe, platform_dir)
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   124
72463
wenzelm
parents: 72444
diff changeset
   125
      if (Platform.is_windows) {
wenzelm
parents: 72444
diff changeset
   126
        Executable.libraries_closure(platform_dir + Path.explode("csdp.exe"), mingw = mingw,
wenzelm
parents: 72444
diff changeset
   127
          filter =
72468
60471f4bafd2 proper library names on Windows;
wenzelm
parents: 72463
diff changeset
   128
            Set("libblas", "liblapack", "libgfortran", "libgcc_s_seh",
60471f4bafd2 proper library names on Windows;
wenzelm
parents: 72463
diff changeset
   129
              "libquadmath", "libwinpthread"))
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   130
      }
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   131
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   132
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   133
      /* settings */
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   134
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   135
      val etc_dir = Isabelle_System.make_directory(component_dir + Path.basic("etc"))
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   136
      File.write(etc_dir + Path.basic("settings"),
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   137
        """# -*- shell-script -*- :mode=shellscript:
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   138
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   139
ISABELLE_CSDP="$COMPONENT/${ISABELLE_WINDOWS_PLATFORM64:-$ISABELLE_PLATFORM64}/csdp"
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   140
""")
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   141
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   142
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   143
      /* README */
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   144
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   145
      File.write(component_dir + Path.basic("README"),
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   146
"""This is CSDP """ + version + """ from
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   147
""" + download_url + """
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   148
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   149
Makefile flags have been changed for various platforms as follows:
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   150
72438
wenzelm
parents: 72437
diff changeset
   151
""" + build_flags.flatMap(_.print).mkString("\n\n") + """
wenzelm
parents: 72437
diff changeset
   152
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   153
The distribution has been built like this:
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   154
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   155
    cd src && make
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   156
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   157
Only the bare "solver/csdp" program is used for Isabelle.
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   158
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   159
72444
2d9a70b85009 tuned whitespace;
wenzelm
parents: 72442
diff changeset
   160
        Makarius
2d9a70b85009 tuned whitespace;
wenzelm
parents: 72442
diff changeset
   161
        """ + Date.Format.date(Date.now()) + "\n")
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   162
    }
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   163
}
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   164
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   165
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   166
  /* Isabelle tool wrapper */
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   167
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   168
  val isabelle_tool =
72763
3cc73d00553c added document antiquotation @{tool};
wenzelm
parents: 72468
diff changeset
   169
    Isabelle_Tool("build_csdp", "build prover component from official download", Scala_Project.here,
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   170
      { args =>
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   171
        var target_dir = Path.current
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   172
        var mingw = MinGW.none
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   173
        var download_url = default_download_url
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   174
        var verbose = false
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   175
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   176
        val getopts = Getopts("""
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   177
Usage: isabelle build_csdp [OPTIONS]
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   178
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   179
  Options are:
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   180
    -D DIR       target directory (default ".")
72425
d0937d55eb90 clarified errors;
wenzelm
parents: 72424
diff changeset
   181
    -M DIR       msys/mingw root specification for Windows
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   182
    -U URL       download URL
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   183
                 (default: """" + default_download_url + """")
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   184
    -v           verbose
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   185
72437
efc5ae4b4ac8 tuned messages;
wenzelm
parents: 72431
diff changeset
   186
  Build prover component from official download.
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   187
""",
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   188
          "D:" -> (arg => target_dir = Path.explode(arg)),
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   189
          "M:" -> (arg => mingw = MinGW(Path.explode(arg))),
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   190
          "U:" -> (arg => download_url = arg),
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   191
          "v" -> (_ => verbose = true))
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   192
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   193
        val more_args = getopts(args)
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   194
        if (more_args.nonEmpty) getopts.usage()
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   195
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   196
        val progress = new Console_Progress()
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   197
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   198
        build_csdp(download_url = download_url, verbose = verbose, progress = progress,
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   199
          target_dir = target_dir, mingw = mingw)
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   200
      })
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   201
}