codeplea / genann

simple neural network library in ANSI C
https://codeplea.com/genann
zlib License
1.99k stars 237 forks source link

Refactored project to incorporate a build system #34

Closed jflopezfernandez closed 5 years ago

jflopezfernandez commented 5 years ago

The project now uses Autotools as its build system, and running the usual './configure', 'make', 'make install' results in the building of a shared library that gets installed in /usr/local/lib by default, as well as the genann.h header, which gets installed in /usr/local/include.

All of the usual configuration flexibility is present, including the addition of gmp and mpfr simply as a demonstration of the auto-configuration ability of the system. The build system looks for gmp and mpfr if the user specifies --with-gmp or --with-mpfr and looks for the installation. If found, it automatically links the target to those libraries.

The usual variables are configurable (CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS), and the configuration even allows specifying the activation function through there with ACTIVATION_FUNCTION=SIGMOID, although LINEAR and THRESHOLD are also options. Specifying these options defines the necessary preprocessor symbol.

Running 'make check' builds the test, links it against the library, and runs it.

Running 'make examples' builds all four examples.

codeplea commented 5 years ago

It looks like you put a lot of work into this, but I don't think a 2-file library needs a build system of this caliber. The point of keeping the library in a single .c file is that a user can just do gcc -c genann.c -o genann.o. They don't need a several hundred line long build system.

Great job on the documentation though, most PRs skip over that.

jflopezfernandez commented 5 years ago

Yea, I completely understand. I've been on an autotools kick recently, and I came across a comment asking for building a shared library, so I figured I'd get some good practice out of it. I definitely agree it's probably overkill though, haha.

I love the library, by the way, it really is awesome.