Skip to content

Installation

Maxie D. Schmidt edited this page Dec 19, 2021 · 1 revision

Installation notes for GTFoldPython

Platform specific install instructions

Dependencies: Linux (Debian-based, e.g., Ubuntu or Mint)

To get the necessary Python3 development and other C source headers installed, run the following:

$ sudo apt-get install python3-dev shtool m4 texinfo libgomp1 libgmp-dev
$ sudo apt-get install python3-numpy

Next, check the version of the gcc compiler you are running by typing

$ gcc --version
gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you are running an older distribution using a version of gcc prior to gcc-8, then you will need to upgrade your GNU C compiler:

$ apt-cache search gcc-8 gcc-9
$ sudo apt-get install gcc-8
$ which gcc && ls -l $(which gcc)
/usr/bin/gcc
lrwxrwxrwx 1 root root 5 Jan 28 07:13 /usr/bin/gcc -> gcc-9
$ sudo rm /usr/bin/gcc
$ sudo ln -s gcc-8 /usr/bin/gcc
$ gcc --version

Dependencies: RedHat Enterprise Linux (math-mulberry)

Note that on math-mulberry the sysadmins will need to ensure that some python packages are installed. You can request they run

$ sudo pip3 install numpy

On math-mulberry make sure we are using the latest compiler tools by first running

scl enable devtoolset-9 /bin/bash

Dependencies: Arch Linux

You will require the following packages:

$ sudo pacman -Syyuu
$ sudo pacman -S base-devel gcc gcc-libs libtool gettext python extra/autogen

Additionally, since ArchLinux installs the lastest autotools package, and we require the functionality from a few versions back, we have to re-install these older packages from source:

$ cd Downloads
$ wget ftp://ftp.gnu.org/gnu/automake/automake-1.16.2.tar.gz
$ tar xvzf automake-1.16.2.tar.gz
$ cd automake-1.16.2
$ ./configure && make && sudo make install 
$ automake --version
automake (GNU automake) 1.16.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tromey@redhat.com>
       and Alexandre Duret-Lutz <adl@gnu.org>.
