The following script downloads the source code of libDAI it, and installs it.
wget https://github.com/yesimon/libDAI/archive/master.zip -O libdai-master.zip unzip libdai-master.zip mkdir libdai-build cd libdai-build cmake ../libDAI-master make -j4 2>&1 | tee ../../LibdaiMake.log sudo make install 2>&1 | tee ../../LibdaiMakeInstall.log