With Ubuntu 22.04, a runtime error related to the adolc
library is currently reported when executing PSOPT code if you follow the instructions that work for Ubuntu 20.04. Here are the specific instructions that are needed to install PSOPT under Ubuntu 22.04.
First, you should run the following from a terminal window to install some packages that are required:
sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install gfortran
sudo apt-get install g++
sudo apt-get install libboost-dev
sudo apt-get install libboost-system-dev
sudo apt-get install coinor-libipopt-dev
sudo apt-get install gnuplot
sudo apt-get install libeigen3-dev
sudo apt-get install libblas-dev
sudo apt-get install liblapack-dev
Second, you should run the following commands to download, compile and install adolc and ColPack.
cd $HOME/Downloads
wget --continue www.coin-or.org/download/source/ADOL-C/ADOL-C-2.6.3.tgz
cd $HOME
tar zxvf ./Downloads/ADOL-C-2.6.3.tgz
cd $HOME/ADOL-C-2.6.3
mkdir ./ThirdParty
cd ./ThirdParty
wget --continue http://archive.ubuntu.com/ubuntu/pool/universe/c/colpack/colpack_1.0.10.orig.tar.gz
tar zxvf colpack_1.0.10.orig.tar.gz
mv ColPack-1.0.10 ColPack
cd ColPack
./autoconf.sh
make
sudo make install
sudo cp -P ./build/lib/libCol* /usr/lib
cd $HOME/ADOL-C-2.6.3
./configure --enable-sparse --with-colpack=$HOME/ADOL-C-2.6.3/ThirdParty/ColPack/build
make
make install
sudo cp -P $HOME/adolc_base/lib64/lib* /usr/lib
sudo cp -r $HOME/adolc_base/include/* /usr/include/
cd $HOME
You should create a file called adolc.pc
with the following content and copy it to the folder /usr/lib/pkgconfig
adolc.pc
prefix=/usr/
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: adolc
Version: 2.6.3
Description: Algorithmic Differentiation Library for C/C++
Requires:
Libs: -L${libdir} -ladolc -Wl,-rpath,${libdir}
-L${libdir} -lColPack -Wl,-rpath,${libdir}
Cflags: -I${includedir}
You should also create a file called ColPack.pc
with the following content and copy it to the folder /usr/lib/pkgconfig
ColPack.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/ColPack
Name: ColPack
Version: 1.0.10
Description: Graph Coloring Library
Requires:
Libs: -L${libdir} -lColPack -Wl,-rpath,${libdir}
-L${libdir} -Wl,-rpath,${libdir}
Cflags: -I${includedir}
Then, you can run the following commands to download, compile and install PSOPT.
git clone https://github.com/PSOPT/psopt.git
cd psopt; mkdir build; cd build
cmake -DBUILD_EXAMPLES=ON ..
make
sudo make install