Skip to content

Commit

Permalink
Paragraph v1.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Krusche committed Feb 26, 2018
1 parent 9ee2120 commit 5361efa
Show file tree
Hide file tree
Showing 226 changed files with 14,326 additions and 6,488 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cmake-build-*
build
.idea
.vscode
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ build
.vscode
.DS_Store
/src/python/test/test_failed.json
valgrind*.xml
cppcheck.xml
cppcheck-result
*-release.tar.gz
*-buildfolder.tar.gz
/.settings/
/.gitignore
/.cproject
/.project
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=missing-docstring,invalid-name,locally-disabled,unsubscriptable-object,duplicate-code
disable=missing-docstring,invalid-name,locally-disabled,unsubscriptable-object,duplicate-code,no-else-return


[REPORTS]
Expand Down
127 changes: 66 additions & 61 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
cmake_minimum_required (VERSION 2.8.5)
project (GRM)

# Support for static linking.
# Note that this implies that all libraries must be found with the
# exact file name (libXXX.a or libXXX.so)
if (PARAGRAPH_FORCE_STATIC_LINK)
message(STATUS "All libraries will be statically linked")
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-static")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-static")
# ensure that even if cmake decides to allow for dynamic libs resolution,
# this gets overriden into static...
set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS ${CMAKE_EXE_LINK_STATIC_CXX_FLAGS})
endif (PARAGRAPH_FORCE_STATIC_LINK)

set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/cmake")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
Expand All @@ -13,54 +25,20 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

include(cxx)
include(configureFiles)
include(FindZLIB)
include(FindBZip2)

file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/scratch)

execute_process(
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/external/make_dependencies.sh
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/scratch
RESULT_VARIABLE DEPENDENCIES_BUILT)

if(NOT (${DEPENDENCIES_BUILT} STREQUAL "0"))
message( FATAL_ERROR "Dependency build failed, CMake will exit." )
endif(NOT (${DEPENDENCIES_BUILT} STREQUAL "0"))

if (IS_DIRECTORY $ENV{PROTOBUF_INSTALL_PATH})
message( "Using pre-built protobuf from $ENV{PROTOBUF_INSTALL_PATH}")
set(CMAKE_PREFIX_PATH $ENV{PROTOBUF_INSTALL_PATH})
set(Protobuf_DIR $ENV{PROTOBUF_INSTALL_PATH})
else()
message( "Using included protobuf from ${CMAKE_BINARY_DIR}/scratch/protobuf-install")
set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/scratch/protobuf-install)
set(Protobuf_DIR ${CMAKE_BINARY_DIR}/scratch/protobuf-install)
endif ()

find_package(Protobuf REQUIRED)
include(FindZLIB)
include(GetHtslib)
include(GetGoogleTest)
include(GetProtobuf)
include(GetSpdlog)

include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${CMAKE_BINARY_DIR}/src/protobuf)
include_directories(${CMAKE_BINARY_DIR}/scratch/spdlog/include)
include_directories(${GRM_SOURCE_DIR}/external/stream)
include_directories(${GRM_SOURCE_DIR}/external/src/c++/include)
include_directories(${GRM_SOURCE_DIR}/external/jsoncpp)
include_directories(${GRM_SOURCE_DIR}/external/klib)
include_directories(${GRM_SOURCE_DIR}/external/gssw)
include_directories(${GRM_SOURCE_DIR}/external/intervaltree)

include_directories(${GRM_SOURCE_DIR}/src/c++/include)

include_directories(${CMAKE_BINARY_DIR}/scratch/googletest-release-1.8.0/googletest/include)
include_directories(${CMAKE_BINARY_DIR}/scratch/googletest-release-1.8.0/googlemock/include)
include_directories(${CMAKE_BINARY_DIR}/scratch/googletest-release-1.8.0/googletest)
include_directories(${CMAKE_BINARY_DIR}/scratch/googletest-release-1.8.0/googlemock)
add_library(gtest STATIC ${CMAKE_BINARY_DIR}/scratch/googletest-release-1.8.0/googletest/src/gtest-all.cc)
add_library(gmock STATIC ${CMAKE_BINARY_DIR}/scratch/googletest-release-1.8.0/googlemock/src/gmock-all.cc)

set(GTEST_LIBRARY gtest gmock)


SET(DATA_SRC "${CMAKE_SOURCE_DIR}/share")
SET(DATA_DST "${CMAKE_BINARY_DIR}/share")
add_custom_target(copy_data ALL COMMENT "Copying ${DATA_SRC} -> ${DATA_DST}")
Expand All @@ -69,55 +47,82 @@ add_custom_command(TARGET copy_data
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DATA_SRC} ${DATA_DST}
)

find_library(HTSLIB_LIBRARY NAMES libhts.a
HINTS "${CMAKE_BINARY_DIR}/scratch/htslib" NO_DEFAULT_PATH)

find_package (Threads REQUIRED)

set(Boost_USE_STATIC_LIBS ON) # only find static libs
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME ON)
find_package(Boost 1.5 COMPONENTS program_options filesystem system REQUIRED)

include_directories(${CMAKE_BINARY_DIR}/include)
include_directories(${CMAKE_BINARY_DIR}/scratch/htslib)
include_directories(${ZLIB_INCLUDE_DIR})
include_directories(${BZIP2_INCLUDE_DIR})

# boost sometimes generates warnings; we won't patch them so let's disable them using SYSTEM
include_directories(SYSTEM ${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})

