Skip to content

Latest commit

 

History

History
175 lines (115 loc) · 7.25 KB

Install.md

File metadata and controls

175 lines (115 loc) · 7.25 KB

This guide is for building SDPB. To just run SDPB, it may be easier to use Docker or Singularity. In addition, there are site specific notes for different HPC machines and also for Apple MacBooks.

Requirements

SDPB requires

SDPB has only been tested on Linux (Debian buster and Centos 7). On Centos 7, the system compiler (gcc 4.8.5) is too old to support C++ 17. So you will have to install a newer compiler and Boost. The system versions of GMP, MPFR, and libxml2 have been tested to work.

In principle, SDPB should be installable on Mac OS X using a package manager such as Homebrew.

Installation

  1. Download the fork of Elemental

     git clone https://gitlab.com/bootstrapcollaboration/elemental.git
    
  2. Make the build directory and cd into it.

     mkdir -p elemental/build
     cd elemental/build
    
  3. Configure Elemental. This can be rather tricky. You may have to specify where the Boost, GMP, and BLAS libraries are. If you are using modules, you may have to load modules. If these define appropriate environment variables, then the configure should be relatively easy. For example, on Yale's Grace cluster, commands that work are

     module load git CMake GCCcore/6.4.0 OpenMPI/2.1.2-GCC-6.4.0-2.28 Boost/1.66.0-foss-2018a OpenBLAS/0.2.20-GCC-6.4.0-2.28 GMP/6.1.2-GCCcore-6.4.0 MPFR/4.0.1-GCCcore-6.4.0 Python/3.6.4-foss-2018a
     export CXX=mpicxx
     export CC=mpicc
     cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/project/install
    

    On Harvard's Odyssey3 cluster, the default Boost module does not work with the most up-to-date compiler.

     module load gcc/9.2.0-fasrc01 cmake/3.16.1-fasrc01 OpenBLAS/0.3.7-fasrc02 openmpi/4.0.2-fasrc01 eigen/3.3.7-fasrc02 libxml2/2.7.8-fasrc02 metis/5.1.0-fasrc01
     module unload boost
     export CXX=mpicxx
     export CC=mpicc
     cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/install
    

    On a Debian Buster laptop, use sudo or the root account to install these packages

     apt-get install openmpi-bin libopenmpi-dev libgmp-dev libmpfr-dev libmpfrc++-dev libboost-all-dev g++ cmake libopenblas-dev libxml2-dev git libmetis-dev pkg-config rapidjson-dev
    

    and then configure as a normal user

     cmake .. -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_INSTALL_PREFIX=/home/boo/qft/src/elemental/install
    
  4. Build and install Elemental

     make && make install
     cd ../..
    
  5. Install FLINT library

     git clone https://github.com/flintlib/flint.git
     cd flint
     ./bootstrap.sh
     ./configure --disable-static --prefix=$HOME/install
     make
     make check
     make install
     cd ..
    

    If you have GMP 6.2.0 or earlier, you should use FLINT 3.0.1 or earlier (git checkout v3.0.1) and run configure with --disable-gmp-internals flag to prevent mpn_gcd_11 not found error.

    See FLINT documentation for installation instructions.

  6. Download SDPB

     git clone https://github.com/davidsd/sdpb
     cd sdpb
    

    You must use git. The tarball generated by github will not work.

  7. Configure the project using the included version of waf. Waf can usually find libraries that are in system directories or have corresponding environment variables. You may have to explicitly tell it where other libraries are. If you are having problems, running ./waf --help will give you a list of options.

    For example, on Debian buster, a working command is

     ./waf configure --elemental-dir=$HOME/install --flint-dir=$HOME/install
    
  8. Type ./waf to build the executable in build/sdpb. This will create eight executables in the build/ directory:

    • sdpb: Semidefinite program solver
      • pmp2sdp: Convert Polynomial Matrix Program (PMP) in JSON, Mathematica or XML format to sdpb input.
    • outer_limits: Semidefinite program solver using the outer approximation (experimental)
      • pmp2functions: Convert PMP in JSON, Mathematica or XML format to outer_limits input.
    • spectrum: Extract the spectrum given the solution and PMP in JSON/Mathematica/XML format.
    • approx_objective: Compute an approximate objective given a solution to a nearby SDP.
    • unit_tests: Unit tests.
    • integration_tests: End-to-end tests for sdpb and other executables. The tests use data from test/data/ folder.

Running

    ./build/sdpb --help

should give you a usage message. HPC systems may require you to run all jobs through a batch system. You will need to consult the documentation for your individual system.

Tests

You can check the installation by running unit_tests and integration_tests (takes up to several minutes):

    mpirun -n 6 ./build/unit_tests
    ./build/integration_tests

If some integration test case fails, you may check the test logs in test/out/log/ folder and files generated during the test run in test/out/ folder.

By default, integration_tests uses mpirun command to run sdpb and other executables. You can also provide a custom command for your HPC, e.g.:

    ./build/integration_tests --mpirun="srun --mpi=pmi2" 

For more command-line options, see Catch2 documentation.

You can also run both unit and integration tests via the script

    ./test/run_all_tests.sh

It also supports custom mpirun command, e.g.

    ./test/run_all_tests.sh srun --mpi=pmi2

Getting Help

If you are having problems with installation, you can create an issue on GitHub. Be sure to include what system you are trying to install SDPB on, what you typed, and the FULL error message (even if you think it is too long).

If installation was successful but some test case fails, please include also the console output and (in the case of integration tests) the corresponding logs, e.g. test/out/log/sdpb/run.stdout.log and test/out/log/sdpb/run.stderr.log.