Skip to content
Commits on Source (9)
BasedOnStyle: Google
BreakBeforeBraces: Mozilla
AllowShortLoopsOnASingleLine: false
AccessModifierOffset: -4
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 100
IndentWidth: 4
PointerAlignment: Left
TabWidth: 4
ReflowComments: false # protect ASCII art in comments
KeepEmptyLinesAtTheStartOfBlocks: true
......@@ -14,3 +14,6 @@ tests/bin/test_pbbam
tests/data/test_group_query/group.fofn
tests/src/TestData.h
# Meson WrapDB stuff
subprojects/packagecache/
subprojects/googletest*
......@@ -34,9 +34,6 @@ before_install:
# prep zlib
- sudo apt-get install -y -qq zlib1g-dev
# prep htslib
- "cd .. && git clone https://github.com/PacificBiosciences/htslib.git && cd htslib && make && sudo make install; cd $TRAVIS_BUILD_DIR"
# prep GoogleTest
- sudo apt-get install -y -qq libgtest-dev
......
......@@ -10,8 +10,123 @@ guarantees will be maintained within each major version series.
## Active
## [0.17.0] - 2018-03-18
### Added
- CompressionLevel/NumThreads parameter implementation to PbiBuilder.
- Dataset ctor to PbiFileQuery.
- TranscriptSet to XML support.
- Auto-enabled "permissive CIGAR mode" for pbbamify tool.
- IndexedBamWriter, for more efficient writing of BAM & PBI simultaneously.
## [0.16.0] - 2018-01-17
### Removed
- Removed the PbiIndex class and its "lookup data"-related helpers. These were
never as useful as initially intended. PbiRawData and its related classes are the
recommended interface for working with PBI index data.
## [0.15.0] - 2018-01-12
### Added
- Support for long CIGARs (>64K operations).
## [0.14.0] - 2017-12-12
### Added
- Support for newer style QNAMEs. Recent version of htslib (1.4+) have started
adding extra null terminators to make the subsequent CIGAR section 32-bit aligned.
### Changed
- Requirements for htslib version used. Must now be htslib v1.4+.
## [0.13.2] - 2017-09-25
### Added
- Backward compatibility for C++11 (std::make_unique which is 11/14 agnostic).
## [0.13.1] - 2017-09-25
### Added
- Support for "pe" tag in stitched, virtual reads.
## [0.13.0] - 2017-09-25
### Changed
- Ran clang-tidy (modernize) over codebase to clean up legacy coding styles.
## [0.12.2] - 2017-09-22
### Added
- HasPulseExclusion() to BamRecord (& derived types).
## [0.12.1] - 2017-09-21
### Added
- Pulse exclusion base feature to read group.
## [0.12.0] - 2017-09-19
### Added
- NumReads() for PBI filter-based queries. This allows fetching of the number
of reads that pass the filter, without needing to iterate over the entire
file(s).
## [0.11.0] - 2017-09-15
### Added
- Support for internal tag: pulse exclusion reason ("pe"). New methods on
BamRecord, and new enum PulseExclusionReason.
### Changed
- Default PacBioBAM format version now 3.0.5
## [0.10.2] - 2017-09-14
### Changed
- Explicitly trim all whitespace from FASTA input.
## [0.10.1] - 2017-09-11
### Changed
- Frames, add mutex to avoid race condition in InitIpdDownsampling(void)
## [0.10.0] - 2017-09-08
### Changed
- PbiBuilder backend for generating PBI index files "on-the-fly" along with
writing BAM files. The previous implementation's memory usage scaled linearly
with the number of reads, sometimes reaching huge numbers (several gigs or more).
The new implementation's memory usage remains constant for any number of reads,
without any runtime hit on files/architectures tested.
### Removed
- PbiBuilder::Result(). Returned an intermediate snapshot of the index under
construction. This method isn't usable with the new PbiBuilder backend and was
really only useful for initial debugging/testing. It is no longer used in the
test framework and is unlikely to be used by client code either. Dropping this
method from the API, and thus bumping the version number.
## [0.9.0] - 2017-08-07
### Removed
- Bundled htslib. Now using 'stock' htslib (v1.3.1+).
- Built-in SWIG wrappers.
## [0.8.0] - 2017-07-24
### Added
- Default DataSet 'Version' attribute if none already present (currently 4.0.0)
- Added whitelist support for filtering ZMWs via DataSetXML.
- Added iterable query over FASTA files & ReferenceSet datasets.
- Added DataSet::AllFiles to access primary resources AND their child files (indices,
scraps, etc).
### Fixed
- Bug in the build system preventing clean rebuilds.
### Removed
- Dropped the bundled, PacBio-forked version of htslib. Now using stock htslib (v1.3.1+).
## [0.7.4] - 2016-11-18
......
......@@ -3,7 +3,7 @@
########################################################################
cmake_policy(SET CMP0048 NEW) # lets us set version in project()
project(PacBioBAM VERSION 0.7.4 LANGUAGES CXX C)
project(PacBioBAM VERSION 0.17.0 LANGUAGES CXX C)
cmake_minimum_required(VERSION 3.0)
# project name & version
......@@ -17,39 +17,32 @@ option(PacBioBAM_build_docs "Build PacBioBAM's API documentation."
option(PacBioBAM_build_tests "Build PacBioBAM's unit tests." ON)
option(PacBioBAM_build_shared "Build PacBioBAM as shared library as well." OFF)
option(PacBioBAM_build_tools "Build PacBioBAM command line utilities (e.g. pbindex)" ON)
option(PacBioBAM_wrap_csharp "Build PacBioBAM with SWIG bindings for C#." OFF)
option(PacBioBAM_wrap_python "Build PacBioBAM with SWIG bindings for Python." OFF)
option(PacBioBAM_wrap_r "Build PacBioBAM with SWIG bindings for R." OFF)
option(PacBioBAM_use_modbuild "Build PacBioBAM using Modular Build System." OFF)
option(PacBioBAM_use_ccache "Build PacBioBAM using ccache, if available." ON)
option(PacBioBAM_auto_validate "Build PacBioBAM with auto-validation enabled." OFF)
if (PacBioBAM_wrap_csharp OR PacBioBAM_wrap_r OR PacBioBAM_wrap_python)
set(wrapping_swig TRUE)
else()
set(wrapping_swig FALSE)
endif()
if(PacBioBAM_build_tests)
enable_testing()
endif()
set(PacBioBAM_permissive_cigar OFF)
STRING(TOLOWER "${PBBAM_PERMISSIVE_CIGAR}" PBBAM_PERMISSIVE_CIGAR_LOWER)
if (DEFINED PBBAM_PERMISSIVE_CIGAR)
set(PacBioBAM_permissive_cigar ON)
add_definitions(-DPBBAM_PERMISSIVE_CIGAR)
endif()
# project paths
set(PacBioBAM_RootDir ${CMAKE_CURRENT_LIST_DIR})
set(PacBioBAM_DocsDir ${PacBioBAM_RootDir}/docs)
set(PacBioBAM_IncludeDir ${PacBioBAM_RootDir}/include)
set(PacBioBAM_SourceDir ${PacBioBAM_RootDir}/src)
set(PacBioBAM_SwigSourceDir ${PacBioBAM_RootDir}/src/swig)
set(PacBioBAM_TestsDir ${PacBioBAM_RootDir}/tests)
set(PacBioBAM_ThirdPartyDir ${PacBioBAM_RootDir}/third-party)
set(PacBioBAM_ToolsDir ${PacBioBAM_RootDir}/tools)
if(NOT PacBioBAM_OutputDir)
set(PacBioBAM_OutputDir ${CMAKE_CURRENT_BINARY_DIR})
else()
if(${wrapping_swig})
message(FATAL_ERROR "SWIG bindings not currently supported in modular build.")
endif()
endif()
set(PacBioBAM_BinDir ${PacBioBAM_OutputDir}/bin)
set(PacBioBAM_LibDir ${PacBioBAM_OutputDir}/lib)
......
Copyright (c) 2014-2015, Pacific Biosciences of California, Inc.
Copyright (c) 2014-2018, Pacific Biosciences of California, Inc.
All rights reserved.
......
......@@ -23,7 +23,40 @@ This library is **not** intended to be used as a general-purpose BAM utility - a
- [Changelog](https://github.com/PacificBiosciences/pbbam/blob/master/CHANGELOG.md)
## FAQ
### [Help! I am getting "unsupported sequencing chemistry combination"!](#chemistry-bundle)
**pbbam** validates all BAM files, and as part of this validation, it checks whether the
`BindingKit` and `SequencingKit` variables in every ReadGroup of the provided BAM file are
known. As part of ongoing chemistry developments, we might need to introduce new part numbers
to identify novel reagents and/or SMRT Cells. You are unlikely to encounter such issues
when using SMRT Link, as it has an integrated auto-updater that will periodically check and
install new chemistries automatically. All PacBio tools being used without a proper SMRT Link
installation will require manual intervention to download new chemistries:
```sh
cd <some persistent dir>
export SMRT_CHEMISTRY_BUNDLE_DIR="${PWD}"
wget https://raw.githubusercontent.com/PacificBiosciences/pbcore/develop/pbcore/chemistry/resources/mapping.xml -O chemistry.xml
```
This will cause **pbbam** to try to load the out-of-band `chemistry.xml` from
`SMRT_CHEMISTRY_BUNDLE_DIR` and should allow you to use somewhat older software
with somewhat newer BAMs. **Note:** this only allows **pbbam**'s internal validation
to pass, this will not automatically make other chemistry-dependent software work
with newer chemistries. For instance, Arrow's backend ([Unanimity](https://github.com/PacificBiosciences/unanimity))
is parametrized on chemistry too, and it will fail should a completely new chemistry
be introduced. See Unanimity's FAQ on how to employ `SMRT_CHEMISTRY_BUNDLE_DIR`
to load models for new chemistries.
## License
- [PacBio open source license](https://github.com/PacificBiosciences/pbbam/blob/master/LICENSE.txt)
DISCLAIMER
----------
THIS WEBSITE AND CONTENT AND ALL SITE-RELATED SERVICES, INCLUDING ANY DATA, ARE PROVIDED "AS IS," WITH ALL FAULTS, WITH NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY, NON-INFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE. YOU ASSUME TOTAL RESPONSIBILITY AND RISK FOR YOUR USE OF THIS SITE, ALL SITE-RELATED SERVICES, AND ANY THIRD PARTY WEBSITES OR APPLICATIONS. NO ORAL OR WRITTEN INFORMATION OR ADVICE SHALL CREATE A WARRANTY OF ANY KIND. ANY REFERENCES TO SPECIFIC PRODUCTS OR SERVICES ON THE WEBSITES DO NOT CONSTITUTE OR IMPLY A RECOMMENDATION OR ENDORSEMENT BY PACIFIC BIOSCIENCES.
#!/usr/bin/env bash
set -vex
################
# DEPENDENCIES #
################
## Load modules
type module >& /dev/null || . /mnt/software/Modules/current/init/bash
module purge
module load meson
module load ninja
module load zlib
module load htslib
module load samtools
module load boost
module load cram
BOOST_ROOT="${BOOST_ROOT%/include}"
# unset these variables to have meson discover all
# boost-dependent variables from BOOST_ROOT alone
unset BOOST_INCLUDEDIR
unset BOOST_LIBRARYDIR
export CC="ccache gcc"
export CXX="ccache g++"
export CCACHE_BASEDIR="${PWD}"
if [[ $USER == bamboo ]]; then
export CCACHE_DIR=/mnt/secondary/Share/tmp/bamboo.${bamboo_shortPlanKey}.ccachedir
export CCACHE_TEMPDIR=/scratch/bamboo.ccache_tempdir
fi
case "${bamboo_planRepository_branchName}" in
develop|master)
export PREFIX_ARG="/mnt/software/p/pbbam/${bamboo_planRepository_branchName}"
export BUILD_NUMBER="${bamboo_globalBuildNumber:-0}"
;;
*)
export BUILD_NUMBER="0"
;;
esac
# in order to make shared libraries consumable
# by conda and other package managers
export LDFLAGS="-static-libstdc++ -static-libgcc"
# i : unity build
for i in "on" "off"; do
for j in "system-gcc" "gcc/8.1.0" "gcc"; do
# 1. load either current MOBS GCC or RHEL-default GCC
if [[ ${j} == system-gcc ]]; then
module load gtest/gcc48
else
module load ${j} gtest
fi
module load ccache
export CURRENT_BUILD_DIR="build_unity=${i^^}_gcc=${j/\//_}"
export ENABLED_TESTS="true"
export ENABLED_UNITY_BUILD="${i}"
bash scripts/ci/build.sh
bash scripts/ci/test.sh
module unload ccache gtest
[[ ${j} != system-gcc ]] && module unload gcc
done
done
# create symlink so Bamboo can find the xunit output
ln -s "${CURRENT_BUILD_DIR}" build
if [[ -z ${PREFIX_ARG+x} ]]; then
echo "Not installing anything (branch: ${bamboo_planRepository_branchName}), exiting."
exit 0
fi
bash scripts/ci/install.sh
if [[ ${BUILD_NUMBER} == 0 ]]; then
echo "Build number is 0, hence not creating artifact"
exit 0
fi
echo "## Creating artifact"
# install into staging dir with --prefix /usr/local
# in order to sidestep all the artifact policy
rm -rf staging
meson configure -Dprefix=/usr/local -Dtests=false "${CURRENT_BUILD_DIR}"
DESTDIR="${PWD}/staging" ninja -C "${CURRENT_BUILD_DIR}" -v install
if [[ ${BUILD_NUMBER} = 0 ]]; then
exit 0
elif [[ $bamboo_planRepository_branchName == master ]]; then
VERSION="$(${CURRENT_BUILD_DIR}/tools/bam2sam --version)".${BUILD_NUMBER}
NEXUS_REPO=maven-releases
elif [[ $bamboo_planRepository_branchName == develop ]]; then
VERSION="$(${CURRENT_BUILD_DIR}/tools/bam2sam --version)".SNAPSHOT${BUILD_NUMBER}
NEXUS_REPO=maven-snapshots
rm -rf /mnt/secondary/builds/unsupported/pbbam.previous
if [[ -e /mnt/secondary/builds/unsupported/pbbam ]]; then
mv /mnt/secondary/builds/unsupported/pbbam \
/mnt/secondary/builds/unsupported/pbbam.previous
fi
DESTDIR="/mnt/secondary/builds/unsupported/pbbam/" ninja -C "${CURRENT_BUILD_DIR}" -v install
else
exit 0
fi
NEXUS_VERSION="$(${CURRENT_BUILD_DIR}/tools/bam2sam --version)".${BUILD_NUMBER}
( cd staging && tar zcf ../pbbam-${VERSION}-x86_64.tgz . )
md5sum pbbam-${VERSION}-x86_64.tgz | awk -e '{print $1}' >| pbbam-${VERSION}-x86_64.tgz.md5
sha1sum pbbam-${VERSION}-x86_64.tgz | awk -e '{print $1}' >| pbbam-${VERSION}-x86_64.tgz.sha1
NEXUS_URL=http://ossnexus.pacificbiosciences.com/repository/${NEXUS_REPO}/pacbio/sat/pbbam/pbbam/${NEXUS_VERSION}
curl -vn --upload-file pbbam-${VERSION}-x86_64.tgz ${NEXUS_URL}/gcc-6.4.0/pbbam-${VERSION}-x86_64.tgz
curl -vn --upload-file pbbam-${VERSION}-x86_64.tgz.md5 ${NEXUS_URL}/gcc-6.4.0/pbbam-${VERSION}-x86_64.tgz.md5
curl -vn --upload-file pbbam-${VERSION}-x86_64.tgz.sha1 ${NEXUS_URL}/gcc-6.4.0/pbbam-${VERSION}-x86_64.tgz.sha1
#!/bin/bash -vex
type module >& /dev/null || . /mnt/software/Modules/current/init/bash
module load cmake
module load ccache
export CCACHE_DIR="/mnt/secondary/Share/tmp/bamboo.${bamboo_shortPlanKey}.ccache"
HTSLIB_VERSION=$(/bin/ls -d src/htslib-*|sed -e 's/.*htslib-//'|sort -V|tail -1)
PBBAM_VERSION=$(grep 'PacBioBAM VERSION ' src/pbbam/CMakeLists.txt|sed -e 's/.*VERSION //'|awk '{print $1}')
# project(PacBioBAM VERSION 0.14.0 LANGUAGES CXX C)
BUILD_NUMBER=0
if [ -n "$bamboo_planRepository_branchName" ]; then
BUILD_NUMBER=${bamboo_globalBuildNumber:-0}
fi
rm -f *.tgz || true
rm -rf pbbam* || true
rm -rf prefix && mkdir -p prefix
PREFIX=$(readlink -f prefix)
cd src/htslib-${HTSLIB_VERSION}
export CCACHE_BASEDIR=$PWD
make distclean
CC=gcc CFLAGS='-fPIC -O' bash ./configure --prefix=$PWD/../../prefix --disable-bz2 --disable-lzma --disable-libcurl
VERBOSE=1 make install
rm -rf $PWD/../../prefix/lib/pkgconfig
cd -
cd src/pbbam
export CCACHE_BASEDIR=$PWD
rm -rf build && mkdir -p build
cd build
curl -sL -O http://nexus/repository/maven-thirdparty/libquadmath/4.8.5-11/libquadmath-devel-4.8.5-11.el7.x86_64.rpm
rpm2cpio libquadmath-devel-4.8.5-11.el7.x86_64.rpm | cpio -vid
CXXFLAGS="-fPIC -I$PWD/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include" \
CFLAGS="-fPIC" \
cmake \
-DCMAKE_CXX_COMPILER="g++" \
-DCMAKE_C_COMPILER="gcc" \
-DPacBioBAM_build_shared=ON \
-DPacBioBAM_build_docs=OFF \
-DPacBioBAM_build_tests=OFF \
-DHTSLIB_INCLUDE_DIRS=$PREFIX/include \
-DHTSLIB_LIBRARIES=$PREFIX/lib/libhts.a \
-DBoost_INCLUDE_DIRS=/mnt/software/b/boost/1.60/include \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_SKIP_BUILD_RPATH=FALSE ..
VERBOSE=1 make -j
tar c bin lib | tar xv -C ../../../prefix/
cd ..
tar c include/pbbam | tar xv -C ../../prefix/
cd ../..
if [ ! -n "$bamboo_planRepository_branchName" ]; then
SNAPSHOT="_branch_"
fi
if [ "$bamboo_planRepository_branchName" = "develop" ]; then
SNAPSHOT="SNAPSHOT"
elif [ "$bamboo_planRepository_branchName" = "master" ]; then
SNAPSHOT=""
else
SNAPSHOT="_branch_"
fi
rsync -ax --delete prefix/ pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}/
tar zcf pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}
sha1sum pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz | awk -e '{print $1}' >| pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.sha1
md5sum pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz | awk -e '{print $1}' >| pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.md5
if [ "$bamboo_planRepository_branchName" = "develop" ]; then
NEXUS_URL=http://ossnexus.pacificbiosciences.com/repository/maven-snapshots/pacbio/itg/pbbam/${PBBAM_VERSION}.${BUILD_NUMBER}
elif [ "$bamboo_planRepository_branchName" = "master" ]; then
NEXUS_URL=http://ossnexus.pacificbiosciences.com/repository/maven-releases/pacbio/itg/pbbam/${PBBAM_VERSION}.${BUILD_NUMBER}
else
echo "[INFO] pbbam-${PBBAM_VERSION}.SNAPSHOT${BUILD_NUMBER}-x86_64.tgz if the branch was develop"
exit
fi
curl -L -fvn --upload-file pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.md5 $NEXUS_URL/pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.md5
curl -L -fvn --upload-file pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.sha1 $NEXUS_URL/pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.sha1
curl -L -fvn --upload-file pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz $NEXUS_URL/pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz
#!/bin/bash -vex
type module >& /dev/null || . /mnt/software/Modules/current/init/bash
module use /mnt/software/modulefiles
module use /pbi/dept/primary/modulefiles
module load cmake
module load ccache
export CCACHE_DIR="/mnt/secondary/Share/tmp/bamboo.${bamboo_shortPlanKey}.ccache"
# module load composer_xe/2017.4.196
HTSLIB_VERSION=$(/bin/ls -d src/htslib-*|sed -e 's/.*htslib-//'|sort -V|tail -1)
PBBAM_VERSION=$(grep 'PacBioBAM VERSION ' src/pbbam/CMakeLists.txt|sed -e 's/.*VERSION //'|awk '{print $1}')
# project(PacBioBAM VERSION 0.14.0 LANGUAGES CXX C)
BUILD_NUMBER=0
if [ -n "$bamboo_planRepository_branchName" ]; then
BUILD_NUMBER=${bamboo_globalBuildNumber:-0}
fi
rm -f *.tgz || true
rm -rf pbbam* || true
# rm -rf prefix && mkdir -p prefix
# cd src/htslib-${HTSLIB_VERSION}
# export CCACHE_BASEDIR=$PWD
# CC=icc CXX=icpc \
# CFLAGS='-fPIC -Os' bash ./configure --prefix=$PWD/../../prefix
# VERBOSE=1 make CC='ccache icc' install
# rm -rf $PWD/../../prefix/lib/pkgconfig
#
# cd -
# cd src/pbbam
# export CCACHE_BASEDIR=$PWD
# rm -rf build && mkdir -p build
# cd build
# cmake \
# -DCMAKE_CXX_COMPILER="ccache" \
# -DCMAKE_CXX_COMPILER_ARG1="icpc -fPIC" \
# -DCMAKE_C_COMPILER="ccache" \
# -DCMAKE_C_COMPILER_ARG1="icc -fPIC" \
# -DPacBioBAM_build_shared=OFF \
# -DPacBioBAM_build_docs=OFF \
# -DPacBioBAM_build_tests=OFF \
# -DHTSLIB_INCLUDE_DIRS=$PWD/../../../prefix/include \
# -DHTSLIB_LIBRARIES=$PWD/../../../prefix/lib/libhts.a \
# -DBoost_INCLUDE_DIRS=/mnt/software/b/boost/1.60/include \
# -DCMAKE_BUILD_TYPE=RelWithDebInfo \
# -DCMAKE_SKIP_BUILD_RPATH=FALSE ..
# VERBOSE=1 make -j
# tar c bin lib | tar xv -C ../../../prefix/
# cd ..
# tar c include/pbbam | tar xv -C ../../prefix/
# cd ../..
#
# if [ ! -n "$bamboo_planRepository_branchName" ]; then
# SNAPSHOT="_branch_"
# fi
# if [ "$bamboo_planRepository_branchName" = "develop" ]; then
# SNAPSHOT="SNAPSHOT"
# elif [ "$bamboo_planRepository_branchName" = "master" ]; then
# SNAPSHOT=""
# else
# SNAPSHOT="_branch_"
# fi
#
# rsync -ax --delete prefix/ pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}/
#
# tar zcf pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}
# sha1sum pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz | awk -e '{print $1}' >| pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.sha1
# md5sum pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz | awk -e '{print $1}' >| pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.md5
# if [ "$bamboo_planRepository_branchName" = "develop" -o "$bamboo_planRepository_branchName" = "master" ]; then
# NEXUS_URL=http://ossnexus.pacificbiosciences.com/repository/maven-snapshots/pacbio/seq/pa/pbbam/${PBBAM_VERSION}.${BUILD_NUMBER}
# curl -L -fvn --upload-file pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.md5 $NEXUS_URL/pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.md5
# curl -L -fvn --upload-file pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.sha1 $NEXUS_URL/pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.sha1
# curl -L -fvn --upload-file pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz $NEXUS_URL/pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz
# else
# echo "[INFO] pbbam-${PBBAM_VERSION}.SNAPSHOT${BUILD_NUMBER}-x86_64.tgz if the branch is develop"
# fi
# GCC BUILD
# module unload composer_xe/2017.4.196
# module load gcc/4.9.2
rm -rf prefix && mkdir -p prefix
cd src/htslib-${HTSLIB_VERSION}
export CCACHE_BASEDIR=$PWD
make distclean
CC=gcc CFLAGS='-fPIC -O' bash ./configure --prefix=$PWD/../../prefix --disable-bz2 --disable-lzma --disable-libcurl
VERBOSE=1 make install
rm -rf $PWD/../../prefix/lib/pkgconfig
cd -
cd src/pbbam
export CCACHE_BASEDIR=$PWD
rm -rf build && mkdir -p build
cd build
curl -sL -O http://nexus/repository/maven-thirdparty/libquadmath/4.8.5-11/libquadmath-devel-4.8.5-11.el7.x86_64.rpm
rpm2cpio libquadmath-devel-4.8.5-11.el7.x86_64.rpm | cpio -vid
CXXFLAGS="-fPIC -I$PWD/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include" \
CFLAGS="-fPIC" \
cmake \
-DCMAKE_CXX_COMPILER="g++" \
-DCMAKE_C_COMPILER="gcc" \
-DPacBioBAM_build_shared=OFF \
-DPacBioBAM_build_docs=OFF \
-DPacBioBAM_build_tests=OFF \
-DHTSLIB_INCLUDE_DIRS=$PWD/../../../prefix/include \
-DHTSLIB_LIBRARIES=$PWD/../../../prefix/lib/libhts.a \
-DBoost_INCLUDE_DIRS=/mnt/software/b/boost/1.60/include \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_SKIP_BUILD_RPATH=FALSE ..
VERBOSE=1 make -j
tar c bin lib | tar xv -C ../../../prefix/
cd ..
tar c include/pbbam | tar xv -C ../../prefix/
cd ../..
if [ ! -n "$bamboo_planRepository_branchName" ]; then
SNAPSHOT="_branch_"
fi
if [ "$bamboo_planRepository_branchName" = "develop" ]; then
SNAPSHOT="SNAPSHOT"
elif [ "$bamboo_planRepository_branchName" = "master" ]; then
SNAPSHOT=""
else
SNAPSHOT="_branch_"
fi
rsync -ax --delete prefix/ pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}/
tar zcf pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}
sha1sum pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz | awk -e '{print $1}' >| pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.sha1
md5sum pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz | awk -e '{print $1}' >| pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.md5
if [ "$bamboo_planRepository_branchName" = "develop" ]; then
NEXUS_URL=http://ossnexus.pacificbiosciences.com/repository/maven-snapshots/pacbio/seq/pa/pbbam/${PBBAM_VERSION}.${BUILD_NUMBER}
elif [ "$bamboo_planRepository_branchName" = "master" ]; then
NEXUS_URL=http://ossnexus.pacificbiosciences.com/repository/maven-releases/pacbio/seq/pa/pbbam/${PBBAM_VERSION}.${BUILD_NUMBER}
else
echo "[INFO] pbbam-${PBBAM_VERSION}.SNAPSHOT${BUILD_NUMBER}-x86_64.tgz if the branch was develop"
echo "[INFO] pbbam-${PBBAM_VERSION}.${BUILD_NUMBER}-x86_64.tgz if the branch was master"
exit
fi
curl -L -fvn --upload-file pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.md5 $NEXUS_URL/pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.md5
curl -L -fvn --upload-file pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.sha1 $NEXUS_URL/pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz.sha1
curl -L -fvn --upload-file pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz $NEXUS_URL/pbbam-${PBBAM_VERSION}.${SNAPSHOT}${BUILD_NUMBER}-x86_64.tgz
#!/usr/bin/env bash
set -xve
source /mnt/software/Modules/current/init/bash
module load gcc meson ccache ninja zlib htslib samtools cram boost gtest gcov
echo "#####################"
echo "# BUILD & RUN TESTS #"
echo "#####################"
rm -rf build
mkdir build
cd build
meson \
--werror \
--backend ninja \
--buildtype debug \
--default-library shared \
--libdir lib \
--wrap-mode nofallback \
--prefix "${PREFIX_ARG:-/usr/local}" \
-Db_coverage=true \
..
ninja test
echo "################"
echo "# COVERAGE #"
echo "################"
find . -type f -iname '*.o' | xargs gcov -acbrfu {} \; >/dev/null && \
mkdir coverage && pushd coverage && mv ../*.gcov . && \
sed -i -e 's@Source:@Source:../@' *.gcov && \
sed -i -e 's@Graph:@Graph:../@' *.gcov && \
sed -i -e 's@Data:@Data:../@' *.gcov && \
rm pugixml*
#
# A CMake Module for finding and using C# (.NET and Mono).
#
# The following variables are set:
# CSHARP_FOUND - set to ON if C# is found
# CSHARP_USE_FILE - the path to the C# use file
# CSHARP_TYPE - the type of the C# compiler (eg. ".NET" or "Mono")
# CSHARP_VERSION - the version of the C# compiler (eg. "v4.0" or "2.10.2")
# CSHARP_COMPILER - the path to the C# compiler executable (eg. "C:/Windows/Microsoft.NET/Framework/v4.0.30319/csc.exe" or "/usr/bin/gmcs")
# CSHARP_INTERPRETER - the path to interpreter needed to run CSharp executables
# CSHARP_PLATFORM - the C# target platform
# CSHARP_SDK - the SDK commandline switch (empty for .NET, for Mono eg. "/sdk:2" or "/sdk:4")
#
# This file is based on the work of GDCM:
# http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/FindCSharp.cmake
# Copyright (c) 2006-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
# TODO: ADD ABILITY TO SELECT WHICH C# COMPILER eg. .NET or Mono (if both exist). For the moment, .NET is selected above Mono.
# Make sure find package macros are included
include( FindPackageHandleStandardArgs )
unset( CSHARP_COMPILER CACHE )
unset( CSHARP_INTERPRETER CACHE )
unset( CSHARP_TYPE CACHE )
unset( CSHARP_VERSION CACHE )
unset( CSHARP_FOUND CACHE )
# By default use anycpu platform, allow the user to override
set( CSHARP_PLATFORM "anycpu" CACHE STRING "C# target platform: x86, x64, anycpu, or itanium" )
if( NOT ${CSHARP_PLATFORM} MATCHES "x86|x64|anycpu|itanium" )
message( FATAL_ERROR "The C# target platform '${CSHARP_PLATFORM}' is not valid. Please enter one of the following: x86, x64, anycpu, or itanium" )
endif( )
if( WIN32 )
find_package( DotNetFrameworkSdk )
if( NOT CSHARP_DOTNET_FOUND )
find_package( Mono )
endif( )
else( UNIX )
find_package( Mono )
endif( )
if( CSHARP_DOTNET_FOUND )
set( CSHARP_TYPE ".NET" CACHE STRING "Using the .NET compiler" )
set( CSHARP_VERSION ${CSHARP_DOTNET_VERSION} CACHE STRING "C# .NET compiler version" FORCE )
set( CSHARP_COMPILER ${CSHARP_DOTNET_COMPILER_${CSHARP_DOTNET_VERSION}} CACHE STRING "Full path to .NET compiler" FORCE )
set( CSHARP_INTERPRETER "" CACHE INTERNAL "Interpretor not required for .NET" FORCE )
elseif( CSHARP_MONO_FOUND )
set( CSHARP_TYPE "Mono" CACHE STRING "Using the Mono compiler" )
set( CSHARP_VERSION ${CSHARP_MONO_VERSION} CACHE STRING "C# Mono compiler version" FORCE )
set( CSHARP_COMPILER ${CSHARP_MONO_COMPILER_${CSHARP_MONO_VERSION}} CACHE STRING "Full path to Mono compiler" FORCE )
set( CSHARP_INTERPRETER ${CSHARP_MONO_INTERPRETER_${CSHARP_MONO_VERSION}} CACHE STRING "Full path to Mono interpretor" FORCE )
set( CSHARP_SDK "/sdk:4.5" CACHE STRING "C# Mono SDK commandline switch (e.g. /sdk:2, /sdk:4, /sdk:5)" )
endif( )
# Handle WIN32 specific issues
if ( WIN32 )
if ( CSHARP_COMPILER MATCHES "bat" )
set( CSHARP_COMPILER "call ${CSHARP_COMPILER}" )
endif ( )
endif( )
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CSharp DEFAULT_MSG CSHARP_TYPE CSHARP_VERSION CSHARP_COMPILER)
mark_as_advanced( CSHARP_TYPE CSHARP_VERSION CSHARP_COMPILER CSHARP_INTERPRETER CSHARP_PLATFORM CSHARP_SDK )
# Set the USE_FILE path
# http://public.kitware.com/Bug/view.php?id=7757
get_filename_component( current_list_path ${CMAKE_CURRENT_LIST_FILE} PATH )
set( CSHARP_USE_FILE ${current_list_path}/UseCSharp.cmake )
# Set paths and vars for .NET compilers
# This is hand-rolled because I had problems with the one from SimpleITK
#
# The following variables are set:
# CSHARP_DOTNET_FOUND
# CSHARP_DOTNET_COMPILER_${version} eg. "CSHARP_DOTNET_COMPILER_v4.0.30319"
# CSHARP_DOTNET_VERSION eg. "v4.0.30319"
# CSHARP_DOTNET_VERSIONS eg. "v2.0.50727, v3.5, v4.0.30319"
# DotNetFrameworkSdk_USE_FILE
#
# CSHARP_PROJECT_BUILDER (xbuild/msbuild)
set(framework_dir "C:/Windows/Microsoft.NET/Framework")
set(CSHARP_DOTNET_VERSION "v4.0.30319")
set(CSHARP_DOTNET_VERSIONS "")
set(CSHARP_DOTNET_COMPILER_${CSHARP_DOTNET_VERSION} "${framework_dir}/${CSHARP_DOTNET_VERSION}/csc.exe")
set(CSHARP_PROJECT_BUILDER "${framework_dir}/${CSHARP_DOTNET_VERSION}/MSBuild.exe")
if(EXISTS ${CSHARP_DOTNET_COMPILER_${CSHARP_DOTNET_VERSION}})
set(CSHARP_DOTNET_FOUND 1)
else()
set(CSHARP_DOTNET_FOUND 0)
endif()
# Set USE_FILE
get_filename_component( current_list_path ${CMAKE_CURRENT_LIST_FILE} PATH )
set( DotNetFrameworkSdk_USE_FILE ${current_list_path}/UseDotNetFrameworkSdk.cmake )
\ No newline at end of file
#
# A CMake Module for finding Mono.
#
# The following variables are set:
# CSHARP_MONO_FOUND
# CSHARP_MONO_COMPILER_${version} eg. "CSHARP_MONO_COMPILER_2.10.2"
# CSHARP_MONO_INTERPRETOR_${version} eg. "CSHARP_MONO_INTERPRETOR_2.10.2"
# CSHARP_MONO_VERSION eg. "2.10.2"
# CSHARP_MONO_VERSIONS eg. "2.10.2, 2.6.7"
#
# Additional references can be found here:
# http://www.mono-project.com/Main_Page
# http://www.mono-project.com/CSharp_Compiler
# http://mono-project.com/FAQ:_Technical (How can I tell where the Mono runtime is installed)
#
# This file is based on the work of GDCM:
# http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/FindMono.cmake
# Copyright (c) 2006-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
set( csharp_mono_valid 1 )
if( DEFINED CSHARP_MONO_FOUND )
# The Mono compiler has already been found
# It may have been reset by the user, verify it is correct
if( NOT DEFINED CSHARP_MONO_COMPILER_${CSHARP_MONO_VERSION} )
set( csharp_mono_version_user ${CSHARP_MONO_VERSION} )
set( csharp_mono_valid 0 )
set( CSHARP_MONO_FOUND 0 )
set( CSHARP_MONO_VERSION "CSHARP_MONO_VERSION-NOTVALID" CACHE STRING "C# Mono compiler version, choices: ${CSHARP_MONO_VERSIONS}" FORCE )
message( FATAL_ERROR "The C# Mono version '${csharp_mono_version_user}' is not valid. Please enter one of the following: ${CSHARP_MONO_VERSIONS}" )
endif( NOT DEFINED CSHARP_MONO_COMPILER_${CSHARP_MONO_VERSION} )
endif( DEFINED CSHARP_MONO_FOUND )
unset( CSHARP_MONO_VERSIONS CACHE ) # Clear versions
if( WIN32 )
# Search for Mono on Win32 systems
# See http://mono-project.com/OldReleases and http://www.go-mono.com/mono-downloads/download.html
set( csharp_mono_bin_dirs )
set( csharp_mono_search_hints
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.11.2;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.9;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.8;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.7;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.6;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.5;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.4;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.3;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.2;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.1;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.8;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.7;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.4;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.3;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.1;SdkInstallRoot]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6;SdkInstallRoot]/bin"
)
foreach( csharp_mono_search_hint ${csharp_mono_search_hints} )
get_filename_component( csharp_mono_bin_dir "${csharp_mono_search_hint}" ABSOLUTE )
if ( EXISTS "${csharp_mono_bin_dir}" )
set( csharp_mono_bin_dirs ${csharp_mono_bin_dirs} ${csharp_mono_bin_dir} )
endif ( EXISTS "${csharp_mono_bin_dir}" )
endforeach( csharp_mono_search_hint )
# TODO: Use HKLM_LOCAL_MACHINE\Software\Novell\Mono\DefaultCLR to specify default version
# get_filename_component( test "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono;DefaultCLR]" NAME )
foreach ( csharp_mono_bin_dir ${csharp_mono_bin_dirs} )
string( REPLACE "\\" "/" csharp_mono_bin_dir ${csharp_mono_bin_dir} )
if (EXISTS "${csharp_mono_bin_dir}/dmcs.bat")
set( csharp_mono_executable "${csharp_mono_bin_dir}/dmcs.bat")
elseif (EXISTS "${csharp_mono_bin_dir}/gmcs.bat")
set( csharp_mono_executable "${csharp_mono_bin_dir}/gmcs.bat")
elseif (EXISTS "${csharp_mono_bin_dir}/mcs.bat")
set( csharp_mono_executable "${csharp_mono_bin_dir}/mcs.bat")
endif (EXISTS "${csharp_mono_bin_dir}/dmcs.bat")
if( csharp_mono_valid )
# Extract version number (eg. 2.10.2)
string(REGEX MATCH "([0-9]*)([.])([0-9]*)([.]*)([0-9]*)" csharp_mono_version_temp ${csharp_mono_bin_dir})
set( CSHARP_MONO_VERSION ${csharp_mono_version_temp} CACHE STRING "C# Mono compiler version" )
mark_as_advanced( CSHARP_MONO_VERSION )
# Add variable holding executable
set( CSHARP_MONO_COMPILER_${csharp_mono_version_temp} ${csharp_mono_executable} CACHE STRING "C# Mono compiler ${csharp_mono_version_temp}" FORCE )
mark_as_advanced( CSHARP_MONO_COMPILER_${csharp_mono_version_temp} )
# Set interpreter
if (EXISTS "${csharp_mono_bin_dir}/mono.exe")
set( CSHARP_MONO_INTERPRETER_${csharp_mono_version_temp} "${csharp_mono_bin_dir}/mono.exe" CACHE STRING "C# Mono interpreter ${csharp_mono_version_temp}" FORCE )
mark_as_advanced( CSHARP_MONO_INTERPRETER_${csharp_mono_version_temp} )
endif (EXISTS "${csharp_mono_bin_dir}/mono.exe")
endif( csharp_mono_valid )
# Create a list of supported compiler versions
if( NOT DEFINED CSHARP_MONO_VERSIONS )
set( CSHARP_MONO_VERSIONS "${csharp_mono_version_temp}" CACHE STRING "Available C# Mono compiler versions" FORCE )
else( NOT DEFINED CSHARP_MONO_VERSIONS )
set( CSHARP_MONO_VERSIONS "${CSHARP_MONO_VERSIONS}, ${csharp_mono_version_temp}" CACHE STRING "Available C# Mono versions" FORCE )
endif( NOT DEFINED CSHARP_MONO_VERSIONS )
mark_as_advanced( CSHARP_MONO_VERSIONS )
# We found at least one Mono compiler version
set( CSHARP_MONO_FOUND 1 CACHE INTERNAL "Boolean indicating if C# Mono was found" )
endforeach( csharp_mono_bin_dir )
else( UNIX )
# Search for Mono on non-Win32 systems
set( chsarp_mono_names "mcs" "mcs.exe" "dmcs" "dmcs.exe" "smcs" "smcs.exe" "gmcs" "gmcs.exe" )
set(
csharp_mono_paths
"/usr/bin/"
"/usr/local/bin/"
"/usr/lib/mono/2.0"
"/opt/novell/mono/bin"
)
find_program(
csharp_mono_compiler # variable is added to the cache, we removed it below
NAMES ${chsarp_mono_names}
PATHS ${csharp_mono_paths}
)
if( EXISTS ${csharp_mono_compiler} )
# Determine version
find_program(
csharp_mono_interpreter # variable is added to the cache, we removed it below
NAMES mono
PATHS ${csharp_mono_paths}
)
if ( EXISTS ${csharp_mono_interpreter} )
execute_process(
COMMAND ${csharp_mono_interpreter} -V
OUTPUT_VARIABLE csharp_mono_version_string
)
string( REGEX MATCH "([0-9]*)([.])([0-9]*)([.]*)([0-9]*)" csharp_mono_version_temp ${csharp_mono_version_string} )
set( CSHARP_MONO_INTERPRETER_${CSHARP_MONO_VERSION} ${csharp_mono_interpreter} CACHE STRING "C# Mono interpreter ${csharp_mono_version_temp}" FORCE )
mark_as_advanced( CSHARP_MONO_INTERPRETER_${CSHARP_MONO_VERSION} )
endif ( EXISTS ${csharp_mono_interpreter} )
unset( csharp_mono_interpreter CACHE )
# We found Mono compiler
set( CSHARP_MONO_VERSION ${csharp_mono_version_temp} CACHE STRING "C# Mono compiler version" )
mark_as_advanced( CSHARP_MONO_VERSION )
set( CSHARP_MONO_COMPILER_${CSHARP_MONO_VERSION} ${csharp_mono_compiler} CACHE STRING "C# Mono compiler ${CSHARP_MONO_VERSION}" FORCE )
mark_as_advanced( CSHARP_MONO_COMPILER_${CSHARP_MONO_VERSION} )
set( CSHARP_MONO_VERSIONS ${CSHARP_MONO_VERSION} CACHE STRING "Available C# Mono compiler versions" FORCE )
mark_as_advanced( CSHARP_MONO_VERSIONS )
set( CSHARP_MONO_FOUND 1 CACHE INTERNAL "Boolean indicating if C# Mono was found" )
# Assume xbuild is just xbuild.
set(CSHARP_PROJECT_BUILDER "xbuild")
endif( EXISTS ${csharp_mono_compiler} )
# Remove temp variable from cache
unset( csharp_mono_compiler CACHE )
endif( WIN32 )
if( CSHARP_MONO_FOUND )
# Report the found versions
message( STATUS "Found the following C# Mono versions: ${CSHARP_MONO_VERSIONS}" )
endif( CSHARP_MONO_FOUND )
# Set USE_FILE
get_filename_component( current_list_path ${CMAKE_CURRENT_LIST_FILE} PATH )
set( Mono_USE_FILE ${current_list_path}/UseMono.cmake )
#
# - This module locates an installed R distribution.
#
# Defines the following:
#
# R_INCLUDE_DIR - Path to R include directory
# R_LIBRARIES - Path to R library
# R_LIBRARY_BASE -
# R_COMMAND - Path to R command
# RSCRIPT_EXECUTABLE - Path to Rscript command
#
# Make sure find package macros are included
include( FindPackageHandleStandardArgs )
set(TEMP_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
set(CMAKE_FIND_APPBUNDLE "NEVER")
find_program(R_COMMAND R DOC "R executable.")
if(R_COMMAND)
execute_process(WORKING_DIRECTORY . COMMAND ${R_COMMAND} RHOME OUTPUT_VARIABLE R_BASE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
set(R_HOME ${R_BASE_DIR} CACHE PATH "R home directory obtained from R RHOME")
mark_as_advanced(R_HOME)
endif(R_COMMAND)
find_program(RSCRIPT_EXECUTABLE Rscript DOC "Rscript executable.")
set(CMAKE_FIND_APPBUNDLE ${TEMP_CMAKE_FIND_APPBUNDLE})
# R.h gets installed in all sorts of places -
# ubuntu: /usr/share/R/include, RHEL/Fedora: /usr/include/R/R.h
find_path(R_INCLUDE_DIR R.h PATHS ${R_INCLUDE_DIR_HINT} /usr/local/lib /usr/local/lib64 /usr/share /usr/include ${R_BASE_DIR} PATH_SUFFIXES include R R/include DOC "Path to file R.h")
find_library(R_LIBRARY_BASE R PATHS ${R_BASE_DIR} PATH_SUFFIXES /lib DOC "R library (example libR.a, libR.dylib, etc.).")
set(R_LIBRARIES ${R_LIBRARY_BASE})
mark_as_advanced(RSCRIPT_EXECUTABLE R_LIBRARIES R_INCLUDE_DIR R_COMMAND R_LIBRARY_BASE)
set( _REQUIRED_R_VARIABLES R_INCLUDE_DIR R_COMMAND )
if( APPLE )
# On linux platform some times the libR.so is not available, however
# on apple a link error results if the library is linked.
list( APPEND _REQUIRED_R_VARIABLES R_LIBRARIES R_LIBRARY_BASE )
endif()
find_package_handle_standard_args(R DEFAULT_MSG ${_REQUIRED_R_VARIABLES} )
include(CMakeParseArguments)
function(create_pbbam_tool)
# parse args
set(oneValueArgs TARGET)
set(multiValueArgs SOURCES)
cmake_parse_arguments(create_pbbam_tool "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# create executable
include_directories(
${ToolsCommonDir} # shared tool code
${GeneratedDir} # generated version headers
${PacBioBAM_INCLUDE_DIRS} # pbbam/htslib includes
)
add_executable(${create_pbbam_tool_TARGET} ${create_pbbam_tool_SOURCES})
set_target_properties(
${create_pbbam_tool_TARGET} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${PacBioBAM_BinDir}
)
target_link_libraries(${create_pbbam_tool_TARGET} pbbam)
endfunction(create_pbbam_tool)
# CMake Module for finding and using C# (.NET and Mono).
#
# The following global variables are assumed to exist:
# CSHARP_SOURCE_DIRECTORY - path to C# sources
# CSHARP_BINARY_DIRECTORY - path to place resultant C# binary files
#
# The following variables are set:
# CSHARP_TYPE - the type of the C# compiler (eg. ".NET" or "Mono")
# CSHARP_COMPILER - the path to the C# compiler executable (eg. "C:/Windows/Microsoft.NET/Framework/v4.0.30319/csc.exe")
# CSHARP_VERSION - the version number of the C# compiler (eg. "v4.0.30319")
#
# The following macros are defined:
# CSHARP_ADD_EXECUTABLE( name references [files] [output_dir] ) - Define C# executable with the given name
# CSHARP_ADD_LIBRARY( name references [files] [output_dir] ) - Define C# library with the given name
#
# Examples:
# CSHARP_ADD_EXECUTABLE( MyExecutable "" "Program.cs" )
# CSHARP_ADD_EXECUTABLE( MyExecutable "ref1.dll ref2.dll" "Program.cs File1.cs" )
# CSHARP_ADD_EXECUTABLE( MyExecutable "ref1.dll;ref2.dll" "Program.cs;File1.cs" )
#
# This file is based on the work of GDCM:
# http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/UseCSharp.cmake
# Copyright (c) 2006-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
# TODO: ADD SUPPORT FOR LINK LIBRARIES
# Check something was found
if( NOT CSHARP_COMPILER )
message( WARNING "A C# compiler executable was not found on your system" )
endif( NOT CSHARP_COMPILER )
# Include type-based USE_FILE
if( CSHARP_TYPE MATCHES ".NET" )
include( ${DotNetFrameworkSdk_USE_FILE} )
elseif ( CSHARP_TYPE MATCHES "Mono" )
include( ${Mono_USE_FILE} )
endif ( CSHARP_TYPE MATCHES ".NET" )
macro( CSHARP_ADD_LIBRARY name )
CSHARP_ADD_PROJECT( "library" ${name} ${ARGN} )
endmacro( CSHARP_ADD_LIBRARY )
macro( CSHARP_ADD_EXECUTABLE name )
CSHARP_ADD_PROJECT( "exe" ${name} ${ARGN} )
endmacro( CSHARP_ADD_EXECUTABLE )
# Private macro
macro( CSHARP_ADD_PROJECT type name )
set( refs "/reference:System.dll" )
set( sources )
set( sources_dep )
if( ${type} MATCHES "library" )
set( output "dll" )
elseif( ${type} MATCHES "exe" )
set( output "exe" )
endif( ${type} MATCHES "library" )
# Step through each argument
foreach( it ${ARGN} )
if( ${it} MATCHES "(.*)(dll)" )
# Argument is a dll, add reference
list( APPEND refs /reference:${it} )
else( )
# Argument is a source file
if( EXISTS ${it} )
list( APPEND sources ${it} )
list( APPEND sources_dep ${it} )
elseif( EXISTS ${CSHARP_SOURCE_DIRECTORY}/${it} )
list( APPEND sources ${CSHARP_SOURCE_DIRECTORY}/${it} )
list( APPEND sources_dep ${CSHARP_SOURCE_DIRECTORY}/${it} )
elseif( ${it} MATCHES "[*]" )
# For dependencies, we need to expand wildcards
FILE( GLOB it_glob ${it} )
list( APPEND sources ${it} )
list( APPEND sources_dep ${it_glob} )
endif( )
endif ( )
endforeach( )
# Check we have at least one source
list( LENGTH sources_dep sources_length )
if ( ${sources_length} LESS 1 )
MESSAGE( SEND_ERROR "No C# sources were specified for ${type} ${name}" )
endif ()
list( SORT sources_dep )
# Perform platform specific actions
if (WIN32)
string( REPLACE "/" "\\" sources ${sources} )
else (UNIX)
string( REPLACE "\\" "/" sources ${sources} )
endif (WIN32)
# Add custom target and command
MESSAGE( STATUS "Adding C# ${type} ${name}: '${CSHARP_COMPILER} /t:${type} /out:${name}.${output} /platform:${CSHARP_PLATFORM} ${CSHARP_SDK} ${refs} ${sources}'" )
add_custom_command(
COMMENT "Compiling C# ${type} ${name}: '${CSHARP_COMPILER} /t:${type} /out:${name}.${output} /platform:${CSHARP_PLATFORM} ${CSHARP_SDK} ${refs} ${sources}'"
OUTPUT ${CSHARP_BINARY_DIRECTORY}/${name}.${output}
COMMAND ${CSHARP_COMPILER}
ARGS /t:${type} /out:${name}.${output} /platform:${CSHARP_PLATFORM} ${CSHARP_SDK} ${refs} ${sources}
WORKING_DIRECTORY ${CSHARP_BINARY_DIRECTORY}
DEPENDS ${sources_dep}
)
add_custom_target(
${name} ALL
DEPENDS ${CSHARP_BINARY_DIRECTORY}/${name}.${output}
SOURCES ${sources_dep}
)
endmacro( CSHARP_ADD_PROJECT )
#
# A CMake Module for using Mono.
#
# The following variables are set:
# (none)
#
# Additional references can be found here:
# http://www.mono-project.com/Main_Page
# http://www.mono-project.com/CSharp_Compiler
#
# This file is based on the work of GDCM:
# http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/FindMono.cmake
# Copyright (c) 2006-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
message( STATUS "Using .NET compiler version ${CSHARP_DOTNET_VERSION}" )
\ No newline at end of file
#
# A CMake Module for using Mono.
#
# The following variables are set:
# (none)
#
# Additional references can be found here:
# http://www.mono-project.com/Main_Page
# http://www.mono-project.com/CSharp_Compiler
#
# This file is based on the work of GDCM:
# http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/FindMono.cmake
# Copyright (c) 2006-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
message( STATUS "Using Mono compiler version ${CSHARP_MONO_VERSION}" )
if(PacBioBAM_use_ccache)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()
endif()