Skip to content

Commit

Permalink
Rebuild Augustus recipe (#51641)
Browse files Browse the repository at this point in the history
* Rebuild Augustus recipe

* add galaxy link

* simplify build.sh

* clean up recipe

* add make clean to reduce package size

* remove make clean
  • Loading branch information
mencian authored Oct 24, 2024
1 parent b463c24 commit 5dad918
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 32 deletions.
47 changes: 26 additions & 21 deletions recipes/augustus/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,39 @@

set -x -e

#export CXXFLAGS="${CXXFLAGS} -std=c++11 -stdlib=libstdc++ -stdlib=libc++ -DUSE_BOOST"
export CXXFLAGS="${CXXFLAGS} -std=c++11 -DUSE_BOOST -I${PREFIX}/include"
export INCLUDES="-I${PREFIX}/include"
export LIBPATH="-L${PREFIX}/lib"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
export CXXFLAGS="${CXXFLAGS} -O3 -std=c++14 -DUSE_BOOST -I${PREFIX}/include"

mkdir -p ${PREFIX}/bin
mkdir -p ${PREFIX}/scripts
mkdir -p ${PREFIX}/config

## Make the software

if [ "$(uname)" = Darwin ] ; then
# SQLITE disabled due to compile issue, see: https://svn.boost.org/trac10/ticket/13501
sqlite=
if [[ "$(uname)" = Darwin ]]; then
# SQLITE disabled due to compile issue, see: https://svn.boost.org/trac10/ticket/13501
sqlite=
else
sqlite='SQLITE=true'
sqlite='SQLITE=true'
fi
make \
CC="${CC}" \
CXX="${CXX}" \
INCLUDE_PATH_BAMTOOLS="-I${PREFIX}/include/bamtools" \
LIBRARY_PATH_BAMTOOLS="-L${PREFIX}/lib" \
INCLUDE_PATH_LPSOLVE="-I${PREFIX}/include/lpsolve" \
LIBRARY_PATH_LPSOLVE="-L${PREFIX}/lib" \
INCLUDE_PATH_HTSLIB="-I${PREFIX}/include/htslib" \
LIBRARY_PATH_HTSLIB="-L${PREFIX}/lib" \
COMPGENPRED=true \
MYSQL=false \
$sqlite

make \
CC="${CC}" \
CXX="${CXX}" \
INCLUDE_PATH_BAMTOOLS="-I${PREFIX}/include/bamtools" \
LIBRARY_PATH_BAMTOOLS="-L${PREFIX}/lib" \
INCLUDE_PATH_LPSOLVE="-I${PREFIX}/include/lpsolve" \
LIBRARY_PATH_LPSOLVE="-L${PREFIX}/lib" \
INCLUDE_PATH_HTSLIB="-I${PREFIX}/include/htslib" \
LIBRARY_PATH_HTSLIB="-L${PREFIX}/lib" \
COMPGENPRED=true \
MYSQL=false \
"${sqlite}" -j"${CPU_COUNT}"

# Fix perl shebang
sed -i.bak '1 s|^.*$|#!/usr/bin/env perl|g' ${SRC_DIR}/scripts/*.pl
rm -rf ${SRC_DIR}/scripts/*.bak

## Build Perl

Expand All @@ -39,7 +44,7 @@ cd perl-build
# affects tests for Augustus 3.3:
# https://github.com/Gaius-Augustus/Augustus/commit/7ca3ab
#sed -i'' -e '1s/perl -w/perl/' *.pl
cp ${RECIPE_DIR}/Build.PL ./
cp -f ${RECIPE_DIR}/Build.PL ./
perl ./Build.PL
perl ./Build manifest
perl ./Build install --installdirs site
Expand All @@ -49,11 +54,11 @@ cd ..

## End build perl

chmod 0755 bin/augustus
mv bin/* $PREFIX/bin/
mv scripts/* $PREFIX/bin/
mv config/* $PREFIX/config/


## Set AUGUSTUS variables on env activation

mkdir -p ${PREFIX}/etc/conda/activate.d ${PREFIX}/etc/conda/deactivate.d
Expand Down
19 changes: 12 additions & 7 deletions recipes/augustus/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
{% set name = "augustus" %}
{% set version = "3.5.0" %}
{% set sha256 = "5ed6ce6106303b800c5e91d37a250baff43b20824657b853ae04d11ad8bdd686" %}

package:
name: augustus
name: {{ name }}
version: {{ version }}

source:
url: https://github.com/Gaius-Augustus/Augustus/archive/v{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- patches/0001-Makefile.patch
- patches/homGeneMapping.src.makefile.patch
- patches/utrrnaseq.patch

build:
number: 4
number: 5
run_exports:
- {{ pin_subpackage('augustus', max_pin="x") }}

requirements:
build:
- make
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
- zlib
- samtools ==0.1.19
- samtools
- bamtools
- htslib
- gsl
Expand All @@ -35,7 +38,6 @@ requirements:
- perl
- perl-module-build
run:
- zlib
- boost-cpp
- gsl
- lp_solve
Expand Down Expand Up @@ -152,19 +154,22 @@ test:
- fix_in_frame_stop_codon_genes.py --help | grep -Fq 'fix_in_frame_stop_codon_genes.py'

about:
home: http://bioinf.uni-greifswald.de/augustus/
license: Artistic Licence
home: "https://bioinf.uni-greifswald.de/augustus"
license: "Artistic Licence"
license_family: Other
license_file: "src/LICENSE.TXT"
summary: 'AUGUSTUS is a gene prediction program for eukaryotes written by Mario
Stanke and Oliver Keller. It can be used as an ab initio program, which means
it bases its prediction purely on the sequence. AUGUSTUS may also incorporate
hints on the gene structure coming from extrinsic sources such as EST, MS/MS,
protein alignments and synthenic genomic alignments.'
dev_url: "https://github.com/Gaius-Augustus/Augustus"
doc_url: "https://github.com/Gaius-Augustus/Augustus/blob/v{{ version }}/docs/RUNNING-AUGUSTUS.md"

extra:
identifiers:
- biotools:augustus
- doi:10.1093/bioinformatics/btr010
- usegalaxy-eu:augustus
- usegalaxy-eu:augustus_training
notes: "Builds with sqlite support are currently only available on Linux due to compile issues with macOS."
40 changes: 40 additions & 0 deletions recipes/augustus/patches/0001-Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/Makefile b/Makefile
index a26b40c..b2ccb6a 100644
--- a/Makefile
+++ b/Makefile
@@ -26,20 +26,26 @@ clean:
cd .. && ./pyclean.sh; \
fi

-PREFIX = /usr/local
-INSTALLDIR = /opt/augustus-$(AUGVERSION)
+# DESTDIR is usually the empty string but can be set for staging
+prefix ?= $(PREFIX)
+bindir = $(DESTDIR)$(prefix)/bin
+INSTALLDIR = $(prefix)/share/augustus-$(AUGVERSION)

install:
- if [ ! $(PWD) -ef $(INSTALLDIR) ] ; then \
+ @echo Installing augustus executables into $(bindir)
+# two main ways:
+# 1) make install is executed from anywhere but in INSTALLDIR. Then INSTALLDIR is created if it does not exist and config data is copied.
+# 2) make install is executed in INSTALLDIR. This is done by the singularity file.
+ if [ ! $(CURDIR) -ef $(INSTALLDIR) ] ; then \
install -d $(INSTALLDIR) && \
cp -a config bin scripts $(INSTALLDIR) ; \
fi
- ln -sf $(INSTALLDIR)/bin/augustus $(PREFIX)/bin/augustus
- ln -sf $(INSTALLDIR)/bin/etraining $(PREFIX)/bin/etraining
- ln -sf $(INSTALLDIR)/bin/prepareAlign $(PREFIX)/bin/prepareAlign
- ln -sf $(INSTALLDIR)/bin/fastBlockSearch $(PREFIX)/bin/fastBlockSearch
- if [ -f $(INSTALLDIR)/bin/load2db ] ; then ln -sf $(INSTALLDIR)/bin/load2db $(PREFIX)/bin/load2db ; fi
- if [ -f $(INSTALLDIR)/bin/getSeq ] ; then ln -sf $(INSTALLDIR)/bin/getSeq $(PREFIX)/bin/getSeq ; fi
+ ln -sf $(INSTALLDIR)/bin/augustus $(bindir)/augustus
+ ln -sf $(INSTALLDIR)/bin/etraining $(bindir)/etraining
+ ln -sf $(INSTALLDIR)/bin/prepareAlign $(bindir)/prepareAlign
+ ln -sf $(INSTALLDIR)/bin/fastBlockSearch $(bindir)/fastBlockSearch
+ if [ -f $(INSTALLDIR)/bin/load2db ] ; then ln -sf $(INSTALLDIR)/bin/load2db $(bindir)/load2db ; fi
+ if [ -f $(INSTALLDIR)/bin/getSeq ] ; then ln -sf $(INSTALLDIR)/bin/getSeq $(bindir)/getSeq ; fi

# for internal purposes:
release:
19 changes: 15 additions & 4 deletions recipes/augustus/patches/utrrnaseq.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
--- a/auxprogs/utrrnaseq/Makefile 2022-09-23 10:06:14.000000000 -0700
+++ b/auxprogs/utrrnaseq/Makefile 2022-10-08 10:15:31.359607884 -0700
@@ -29,6 +29,7 @@
diff --git a/auxprogs/utrrnaseq/Makefile b/auxprogs/utrrnaseq/Makefile
index 134c5c5..63fa103 100644
--- a/auxprogs/utrrnaseq/Makefile
+++ b/auxprogs/utrrnaseq/Makefile
@@ -3,7 +3,7 @@
include ../../common.mk

CXX ?= g++
-CXXFLAGS := -Wall -O0 -pedantic -fmessage-length=0 ${CXXFLAGS}
+CXXFLAGS := -Wall -O3 -pedantic -fmessage-length=0 -std=c++14 ${CXXFLAGS}
INCLS += $(INCLUDE_PATH_BOOST) # set boost include path in INCLUDE_PATH_BOOST, if boost is not installed system-wide
LDFLAGS += $(LIBRARY_PATH_BOOST) # set boost library path in LIBRARY_PATH_BOOST, if boost is not installed system-wide

@@ -29,6 +29,7 @@ utrrnaseq: $(OBJS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
+ cp -f utrrnaseq ../../bin/utrrnaseq

$(OBJS): $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
@echo 'Building file: $<'
@@ -55,5 +56,6 @@
@@ -55,5 +56,6 @@ clean_test:
clean: clean_test
rm -rf $(OBJS) $(DEPS) $(OBJ_DIR) utrrnaseq
@echo ' '
Expand Down

0 comments on commit 5dad918

Please sign in to comment.