# make libraries first
add_subdirectory (src/protobuf)
add_subdirectory (src/c++/lib)

add_subdirectory (external)

set(GRM_ALL_LIBS ${COMMON_LIBRARY}
${HTSLIB_LIBRARY}
${EXT_LIBRARY}
${PROTO_LIBRARY}
${GTEST_LIBRARY}
${PROTOBUF_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${Boost_LIBRARIES}
${BZIP2_LIBRARIES}
${ZLIB_LIBRARIES}
add_library(grm STATIC $<TARGET_OBJECTS:grmpy_common> $<TARGET_OBJECTS:proto> $<TARGET_OBJECTS:external>)
set(GRM_LIBRARY grm)

set(GRM_EXTERNAL_LIBS ${HTSLIB_LIBRARY}
${PROTOBUF_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${Boost_LIBRARIES}
${BZIP2_LIBRARIES}
${ZLIB_LIBRARIES}
)

set(PARAGRAPH_EXEC_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE)

include(GetGitRevisionDescription)
git_describe(GRM_VERSION)
if ("${GRM_VERSION}" STREQUAL "HEAD-HASH-NOTFOUND")
SET(PARAGRAPH_VERSION_MAJOR "MAJOR")
SET(PARAGRAPH_VERSION_MINOR "MINOR")
SET(PARAGRAPH_VERSION_PATCH "PATCH")
else("${GRM_VERSION}" STREQUAL "HEAD-HASH-NOTFOUND")
STRING(REGEX REPLACE "^paragraph-v([0-9]+)\\.[0-9]+\\-.+" "\\1" PARAGRAPH_VERSION_MAJOR "${GRM_VERSION}")
STRING(REGEX REPLACE "^paragraph-v[0-9]+\\.([0-9])+\\-.+" "\\1" PARAGRAPH_VERSION_MINOR "${GRM_VERSION}")
STRING(REGEX REPLACE "^paragraph-v[0-9]+\\.[0-9]+\\-(.+)" "\\1" PARAGRAPH_VERSION_PATCH "${GRM_VERSION}")
endif ("${GRM_VERSION}" STREQUAL "HEAD-HASH-NOTFOUND")

if (CPACK_GENERATOR)
message (STATUS "Configuring to produce the following package types: ${CPACK_GENERATOR}")
SET(CPACK_PACKAGE_VENDOR "Illumina")
SET(CPACK_PACKAGE_VERSION_MAJOR "${PARAGRAPH_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${PARAGRAPH_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${PARAGRAPH_VERSION_PATCH}")
INCLUDE(CPack)
endif (CPACK_GENERATOR)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/c++/include/grm/Version.hh.in"
"${CMAKE_BINARY_DIR}/include/Version.hh")

"${CMAKE_BINARY_DIR}/include/grm/Version.hh")
include_directories("${CMAKE_BINARY_DIR}/include")

add_subdirectory (src/c++/main)
add_subdirectory (src/c++/test)
add_subdirectory (src/c++/test-blackbox)
add_subdirectory (src/python)

# install
install (DIRECTORY "${CMAKE_BINARY_DIR}/bin/" DESTINATION bin FILES_MATCHING PATTERN "*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE)
install (DIRECTORY "${CMAKE_BINARY_DIR}/lib/" DESTINATION lib)
add_subdirectory (src/make/validation)
add_subdirectory (src/sh/validation)

# install binaries + libraries
install (DIRECTORY "${CMAKE_BINARY_DIR}/bin/" DESTINATION bin FILES_MATCHING PATTERN "*" PERMISSIONS ${PARAGRAPH_EXEC_PERMISSIONS})
install (TARGETS grm DESTINATION lib)

# install headers
install (DIRECTORY "${CMAKE_SOURCE_DIR}/src/c++/include/" DESTINATION include)
install (FILES "${CMAKE_BINARY_DIR}/include/grm/Version.hh" DESTINATION include/grm)
install (DIRECTORY "${CMAKE_SOURCE_DIR}/external/gssw" DESTINATION include FILES_MATCHING PATTERN "*.h")
install (DIRECTORY "${CMAKE_SOURCE_DIR}/external/jsoncpp/json" DESTINATION include)
install (DIRECTORY "${CMAKE_BINARY_DIR}/src/protobuf/" DESTINATION include FILES_MATCHING PATTERN "*.h")

# install docs
install (DIRECTORY "${CMAKE_SOURCE_DIR}/doc/" DESTINATION doc)
install (DIRECTORY "${CMAKE_BINARY_DIR}/share/" DESTINATION share)
install (DIRECTORY "${CMAKE_BINARY_DIR}/lib/python3" DESTINATION lib)
2 changes: 0 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ respective source files / tarballs):
See also the LICENSE files contained in external/googletest-release-1.8.0.tar.gz.
* VG stream.hpp from https://github.com/vgteam/vg/blob/master/src/stream.hpp -- MIT license, see
https://github.com/vgteam/vg/blob/master/LICENSE
* Intervaltree by Erik Garrison from https://github.com/ekg/intervaltree -- MIT license,
see https://github.com/ekg/intervaltree/blob/master/LICENSE and external/intervaltree/LICENSE.
* Spdlog from https://github.com/gabime/spdlog (MIT license, Copyright (c) 2016 Gabi Melman.),
see https://github.com/gabime/spdlog/blob/master/LICENSE and the LICENSE file in
external/spdlog.tar.gz
Expand Down
Loading

0 comments on commit 5361efa

Please sign in to comment.