| 1 |
The file example.cc contains simple program illustrating a few |
| 2 |
features of the L_function class. To build it, we assume that you've |
| 3 |
installed libLfunction and its headers to locations where your |
| 4 |
compiler and linker know how to find them -- if not by default, then |
| 5 |
using the -I and -L C preprocessor flags (CPPFLAGS). |
| 6 |
|
| 7 |
To build the example, run "make -f Makefile.example" from within this |
| 8 |
directory. A few standard environment variables affect the outcome: |
| 9 |
|
| 10 |
* CXX: the name of your C++ compiler (default: c++) |
| 11 |
* CXXFLAGS: flags to pass to the C++ compiler (default: empty) |
| 12 |
* CPPFLAGS: flags to pass to the C++ preprocessor (default: empty) |
| 13 |
* LDFLAGS: flags to pass to the linker (default: empty) |
| 14 |
* LIBS: the "-l<library>" flags for the linker (default: -lLfunction) |
| 15 |
|
| 16 |
Examples: |
| 17 |
|
| 18 |
1. Compile using g++ from the GNU Compiler Collection: |
| 19 |
|
| 20 |
$ make CXX="g++" -f Makefile.example |
| 21 |
|
| 22 |
2. Compile with g++, using a few performance optimizations: |
| 23 |
|
| 24 |
$ make CXX=g++ CXXFLAGS="-march=native -O2 -pipe" -f Makefile.example |
| 25 |
|
| 26 |
3. Compile using clang++ from LLVM: |
| 27 |
|
| 28 |
$ make CXX="clang++" -f Makefile.example |
| 29 |
|
| 30 |
4. Build against a copy of lcalc installed under /usr/local, and |
| 31 |
execute the result: |
| 32 |
|
| 33 |
$ export CPPFLAGS="-I/usr/local/include" |
| 34 |
$ export LDFLAGS="-L/usr/local/lib" |
| 35 |
$ export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib" |
| 36 |
$ make -f Makefile.example |
| 37 |
$ ./example |
| 38 |
|
| 39 |
5. Build in C++17 mode: |
| 40 |
|
| 41 |
$ make CXXFLAGS="-std=c++17" -f Makefile.example |
| 42 |
|