Difference between revisions of "Building on Ubuntu 18"

From GridPACK
Jump to: navigation, search
(Created page with "<span style="color:red">'''This page is under construction'''</span>. Building GridPACK on Ubuntu 18.04 is slightly more complicated than building it on Ubuntu 16.04. The mai...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<span style="color:red">'''This page is under construction'''</span>.
 
<span style="color:red">'''This page is under construction'''</span>.
  
Building GridPACK on Ubuntu 18.04 is slightly more complicated than building it on Ubuntu 16.04. The main differences are that 1) the PPN build does not work for this version of Ubuntu and 2) the Global Arrays library must be built by hand. MPI, Boost and PETSc can all be installed using the package manager. This example was performed on a [https://www.virtualbox.org/ Virtual Box] instance running a clean install of [http://releases.ubuntu.com/16.04/ Ubuntu Linux 16.04 (LTS)]. Virtual Box is not required and this build should work on Linux systems using the Ubuntu operating system. <span style="color:red">'''You will need super user or sudo privileges for this installation'''</span>.
+
Building GridPACK on Ubuntu 18.04 is slightly more complicated than building it on Ubuntu 16.04. The main differences are that 1) the PPN build does not work for this version of Ubuntu and 2) the Global Arrays library must be built by hand. MPI, Boost and PETSc can all be installed using the package manager. This example was performed on a [https://www.virtualbox.org/ Virtual Box] instance running a clean install of [http://releases.ubuntu.com/18.04/ Ubuntu Linux 18.04 (LTS)]. Virtual Box is not required and this build should work on Linux systems using the Ubuntu operating system. <span style="color:red">'''You will need super user or sudo privileges for this installation'''</span>.
  
 
A few basic development packages will be necessary. Install them with
 
A few basic development packages will be necessary. Install them with
Line 9: Line 9:
  
 
== Install Required Packages ==
 
== Install Required Packages ==
 +
Before installing the remaining packages, you ''must'' first download GridPACK onto your computer and put it in a convenient directory. Information on how to download and install GridPACK can be found [https://www.gridpack.org/wiki/index.php/Download_GridPACK here].
  
 
All the [https://www.gridpack.org/wiki/index.php/Software_Required_to_Build_GridPACK GridPACK prerequisites] packages can be installed using the packaging information in the source. Run this command in the top directory of the cloned repository:
 
All the [https://www.gridpack.org/wiki/index.php/Software_Required_to_Build_GridPACK GridPACK prerequisites] packages can be installed using the packaging information in the source. Run this command in the top directory of the cloned repository:
Line 18: Line 19:
 
== Build and Install Global Arrays ==
 
== Build and Install Global Arrays ==
  
Get the [http://hpc.pnl.gov/globalarrays/ Global Arrays] source from the [https://github.com/GlobalArrays/ga/releases/tag/v5.6.5 release page]. Unpack in a convenient location. In the unpacked directory, configure, build, and install using
+
Get the [http://hpc.pnl.gov/globalarrays/ Global Arrays] source from the [https://github.com/GlobalArrays/ga/releases/tag/v5.6.5 release page]. We recommend using version 5.6 or 5.7 but any recent version should work. Unpack GA in a convenient location. In the unpacked directory, configure, build, and install using
  
     ./configure --with-mpi-ts --disable-f77 --without-blas \
+
     ./configure --enable-i4 --without-blas --enable-cxx --with-mpi-ts --disable-f77 \
        --enable-cxx --enable-i4 --prefix="$PREFIX"
+
        --prefix=<span style="color:red">"/home/gridpack/software/ga-5.7"</span>
 
     make
 
     make
 
     make install  
 
     make install  
 +
 +
Be sure and replace the install directory in <span style="color:red">red</span> with an appropriate directory on your local system.
  
 
== Build and Test GridPACK ==
 
== Build and Test GridPACK ==
  
[[How_to_Build_GridPACK#Obtaining_GridPACK_Source | Obtain the GridPACK release or development code]] and put it in a convenient directory.  
+
[[Download_GridPACK | Obtain the GridPACK release or development code]] and put it in a convenient directory.
  
Configure and build GridPACK using the recipe for <code>gridpackvm</code> in <code>example_configuration.sh</code>. From the top-most GridPACK source directory, do the following:
+
From the top-most GridPACK source directory, do the following:
  
<pre>mkdir src/build
+
  mkdir src/build
cd src/build
+
  cd src/build
bash ../example_configuration.sh gridpackvm
 
make
 
make test</pre>
 
  
Or, modify this configuration recipe to fit your needs:
+
Modify this configuration recipe to fit your needs. The main changes you need to make are to modify the directories to reflect your local file structure.
  
<pre>CC=gcc
+
  rm -rf CMake*
CXX=g++
+
  export CC=gcc
export CC CXX
+
  export CXX=g++
 
+
 
cmake \
+
  cmake \
     -D PETSC_DIR:STRING=&quot;/usr/lib/petscdir/3.6.2&quot; \
+
     -D PETSC_DIR:STRING=&quot;/usr/lib/petsc&quot; \
    -D PETSC_ARCH:STRING=&quot;x86_64-linux-gnu-real&quot; \
 
 
     -D PARMETIS_DIR:PATH=&quot;/usr&quot; \
 
     -D PARMETIS_DIR:PATH=&quot;/usr&quot; \
     -D GA_EXTRA_LIBS:STRING=&quot;-lscalapack-openmpi -lblacsCinit-openmpi -lblacs-openmpi -llapack -lblas -lgfortran&quot; \
+
     -D GA_DIR:STRING=<span style="color:red">&quot;/home/gridpack/software/ga-5.7&quot;</span> \
 
     -D MPI_CXX_COMPILER:STRING=&quot;mpicxx&quot; \
 
     -D MPI_CXX_COMPILER:STRING=&quot;mpicxx&quot; \
 
     -D MPI_C_COMPILER:STRING=&quot;mpicc&quot; \
 
     -D MPI_C_COMPILER:STRING=&quot;mpicc&quot; \
 
     -D MPIEXEC:STRING=&quot;mpiexec&quot; \
 
     -D MPIEXEC:STRING=&quot;mpiexec&quot; \
 
     -D MPIEXEC_MAX_NUMPROCS:STRING=&quot;2&quot; \
 
     -D MPIEXEC_MAX_NUMPROCS:STRING=&quot;2&quot; \
     -D GRIDPACK_TEST_TIMEOUT:STRING=60 \
+
     -D GRIDPACK_TEST_TIMEOUT:STRING=&quot;20&quot; \
 
     -D USE_GLPK:BOOL=ON \
 
     -D USE_GLPK:BOOL=ON \
 
     -D GLPK_ROOT_DIR:PATH=&quot;/usr&quot; \
 
     -D GLPK_ROOT_DIR:PATH=&quot;/usr&quot; \
 
     -D BUILD_SHARED_LIBS:BOOL=OFF \
 
     -D BUILD_SHARED_LIBS:BOOL=OFF \
     -D CMAKE_INSTALL_PREFIX:PATH=&quot;$HOME/gridpack&quot; \
+
     -D CMAKE_INSTALL_PREFIX:PATH=<span style="color:red">&quot;/home/gridpack/gridpack-3.3/src/build/install&quot;</span> \
    -D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
+
    CC=gcc CXX=g++ ..
    ..
+
 
make</pre>
+
  make
 +
  make install
 +
 
 +
Again, be sure and modify the Global Array directory and the GridPACK installation directories in <span style="color:red">red</span> to match the appropriate locations on your local system.
  
 
If compilation is successful, the [[How to Build GridPACK#Running Tests|unit tests]] and/or [[How to Build GridPACK#Running_the_Powerflow_Example.28s.29|example applications]] can be run.   
 
If compilation is successful, the [[How to Build GridPACK#Running Tests|unit tests]] and/or [[How to Build GridPACK#Running_the_Powerflow_Example.28s.29|example applications]] can be run.   

Latest revision as of 16:48, 10 May 2019

This page is under construction.

Building GridPACK on Ubuntu 18.04 is slightly more complicated than building it on Ubuntu 16.04. The main differences are that 1) the PPN build does not work for this version of Ubuntu and 2) the Global Arrays library must be built by hand. MPI, Boost and PETSc can all be installed using the package manager. This example was performed on a Virtual Box instance running a clean install of Ubuntu Linux 18.04 (LTS). Virtual Box is not required and this build should work on Linux systems using the Ubuntu operating system. You will need super user or sudo privileges for this installation.

A few basic development packages will be necessary. Install them with

sudo apt-get install git build-essential devscripts equivs


Install Required Packages

Before installing the remaining packages, you must first download GridPACK onto your computer and put it in a convenient directory. Information on how to download and install GridPACK can be found here.

All the GridPACK prerequisites packages can be installed using the packaging information in the source. Run this command in the top directory of the cloned repository:

sudo mk-build-deps -i

This will make and install a virtual package called gridpack-build-deps with most of the dependencies needed to build GridPACK.

Build and Install Global Arrays

Get the Global Arrays source from the release page. We recommend using version 5.6 or 5.7 but any recent version should work. Unpack GA in a convenient location. In the unpacked directory, configure, build, and install using

   ./configure --enable-i4 --without-blas --enable-cxx --with-mpi-ts --disable-f77 \
       --prefix="/home/gridpack/software/ga-5.7"
   make
   make install 

Be sure and replace the install directory in red with an appropriate directory on your local system.

Build and Test GridPACK

Obtain the GridPACK release or development code and put it in a convenient directory.

From the top-most GridPACK source directory, do the following:

 mkdir src/build
 cd src/build

Modify this configuration recipe to fit your needs. The main changes you need to make are to modify the directories to reflect your local file structure.

 rm -rf CMake*
 export CC=gcc
 export CXX=g++
 
 cmake  \
   -D PETSC_DIR:STRING="/usr/lib/petsc" \
   -D PARMETIS_DIR:PATH="/usr" \
   -D GA_DIR:STRING="/home/gridpack/software/ga-5.7" \
   -D MPI_CXX_COMPILER:STRING="mpicxx" \
   -D MPI_C_COMPILER:STRING="mpicc" \
   -D MPIEXEC:STRING="mpiexec" \
   -D MPIEXEC_MAX_NUMPROCS:STRING="2" \
   -D GRIDPACK_TEST_TIMEOUT:STRING="20" \
   -D USE_GLPK:BOOL=ON \
   -D GLPK_ROOT_DIR:PATH="/usr" \
   -D BUILD_SHARED_LIBS:BOOL=OFF \
   -D CMAKE_INSTALL_PREFIX:PATH="/home/gridpack/gridpack-3.3/src/build/install" \
    CC=gcc CXX=g++ ..
 
 make
 make install

Again, be sure and modify the Global Array directory and the GridPACK installation directories in red to match the appropriate locations on your local system.

If compilation is successful, the unit tests and/or example applications can be run.

Removing Required Software

If no longer needed, the required packages can be removed using


sudo apt-get purge gridpack-build-deps
sudo apt autoremove