src/Pure/Admin/build_csdp.scala
author wenzelm
Sat, 10 Oct 2020 14:46:13 +0200
changeset 72418 4ed247fadbc4
parent 72417 992822a11039
child 72423 f8aa2efce869
permissions -rw-r--r--
proper support for x86_64-windows via msys/mingw64;
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
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
     4
Build Isabelle CSDP component from official downloads.
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
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    10
object Build_CSDP
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    11
{
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    12
  // 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
    13
  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
    14
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    15
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    16
  /* flags */
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    17
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    18
  sealed case class Flags(platform: String, CFLAGS: String = "", LIBS: String = "")
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    19
  {
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    20
    val changed: List[(String, String)] =
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    21
      List("CFLAGS" -> CFLAGS, "LIBS" -> LIBS).filter(p => p._2.nonEmpty)
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    22
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    23
    def print: String =
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    24
      if (changed.isEmpty) ""
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    25
      else "  * " + platform + ":\n" + changed.map(p => "    " + p._1 + "=" + p._2).mkString("\n")
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    26
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    27
    def change(path: Path)
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    28
    {
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    29
      def change_line(line: String, entry: (String, String)): String =
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    30
        line.replaceAll(entry._1 + "=.*", entry._1 + "=" + entry._2)
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    31
      File.change(path, s =>
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    32
        split_lines(s).map(line => (line /: changed)(change_line)).mkString("\n"))
72414
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
  }
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    35
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    36
  val build_flags: List[Flags] =
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    37
    List(
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    38
      Flags("arm64-linux",
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    39
        CFLAGS = "-O3 -ansi -Wall -DNOSHORTS -DBIT64 -DUSESIGTERM -DUSEGETTIME -I../include",
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    40
        LIBS = "-static -L../lib -lsdp -llapack -lblas -lgfortran -lm"),
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    41
      Flags("x86_64-linux",
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    42
        CFLAGS = "-O3 -ansi -Wall -DNOSHORTS -DBIT64 -DUSESIGTERM -DUSEGETTIME -I../include",
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    43
        LIBS = "-static -L../lib -lsdp -llapack -lblas -lgfortran -lquadmath -lm"),
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    44
      Flags("x86_64-darwin",
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    45
        CFLAGS = "-O3 -Wall -DNOSHORTS -DBIT64 -DUSESIGTERM -DUSEGETTIME -I../include",
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    46
        LIBS = "-L../lib -lsdp -llapack -lblas -lm"),
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    47
      Flags("x86_64-windows"))
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    48
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    49
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    50
  /* build CSDP */
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    51
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    52
  def build_csdp(
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    53
    download_url: String = default_download_url,
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    54
    verbose: Boolean = false,
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    55
    progress: Progress = new Progress,
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
    56
    target_dir: Path = Path.current,
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
    57
    msys_root: Option[Path] = None)
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    58
  {
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    59
    Isabelle_System.with_tmp_dir("build")(tmp_dir =>
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    60
    {
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    61
      /* component */
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    62
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    63
      val Archive_Name = """^.*?([^/]+)$""".r
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    64
      val Version = """^[^0-9]*([0-9].*)\.tar.gz$""".r
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    65
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    66
      val archive_name =
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    67
        download_url match {
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    68
          case Archive_Name(name) => name
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    69
          case _ => error("Failed to determine source archive name from " + quote(download_url))
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    70
        }
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    71
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    72
      val version =
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    73
        archive_name match {
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    74
          case Version(version) => version
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    75
          case _ => error("Failed to determine component version from " + quote(archive_name))
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    76
        }
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    77
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    78
      val component_name = "csdp-" + version
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    79
      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
    80
      progress.echo("Component " + component_dir)
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
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    83
      /* platform */
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    84
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    85
      val platform_name =
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    86
        proper_string(Isabelle_System.getenv("ISABELLE_WINDOWS_PLATFORM64")) orElse
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    87
        proper_string(Isabelle_System.getenv("ISABELLE_PLATFORM64")) getOrElse
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    88
        error("No 64bit platform")
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    89
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    90
      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
    91
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    92
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    93
      /* download source */
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
    94
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    95
      val archive_path = tmp_dir + Path.basic(archive_name)
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    96
      Isabelle_System.download(download_url, archive_path, progress = progress)
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    97
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
    98
      Isabelle_System.bash("tar xzf " + File.bash_path(archive_path), cwd = tmp_dir.file).check
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
      val source_name =
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   101
        File.read_dir(tmp_dir).filter(name => (tmp_dir + Path.basic(name)).is_dir) match {
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   102
          case List(dir) => dir
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   103
          case dirs =>
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   104
            error("Exactly one directory entry expected in archive " + quote(download_url) +
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   105
              "\n" + commas_quote(dirs))
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   106
        }
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   107
      Isabelle_System.bash(
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   108
        "tar xzf " + archive_path + " && mv " + Bash.string(source_name) + " src",
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   109
        cwd = component_dir.file).check
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   110
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   111
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   112
      /* build */
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   113
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   114
      progress.echo("Building CSDP ...")
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   115
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   116
      val build_dir = tmp_dir + Path.basic(source_name)
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   117
      build_flags.find(flags => flags.platform == platform_name) match {
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   118
        case None => error("No build flags for platform " + quote(platform_name))
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   119
        case Some(flags) =>
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   120
          File.find_files(build_dir.file, pred = file => file.getName == "Makefile").
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   121
            foreach(file => flags.change(File.path(file)))
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   122
      }
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   123
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   124
      val build_script = {
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   125
        if (!Platform.is_windows) "make"
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   126
        else if (msys_root.isEmpty) error("Windows requires specification of msys root directory")
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   127
        else {
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   128
          val msys_script =
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   129
            "PATH=/usr/bin:/bin:/mingw64/bin; export CONFIG_SITE=/mingw64/etc/config.site; make"
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   130
          File.bash_path(msys_root.get + Path.explode("usr/bin/bash")) +
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   131
            " -c " + Bash.string(msys_script)
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   132
        }
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   133
      }
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   134
      progress.bash(build_script, cwd = build_dir.file, echo = verbose).check
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   135
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   136
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   137
      /* install */
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   138
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   139
      File.copy(build_dir + Path.explode("LICENSE"), component_dir)
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   140
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   141
      if (!Platform.is_windows) {
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   142
        File.copy(build_dir + Path.explode("solver/csdp"), platform_dir)
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   143
      }
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   144
      else {
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   145
        File.copy(build_dir + Path.explode("solver/csdp.exe"), platform_dir)
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   146
        val libs =
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   147
          List("libblas", "liblapack", "libgfortran-5", "libgcc_s_seh-1",
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   148
            "libquadmath-0", "libwinpthread-1")
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   149
        for (name <- libs) {
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   150
          File.copy(msys_root.get + Path.explode("mingw64/bin") + Path.basic(name).ext("dll"),
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   151
            platform_dir)
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   152
        }
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   153
      }
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   154
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   155
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   156
      /* settings */
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   157
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   158
      val etc_dir = Isabelle_System.make_directory(component_dir + Path.basic("etc"))
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   159
      File.write(etc_dir + Path.basic("settings"),
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   160
        """# -*- shell-script -*- :mode=shellscript:
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   161
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   162
ISABELLE_CSDP="$COMPONENT/${ISABELLE_WINDOWS_PLATFORM64:-$ISABELLE_PLATFORM64}/csdp"
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
      /* README */
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
      File.write(component_dir + Path.basic("README"),
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   169
"""This is CSDP """ + version + """ from
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   170
""" + download_url + """
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   171
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   172
Makefile flags have been changed for various platforms as follows:
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   173
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   174
""" + build_flags.map(_.print).mkString("\n\n") + """
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   175
The distribution has been built like this:
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   176
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   177
    cd src && make
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   178
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   179
Only the bare "solver/csdp" program is used for Isabelle.
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   180
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   181
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   182
    Makarius
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   183
    """ + Date.Format.date(Date.now()) + "\n")
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   184
    })
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   185
}
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   186
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   187
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   188
  /* Isabelle tool wrapper */
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   189
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   190
  val isabelle_tool =
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   191
    Isabelle_Tool("build_csdp", "build prover component from official downloads",
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   192
    args =>
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   193
    {
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   194
      var target_dir = Path.current
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   195
      var msys_root: Option[Path] = None
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   196
      var download_url = default_download_url
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   197
      var verbose = false
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   198
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   199
      val getopts = Getopts("""
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   200
Usage: isabelle build_csdp [OPTIONS]
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   201
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   202
  Options are:
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   203
    -D DIR       target directory (default ".")
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   204
    -M DIR       msys root directory (for Windows)
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   205
    -U URL       download URL
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   206
                 (default: """" + default_download_url + """")
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   207
    -v           verbose
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   208
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   209
  Build prover component from official downloads.
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   210
""",
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   211
        "D:" -> (arg => target_dir = Path.explode(arg)),
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   212
        "M:" -> (arg => msys_root = Some(Path.explode(arg))),
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   213
        "U:" -> (arg => download_url = arg),
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   214
        "v" -> (_ => verbose = true))
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   215
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   216
      val more_args = getopts(args)
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   217
      if (more_args.nonEmpty) getopts.usage()
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   218
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   219
      val progress = new Console_Progress()
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   220
72417
992822a11039 more standard build from sources;
wenzelm
parents: 72414
diff changeset
   221
      build_csdp(download_url = download_url, verbose = verbose, progress = progress,
72418
4ed247fadbc4 proper support for x86_64-windows via msys/mingw64;
wenzelm
parents: 72417
diff changeset
   222
        target_dir = target_dir, msys_root = msys_root)
72414
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   223
    })
af24c0dd6975 build Isabelle CSDP component from official downloads;
wenzelm
parents:
diff changeset
   224
}