File: configure.ac

package info (click to toggle)
relion 1.4+dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 4,188 kB
  • sloc: cpp: 42,912; sh: 10,415; makefile: 267; ansic: 50; csh: 2
file content (107 lines) | stat: -rw-r--r-- 3,817 bytes parent folder | download | duplicates (2)
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
## LibRelion

AC_INIT([relion], [1.4], [scheres@mrc-lmb.cam.ac.uk], [relion], [http://www.relion.org])
AM_INIT_AUTOMAKE([-Wall no-define])

# Define these substitions here to keep all version information in one place.
# For information on how to properly maintain the library version information,
# refer to the libtool manual, section "Updating library version information":
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
AC_SUBST([RELION_SO_VERSION], [1:4:0])
AC_SUBST([RELION_API_VERSION], [1.4])

# Generate two configuration headers; one for building the library itself with
# an autogenerated template, and a second one that will be installed alongside
# the library.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_LIBTOOL

# Check for mpi headers
AC_ARG_ENABLE([mpi],
    AC_HELP_STRING([--enable-mpi],
        [compile with MPI support]),
    if test x$enableval = "xyes"; then
        AC_CHECK_PROGS(MPICXX, mpic++,)
        test -z "$MPICXX" &&  AC_MSG_ERROR([couldn't find mpi library for --enable-mpi])
        enable_mpi=$enableval
        CXX="$MPICXX"
        CPPFLAGS="$CPPFLAGS -fpic"
        dnl HAVE_MPI=1
        AC_DEFINE([HAVE_MPI], 1, [Use MPI])
    fi,
    [enable_mpi=no])
AM_CONDITIONAL(HAVE_MPI, test "$enable_mpi" = yes)

# Check for single-precision compilation
AC_ARG_ENABLE([float],
    AC_HELP_STRING([--enable-float],
        [compile with float-precision]),
    if test x$enableval = "xyes"; then
        enable_float=$enableval
    fi,
    [enable_float=no])
AM_CONDITIONAL(FLOAT_PRECISION, test "$enable_float" = yes)


# Check for FFTW3
# Check for header <fftw3.h> AC_CHECK_HEADERS doesnt work, since we must
# use mpicc to get includes - cpp isnt always the same compiler.
  AC_MSG_CHECKING([for fftw3.h])
  AC_COMPILE_IFELSE(
  [AC_LANG_PROGRAM([[#include <fftw3.h>]],)],
  [
  # ok, look for library files too
  AC_MSG_RESULT(yes)
   if test "$enable_float" = yes; then
     AC_CHECK_LIB([fftw3f],main,,AC_MSG_ERROR([Cannot find fftw3f library]))
     AC_CHECK_LIB([fftw3f_threads],fftwf_plan_with_nthreads,,AC_MSG_ERROR([Cannot find fftw3f_threads library]))
     FFT_LIBS="-lfftw3f_threads -lfftw3f"
     CPPFLAGS="$CPPFLAGS -DFLOAT_PRECISION"
   else
     AC_CHECK_LIB([fftw3],main,,AC_MSG_ERROR([Cannot find fftw3 library]))
     AC_CHECK_LIB([fftw3_threads],fftw_plan_with_nthreads,,AC_MSG_ERROR([Cannot find fftw3_threads library]))
     FFT_LIBS="-lfftw3_threads -lfftw3"
   fi
  ],[
  # not ok, echo a warning
  AC_MSG_ERROR([Cannot find the FFTW3 library. Please install it (with threads enabled) from http://www.fftw.org.])
  ])


#Check for FLTK
# as g++ seems needed and not gcc for compilation, 
#just check for presence of fltk-config program 
[fltkfile=/usr/bin/fltk-config]
AC_ARG_ENABLE([gui],
    AC_HELP_STRING([--enable-gui], [compile GUI]),
    if test x$enableval = "xyes"; then
        AC_CHECK_FILE($fltkfile,
        [
        enable_fltk=yes
        ],
        [
        AC_MSG_RESULT(warning: bin/fltk-config was not found, so GUI will not be built)
        enable_fltk=no
        ])
    fi,
    [enable_fltk=no])
AM_CONDITIONAL(HAVE_FLTK, test "$enable_fltk" = yes)

# If no --prefix is passed to the configure script, relion programs and
# libraries will be installed under the current directory by default.
AC_PREFIX_DEFAULT(`pwd`)

# The "relion_" string is prepended by default to installed programs.
# It can be changed using --program-prefix=your_string
if test "x$program_prefix" = xNONE; then
  program_transform_name="s,^,relion_,"
fi

# Override the template file name of the generated .pc file, so that there
# is no need to rename the template file when the API version changes.
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile
	         relion-${RELION_API_VERSION}.pc:relion.pc.in])
AC_OUTPUT