File: parcon.m4

package info (click to toggle)
neuron 7.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 48,268 kB
  • sloc: cpp: 192,952; ansic: 145,860; python: 42,092; sh: 10,507; makefile: 6,816; yacc: 3,259; java: 995; lex: 457; csh: 108; pascal: 37; sed: 5
file content (89 lines) | stat: -rwxr-xr-x 2,171 bytes parent folder | download
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
AC_DEFUN([AC_NRN_ParallelContext],[
xLIBS="$LIBS"
dnl does PVM exist. specifically pvm3.h
if test "$use_mpi" = "no" ; then
AC_CHECK_HEADER($PVM_ROOT/include/pvm3.h,
[
	PVM_INCLUDES='-I${PVM_ROOT}/include'
	PVM_XTRA_LIBS="`sed -n '/^ARCHLIB/s/[[^-]]*//p' ${PVM_ROOT}/conf/${PVM_ARCH}.def`"
	echo "PVM_XTRA_LIBS=$PVM_XTRA_LIBS"
	PVM_LIBS='-L${PVM_ROOT}/lib/${PVM_ARCH} -lpvm3'
	tPVM_LIBS="-L${PVM_ROOT}/lib/${PVM_ARCH} -lpvm3 ${PVM_XTRA_LIBS}"
	LIBS="$tPVM_LIBS $LIBS"
	AC_CHECK_LIB(pvm3,pvm_parent,[
		NRN_DEFINE(HAVE_PVM3_H,1,[define if pvm3.h exists])
		AC_CHECK_LIB(pvm3,pvm_pkmesg,[
			NRN_DEFINE(HAVE_PKMESG,1,[define if pvm_pkmesg in the -lpvm3 library])
		])
	],[
		echo "There is a pvm3.h but I can't link with -lpvm3"
		echo "So not using pvm afterall."
		PVM_INCLUDES=""
		PVM_LIBS=""
		tPVM_LIBS=""
		case "$host_os" in
		irix6* )
echo "This is a $host so if you want to use ParallelContext under PVM"
echo "you probably need to rebuild"
echo "everything (including interviews) with the environment variables"
			if test "$GCC"='yes' ; then
				echo setenv CC '"'"$CC -mabi=64"'"'
			else
				echo setenv CC '"'"$CC -64"'"'
			fi
			if test "$GXX"='yes' ; then
				echo setenv CXX '"'"$CXX -mabi=64"'"'
			else
				echo setenv CXX '"'"$CXX -64"'"'
			fi
		;;
		esac
	])
	LIBS="$xLIBS"
])
else dnl use_mpi is not "no" so avoid pvm
	PVM_INCLUDES=""
	PVM_LIBS=""
	tPVM_LIBS=""
	PVM_XTRA_LIBS=""
fi

dnl Check for SIGPOLL and verify that it works
echo
AC_LANG_PUSH([C++])
AC_TRY_RUN([
#include <stdio.h>
#include <unistd.h>
#include <stropts.h>
#include <signal.h>
#include <errno.h>
int main() {
	int fd, arg;
	sighold(SIGPOLL);
	fd = fileno(popen("ls", "r"));
	if (ioctl(fd, I_GETSIG, &arg) < 0 && errno != EINVAL) {
		exit(1);
	}
	exit(0);
	return 0;
}
],[
NRN_DEFINE(HAVE_SIGPOLL,1,[define if SIGPOLL in signal.h])
echo "do SIGPOLL and I_GETSIG work: yes"
],[
echo "do SIGPOLL and I_GETSIG work: no"
echo " But see config.log to see why it failed."
],[
echo "cross compiling: Assume HAVE_SIGPOLL is 0"
])
AC_LANG_POP([])

dnl Check for STL
AC_CXX_HAVE_STL

AC_SUBST(PVM_INCLUDES)
AC_SUBST(PVM_XTRA_LIBS)
AC_SUBST(PVM_LIBS)

])dnl end of AC_NRN_ParallelContext