Skip to content

Commit

Permalink
Merge pull request #2 from statgen/develop
Browse files Browse the repository at this point in the history
Alpha2 Merge
  • Loading branch information
jonathonl authored Jan 3, 2018
2 parents 218b0c5 + 794937e commit 89059d8
Show file tree
Hide file tree
Showing 60 changed files with 4,900 additions and 2,102 deletions.
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: cpp
compiler: gcc
dist: trusty
sudo: required
group: edge
branches:
only:
- develop
addons:
apt:
sources:
- george-edison55-precise-backports
- ubuntu-toolchain-r-test
packages:
- cmake-data
- cmake
- python-dev
- python-pip
install:
- sudo pip install cget
- cget install -f ./requirements.txt
script:
- cmake --version
- mkdir build && cd build
- cmake -DBUILD_TESTS=1 -DCMAKE_TOOLCHAIN_FILE=../cget/cget/cget.cmake ..
- make
- make CTEST_OUTPUT_ON_FAILURE=1 test
58 changes: 39 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.2)
project(savvy VERSION 1.0.0)
include(CMakePackageConfigHelpers)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)

#add_library(hts STATIC IMPORTED)
#set_property(TARGET hts PROPERTY IMPORTED_LOCATION ${CMAKE_INSTALL_PREFIX}/lib/libhts.a)
Expand All @@ -16,49 +16,67 @@ endif()
#find_package(shrinkwrap CONFIG REQUIRED)
find_library(HTS_LIBRARY hts)
find_library(ZLIB_LIBRARY z)
#ZSTD can only likn statically since experimental functions are being used.
find_library(ZSTD_LIBRARY NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}zstd${CMAKE_STATIC_LIBRARY_SUFFIX})
find_library(ZSTD_LIBRARY zstd)
find_package(Threads)

#get_target_property(SHRINKWRAP_LIBS shrinkwrap INTERFACE_LINK_LIBRARIES)

add_definitions(-DSAVVY_VERSION="${PROJECT_VERSION}-alpha")
add_definitions(-DSAVVY_VERSION="${PROJECT_VERSION}-alpha2")

set(HEADER_FILES
include/savvy/savvy.hpp include/savvy/reader.hpp include/savvy/m3vcf_reader.hpp include/savvy/sav_reader.hpp include/savvy/allele_status.hpp include/savvy/vcf_reader.hpp include/savvy/varint.hpp include/savvy/s1r.hpp include/savvy/site_info.hpp include/savvy/variant_iterator.hpp include/savvy/portable_endian.hpp include/savvy/region.hpp include/savvy/compressed_vector.hpp include/savvy/eigen3_vector.hpp include/savvy/ublas_vector.hpp include/savvy/armadillo_vector.hpp include/savvy/utility.hpp include/savvy/data_format.hpp)

set(SOURCE_FILES
src/savvy.cpp src/reader.cpp src/m3vcf_reader.cpp include/savvy/sav_reader.hpp src/sav_reader.cpp include/savvy/test_class.hpp src/vcf_reader.cpp src/varint.cpp src/utility.cpp src/site_info.cpp src/region.cpp)
src/savvy/savvy.cpp src/savvy/reader.cpp src/savvy/m3vcf_reader.cpp include/savvy/sav_reader.hpp src/savvy/sav_reader.cpp include/test/test_class.hpp src/savvy/vcf_reader.cpp src/savvy/varint.cpp src/savvy/utility.cpp src/savvy/site_info.cpp src/savvy/region.cpp)

add_library(savvy ${SOURCE_FILES} ${HEADER_FILES})
target_link_libraries(savvy ${HTS_LIBRARY} ${ZLIB_LIBRARY} ${ZSTD_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(savvy PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)

add_executable(savvy-test src/test.cpp src/test_class.cpp include/savvy/test_class.hpp)
target_link_libraries(savvy-test savvy)
add_executable(sav
src/sav/main.cpp
src/sav/export.cpp include/sav/export.hpp
src/sav/import.cpp include/sav/import.hpp
src/sav/index.cpp include/sav/index.hpp
src/sav/merge.cpp include/sav/merge.hpp
src/sav/sort.cpp include/sav/sort.hpp
src/sav/utility.cpp include/sav/utility.hpp)
target_link_libraries(sav savvy)

add_executable(bcf2m3vcf src/bcf2m3vcf.cpp)
target_link_libraries(bcf2m3vcf savvy)
#add_executable(bcf2m3vcf src/sav/bcf2m3vcf.cpp)
#target_link_libraries(bcf2m3vcf savvy)

add_executable(vcf2sav src/vcf2sav.cpp)
target_link_libraries(vcf2sav savvy)
#add_executable(sav-sample-sort src/sav/sav_sample_sort.cpp)
#target_link_libraries(sav-sample-sort savvy)

add_executable(sav2vcf src/sav2vcf.cpp)
target_link_libraries(sav2vcf savvy)
#add_executable(savvy-speed-test src/test/savvy_speed_test.cpp)
#target_link_libraries(savvy-speed-test savvy)

add_executable(sav-sample-sort src/sav_sample_sort.cpp)
target_link_libraries(sav-sample-sort savvy)

add_executable(savvy-speed-test src/savvy_speed_test.cpp)
target_link_libraries(savvy-speed-test savvy)
if(BUILD_TESTS)
enable_testing()

add_definitions(-DSAVVYT_VCF_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/test_file.vcf\"
-DSAVVYT_SAV_FILE_HARD=\"${CMAKE_CURRENT_SOURCE_DIR}/test_file_hard.sav\"
-DSAVVYT_SAV_FILE_DOSE=\"${CMAKE_CURRENT_SOURCE_DIR}/test_file_dose.sav\"
-DSAVVYT_MARKER_COUNT_HARD=28
-DSAVVYT_MARKER_COUNT_DOSE=20)

add_executable(savvy-test src/test/main.cpp src/test/test_class.cpp include/test/test_class.hpp)
target_link_libraries(savvy-test savvy)

add_test(convert_file_test savvy-test convert-file)
add_test(subset_test savvy-test subset)
add_test(varint_test savvy-test varint)
endif()

if(BUILD_SLR_EXAMPLES)
add_executable(slr-examples src/slr_examples.cpp)
add_executable(slr-examples src/test/slr_examples.cpp)
target_link_libraries(slr-examples savvy armadillo)

find_library(OPENCL_LIB OpenCL)

add_executable(linreg-ttest src/linreg_ttest.cpp)
add_executable(linreg-ttest src/test/linreg_ttest.cpp)
target_link_libraries(linreg-ttest savvy ${OPENCL_LIB})
endif()

Expand All @@ -67,6 +85,8 @@ install(TARGETS savvy EXPORT ${PROJECT_NAME}-config
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)

install(TARGETS sav RUNTIME DESTINATION bin)

install(EXPORT ${PROJECT_NAME}-config DESTINATION share/${PROJECT_NAME})
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake COMPATIBILITY SameMajorVersion)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION share/${PROJECT_NAME})
Expand Down
Loading

0 comments on commit 89059d8

Please sign in to comment.