$ cd ..
$ wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
$ tar xvzf autoconf-2.69.tar.gz
$ cd autoconf-2.69
$ ./configure && make && sudo make install 
$ autoconf --version
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.
$ autoreconf --version
autoreconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.
$ autoheader --version
autoheader (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Roland McGrath and Akim Demaille.

Troubleshooting and hints with ArchLinux

ISSUE -- Pacman needs to be updated (or out-of-date mirrors, or invalid PGP signatures, or corrupted databases)

If you have corrupted databases, run the following sequence of commands:

$ file /var/lib/pacman/sync/core.db
/var/lib/pacman/sync/core.db: HTML document, ASCII text, with very long lines (1508)
$ sudo rm -R /var/lib/pacman/sync/

Note that what you should see instead is more like the following:

$ file /var/lib/pacman/sync/*
/var/lib/pacman/sync/community.db: gzip compressed data, from Unix, original size modulo 2^32 21667840
/var/lib/pacman/sync/core.db:      gzip compressed data, from Unix, original size modulo 2^32 552960
/var/lib/pacman/sync/extra.db:     gzip compressed data, from Unix, original size modulo 2^32 6860800
SOLUTION 1: Assuming you have the pacman-contrib package installed:

If Arch (pacman) complains about invalid packages or PGP signatures, make sure you are connected to the internet, and then update the /etc/pacman.d/mirrorlist by running the following:

$ sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
$ sudo curl -o /etc/pacman.d/mirrorlist http://www.archlinux.org/mirrorlist/all/
$ sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.temp
$ sudo sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.temp
$ /usr/bin/rankmirrors -n 6 /etc/pacman.d/mirrorlist.temp > mirrorlist.txt
$ sudo mv mirrorlist.txt /etc/pacman.d/mirrorlist
$ sudo pacman -Syyuu

Now continue by installing the packages required in the instructions above.

SOLUTION 2: Assuming you have the pacman-mirrors package installed:
$ sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
$ sudo pacman-mirrors
$ sudo pacman -Syyuu

Now continue by installing the packages required in the instructions above.

SOLUTION 3: Assuming you have the reflector package installed:
$ sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
$ sudo reflector --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
$ sudo pacman -Syyuu

Now continue by installing the packages required in the instructions above.

SOLUTION 4: Default / fallback method -- edit the mirrorlist configuration by hand:
$ sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
$ sudo curl -o /etc/pacman.d/mirrorlist http://www.archlinux.org/mirrorlist/all/
# Uncomment servers from the list: 
$ sudo nano -w /etc/pacman.d/mirrorlist

Now continue by installing the packages required in the instructions above.

ISSUE -- Pacman's update command (pacman -Syyuu) fails due to errors with specific packages:

To ignore certain packages in the pacman update command, say pkg1 and pkg2, update the system using the following variant:

$ sudo pacman -Syyuu --ignore=pkg1,pkg2

Dependencies (Mac OSX instructions)

The full set of platform indeterminate install instructions can be referenced (or adapted) to install these Python bindings, and the associated Python wrapper library, on a Linux or semi-standard Unix platform besides MacOS. The next instructions are Mac OSX (10.14.x -- codename Mojave) specific:

$ brew install coreutils gnu-sed numpy python shtool pkg-config
$ brew install autoconf@2.69 automake libtool autoconf-archive 
$ brew unlink autoconf && brew link autoconf@2.69
$ brew install binutils
$ pip3 install numpy

Since the current state of autotools on MacOS is a transitional mess, we will install previous versions of these packages directly as in the instructions for ArchLinux installations:

$ cd Downloads
$ wget ftp://ftp.gnu.org/gnu/automake/automake-1.16.2.tar.gz
$ tar xvzf automake-1.16.2.tar.gz
$ cd automake-1.16.2
$ ./configure && make && sudo make install 
$ automake --version
automake (GNU automake) 1.16.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tromey@redhat.com>
       and Alexandre Duret-Lutz <adl@gnu.org>.
$ cd ..
$ wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
$ tar xvzf autoconf-2.69.tar.gz
$ cd autoconf-2.69
$ ./configure && make && sudo make install 
$ autoconf --version
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.
$ autoreconf --version
autoreconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.
$ autoheader --version
autoheader (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Roland McGrath and Akim Demaille.
$ cd ..
$ wget ftp://ftp.gnu.org/gnu/libtool/libtool-2.2.8.tar.gz
$ tar xvzf libtool-2.2.8.tar.gz
$ cd libtool-2.2.8
$ ./configure && make && sudo make install && sudo make install-data
$ libtoolize --version 
libtoolize (GNU libtool) 2.2.8
Written by Gary V. Vaughan <gary@gnu.org>, 2003

Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Optional terminal packages (with brew)

In general, we want to be able to assume the user has access to reasonable (e.g., GNU versioned, non-Apple-default) standardized interfaces to common shell commands like sed,grep,bash (among others). Otherwise we can run into syntactical compatibility issues stemming from off-standard support for POSIX (and other de facto GNU-like) interfaces supported via commandline options when running on Mac OSX. To avoid this known issue on Mac, install GNU compatible replacements for these core Unix shell utilities using the following commands:

$ brew install grep coreutils make bash

Note that the grep package may be optional. Restart your terminal session under Mac to use the new Bash shell version.

Cloning and building from source (all platforms)

Now to build the GTFold python bindings run the following commands:

$ cd $GTDMMB_HOME
$ git clone https://github.gatech.edu/gtDMMB/GTFoldPython.git
$ cd GTFoldPython/Python
$ make clean && make
... PATIENCE: THIS WILL TAKE A WHILE TO BUILD ...

If you run into unexplained issues with the build, please ensure that you are running python3.9 (or later versions of python3):

$ python3 --version
Python 3.9.2

Next, continue by running the following commands:

$ make bash-configure
(ON LINUX) $ source ~/.bashrc
(ON MACOS) $ source ~/.bash_profile
$ make test

Note that if you DO NOT wish to clobber existing settings added to the user's local bash shell configuration by a previous invocation of make bash-configure (this is not the recommended behavior), then you can first export the following environmental variable before running this command:

$ export NOCLOBBER_BASHRC_SETTINGS=1
$ make bash-configure

The make bash-configure command appends the next lines (or something very similar to it modulo the datestamp and platform specific variable settings for MacOS) to the user's home bash shell configuration. These changes will set several runtime paths used by our new GTFoldPython libraries, including the active location to the thermodynamic parameter data files. Note that it is possible to use GTModify or other thermodynamic parameter sources in place of this default setting (e.g., see this example).

#### -- START OF GTDMMB GTFOLDPYTHON CONFIG OPTIONS [ADDED += 2021-05-10 @@ 13:56:41]

## Setup the working GTDMMB software directory reference:
export GTDMMB_HOME=/Users/mschmidt34/GTDMMBSoftware

## Configure library GTFoldPython:
export GTFOLDDATADIR="/Users/mschmidt34/GTDMMBSoftware/GTFoldPython/Python/Testing/ExtraGTFoldThermoData/GTFoldTurner99"
export READLINK=/usr/local/bin/greadlink
if [[ "$LD_LIBRARY_PATH" == "" ]]; then
	export LD_LIBRARY_PATH=$(/usr/local/bin/greadlink -f /Users/mschmidt34/GTDMMBSoftware/GTFoldPython/Python/Lib)
else
	export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(/usr/local/bin/greadlink -f ./Lib)
fi
if [[ "$DYLD_LIBRARY_PATH" == "" ]]; then
	export DYLD_LIBRARY_PATH=$(/usr/local/bin/greadlink -f /Users/mschmidt34/GTDMMBSoftware/GTFoldPython/Python/Lib)
else
	export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$(/usr/local/bin/greadlink -f ./Lib)
fi
if [[ "$PYTHONPATH" == "" ]]; then
	export PYTHONPATH=$(/usr/local/bin/greadlink -f /Users/mschmidt34/GTDMMBSoftware/GTFoldPython/Python/PythonLibrarySrc)
else
	export PYTHONPATH=$PYTHONPATH:$(/usr/local/bin/greadlink -f /Users/mschmidt34/GTDMMBSoftware/GTFoldPython/Python/PythonLibrarySrc)
fi
export MACOSX_DEPLOYMENT_TARGET=10.14

#### -- END OF GTDMMB GTFOLDPYTHON SPECIFIC CONFIG SETTINGS --

If the build is successful, but some or all of the test cases fail, please post a new issue to the GTFoldPython issues pages so the problem can be addressed.

Testing the installation

Try running the following from within the same directory to test and verify the installation:

$ python3 Testing/RunBasicInterface.py
Clone this wiki locally