-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathconfigure.ac
More file actions
131 lines (115 loc) · 4.39 KB
/
configure.ac
File metadata and controls
131 lines (115 loc) · 4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
dnl This file is part of dnmtools
dnl
dnl Copyright (C) 2022-2025: Andrew D. Smith
dnl
dnl Authors: Andrew D. Smith
dnl
dnl This is free software: you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by
dnl the Free Software Foundation, either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl This software is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
AC_INIT([dnmtools], [1.5.1], [andrewds@usc.edu],
[dnmtools], [https://github.com/smithlabcode/dnmtools])
dnl the config.h is #included in the sources for version info
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([subdir-objects foreign])
AC_CONFIG_MACRO_DIR([m4])
AC_LANG(C++)
AC_PROG_CXX
# Set CXXFLAGS only if the user hasn't set them
AS_IF([test "x$CXXFLAGS_set" != "xset"], [
CXXFLAGS="-O3 -DNDEBUG"
])
AC_MSG_NOTICE([CXXFLAGS is $CXXFLAGS])
AX_CXX_COMPILE_STDCXX(17, [noext], [mandatory])
AC_PROG_RANLIB
dnl recursively configure abismal and smithlab_cpp
AC_CONFIG_SUBDIRS([src/abismal])
AC_CONFIG_SUBDIRS([src/smithlab_cpp])
dnl check for HTSLib if requested
hts_fail_msg="
Failed to locate HTSLib on your system. Please use the LDFLAGS and CPPFLAGS
variables to specify the directories where the HTSLib library and headers can
be found.
"
gsl_fail_msg="
Failed to locate the GNU Scientific Library (GSL) on your system. Please use
the LDFLAGS and CPPFLAGS variables to specify the directories where the GSL
library and headers can be found.
"
dnl arg for using libdeflate, which might happen by default anyway
AC_ARG_WITH([libdeflate],
[AS_HELP_STRING([--with-libdeflate], [use libdeflate for BAM output])],
[with_libdeflate=yes], [with_libdeflate=no])
dnl arg for building with mods support in 'counts'
AC_ARG_WITH([htsmods],
[AS_HELP_STRING([--with-htsmods], [use HTSLib 'mods' to support Nanopore])],
[with_htsmods=yes], [with_htsmods=no])
dnl check for required libraries
AC_SEARCH_LIBS([pthread_create], [pthread], [], [AC_MSG_FAILURE(["pthread library not found"])])
AC_SEARCH_LIBS([gzopen], [z], [], [AC_MSG_FAILURE(["Zlib library not found"])])
AS_IF([test "x$with_libdeflate" = "xyes"],
[
AC_SEARCH_LIBS([libdeflate_deflate_compress], [deflate], [],
[AC_MSG_ERROR([--with-libdeflate specified but libdeflate not found])])
])
AC_SEARCH_LIBS([hts_version], [hts], [], [AC_MSG_FAILURE([$hts_fail_msg])])
AC_CHECK_HEADERS([htslib/hts.h], [], [AC_MSG_ERROR([hts.h not found])])
# Require HTS_VERSION >= 102000
AS_IF([test "x$with_htsmods" = "xyes"],
[
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM([[
#include <htslib/hts.h>
#if !defined(HTS_VERSION)
# error HTS_VERSION not defined
#endif
#if HTS_VERSION < 102000
# error htslib library too old
#endif
]], [[]])
], [have_htsmods_version=yes], [have_htsmods_version=no])
],
[have_htsmods_version=yes]
)
AC_COMPUTE_INT(
[hts_version_macro],
[HTS_VERSION],
[#include <htslib/hts.h>],
[AC_MSG_ERROR([Could not compute HTS_VERSION])]
)
AC_MSG_NOTICE([Detected htslib version: $hts_version_macro])
AS_IF([test "x$have_htsmods_version" != "xyes"], [
AC_MSG_ERROR([
HTSLib version must be at least 102000 (v1.20) for mods support
])
])
AM_CONDITIONAL([BUILD_NANOPORE], [test "x$with_htsmods" = "xyes"])
AC_SEARCH_LIBS([cblas_dgemm], [gslcblas], [], [AC_MSG_FAILURE([$gsl_fail_msg])])
AC_SEARCH_LIBS([gsl_blas_dgemm], [gsl], [], [AC_MSG_FAILURE([$gsl_fail_msg])])
AC_CONFIG_FILES([
Makefile
])
dnl make the test data files available in the build tree
AC_CONFIG_LINKS([
tests/md5sum.txt:data/md5sum.txt
tests/tRex1.fa:data/tRex1.fa
tests/tRex1_promoters.bed:data/tRex1_promoters.bed
tests/reads_1.fq.gz:data/reads_1.fq.gz
tests/reads_2.fq.gz:data/reads_2.fq.gz
tests/radmeth_test_table.txt:data/radmeth_test_table.txt
tests/radmeth_test_design.txt:data/radmeth_test_design.txt
tests/two_epialleles.states:data/two_epialleles.states
tests/araTha1_simulated.counts.gz:data/araTha1_simulated.counts.gz
tests/methylome_a.counts.sym:data/methylome_a.counts.sym
tests/methylome_b.counts.sym:data/methylome_b.counts.sym
tests/mlml_test_data.tgz:data/mlml_test_data.tgz
tests/pmd_test_data.counts.sym.gz:data/pmd_test_data.counts.sym.gz
])
AC_OUTPUT