osuosl-cookbooks / pgd

Apache License 2.0
1 stars 0 forks source link

Build and install DSSP v2 #10

Open mathuin opened 9 years ago

mathuin commented 9 years ago

The old installations of PGD use a precompiled binary named dsspcmbi which was downloaded from a place that is no longer around. Recently a number of problem proteins were fixed by building a new binary from scratch.

The source code to DSSP is available at ftp://ftp.cmbi.ru.nl/pub/software/dssp/. This code uses Boost which requires a bunch of other bits of code to be installed in order to compile DSSP. Once DSSP is compiled, it needs to be installed on the virtual machine.

mathuin commented 9 years ago

This script, when run on a freshly converged virtual machine using the current cookbook, will correctly build and install DSSP. I do not recommend using this script as-is, I'm just providing a proof of concept here.

#!/bin/sh

# First, build vm from kitchen converge.

# Install necessary packages
sudo yum install -y zlib zlib-devel zlib-static
sudo yum install -y glibc glibc-devel glibc-static

# Now download, build, and install bzip2
wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar zxf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6
make
sudo make install
cd ..

# Now download, build, and install Boost
wget http://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.gz
tar zxf boost_1_57_0.tar.gz
cd boost_1_57_0
./bootstrap.sh
./b2
sudo ./b2 install
cd ..

# Now download, build, and install DSSP
wget ftp://ftp.cmbi.ru.nl/pub/software/dssp/dssp-2.2.1.tgz
tar zxf dssp-2.2.1.tgz
cd dssp-2.2.1
# append rt to end of LIBS line
mv makefile makefile.old
sed -e "/^LIBS/s/$/ rt/" < makefile.old > makefile
make
# bad install
sudo cp mkdssp /usr/local/bin/dsspcmbi
cd ..
mathuin commented 9 years ago

I have created an RPM and opened a ticket with support to have that RPM posted on our internal repository. I have also created a repository for DSSP so we can build from that repo in the future.

Once the RPM is posted, I will see about adding it to the RPMs already installed by the cookbook.

ramereth commented 9 years ago

@mathuin where does the spec file live for this package? Ideally it should be in the DSSP repo you just created. I'd like to inspect that spec before it gets uploaded. I'm a little concerned about some of the stuff you listed in your PoC script above.

jordane commented 9 years ago

@ramereth IIRC this was created with fpm, not a srpm.

jordane commented 9 years ago

@ramereth Part of the problem was that some of the libraries need to be built so that DSSP links them statically, rather than dynamically. This is a problem with crappy code in DSSP.

ramereth commented 9 years ago

@jordane do you think fpm is still a good approach to this specific app? Or should we make a more proper specfile that we can build with mock to ensure the build env is correct? I was hoping we could stick to fpm and use our fpm-builds repo. But I fear there are some apps that just need proper spec files.

jordane commented 9 years ago

A specfile is probably better in the end, but I'm not sure that this warrants a specfile as long as the fpm build steps are properly documented. If maintaining documentation for them is complicated, then a spec file is probably the right choice.

ramereth commented 9 years ago

I'd say lets try making it work with fpm first. We just have to make sure we build it on the correct OS platform.

@mathuin can you please make a pull request from the fpm-builds repo for this?

mathuin commented 8 years ago

Was going through my old issues, noticed this one. Do you still want me to make a PR for fpm-builds? That repo has six commits with the last one almost two years ago. I can do it, I just want to make sure that repo is still the right place for this issue.

ramereth commented 8 years ago

@mathuin It's probably better to make a spec file for this but it's a little more work. For now let's stick with fpm-builds

mathuin commented 8 years ago

I had a little trouble with fpm until I discovered https://github.com/alanfranz/fpm-within-docker which is awesome.

https://github.com/osuosl/dssp/pull/3 is a better solution than the fpm-builds repository for this problem -- I think keeping the RPM-building code in the same repo as the code being built makes a lot more sense, and it also lends itself towards automating RPM production when pushing to master, guaranteeing that we have the most recent build.

ramereth commented 8 years ago

@mathuin sounds like a plan to me. Great work on finding that!