File: build

package info (click to toggle)
libfann 2.1.0~beta%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,648 kB
  • ctags: 924
  • sloc: sh: 8,753; ansic: 5,994; cpp: 2,351; makefile: 507; perl: 243; python: 131; sed: 7
file content (44 lines) | stat: -rw-r--r-- 1,219 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
#!/bin/sh
# autopkgtest check: Build and run a program against libfann, to verify that the
# headers are installed correctly
# Source taken from http://leenissen.dk/fann/wp/help/getting-started/
# (C) 2013 Vibhav Pant
# Author: Vibhav Pant <vibhavp@ubuntu.com>
#
# Updated by Christian Kastner <debian@kvr.at> to use $ADTTMP.

set -e

# Presence of $ADTTMP implies that someone will handle cleanup for us, so we
# can avoid duplicating the effort (signal handling, etc.) here.
if [ -z "$ADTTMP" ]
then
	echo "Required envvar \"$ADTTMP\"is not set" >&2
	exit 1
fi

cd "$ADTTMP"
cat <<EOF > libfann_test.c
#include <fann.h>

int main(void)
{
    const unsigned int num_input = 2;
    const unsigned int num_output = 1;
    const unsigned int num_layers = 3;
    const unsigned int num_neurons_hidden = 3;

    struct fann *ann = fann_create_standard(num_layers, num_input,
        num_neurons_hidden, num_output);
    fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC);
    fann_set_activation_function_output(ann, FANN_SIGMOID_SYMMETRIC);
    fann_destroy(ann);
    return 0;
}
EOF

gcc -o libfann_test libfann_test.c -lfann -Wall -Werror
echo "build: OK"
[ -x libfann_test ]
./libfann_test
echo "run: OK"