Skip to content

Commit

Permalink
Finish Release-2.3.1
Browse files Browse the repository at this point in the history
No changes to the KAT tools themselves.  This release focuses on making an improved build process.  User's now have the option of disabling plotting completely, and requesting whether to link to boost in dynamic mode.  We also ensure that KAT only links to python3 rather than python2 if python2 is the default python installation on the system.
  • Loading branch information
Daniel Mapleson committed Dec 12, 2016
2 parents d2826fe + 0e1b99f commit acbaa32
Show file tree
Hide file tree
Showing 20 changed files with 272 additions and 543 deletions.
18 changes: 15 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ matrix:
env: COMPILER=GCC5 PLOT=python
- os: osx
compiler: clang


# safelist
branches:
only:
- master
- develop

# Setup compiler
before_install:
- ./.travis/before_install.sh
Expand All @@ -34,8 +40,14 @@ install:

# Make sure python's available at runtime (if necessary) and then build KAT and run tests
script:
- if [[ "$PLOT" == "python" ]] || [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="$HOME/miniconda/bin:$PATH" && source activate test-environment && export LD_LIBRARY_PATH="$HOME/miniconda/envs/test-environment/lib:$LD_LIBRARY_PATH"; fi
- ./configure --disable-silent-rules && make && make check && make distcheck
- if [[ "$COMPILER" == "GCC5" ]]; then export CXX="g++-5" && export CC="gcc-5"; elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX="g++-4.9" && export CC="gcc-4.9"; fi
- if [[ "$PLOT" == "python" ]] || [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="$HOME/miniconda/bin:$PATH" && source activate test-environment && export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/miniconda/envs/test-environment/lib"; fi
- gcc --version
- g++ --version
- ./configure
- make V=1
- make V=1 check
#- make V=1 distcheck



1 change: 1 addition & 0 deletions .travis/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.install.sh.swp
9 changes: 6 additions & 3 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
else
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update -qq
sudo apt-get install -qq libc6-dev
if [ "$COMPILER" == "GCC5" ]; then
sudo apt-get install -qq g++-5
sudo apt-get install -qq gcc-5 g++-5
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 100
export CXX="g++-5"
export CC="gcc-5"
export CC="gcc-5"
else
sudo apt-get install -qq g++-4.9
sudo apt-get install -qq gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 100
export CXX="g++-4.9"
export CC="gcc-4.9"
fi
gcc --version
g++ --version
gcc --print-search-dirs
fi
83 changes: 43 additions & 40 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -1,51 +1,54 @@
#!/bin/bash

if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
# Install boost -- looks like boost 1.55.0_2 is already installed with brew
#brew install boost

# Install boost -- looks like boost 1.55.0_2 is already installed with brew
#brew install boost


# install anaconda
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda;
export PATH="$HOME/miniconda/bin:$PATH";
hash -r;
conda config --set always_yes yes --set changeps1 no;
conda update -q conda;
conda info -a
conda create -q -n test-environment python=3.5 anaconda;
# install anaconda
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda;
export PATH="$HOME/miniconda/bin:$PATH";
hash -r;
conda config --set always_yes yes --set changeps1 no;
conda update -q conda;
conda info -a
conda create -q -n test-environment python=3.5 anaconda;

else

# Boost installation
wget -q http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz/download
mv download boost.tar.gz
tar -xf boost.tar.gz
cd boost_1_59_0
sudo ./bootstrap.sh --with-libraries=chrono,timer,program_options,filesystem,system
if [[ "$COMPILER" == "GCC5" ]]; then
sudo ./b2 -d0 --toolset=gcc-5 install;
else
sudo ./b2 -d0 --toolset=gcc-4.9 install;
fi
cd ..


# Plotting installation
if [[ "$PLOT" == "python" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda;
export PATH="$HOME/miniconda/bin:$PATH";
hash -r;
conda config --set always_yes yes --set changeps1 no;
conda update -q conda;
conda info -a
conda create -q -n test-environment python=3.5 anaconda;
elif [ "$PLOT" == "gnuplot" ]; then
sudo apt-get install gnuplot
gnuplot --version;
fi
# Boost installation
wget -q http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz/download
mv download boost.tar.gz
tar -xf boost.tar.gz
cd boost_1_59_0
sudo ./bootstrap.sh --with-libraries=chrono,timer,program_options,filesystem,system
if [[ "$COMPILER" == "GCC5" ]]; then
export CXX="g++-5"
export CC="gcc-5"
sudo ./b2 -d0 --toolset=gcc-5 install;
else
export CXX="g++-4.9"
export CC="gcc-4.9"
sudo ./b2 -d0 --toolset=gcc-4.9 install;
fi
cd ..


# Plotting installation
if [[ "$PLOT" == "python" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda;
export PATH="$HOME/miniconda/bin:$PATH";
hash -r;
conda config --set always_yes yes --set changeps1 no;
conda update -q conda;
conda info -a
conda create -q -n test-environment python=3.5 anaconda;
elif [ "$PLOT" == "gnuplot" ]; then
sudo apt-get install gnuplot
gnuplot --version;
fi

fi

130 changes: 82 additions & 48 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Autoconf initialistion. Sets package name version and contact details
AC_PREREQ([2.68])
AC_INIT([kat],[2.3.0],[https://github.com/TGAC/KAT/issues],[kat],[https://github.com/TGAC/KAT])
AC_INIT([kat],[2.3.1],[https://github.com/TGAC/KAT/issues],[kat],[https://github.com/TGAC/KAT])
AC_CONFIG_SRCDIR([src/kat.cc])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
Expand Down Expand Up @@ -78,45 +78,48 @@ else
fi

# Plotting
AC_ARG_ENABLE([gnuplot], AS_HELP_STRING([--enable-gnuplot], [Enable gnuplot plotting even if python matplotlib is available]), enable_gnuplot="yes", enable_gnuplot="no")

#AM_PATH_PYTHON([], [], AC_MSG_ERROR([Python interpreter not found.]))

AX_PYTHON_DEVEL([>= '3.1'])

pybin=python${PYTHON_VERSION}
pymod_good="no"
if [[ -n "${PYTHON_VERSION}" ]]; then
if [[ -z "${PYTHON_EXTRA_LIBS}" ]]; then
pymod_good="no"
AC_MSG_WARN([Python3 detected but Python3 development library was not found. If you wish to use python plotting please install python3 library. e.g. "sudo apt-get install python3-dev" on debian systems.])
fi
pymod_good="yes"
AX_PYTHON_MODULE(numpy, ,${pybin})
if [[ "${PYMOD}" == "no" ]]; then
pymod_good="no"
fi
AX_PYTHON_MODULE(matplotlib, ,${pybin})
if [[ "${PYMOD}" == "no" ]]; then
pymod_good="no"
fi
AX_PYTHON_MODULE(scipy, ,${pybin})
if [[ "${PYMOD}" == "no" ]]; then
pymod_good="no"
AC_ARG_ENABLE([noplotting], AS_HELP_STRING([--disable-plotting], [This will disable plotting even if python matplotlib or gnuplot are available]), do_plotting="no", do_plotting="yes")
AC_ARG_ENABLE([gnuplot], AS_HELP_STRING([--enable-gnuplot], [Enable gnuplot plotting even if python matplotlib is available]), use_gnuplot="yes", use_gnuplot="no")

if [[ "${do_plotting}" == "yes" ]]; then
if [[ "${use_gnuplot}" == "no" ]]; then
AX_PYTHON_DEVEL([>= '3.1'])

pybin=python${PYTHON_VERSION}
if [[ -n "${PYTHON_VERSION}" ]]; then
if [[ -z "${PYTHON_EXTRA_LIBS}" ]]; then
pymod_good="no"
AC_MSG_WARN([Python3 detected but Python3 development library was not found. If you wish to use python plotting please install python3 library. e.g. "sudo apt-get install python3-dev" on debian systems.])
fi
pymod_good="yes"
AX_PYTHON_MODULE(numpy, ,${pybin})
if [[ "${PYMOD}" == "no" ]]; then
pymod_good="no"
fi
AX_PYTHON_MODULE(matplotlib, ,${pybin})
if [[ "${PYMOD}" == "no" ]]; then
pymod_good="no"
fi
AX_PYTHON_MODULE(scipy, ,${pybin})
if [[ "${PYMOD}" == "no" ]]; then
pymod_good="no"
fi
fi
fi
fi

# Check for gnuplot on path. Just emit a warning if not present
if [[ "${pymod_good}" == "no" ]] || [[ "${enable_gnuplot}" == "yes" ]]; then
AC_DEFINE([HAVE_PYTHON], [0], [Python not present])
AC_CHECK_PROG([gnuplot_found], [gnuplot], [yes], [no])
if [[ "${gnuplot_found}" == "no" ]] ; then
AC_DEFINE([HAVE_GNUPLOT], [0], [Gnuplot not present])
# Check for gnuplot on path. Just emit a warning if not present
if [[ "${pymod_good}" == "no" ]] || [[ "${use_gnuplot}" == "yes" ]]; then
AC_DEFINE([HAVE_PYTHON], [0], [Python not present])
AC_CHECK_PROG([gnuplot_found], [gnuplot], [yes], [no])
if [[ "${gnuplot_found}" == "no" ]] ; then
AC_DEFINE([HAVE_GNUPLOT], [0], [Gnuplot not present])
else
AC_DEFINE([HAVE_GNUPLOT], [1], [Gnuplot present])
fi
else
AC_DEFINE([HAVE_GNUPLOT], [1], [Gnuplot present])
AC_DEFINE([HAVE_PYTHON], [1], [Python present])
fi
else
AC_DEFINE([HAVE_PYTHON], [1], [Python present])
fi

# Check for sphinx to build documentation (optional)
Expand All @@ -141,7 +144,11 @@ AM_CONDITIONAL([MAKE_DOCS], [test x$sphinx = xyes])
AC_SUBST([MAKE_DOCS])



## Check for boost

AC_ARG_ENABLE([dynamic-boost], AS_HELP_STRING([--enable-dynamic-boost], [Boost is statically linked by default. Use this option if you would prefer to dynamically link boost]), dynboost="yes", dynboost="no")

AX_BOOST_BASE([1.52],, [AC_MSG_ERROR([Boost not found. Please ensure that boost is properly built and the BOOST_ROOT environment variable is set. Alternatively you can override BOOST_ROOT with the --with-boost option.])])
AX_BOOST_FILESYSTEM
AX_BOOST_SYSTEM
Expand All @@ -154,20 +161,37 @@ define([PC_FILE], lib/kat-2.2.pc)


# Combine BOOST variables (apart for BOOST_TEST)
BOOST_LIBS="${BOOST_FILESYSTEM_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} ${BOOST_SYSTEM_LIB} ${BOOST_TIMER_LIB}"
BOOST_STATIC_LIBS="${BOOST_TIMER_STATIC_LIB} ${BOOST_CHRONO_STATIC_LIB} ${RT_LIB} ${BOOST_FILESYSTEM_STATIC_LIB} ${BOOST_PROGRAM_OPTIONS_STATIC_LIB} ${BOOST_SYSTEM_STATIC_LIB} "
BOOST_DYN_LIBS="${BOOST_TIMER_LIB} ${BOOST_CHRONO_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} ${BOOST_SYSTEM_LIB}"
AC_SUBST([BOOST_DYN_LIBS])

BOOST_STATIC_LIBS="${BOOST_TIMER_STATIC_LIB} ${BOOST_CHRONO_STATIC_LIB} ${BOOST_FILESYSTEM_STATIC_LIB} ${BOOST_PROGRAM_OPTIONS_STATIC_LIB} ${BOOST_SYSTEM_STATIC_LIB} "
AC_SUBST([BOOST_STATIC_LIBS])

# Prefer static linking of boost. If one or more static libs are not present
# (this happens with some default boost installations on some environments) then
# use dynamic libs instead.
if [[ "${dynboost}" == "yes" ]]; then
BOOST_LIBS="${BOOST_DYN_LIBS}"
else
if [[ -z "${BOOST_TIMER_STATIC_LIB}" ]] || [[ -z "${BOOST_CHRONO_STATIC_LIB}" ]] || [[ -z "${BOOST_FILESYSTEM_STATIC_LIB}" ]] || [[ -z "${BOOST_PROGRAM_OPTIONS_STATIC_LIB}" ]] || [[ -z "${BOOST_SYSTEM_STATIC_LIB}" ]]; then
AC_MSG_WARN([Not all static boost libraries could be found. Will use dynamic libraries instead.])
BOOST_LIBS="${BOOST_DYN_LIBS}"
else
BOOST_LIBS="${BOOST_STATIC_LIBS}"
fi
fi
AC_SUBST([BOOST_LIBS])

AM_CXXFLAGS="-DCPLUSPLUS"
AC_SUBST([AM_CXXFLAGS])

if [[ "${pymod_good}" == "yes" ]]; then
AM_CPPFLAGS="${BOOST_CPPFLAGS} ${PYTHON_CPPFLAGS}"
AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_STATIC_LIBS} ${PYTHON_EXTRA_LIBS} ${PYTHON_LIBS}"
AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_LIBS} ${RT_LIB} ${PYTHON_EXTRA_LIBS} ${PYTHON_LIBS}"
AM_LDFLAGS="${BOOST_LDFLAGS} ${PYTHON_EXTRA_LDFLAGS}"
else
AM_CPPFLAGS="${BOOST_CPPFLAGS}"
AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_STATIC_LIBS}"
AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_LIBS} ${RT_LIB}"
AM_LDFLAGS="${BOOST_LDFLAGS}"
fi

Expand All @@ -181,24 +205,34 @@ AC_CONFIG_FILES([Makefile doc/Makefile doc/source/conf.py lib/kat.pc lib/Makefil
AC_CONFIG_SUBDIRS([deps/jellyfish-2.2.0])
AC_OUTPUT

if [[ "${pymod_good}" == "yes" ]] && [[ "$enable_gnuplot" == "no" ]] ; then
AC_MSG_NOTICE([Using python plotting])
if [[ "${do_plotting}" == "no" ]]; then
AC_MSG_NOTICE([Plotting disabled])
else
if [[ "${gnuplot_found}" == "yes" ]]; then
if [[ "$enable_gnuplot" == "no" ]]; then
AC_MSG_WARN([Python3, or some required python modules where not found. Python via matplotlib is the preferred plotting method in KAT. If you want to use python plotting (the preferred option) then we suggest you install anaconda3 (or python3 with numpy, scipy and matplotlib separately). However, gnuplot was detected so KAT plots will be generated via gnuplot instead.])
if [[ "${pymod_good}" == "yes" ]] && [[ "$use_gnuplot" == "no" ]] ; then
AC_MSG_NOTICE([Using python plotting])
else
if [[ "${gnuplot_found}" == "yes" ]]; then
if [[ "${use_gnuplot}" == "no" ]]; then
AC_MSG_WARN([Python3, or some required python modules where not found. Python via matplotlib is the preferred plotting method in KAT. If you want to use python plotting (the preferred option) then we suggest you install anaconda3 (or python3 with numpy, scipy and matplotlib separately). However, gnuplot was detected so KAT plots will be generated via gnuplot instead.])
else
AC_MSG_NOTICE([Using gnuplot plotting])
fi
else
AC_MSG_NOTICE([Using gnuplot plotting])
AC_MSG_WARN([Neither python (with plotting modules present) or Gnuplot not detected. KAT will still work (minus plots). Should you require plotting functionality, you must install either anaconda3 (or python3 with numpy, scipy and matplotlib) or gnuplot, and then reconfigure and compile to enable plotting in KAT.])
fi
else
AC_MSG_WARN([Neither python (with plotting modules present) or Gnuplot not detected. KAT will still work (minus plots). Should you require plotting functionality, you must install either anaconda3 (or python3 with numpy, scipy and matplotlib) or gnuplot, and then reconfigure and compile to enable plotting in KAT.])
fi
fi
fi

if [[ "${sphinx}" == "no" ]]; then
AC_MSG_WARN([Sphinx not detected, or version is too old. Wont create documentation. You can still find the documentation online at: https://kat.readthedocs.org/en/latest/])
else
AC_MSG_NOTICE([Building documentation with sphinx])
fi

if [[ "${dynboost}" == "yes" ]]; then
AC_MSG_NOTICE([Boost will be dynamically linked to your executable])
else
AC_MSG_NOTICE([Boost will be statically linked to your executable])
fi


1 change: 1 addition & 0 deletions deps/jellyfish-2.2.0/tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
/multi_file_fail_cmds
/bloom_counter_commands
*.timing
merge_m40*
1 change: 1 addition & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ DISTFILES = $(DPS)/index.rst \
$(DPI)/kmer_spectra1.png \
$(DPI)/kmer_spectra_breakdown.png \
$(DPI)/pe_v_asm_clean.png \
$(DPI)/pe_v_asm_wrong.png \
$(DPI)/pe_v_mp_after_density.png \
$(DPI)/pe_v_mp_after_shared.png \
$(DPI)/pe_v_mp_before_density.png \
Expand Down
1 change: 1 addition & 0 deletions doc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ DISTFILES = $(DPS)/index.rst \
$(DPI)/kmer_spectra1.png \
$(DPI)/kmer_spectra_breakdown.png \
$(DPI)/pe_v_asm_clean.png \
$(DPI)/pe_v_asm_wrong.png \
$(DPI)/pe_v_mp_after_density.png \
$(DPI)/pe_v_mp_after_shared.png \
$(DPI)/pe_v_mp_before_density.png \
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
# built documents.
#
# The short X.Y version.
version = '2.3.0'
version = '2.3.1'
# The full version, including alpha/beta/rc tags.
release = '2.3.0'
release = '2.3.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
Loading

0 comments on commit acbaa32

Please sign in to comment.