File: ac_datatap.m4

package info (click to toggle)
adios 1.3-11
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 7,376 kB
  • sloc: ansic: 48,186; sh: 9,682; cpp: 2,662; f90: 1,390; makefile: 895; python: 372; xml: 301
file content (142 lines) | stat: -rw-r--r-- 3,699 bytes parent folder | download | duplicates (6)
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
132
133
134
135
136
137
138
139
140
141
142

AC_DEFUN([AC_DATATAP], [

AC_REQUIRE([AC_INFINIBAND])
AC_REQUIRE([AC_PORTALS])

dnl give an option to the user to enable datatap (with either ib or portals)
dnl by default datatap will be disabled

DT_SRCDIR=""
DT_CPPFLAGS=""
DT_LDFLAGS=""
DT_LIBS=""

datatap=disable

temptest=enable

datatap_dir=""


AC_ARG_WITH(datatap, 
	[  --with-datatap=DIR 	Location of DataTap], 
	[ ac_with_datatap=$withval], [with_datatap=no])

if test "x$with_datatap" = "xno"; then
	AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled])
	datatap=disable
	temptest=disable

elif test x"$with_datatap" = xyes -o x"$with_datatap" = xcheck; then
		
	AC_DEFINE(NO_DATATAP, 0, [Datatap is disabled])

	if test x"$ac_with_infiniband" = xyes; then
		CERCS_REQUIRE_PACKAGE(ibpbio, thin_ib.h, libibclient.la)
		CERCS_REQUIRE_PACKAGE(ffs, ffs.h, libffs.la)
		CERCS_REQUIRE_PACKAGE(gen_thread, gen_thread.h, libgen_thread.la)
		if test -n "$cercs_cv_ibpbio_link_dir";then
			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ibpbio_link_dir"
			DT_LIBS="$DT_LIBS -libclient"
			datatap=ibverbs
		else
			temptest=disable
		fi
		if test -n "$cercs_cv_ffs_link_dir";then
                   	DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ffs_link_dir"
			DT_LIBS="$DT_LIBS -lgen_thread"
			datatap=ibverbs
		else
			temptest=disable
		fi
		if test -n "$cercs_cv_gen_thread_link_dir";then
			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_gen_thread_link_dir"
			DT_LIBS="$DT_LIBS -lgen_thread"
			datatap=ibverbs
		else
			temptest=disable
		fi		
				
        elif test x"$ac_with_portals" = xyes; then
		CERCS_REQUIRE_PACKAGE(ptlpbio, thin_portal.h, libptlclient.a)

		if test -n "$cercs_cv_ptlpbio_link_dir";then
			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ptlpbio_link_dir"
			DT_LIBS="$DT_LIBS -lptlclient -lptlserver -lbench -ldl"
			datatap=portals
		else
			temptest=disable
		fi

	else
		echo "Neither portals nor infiniband found. Disabling datatap"
		AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled])
		datatap=disable
		temptest=disable
	fi
else
dnl directory given .. add it to search path with CERCS_REQUIRE_PACKAGE
	AC_MSG_NOTICE([Datatap with custom library path: $withval])
	
	datatap_dir=$withval

	AC_DEFINE(NO_DATATAP, 0, [Datatap is disabled])

	if test x"$ac_with_infiniband" = xyes; then
		CERCS_REQUIRE_PACKAGE(ibpbio, thin_ib.h, libibclient.la)
		CERCS_REQUIRE_PACKAGE(ffs, ffs.h, libffs.la)
		CERCS_REQUIRE_PACKAGE(gen_thread, gen_thread.h, libgen_thread.la)
		if test -n "$cercs_cv_ibpbio_link_dir";then
			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ibpbio_link_dir"
			DT_LIBS="$DT_LIBS -libclient"
			datatap=ibverbs
		else
			temptest=disable
		fi
		if test -n "$cercs_cv_ffs_link_dir";then
			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ffs_link_dir"
			DT_LIBS="$DT_LIBS -lgen_thread"
			datatap=ibverbs
		else
			temptest=disable
		fi
		if test -n "$cercs_cv_gen_thread_link_dir";then
			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_gen_thread_link_dir"
			DT_LIBS="$DT_LIBS -lgen_thread"
			datatap=ibverbs
		else
			temptest=disable
		fi		
				
        elif test x"$ac_with_portals" = xyes; then
		CERCS_REQUIRE_PACKAGE(ptlpbio, thin_portal.h, libptlclient.a)

		if test -n "$cercs_cv_ptlpbio_link_dir";then
			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ptlpbio_link_dir"
			DT_LIBS="$DT_LIBS -lptlclient -lptlserver -lbench -ldl"
			datatap=portals
		else
			temptest=disable
		fi

	else
		echo "Neither portals nor infiniband found. Disabling datatap"
		AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled])
		datatap=disable
		temptest=disable
	fi	
fi

if test x"$temptest" = xdisable; then
	datatap=disable
	echo "Datatap dependency check failed"
	AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled])
fi

AC_SUBST(DT_LIBS)
AC_SUBST(DT_CPPFLAGS)
AC_SUBST(DT_LDFLAGS)


]) dnl AC_DATATAP