Skip to content

Commit

Permalink
1. Bump version number
Browse files Browse the repository at this point in the history
2. Adjust CMakeLists.txt parameters
  • Loading branch information
Griffan committed Jan 13, 2021
1 parent 6c3c4e6 commit 0764b9f
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 71 deletions.
141 changes: 71 additions & 70 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,70 +1,71 @@
cmake_minimum_required(VERSION 2.8.4)
project(VerifyBamID)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wno-format-security")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-unused-variable -Wno-unused-result ")

add_definitions(-D__STDC_LIMIT_MACROS)
add_definitions(-D__ZLIB_AVAILABLE__)

find_path(HTS_INCLUDE_DIRS htslib/bgzf.h HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if(NOT HTS_INCLUDE_DIRS )
message(FATAL_ERROR "libhts HTS_INCLUDE_DIRS not found")
endif()

find_library(HTS_LIBRARIES hts HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if(NOT HTS_LIBRARIES)
message(FATAL_ERROR "libhts HTS_LIBRARIES not found")
endif()

find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()

find_library(ZLIB z HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if(NOT ZLIB)
message(FATAL_ERROR "libz library not found")
endif()
find_library(CURLLIB curl HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if(NOT CURLLIB)
message(FATAL_ERROR "libcurl library not found")
endif()

find_package (BZip2)
if (NOT BZIP2_FOUND)
message(FATAL_ERROR "libbz2 library not found")
else()
include_directories(${BZIP2_INCLUDE_DIRS})
set(BZIP2 ${BZIP2_LIBRARIES})
endif()

find_library(LZMA lzma HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if(NOT LZMA)
message(WARNING "liblzma library not found, if you specified --disable-lzma when compiling libhts, please ignore this warning")
set(LZMA "")
else()
set(LZMA ${LZMA_LIBRARIES})
endif()


add_subdirectory(statgen)
set(LIBSTATGEN_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/statgen")
add_subdirectory(samtools)
add_subdirectory(libVcf)
set(SOURCE_FILES main.cpp SVDcalculator.cpp ContaminationEstimator.cpp MathGenMin.cpp MathGold.cpp Random.cpp SimplePileupViewer.cpp params.cpp )
include_directories(statgen ${HTS_INCLUDE_DIRS} samtools libVcf Eigen)
add_executable(VerifyBamID ${SOURCE_FILES})

target_link_libraries(VerifyBamID statgen Vcf ${HTS_LIBRARIES} samtools ${ZLIB} ${BZIP2} ${LZMA} ${CURLLIB})

enable_testing()
add_test( NAME myTest1
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND VerifyBamID --DisableSanityCheck --UDPath resource/test/hapmap_3.3.b37.dat.UD --BamFile resource/test/test.bam --BedPath resource/test/hapmap_3.3.b37.dat.bed --MeanPath resource/test/hapmap_3.3.b37.dat.mu --Reference resource/test/chr20.fa.gz )
#add_test( NAME myTest2
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# COMMAND sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/run.plot.sh -i ${CMAKE_CURRENT_SOURCE_DIR}/resource/test/hapmap_3.3.b37.dat.V -o ${CMAKE_CURRENT_SOURCE_DIR}/resource/test/hapmap -r 1000g -g grey)
cmake_minimum_required(VERSION 2.8.4)
project(VerifyBamID)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fPIC -Wno-format-security")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fPIC -Wno-unused-variable -Wno-unused-result ")

add_definitions(-D__STDC_LIMIT_MACROS)
add_definitions(-D__ZLIB_AVAILABLE__)

find_package(OpenMP)
if (OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif ()

find_library(CURLLIB curl HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if (NOT CURLLIB)
message(FATAL_ERROR "libcurl library not found")
endif ()

find_library(ZLIB z HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/ /usr/local/Cellar/zlib/1.2.11/lib/)
if (NOT ZLIB)
message(FATAL_ERROR "libz library not found")
endif ()

find_path(HTS_INCLUDE_DIRS htslib/bgzf.h HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if (NOT HTS_INCLUDE_DIRS)
message(FATAL_ERROR "libhts HTS_INCLUDE_DIRS not found")
endif ()

find_library(HTS_LIBRARIES hts HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if (NOT HTS_LIBRARIES)
message(FATAL_ERROR "libhts HTS_LIBRARIES not found")
endif ()

find_package(BZip2)
if (NOT BZIP2_FOUND)
message(FATAL_ERROR "libbz2 library not found")
else ()
include_directories(${BZIP2_INCLUDE_DIRS})
set(BZIP2 ${BZIP2_LIBRARIES})
endif ()

find_library(LZMA lzma HINTS /usr/lib/x86_64-linux-gnu/ /usr/lib/ /usr/lib64/)
if(NOT LZMA)
message(WARNING "liblzma library not found, if you specified --disable-lzma when compiling libhts, please ignore this warning")
set(LZMA "")
else()
set(LZMA ${LZMA_LIBRARIES})
endif()


add_subdirectory(statgen)
set(LIBSTATGEN_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/statgen")
add_subdirectory(samtools)
add_subdirectory(libVcf)
set(SOURCE_FILES main.cpp SVDcalculator.cpp ContaminationEstimator.cpp MathGenMin.cpp MathGold.cpp Random.cpp SimplePileupViewer.cpp params.cpp )
include_directories(statgen ${HTS_INCLUDE_DIRS} samtools libVcf Eigen)
add_executable(VerifyBamID ${SOURCE_FILES})

target_link_libraries(VerifyBamID statgen Vcf ${HTS_LIBRARIES} samtools ${ZLIB} ${BZIP2} ${LZMA} ${CURLLIB})

enable_testing()
add_test( NAME myTest1
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND VerifyBamID --DisableSanityCheck --UDPath resource/test/hapmap_3.3.b37.dat.UD --BamFile resource/test/test.bam --BedPath resource/test/hapmap_3.3.b37.dat.bed --MeanPath resource/test/hapmap_3.3.b37.dat.mu --Reference resource/test/chr20.fa.gz )
#add_test( NAME myTest2
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# COMMAND sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/run.plot.sh -i ${CMAKE_CURRENT_SOURCE_DIR}/resource/test/hapmap_3.3.b37.dat.V -o ${CMAKE_CURRENT_SOURCE_DIR}/resource/test/hapmap -r 1000g -g grey)
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SOFTWARE.
#include "htslib/sam.h"
#include "params.h"

#define VERSION "1.0.6"
#define VERSION "1.0.7"

int execute(int argc, char **argv) {

Expand Down

0 comments on commit 0764b9f

Please sign in to comment.