[libfann] 45/133: Add Makefile and update instructions for examples

Christian Kastner chrisk-guest at moszumanska.debian.org
Sat Oct 4 21:07:47 UTC 2014


This is an automated email from the git hooks/post-receive script.

chrisk-guest pushed a commit to branch master
in repository libfann.

commit b03e6b1df2eeaf042bed8de8234fa30a81e92b67
Author: Christian Kastner <debian at kvr.at>
Date:   Tue Jun 8 22:13:58 2010 +0200

    Add Makefile and update instructions for examples
    
    As suggested by Yaroslav Halchenko
---
 debian/Makefile.examples        | 24 +++++++++++++++++++++
 debian/README-libfann2-examples | 48 ++++++++++++++++++++++++++++++++++++-----
 debian/changelog                |  2 +-
 debian/rules                    |  4 +++-
 4 files changed, 71 insertions(+), 7 deletions(-)

diff --git a/debian/Makefile.examples b/debian/Makefile.examples
new file mode 100644
index 0000000..dfeef43
--- /dev/null
+++ b/debian/Makefile.examples
@@ -0,0 +1,24 @@
+#!/usr/bin/make -f
+# Based on upstream's makefile for the examples, see $SRC/examples/Makefile
+# See the README in this directory for instructions on how to run this
+
+CC=gcc
+
+TARGETS = xor_train xor_test simple_train steepness_train simple_test robot mushroom cascade_train scaling_test scaling_train
+
+all: $(TARGETS)
+
+%: /usr/share/doc/libfann-dev/examples/%.c
+	$(CC) -O3 $< -o $@ -lm -lfann
+
+clean:
+	rm -f $(TARGETS) xor_fixed.data *.net
+
+runtest: $(TARGETS)
+	@echo
+	@echo Training network
+	./xor_train
+
+	@echo
+	@echo Testing network with floats
+	./xor_test
diff --git a/debian/README-libfann2-examples b/debian/README-libfann2-examples
index 8f42a64..13107b2 100644
--- a/debian/README-libfann2-examples
+++ b/debian/README-libfann2-examples
@@ -1,8 +1,46 @@
-To compile and run these tests, execute the following commands within a
-directory for which you have write permission:
+README
+---------
 
-    $ gcc -o <example> -lm -lfann <example>.c
-    $ ./example
+To compile and run these tests, you need to be in a directory for which you
+have write permission (for example the /tmp directory).
 
 Note that some of these tests have interdependencies. Specifically, for all
-tests NAME_test.c, you have to run NAME_train.c first.
+tests <NAME>_test.c, you have to run <NAME>_train.c first.
+
+Available Tests are:
+    xor_train
+    xor_test
+    simple_train
+    simple_test 
+    scaling_train
+    scaling_test
+    steepness_train
+    robot
+    mushroom
+    cascade_train
+
+
+
+Method 1:
+---------
+
+Use the Makefile provided by the package:
+
+# Compile only one example
+
+    $ make -f /usr/share/doc/libfann-dev/examples/Makefile cascade_train
+    $ ./cascade_train
+
+# Compile all examples
+
+    $ make -f /usr/share/doc/libfann-dev/examples/Makefile 
+    $ ./TESTNAME
+
+
+Method 2:
+--------
+
+Use gcc directly:
+
+    $ gcc -o example -lm -lfann /usr/share/doc/libfann-dev/examples/<example>.c
+    $ ./example
diff --git a/debian/changelog b/debian/changelog
index 4db3fbd..ff86534 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -42,7 +42,7 @@ libfann (2.1.0~beta~dfsg-1) unstable; urgency=low
   * libfann2-dev:
     - Renamed to libfann-dev
     - Include training data for examples, modify their paths and include
-      instructions on how to run them. Closes: #498227
+      a Makefile + instructions on how to run them. Closes: #498227
   * debian/patches:
     - Added 0001-Link-python-pyfann-dynamically-instead-of-statically.patch
     - Added 0002-Link-against-libm.patch (Closes: #558887)
diff --git a/debian/rules b/debian/rules
index 206bd43..9436281 100755
--- a/debian/rules
+++ b/debian/rules
@@ -72,7 +72,9 @@ override_dh_installexamples:
 		debian/libfann-dev/usr/share/doc/libfann-dev/examples/*.c \
 		debian/python-pyfann/usr/share/doc/python-pyfann/examples/*.py
 	
-	# Add compile/run instructions for the examples
+	# Add Makefile & compile/run instructions for the examples
+	cp debian/Makefile.examples \
+		debian/libfann-dev/usr/share/doc/libfann-dev/examples/Makefile
 	cp debian/README-libfann2-examples \
 		debian/libfann-dev/usr/share/doc/libfann-dev/examples/README
 	

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libfann.git



More information about the debian-science-commits mailing list