Skip to content
Commits on Source (37)
vg (1.18.0+ds-1) UNRELEASED; urgency=medium
vg (1.18.0+ds2-1) UNRELEASED; urgency=medium
* Initial release. (Closes: #939537)
......
......@@ -52,7 +52,10 @@ Build-Depends: debhelper-compat (= 12),
rapidjson-dev,
libfml-dev,
libfastahack-dev,
fastahack
fastahack,
libsmithwaterman-dev,
libjs-d3,
libdivsufsort-dev
# libvcflib-dev (>= 1.0),
# libhts-dev
# libsdsl-dev,
......@@ -63,10 +66,11 @@ Vcs-Git: https://salsa.debian.org/med-team/vg.git
Homepage: https://github.com/vgteam/vg#vg
Package: vg
Architecture: any
Architecture: amd64
Depends: ${shlibs:Depends},
${misc:Depends}
Breaks: cgvg
${misc:Depends},
libjs-d3
Conflicts: cgvg
Description: tools for working with genome variation graphs
variation graph data structures, interchange formats, alignment, genotyping,
and variant calling methods
......
......@@ -15,52 +15,214 @@ Files-Excluded: deps/libdeflate
deps/vowpal_wabbit/rapidjson
deps/vowpal_wabbit/vowpalwabbit/win32
deps/vowpal_wabbit/vowpalwabbit/.nuget
deps/vowpal_wabbit/demo
deps/vowpal_wabbit/utl
deps/fermi-lite
deps/fastahack
deps/libVCFH
deps/vcflib/libVCFH
deps/vcflib/tabixpp/htslib
deps/vcflib/fastahack
deps/vcflib/smithwaterman
deps/vcflib/src/ssw.*
deps/vcflib/src/ssw_cpp.*
deps/sublinear-Li-Stephens/deps/htslib
deps/sparsehash
deps/sdsl-lite/external
deps/vcflib/googletest
deps/sonLib/C/impl/lz4hc.h
deps/sonLib/C/impl/lz4.h
deps/sonLib/C/impl/lz4.c
deps/sonLib/C/impl/lz4hc.c
deps/FlameGraph
Files: *
Copyright: © 2014 Erik Garrison
deps/htslib/htslib/kfunc.*
deps/htslib/bgzf.c
deps/htslib/htslib/bgzf.h
deps/sparsepp/sparsepp/spp_timer.h
Copyright: © 2014, 2010, 2012, 2014-2015 Erik Garrison
2013, Pavel Shramov <shramov@mexmat.net>
(C) 2009-2014, 2018 by Benedict Paten (benedictpaten@gmail.com)
(C) 2012 by Dent Earl dentearl (a) gmail com
(C) 2006-2014 by Joel Armstrong & Benedict Paten
(c) 2010 Serge A. Zaitsev
(C) 2006-2012 by Glenn Hickey
2008-2018, Genome Research Ltd.
2017-2019, Jouni Siren
2008-2013, Broad Institute / Massachusetts Institute of Technology
<2015> <Zev N. Kronenberg>
(C) 2011 Attractive Chaos <attractor@live.co.uk>
2012-2016, Boston College
2012-2018 Wellcome Sanger Institute
2003-2006, 2008-2010, Heng Li <lh3@live.co.uk>
2014, Intel Corporation.
2018, Google LLC.
2014, Juha Karkkainen, Dominik Kempa and Simon J. Puglisi
2016, Mariano Gonzalez
2014, Robert Davis
© `2015` `Eric T Dawson`
License: MIT
Files: ./contrib/proto2cpp/proto2cpp.py
Files: contrib/proto2cpp/proto2cpp.py
Copyright: 2012-2015, Timo Marjoniemi
2016, Regents of the University of California
License: LGPL-2.1+
Files: ./ontology/owl2xhtml.xsl
Files: ontology/owl2xhtml.xsl
Copyright: 2008, Andreas Radinger and Martin Hepp, Bundeswehr University Munich, http:www.unibw.de/ebusiness/
2014, UniProt consortium, http:www.uniprot.org
2016, SIB Swiss Institute of Bioinformatics, http:www.isb-sib.ch
License: LGPL
License: LGPL-3+
Files: ./src/unittest/catch.hpp
Files: src/unittest/catch.hpp
deps/vcflib/intervaltree/catch.hpp
deps/sublinear-Li-Stephens/src/test/catch.hpp
Copyright: 2012, Two Blue Cubes Ltd.
License: BSL-1.0
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
Files: deps/htslib/cram/*
deps/htslib/header.*
deps/sparsepp/*
deps/sonLib/C/inc/hashTableC.h
deps/sonLib/C/inc/hashTablePrivateC.h
deps/sonLib/C/inc/hashTableC_itr.h
deps/sonLib/C/impl/hashTableC_itr.c
deps/sonLib/C/impl/hashTableC.c
deps/vcflib/src/mt19937ar.h
deps/vowpal_wabbit/*
Copyright: 2008-2018, Genome Research Ltd.
2008-2009, 2011, Attractive Chaos <attractor@live.co.uk>
1993-2002, MEDICAL RESEARCH COUNCIL
2016, Gregory Popovitch - greg7mdp@gmail.com
2005, 2010, Google Inc.
(C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk
(C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura
© Microsoft Corp 2012-2014, Yahoo! Inc. 2007-2012, and many individual contributors.
(c) 2012 - ariel faigon for vowpal-wabbit
License: BSD-3-clause
Files: deps/sonLib/sonLib_daemonize.py
Copyright: (C) 2006-2012 by Glenn Hickey
(C) 2005 Chad J. Schroeder
License: Python and MIT
Files: deps/sonLib/externalTools/quicktree_1.1/*
Copyright: (C) Genome Research Limited, 2002-
Comment: License verified from https://github.com/khowe/quicktree/
Which is linked from https://www.sanger.ac.uk/science/tools/quicktree
License: Apache-2
Files: deps/sonLib/externalTools/cutest/*
Copyright: (c) 2003 Asim Jalis
License: Zlib
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
.
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software in
a product, an acknowledgment in the product documentation would be
appreciated but is not required.
.
2. Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
.
3. This notice may not be removed or altered from any source
distribution.
Comment: from License.txt
The license is based on the zlib/libpng license. For more details see
http://www.opensource.org/licenses/zlib-license.html. The intent of the
license is to:
.
- keep the license as simple as possible
- encourage the use of CuTest in both free and commercial applications
and libraries
- keep the source code together
- give credit to the CuTest contributors for their work
.
If you ship CuTest in source form with your source distribution, the
following license document must be included with it in unaltered form.
If you find CuTest useful we would like to hear about it.
Files: deps/pinchesAndCacti/externalTools/threeEdgeConnected/inc/3_Absorb3edge2x.h
deps/pinchesAndCacti/externalTools/threeEdgeConnected/impl/3_Absorb3edge2x.c
Copyright: (C) 2011 by Yung H Tsin and Nima Norouzi
License: 3edgeconnected
* The authors of this code have given their permission
* to distribute and redistribute this code within this software product,
* however they require that any further incorporation or copying
* be permitted by request only, hence the BSD/MIT license which
* applies to much of the other code in this software product does not apply to this file.
Files: deps/htslib/os/rand.c
Copyright: (c) 1993 Martin Birgmeier
License: other
You may redistribute unmodified or modified versions of this source
code provided that the above copyright notice and this and the
following conditions are retained.
.
This software is provided ``as is'', and comes with no warranties
of any kind. I shall in no event be liable for anything that happens
to anyone/anything when using this software.
Files: deps/sdsl-lite/*
deps/vcflib/filevercmp/*
deps/sonLib/C/impl/avl.c
deps/sonLib/C/inc/avl.h
Copyright: 2007-2014 Simon Gog
1995, Ian Jackson <iwj10@cus.cam.ac.uk>
2001, Anthony Towns <aj@azure.humbug.org.au>
1998-2002, 2004, 2008-2009, Free Software Foundation, Inc.
2016, Francisco Montoto
2011, Timo Beller, Simon Gog
2012, Simon Gog, Matthias Petri
2013, Simon Gog, Timo Beller and Markus Brenner
1999, N. Jesper Larsson
2013, Timo Beller
License: GPL-3+
Files: deps/structures/*
Copyright: 2017, Netflix, Inc.
License: Apache-2
Files: deps/libvgio/include/vg/io/fdstream.hpp
Copyright: (C) Copyright Nicolai M. Josuttis 2001.
License: NTP
Permission to copy, use, modify, sell and distribute this software
is granted provided this copyright notice appears in all copies.
This software is provided "as is" without express or implied
warranty, and with no claim as to its suitability for any purpose.
Files: deps/htslib/md5.c
Copyright: No copyright is claimed
License: solar-MD5
This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.
MD5 Message-Digest Algorithm (RFC 1321).
.
Homepage:
http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
.
Author:
Alexander Peslyak, better known as Solar Designer <solar at openwall.com>
.
This software was written by Alexander Peslyak in 2001. No copyright is
claimed, and the software is hereby placed in the public domain.
In case this attempt to disclaim copyright and place the software in the
public domain is deemed null and void, then the software is
Copyright (c) 2001 Alexander Peslyak and it is hereby released to the
general public under the following terms:
.
Redistribution and use in source and binary forms, with or without
modification, are permitted.
.
There's ABSOLUTELY NO WARRANTY, express or implied.
Files: debian/*
Copyright: © 2018 Michael R. Crusoe <michael.crusoe@gmail.com>
......@@ -84,3 +246,168 @@ License: MIT
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License: LGPL-2.1+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
.
On Debian systems, the complete text of version 2 of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-2'.
License: LGPL-3+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
Comment:
On Debian systems, you can find the LGPL license version 3 in
‘/usr/share/common-licenses/LGPL-3’.
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
https://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian systems, the complete text of the Apache version 2.0 license
can be found in "/usr/share/common-licenses/Apache-2.0".
License: BSD-3-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
.
* Neither the name of the original author; nor the names of any contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License: Python
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
.
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016 Python Software Foundation; All Rights
Reserved" are retained in Python alone or in any derivative version prepared by
Licensee.
.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
License: BSL-1.0
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
.
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
License: GPL-3+
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
.
You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
Comment:
On Debian systems, you can find the GPL license version 3 in
‘/usr/share/common-licenses/GPL-3’.
This diff is collapsed.
......@@ -31,7 +31,7 @@ Description: Ensure that we don't accidentally include profile mode
ifndef CGL_DEBUG
--- vg.orig/deps/vcflib/Makefile
+++ vg/deps/vcflib/Makefile
@@ -163,7 +163,7 @@
@@ -158,7 +158,7 @@
$(MAKE) CXXFLAGS="$(CXXFLAGS) -g" all
gprof:
......
From: Michael R. Crusoe <michael.crusoe@gmail.com>
Subject: improve build parallization
--- vg.orig/deps/sonLib/externalTools/Makefile
+++ vg/deps/sonLib/externalTools/Makefile
@@ -8,13 +8,13 @@
clean : cutestM.clean quicktreeM.clean
cutestM :
- cd cutest && make all
+ +cd cutest && $(MAKE) all
cutestM.clean :
- cd cutest && make clean
+ +cd cutest && $(MAKE) clean
quicktreeM :
- cd quicktree_1.1 && make all CC="${cxx}"
+ +cd quicktree_1.1 && $(MAKE) all CC="${cxx}"
quicktreeM.clean :
- cd quicktree_1.1 && make clean
+ +cd quicktree_1.1 && $(MAKE) clean
--- vg.orig/deps/vcflib/Makefile
+++ vg/deps/vcflib/Makefile
@@ -167,7 +167,7 @@
# cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm
$(FILEVERCMP): pre
- cd filevercmp && make && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp *.o $(VCF_LIB_LOCAL)/$(INC_DIR)/
+ +cd filevercmp && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp *.o $(VCF_LIB_LOCAL)/$(INC_DIR)/
$(SHORTBINS): pre
$(MAKE) bin/$@
@@ -206,7 +206,7 @@
cd multichoose && $(MAKE) clean
cd fsom && $(MAKE) clean
cd test && $(MAKE) clean
- cd filevercmp && $(MAKE) clean
+ +cd filevercmp && $(MAKE) clean
cd intervaltree && $(MAKE) clean
.PHONY: clean all test pre
--- vg.orig/deps/structures/Makefile
+++ vg/deps/structures/Makefile
@@ -13,7 +13,7 @@
all:
- make $(BINDIR)/test
+ +$(MAKE) $(BINDIR)/test
.PHONY: clean .pre_build
clean:
......@@ -2,7 +2,7 @@ use_packaged_libdeflate
use_packaged_boost
use_packaged_jemalloc
use_packaged_libbackward-cpp
use_packages_rocksdb
use_packaged_rocksdb
use_packaged_elfutils
use_packaged_protobuf
use_packaged_raptor2
......@@ -19,4 +19,8 @@ use_packaged_fastahack
#use_packaged_htslib # waiting on https://github.com/samtools/htslib/pull/904/files or similiar to be merged & new htslib release
#use_packaged_vw # debian package is out of date, missing array_parameters.h, and not in testing/stable
#use_packaged_sdsl # fails many tests, local copy is a newer snapshot than Debian's
#hardening_flags not yet ready
hardening_flags
use_packaged_smithwaterman
static
use_packaged_lz4
parallize_better
Author: Michael R. Crusoe <michael.crusoe@gmail.com>
Description: For Debian, don't statically link to cairo, jansson, libstdc++, libgcc
--- vg.orig/Makefile
+++ vg/Makefile
@@ -35,9 +35,9 @@
# Define libraries to link against. Make sure to always link statically against
# htslib and libdeflate and Protobuf so that we can use position-dependent code
# there for speed.
-LD_LIB_FLAGS:= -L$(CWD)/$(LIB_DIR) $(CWD)/$(LIB_DIR)/libvgio.a -lhandlegraph -lvcflib -lgssw -lssw -lprotobuf -lsublinearLS $(CWD)/$(LIB_DIR)/libhts.a -ldeflate -lpthread -ljansson -lncurses -lgcsa2 -lgbwt -ldivsufsort -ldivsufsort64 -lgfakluge -lraptor2 -lsdsl -lpinchesandcacti -l3edgeconnected -lsonlib -lfml -llz4 -lstructures -lvw -lboost_program_options -lallreduce -lbdsg $(shell pkg-config --libs libfastahack) $(shell pkg-config --libs libsmithwaterman)
+LD_LIB_FLAGS:= -L$(CWD)/$(LIB_DIR) $(CWD)/$(LIB_DIR)/libvgio.a -lhandlegraph -lz -lvcflib -lgssw -lssw -lprotobuf -lsublinearLS $(CWD)/$(LIB_DIR)/libhts.a -ldeflate -lpthread -ljansson -lncurses -lgcsa2 -lgbwt -ldivsufsort -ldivsufsort64 -lgfakluge -lraptor2 -lsdsl -lpinchesandcacti -l3edgeconnected -lsonlib -lfml -llz4 -lstructures -lvw -lboost_program_options -lallreduce -lbdsg $(shell pkg-config --libs libfastahack) $(shell pkg-config --libs libsmithwaterman)
# Use pkg-config to find Cairo and all the libs it uses
-LD_LIB_FLAGS += $(shell pkg-config --libs --static cairo jansson)
+LD_LIB_FLAGS += $(shell pkg-config --libs cairo jansson)
ifeq ($(shell uname -s),Darwin)
@@ -149,7 +149,7 @@
# When building statically, we need to tell the linker not to bail if it sees multiple definitions.
# libc on e.g. our Jenkins host does not define malloc as weak, so other mallocs can't override it in a static build.
# TODO: Why did this problem only begin to happen when libvw was added?
-STATIC_FLAGS=-static -static-libstdc++ -static-libgcc -Wl,--allow-multiple-definition
+STATIC_FLAGS=-static -Wl,--allow-multiple-definition
# These are put into libvg. Grab everything except main
OBJ = $(filter-out $(OBJ_DIR)/main.o,$(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(wildcard $(SRC_DIR)/*.cpp)))
......@@ -7,13 +7,13 @@ Description: Use the Debian version of fastahack; not working due to vg needing
# Set include flags. All -I options need to go in here, so the first directory listed is genuinely searched first.
-INCLUDE_FLAGS:=-I$(CWD)/$(INC_DIR) -I. -I$(CWD)/$(SRC_DIR) -I$(CWD)/$(UNITTEST_SRC_DIR) -I$(CWD)/$(SUBCOMMAND_SRC_DIR) -I$(CWD)/$(INC_DIR)/dynamic -I$(CWD)/$(INC_DIR)/sonLib $(shell pkg-config --cflags cairo jansson)
+INCLUDE_FLAGS:=-I/usr/include/fastahack -I$(CWD)/$(INC_DIR) -I. -I$(CWD)/$(SRC_DIR) -I$(CWD)/$(UNITTEST_SRC_DIR) -I$(CWD)/$(SUBCOMMAND_SRC_DIR) -I$(CWD)/$(INC_DIR)/dynamic -I$(CWD)/$(INC_DIR)/sonLib $(shell pkg-config --cflags cairo jansson)
+INCLUDE_FLAGS:=$(shell pkg-config --cflags libfastahack) -I$(CWD)/$(INC_DIR) -I. -I$(CWD)/$(SRC_DIR) -I$(CWD)/$(UNITTEST_SRC_DIR) -I$(CWD)/$(SUBCOMMAND_SRC_DIR) -I$(CWD)/$(INC_DIR)/dynamic -I$(CWD)/$(INC_DIR)/sonLib $(shell pkg-config --cflags cairo jansson)
# Define libraries to link against. Make sure to always link statically against
# htslib and libdeflate and Protobuf so that we can use position-dependent code
# there for speed.
-LD_LIB_FLAGS:= -L$(CWD)/$(LIB_DIR) $(CWD)/$(LIB_DIR)/libvgio.a -lhandlegraph -lvcflib -lgssw -lssw -lprotobuf -lsublinearLS $(CWD)/$(LIB_DIR)/libhts.a -ldeflate -lpthread -ljansson -lncurses -lgcsa2 -lgbwt -ldivsufsort -ldivsufsort64 -lvcfh -lgfakluge -lraptor2 -lsdsl -lpinchesandcacti -l3edgeconnected -lsonlib -lfml -llz4 -lstructures -lvw -lboost_program_options -lallreduce -lbdsg
+LD_LIB_FLAGS:= -L$(CWD)/$(LIB_DIR) $(CWD)/$(LIB_DIR)/libvgio.a -lhandlegraph -lvcflib -lgssw -lssw -lprotobuf -lsublinearLS $(CWD)/$(LIB_DIR)/libhts.a -ldeflate -lpthread -ljansson -lncurses -lgcsa2 -lgbwt -ldivsufsort -ldivsufsort64 -lgfakluge -lraptor2 -lsdsl -lpinchesandcacti -l3edgeconnected -lsonlib -lfml -llz4 -lstructures -lvw -lboost_program_options -lallreduce -lbdsg -lfastahack
+LD_LIB_FLAGS:= -L$(CWD)/$(LIB_DIR) $(CWD)/$(LIB_DIR)/libvgio.a -lhandlegraph -lvcflib -lgssw -lssw -lprotobuf -lsublinearLS $(CWD)/$(LIB_DIR)/libhts.a -ldeflate -lpthread -ljansson -lncurses -lgcsa2 -lgbwt -ldivsufsort -ldivsufsort64 -lgfakluge -lraptor2 -lsdsl -lpinchesandcacti -l3edgeconnected -lsonlib -lfml -llz4 -lstructures -lvw -lboost_program_options -lallreduce -lbdsg $(shell pkg-config --libs libfastahack)
# Use pkg-config to find Cairo and all the libs it uses
LD_LIB_FLAGS += $(shell pkg-config --libs --static cairo jansson)
......@@ -141,18 +141,20 @@ Description: Use the Debian version of fastahack; not working due to vg needing
SMITHWATERMAN = smithwaterman/SmithWatermanGotoh.o
REPEATS = smithwaterman/Repeats.o
INDELALLELE = smithwaterman/IndelAllele.o
@@ -135,8 +134,8 @@
@@ -135,10 +134,8 @@
HTS_LDFLAGS ?= -L$(VCF_LIB_LOCAL)/tabixpp/htslib -lhts -lbz2 -lm -lz -llzma -pthread
-INCLUDES = $(HTS_INCLUDES) -I$(INC_DIR)
-LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2
+INCLUDES = -I/usr/include/fastahack $(HTS_INCLUDES) -I$(INC_DIR)
+LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2 -lfastahack
-
-
+INCLUDES = $(shell pkg-config --cflags libfastahack) $(HTS_INCLUDES) -I$(INC_DIR)
+LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2 $(shell pkg-config --libs libfastahack)
all: $(OBJECTS) $(BINS) scriptToBin
@@ -188,9 +187,6 @@
@@ -183,9 +180,6 @@
$(INDELALLELE): $(SMITHWATERMAN)
......@@ -162,7 +164,7 @@ Description: Use the Debian version of fastahack; not working due to vg needing
#$(FSOM):
# cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm
@@ -233,10 +229,8 @@
@@ -227,10 +221,8 @@
rm -rf $(OBJ_DIR)
cd tabixpp && $(MAKE) clean
cd smithwaterman && $(MAKE) clean
......
Author: Michael R. Crusoe <michael.crusoe@gmail.com>
Description: Use the Debian packaged lz4 library
--- vg.orig/deps/sonLib/C/Makefile
+++ vg/deps/sonLib/C/Makefile
@@ -22,7 +22,7 @@
${binPath}/sonLibTests : ${libTests} ${libInternalHeaders} ${libPath}/sonLib.a ${libPath}/cuTest.a tests/allTests.c
@mkdir -p $(dir $@)
- ${cxx} $(LDFLAGS) $(CPPFLAGS) ${cflags} -I inc -I ${libPath} -o $@.tmp tests/allTests.c ${libTests} ${libPath}/sonLib.a ${libPath}/cuTest.a ${dblibs} ${mysqlLibs} -lm -lstdc++ -lpthread
+ ${cxx} $(LDFLAGS) $(CPPFLAGS) ${cflags} -I inc -I ${libPath} -o $@.tmp tests/allTests.c ${libTests} ${libPath}/sonLib.a ${libPath}/cuTest.a ${dblibs} ${mysqlLibs} -lm -lstdc++ -lpthread -llz4
mv $@.tmp $@
${binPath}/sonLib_kvDatabaseTest : ${libTests} ${libInternalHeaders} ${libPath}/sonLib.a ${libPath}/cuTest.a tests/kvDatabaseTest.c tests/kvDatabaseTestCommon.c
Author: Michael R. Crusoe <michael.crusoe@gmail.com>
Description: make the vcflib codecopy less bad by using the smithwaterman library
--- vg.orig/deps/vcflib/Makefile
+++ vg/deps/vcflib/Makefile
@@ -119,11 +119,6 @@
SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=))
TABIX = tabixpp/tabix.o
-SMITHWATERMAN = smithwaterman/SmithWatermanGotoh.o
-REPEATS = smithwaterman/Repeats.o
-INDELALLELE = smithwaterman/IndelAllele.o
-DISORDER = smithwaterman/disorder.o
-LEFTALIGN = smithwaterman/LeftAlign.o
FSOM = fsom/fsom.o
FILEVERCMP = filevercmp/filevercmp.o
@@ -134,8 +129,8 @@
HTS_LDFLAGS ?= -L$(VCF_LIB_LOCAL)/tabixpp/htslib -lhts -lbz2 -lm -lz -llzma -pthread
-INCLUDES = $(shell pkg-config --cflags libfastahack) $(HTS_INCLUDES) -I$(INC_DIR)
-LDFLAGS += -L$(LIB_DIR) $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2 $(shell pkg-config --libs libfastahack)
+INCLUDES = $(shell pkg-config --cflags libfastahack) $(HTS_INCLUDES) -I$(INC_DIR) $(shell pkg-config --cflags libsmithwaterman)
+LDFLAGS += -L$(LIB_DIR) $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2 $(shell pkg-config --libs libfastahack) $(shell pkg-config --libs libsmithwaterman)
all: $(OBJECTS) $(BINS) scriptToBin
@@ -155,7 +150,7 @@
gprof:
$(MAKE) CXXFLAGS="$(CXXFLAGS)" all
-$(OBJECTS): $(SOURCES) $(HEADERS) $(TABIX) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP) $(FASTAHACK)
+$(OBJECTS): $(SOURCES) $(HEADERS) $(TABIX) multichoose pre $(FILEVERCMP) $(FASTAHACK)
$(CXX) $(CPPFLAGS) -c -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && cp src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
# $(CXX) $(CPPFLAGS) -c -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) -lvcflib $(CXXFLAGS) && cp src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
@@ -168,17 +163,6 @@
$(TABIX): pre
cd tabixpp && INCLUDES="$(HTS_INCLUDES)" LIBPATH="-L. $(HTS_LDFLAGS)" HTSLIB="$(HTS_LIB)" HTS_HEADERS="" $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
-$(SMITHWATERMAN): pre
- cd smithwaterman && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp *.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
-
-$(DISORDER): $(SMITHWATERMAN)
-
-$(REPEATS): $(SMITHWATERMAN)
-
-$(LEFTALIGN): $(SMITHWATERMAN)
-
-$(INDELALLELE): $(SMITHWATERMAN)
-
#$(FSOM):
# cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm
@@ -188,11 +172,11 @@
$(SHORTBINS): pre
$(MAKE) bin/$@
-$(BINS): $(BIN_SOURCES) libvcflib.a $(OBJECTS) $(SMITHWATERMAN) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(FILEVERCMP) pre intervaltree
+$(BINS): $(BIN_SOURCES) libvcflib.a $(OBJECTS) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(FILEVERCMP) pre intervaltree
$(CXX) $(CPPFLAGS) src/$(notdir $@).cpp -o $@ $(INCLUDES) -lvcflib $(LDFLAGS) $(CXXFLAGS) -DVERSION=\"$(GIT_VERSION)\"
-libvcflib.a: $(OBJECTS) $(SMITHWATERMAN) $(REPEATS) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(FILEVERCMP) $(TABIX) pre
- ar rs libvcflib.a $(OBJECTS) smithwaterman/sw.o $(FASTAHACK) $(FILEVERCMP) $(TABIX)
+libvcflib.a: $(OBJECTS) $(REPEATS) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(FILEVERCMP) $(TABIX) pre
+ ar rs libvcflib.a $(OBJECTS) $(FASTAHACK) $(FILEVERCMP) $(TABIX)
cp libvcflib.a $(LIB_DIR)
@@ -219,7 +203,6 @@
rm -rf $(INC_DIR)
rm -rf $(OBJ_DIR)
cd tabixpp && $(MAKE) clean
- cd smithwaterman && $(MAKE) clean
cd multichoose && $(MAKE) clean
cd fsom && $(MAKE) clean
cd test && $(MAKE) clean
--- vg.orig/Makefile
+++ vg/Makefile
@@ -30,12 +30,12 @@
CXXFLAGS := -O3 -Werror=return-type -std=c++14 -ggdb -g -MMD -MP -msse4.2 $(CXXFLAGS)
# Set include flags. All -I options need to go in here, so the first directory listed is genuinely searched first.
-INCLUDE_FLAGS:=$(shell pkg-config --cflags libfastahack) -I$(CWD)/$(INC_DIR) -I. -I$(CWD)/$(SRC_DIR) -I$(CWD)/$(UNITTEST_SRC_DIR) -I$(CWD)/$(SUBCOMMAND_SRC_DIR) -I$(CWD)/$(INC_DIR)/dynamic -I$(CWD)/$(INC_DIR)/sonLib $(shell pkg-config --cflags cairo jansson)
+INCLUDE_FLAGS:=$(shell pkg-config --cflags libfastahack) -I$(CWD)/$(INC_DIR) -I. -I$(CWD)/$(SRC_DIR) -I$(CWD)/$(UNITTEST_SRC_DIR) -I$(CWD)/$(SUBCOMMAND_SRC_DIR) -I$(CWD)/$(INC_DIR)/dynamic -I$(CWD)/$(INC_DIR)/sonLib $(shell pkg-config --cflags cairo jansson) $(shell pkg-config --cflags libsmithwaterman)
# Define libraries to link against. Make sure to always link statically against
# htslib and libdeflate and Protobuf so that we can use position-dependent code
# there for speed.
-LD_LIB_FLAGS:= -L$(CWD)/$(LIB_DIR) $(CWD)/$(LIB_DIR)/libvgio.a -lhandlegraph -lvcflib -lgssw -lssw -lprotobuf -lsublinearLS $(CWD)/$(LIB_DIR)/libhts.a -ldeflate -lpthread -ljansson -lncurses -lgcsa2 -lgbwt -ldivsufsort -ldivsufsort64 -lgfakluge -lraptor2 -lsdsl -lpinchesandcacti -l3edgeconnected -lsonlib -lfml -llz4 -lstructures -lvw -lboost_program_options -lallreduce -lbdsg $(shell pkg-config --libs libfastahack)
+LD_LIB_FLAGS:= -L$(CWD)/$(LIB_DIR) $(CWD)/$(LIB_DIR)/libvgio.a -lhandlegraph -lvcflib -lgssw -lssw -lprotobuf -lsublinearLS $(CWD)/$(LIB_DIR)/libhts.a -ldeflate -lpthread -ljansson -lncurses -lgcsa2 -lgbwt -ldivsufsort -ldivsufsort64 -lgfakluge -lraptor2 -lsdsl -lpinchesandcacti -l3edgeconnected -lsonlib -lfml -llz4 -lstructures -lvw -lboost_program_options -lallreduce -lbdsg $(shell pkg-config --libs libfastahack) $(shell pkg-config --libs libsmithwaterman)
# Use pkg-config to find Cairo and all the libs it uses
LD_LIB_FLAGS += $(shell pkg-config --libs --static cairo jansson)
......@@ -36,3 +36,51 @@ Description: Use the Debian packaged version of libssw
cd $(DEP_DIR) && cd progress_bar && $(MAKE) clean
cd $(DEP_DIR) && cd sdsl-lite && ./uninstall.sh || true
cd $(DEP_DIR) && cd libVCFH && $(MAKE) clean
--- vg.orig/deps/vcflib/Makefile
+++ vg/deps/vcflib/Makefile
@@ -151,11 +151,6 @@
#CXXFLAGS = -O2
#CXXFLAGS = -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual
-SSW = src/ssw.o src/ssw_cpp.o
-
-ssw.o: src/ssw.hpp
-ssw_cpp.o:src/ssw_cpp.hpp
-
openmp:
$(MAKE) CXXFLAGS="$(CXXFLAGS) -fopenmp -D HAS_OPENMP"
@@ -200,11 +195,11 @@
$(SHORTBINS): pre
$(MAKE) bin/$@
-$(BINS): $(BIN_SOURCES) libvcflib.a $(OBJECTS) $(SMITHWATERMAN) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre intervaltree
+$(BINS): $(BIN_SOURCES) libvcflib.a $(OBJECTS) $(SMITHWATERMAN) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(FILEVERCMP) pre intervaltree
$(CXX) src/$(notdir $@).cpp -o $@ $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) -DVERSION=\"$(GIT_VERSION)\"
-libvcflib.a: $(OBJECTS) $(SMITHWATERMAN) $(REPEATS) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) $(TABIX) pre
- ar rs libvcflib.a $(OBJECTS) smithwaterman/sw.o $(FASTAHACK) $(SSW) $(FILEVERCMP) $(TABIX)
+libvcflib.a: $(OBJECTS) $(SMITHWATERMAN) $(REPEATS) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(FILEVERCMP) $(TABIX) pre
+ ar rs libvcflib.a $(OBJECTS) smithwaterman/sw.o $(FASTAHACK) $(FILEVERCMP) $(TABIX)
cp libvcflib.a $(LIB_DIR)
@@ -225,7 +220,6 @@
clean:
rm -f $(BINS) $(OBJECTS)
- rm -f ssw_cpp.o ssw.o
rm -f libvcflib.a
rm -rf $(BIN_DIR)
rm -rf $(LIB_DIR)
--- vg.orig/deps/vcflib/src/Variant.h
+++ vg/deps/vcflib/src/Variant.h
@@ -20,7 +20,7 @@
#include "tabix.hpp"
#include "SmithWatermanGotoh.h"
#include "disorder.h"
-#include "ssw_cpp.hpp"
+#include "ssw_cpp.h"
#include "convert.h"
#include "multichoose.h"
#include "Fasta.h"
......@@ -3,18 +3,6 @@
DH_VERBOSE := 1
export LC_ALL=C.UTF-8
#include /usr/share/dpkg/default.mk
# this provides:
# DEB_SOURCE: the source package name
# DEB_VERSION: the full version of the package (epoch + upstream vers. + revision)
# DEB_VERSION_EPOCH_UPSTREAM: the package's version without the Debian revision
# DEB_VERSION_UPSTREAM_REVISION: the package's version without the Debian epoch
# DEB_VERSION_UPSTREAM: the package's upstream version
# DEB_DISTRIBUTION: the distribution(s) listed in the current entry of debian/changelog
# SOURCE_DATE_EPOCH: the source release date as seconds since the epoch, as
# specified by <https://reproducible-builds.org/specs/source-date-epoch/>
# for hardening you might like to uncomment this:
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
export CPPFLAGS=$(shell dpkg-buildflags --get CPPFLAGS)
......@@ -24,11 +12,5 @@ export CXXFLAGS=$(shell dpkg-buildflags --get CXXFLAGS)
%:
dh $@
### When overriding auto_test make sure DEB_BUILD_OPTIONS will be respected
#override_dh_auto_test:
#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# do_stuff_for_testing
#endif
override_dh_auto_clean:
echo
dh_auto_clean || true
Test-Command: vg test
Depends: vg
Restrictions: allow-stderr
# false positive
vg: spelling-error-in-binary bin/vg lengH length
vg: spelling-error-in-binary bin/vg wiThe with
# Using the container-based infrastructure
sudo: false
language: perl
perl:
- "5.24"
- "5.22"
- "5.20"
- "5.18"
- "5.16"
- "5.14"
- "5.12"
- "5.10"
install:
/bin/true
script:
./test.sh
# Flame Graphs visualize profiled code
Main Website: http://www.brendangregg.com/flamegraphs.html
Example (click to zoom):
[![Example](http://www.brendangregg.com/FlameGraphs/cpu-bash-flamegraph.svg)](http://www.brendangregg.com/FlameGraphs/cpu-bash-flamegraph.svg)
Other sites:
- The Flame Graph article in ACMQ and CACM: http://queue.acm.org/detail.cfm?id=2927301 http://cacm.acm.org/magazines/2016/6/202665-the-flame-graph/abstract
- CPU profiling using Linux perf\_events, DTrace, SystemTap, or ktap: http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html
- CPU profiling using XCode Instruments: http://schani.wordpress.com/2012/11/16/flame-graphs-for-instruments/
- CPU profiling using Xperf.exe: http://randomascii.wordpress.com/2013/03/26/summarizing-xperf-cpu-usage-with-flame-graphs/
- Memory profiling: http://www.brendangregg.com/FlameGraphs/memoryflamegraphs.html
- Other examples, updates, and news: http://www.brendangregg.com/flamegraphs.html#Updates
Flame graphs can be created in three steps:
1. Capture stacks
2. Fold stacks
3. flamegraph.pl
1\. Capture stacks
=================
Stack samples can be captured using Linux perf\_events, FreeBSD pmcstat (hwpmc), DTrace, SystemTap, and many other profilers. See the stackcollapse-\* converters.
### Linux perf\_events
Using Linux perf\_events (aka "perf") to capture 60 seconds of 99 Hertz stack samples, both user- and kernel-level stacks, all processes:
```
# perf record -F 99 -a -g -- sleep 60
# perf script > out.perf
```
Now only capturing PID 181:
```
# perf record -F 99 -p 181 -g -- sleep 60
# perf script > out.perf
```
### DTrace
Using DTrace to capture 60 seconds of kernel stacks at 997 Hertz:
```
# dtrace -x stackframes=100 -n 'profile-997 /arg0/ { @[stack()] = count(); } tick-60s { exit(0); }' -o out.kern_stacks
```
Using DTrace to capture 60 seconds of user-level stacks for PID 12345 at 97 Hertz:
```
# dtrace -x ustackframes=100 -n 'profile-97 /pid == 12345 && arg1/ { @[ustack()] = count(); } tick-60s { exit(0); }' -o out.user_stacks
```
60 seconds of user-level stacks, including time spent in-kernel, for PID 12345 at 97 Hertz:
```
# dtrace -x ustackframes=100 -n 'profile-97 /pid == 12345/ { @[ustack()] = count(); } tick-60s { exit(0); }' -o out.user_stacks
```
Switch `ustack()` for `jstack()` if the application has a ustack helper to include translated frames (eg, node.js frames; see: http://dtrace.org/blogs/dap/2012/01/05/where-does-your-node-program-spend-its-time/). The rate for user-level stack collection is deliberately slower than kernel, which is especially important when using `jstack()` as it performs additional work to translate frames.
2\. Fold stacks
==============
Use the stackcollapse programs to fold stack samples into single lines. The programs provided are:
- `stackcollapse.pl`: for DTrace stacks
- `stackcollapse-perf.pl`: for Linux perf_events "perf script" output
- `stackcollapse-pmc.pl`: for FreeBSD pmcstat -G stacks
- `stackcollapse-stap.pl`: for SystemTap stacks
- `stackcollapse-instruments.pl`: for XCode Instruments
- `stackcollapse-vtune.pl`: for Intel VTune profiles
- `stackcollapse-ljp.awk`: for Lightweight Java Profiler
- `stackcollapse-jstack.pl`: for Java jstack(1) output
- `stackcollapse-gdb.pl`: for gdb(1) stacks
- `stackcollapse-go.pl`: for Golang pprof stacks
- `stackcollapse-vsprof.pl`: for Microsoft Visual Studio profiles
Usage example:
```
For perf_events:
$ ./stackcollapse-perf.pl out.perf > out.folded
For DTrace:
$ ./stackcollapse.pl out.kern_stacks > out.kern_folded
```
The output looks like this:
```
unix`_sys_sysenter_post_swapgs 1401
unix`_sys_sysenter_post_swapgs;genunix`close 5
unix`_sys_sysenter_post_swapgs;genunix`close;genunix`closeandsetf 85
unix`_sys_sysenter_post_swapgs;genunix`close;genunix`closeandsetf;c2audit`audit_closef 26
unix`_sys_sysenter_post_swapgs;genunix`close;genunix`closeandsetf;c2audit`audit_setf 5
unix`_sys_sysenter_post_swapgs;genunix`close;genunix`closeandsetf;genunix`audit_getstate 6
unix`_sys_sysenter_post_swapgs;genunix`close;genunix`closeandsetf;genunix`audit_unfalloc 2
unix`_sys_sysenter_post_swapgs;genunix`close;genunix`closeandsetf;genunix`closef 48
[...]
```
3\. flamegraph.pl
================
Use flamegraph.pl to render a SVG.
```
$ ./flamegraph.pl out.kern_folded > kernel.svg
```
An advantage of having the folded input file (and why this is separate to flamegraph.pl) is that you can use grep for functions of interest. Eg:
```
$ grep cpuid out.kern_folded | ./flamegraph.pl > cpuid.svg
```
Provided Examples
=================
### Linux perf\_events
An example output from Linux "perf script" is included, gzip'd, as example-perf-stacks.txt.gz. The resulting flame graph is example-perf.svg:
[![Example](http://www.brendangregg.com/FlameGraphs/example-perf.svg)](http://www.brendangregg.com/FlameGraphs/example-perf.svg)
You can create this using:
```
$ gunzip -c example-perf-stacks.txt.gz | ./stackcollapse-perf.pl --all | ./flamegraph.pl --color=java --hash > example-perf.svg
```
This shows my typical workflow: I'll gzip profiles on the target, then copy them to my laptop for analysis. Since I have hundreds of profiles, I leave them gzip'd!
Since this profile included Java, I used the flamegraph.pl --color=java palette. I've also used stackcollapse-perf.pl --all, which includes all annotations that help flamegraph.pl use separate colors for kernel and user level code. The resulting flame graph uses: green == Java, yellow == C++, red == user-mode native, orange == kernel.
This profile was from an analysis of vert.x performance. The benchmark client, wrk, is also visible in the flame graph.
### DTrace
An example output from DTrace is also included, example-dtrace-stacks.txt, and the resulting flame graph, example-dtrace.svg:
[![Example](http://www.brendangregg.com/FlameGraphs/example-dtrace.svg)](http://www.brendangregg.com/FlameGraphs/example-dtrace.svg)
You can generate this using:
```
$ ./stackcollapse.pl example-stacks.txt | ./flamegraph.pl > example.svg
```
This was from a particular performance investigation: the Flame Graph identified that CPU time was spent in the lofs module, and quantified that time.
Options
=======
See the USAGE message (--help) for options:
USAGE: ./flamegraph.pl [options] infile > outfile.svg
--title TEXT # change title text
--subtitle TEXT # second level title (optional)
--width NUM # width of image (default 1200)
--height NUM # height of each frame (default 16)
--minwidth NUM # omit smaller functions (default 0.1 pixels)
--fonttype FONT # font type (default "Verdana")
--fontsize NUM # font size (default 12)
--countname TEXT # count type label (default "samples")
--nametype TEXT # name type label (default "Function:")
--colors PALETTE # set color palette. choices are: hot (default), mem,
# io, wakeup, chain, java, js, perl, red, green, blue,
# aqua, yellow, purple, orange
--bgcolors COLOR # set background colors. gradient choices are yellow
# (default), blue, green, grey; flat colors use "#rrggbb"
--hash # colors are keyed by function name hash
--cp # use consistent palette (palette.map)
--reverse # generate stack-reversed flame graph
--inverted # icicle graph
--flamechart # produce a flame chart (sort by time, do not merge stacks)
--negate # switch differential hues (blue<->red)
--notes TEXT # add notes comment in SVG (for debugging)
--help # this message
eg,
./flamegraph.pl --title="Flame Graph: malloc()" trace.txt > graph.svg
As suggested in the example, flame graphs can process traces of any event,
such as malloc()s, provided stack traces are gathered.
Consistent Palette
==================
If you use the `--cp` option, it will use the $colors selection and randomly
generate the palette like normal. Any future flamegraphs created using the `--cp`
option will use the same palette map. Any new symbols from future flamegraphs
will have their colors randomly generated using the $colors selection.
If you don't like the palette, just delete the palette.map file.
This allows your to change your colorscheme between flamegraphs to make the
differences REALLY stand out.
Example:
Say we have 2 captures, one with a problem, and one when it was working
(whatever "it" is):
```
cat working.folded | ./flamegraph.pl --cp > working.svg
# this generates a palette.map, as per the normal random generated look.
cat broken.folded | ./flamegraph.pl --cp --colors mem > broken.svg
# this svg will use the same palette.map for the same events, but a very
# different colorscheme for any new events.
```
Take a look at the demo directory for an example:
palette-example-working.svg
palette-example-broken.svg
#!/usr/bin/perl
use Getopt::Std;
getopt('urt');
unless ($opt_r && $opt_t){
print "Usage: $0 [ -u user] -r sample_count -t sleep_time\n";
exit(0);
}
my $i;
my @proc = "";
for ($i = 0; $i < $opt_r ; $i++){
if ($opt_u){
$proc = `/usr/sysv/bin/ps -u $opt_u `;
$proc =~ s/^.*\n//;
$proc =~ s/\s*(\d+).*\n/\1 /g;
@proc = split(/\s+/,$proc);
} else {
opendir(my $dh, '/proc') || die "Cant't open /proc: $!";
@proc = grep { /^[\d]+$/ } readdir($dh);
closedir ($dh);
}
foreach my $pid (@proc){
my $command = "/usr/bin/procstack $pid";
print `$command 2>/dev/null`;
}
select(undef, undef, undef, $opt_t);
}
Flame Graph demos gathered and created for the talk "Blazing Performance with
Flame Graphs" at USENIX/LISA 2013.
These SVGs can not be seen on github directly; save them locally first (git
clone or download), then open them in a browser (file://...).