#!/bin/bash

# unpack header-only libraries
tar -zxf CoDiPack-1.2.1.tar.gz
unzip FADBAD++-2.1.zip

# build CppAD
tar -zxf CppAD.tar.gz
cd CppAD && mkdir build && mkdir local && cd build && cmake .. -Dcppad_prefix=../local && make install && cd ../..

# build trilinos
tar -zxf trilinos-12.4.2-Source.tar.gz
cd trilinos-12.4.2-Source && mkdir build && mkdir local && cd build && cp ../../do-configure . && ./do-configure && make install && cd ../..

# build ADOLC
tar -zxf ADOL-C-2.6.1.tgz
cd ADOL-C-2.6.1 && mkdir local && ./configure --prefix=$PWD/local && make install && cd ..

# build adept
tar -zxf adept-1.1.tar.gz
cd adept-1.1 && mkdir local && ./configure --prefix=$PWD/local && make install && cd ..

