Chris@49
|
1 # The generated "Makefile" from "Makefile.cmake" is only usable after
|
Chris@49
|
2 # the Armadillo library has been configured and installed by CMake.
|
Chris@49
|
3
|
Chris@49
|
4 CXX=g++
|
Chris@49
|
5 #CXX=g++-4.2
|
Chris@49
|
6 ## Under MacOS you may have an old compiler as default (e.g. GCC 4.0).
|
Chris@49
|
7 ## However, GCC 4.2 or later is available and preferable due to better
|
Chris@49
|
8 ## handling of template code.
|
Chris@49
|
9
|
Chris@49
|
10 #CXX=CC
|
Chris@49
|
11 ## When using the Sun Studio compiler
|
Chris@49
|
12
|
Chris@49
|
13
|
Chris@49
|
14 # flags configured by CMake
|
Chris@49
|
15 ifeq (${ARMA_OS},macos)
|
Chris@49
|
16 EXTRA_LIB_FLAGS = -framework Accelerate
|
Chris@49
|
17 endif
|
Chris@49
|
18
|
Chris@49
|
19 #EXTRA_LIB_FLAGS = -library=sunperf
|
Chris@49
|
20 ## When using the Sun Studio compiler
|
Chris@49
|
21
|
Chris@49
|
22
|
Chris@49
|
23 ifeq (${ARMA_USE_BOOST},true)
|
Chris@49
|
24 BOOST_INCLUDE_FLAG = -I ${Boost_INCLUDE_DIR}
|
Chris@49
|
25 endif
|
Chris@49
|
26
|
Chris@49
|
27
|
Chris@49
|
28
|
Chris@49
|
29 LIB_FLAGS = -larmadillo $(EXTRA_LIB_FLAGS)
|
Chris@49
|
30 ## NOTE: on Ubuntu and Debian based systems you may need to add
|
Chris@49
|
31 ## -lgfortran to LIB_FLAGS
|
Chris@49
|
32
|
Chris@49
|
33
|
Chris@49
|
34
|
Chris@49
|
35 OPT = -O2
|
Chris@49
|
36 ## As the Armadillo library uses recursive templates,
|
Chris@49
|
37 ## compilation times depend on the level of optimisation:
|
Chris@49
|
38 ##
|
Chris@49
|
39 ## -O0: quick compilation, but the resulting program will be slow
|
Chris@49
|
40 ## -O1: good trade-off between compilation time and execution speed
|
Chris@49
|
41 ## -O2: produces programs which have almost all possible speedups,
|
Chris@49
|
42 ## but compilation takes longer
|
Chris@49
|
43
|
Chris@49
|
44
|
Chris@49
|
45 #OPT = -xO4 -xannotate=no
|
Chris@49
|
46 ## When using the Sun Studio compiler
|
Chris@49
|
47
|
Chris@49
|
48
|
Chris@49
|
49 #EXTRA_OPT = -fwhole-program
|
Chris@49
|
50 ## Uncomment the above line if you're compiling
|
Chris@49
|
51 ## all source files into one program in a single hit.
|
Chris@49
|
52
|
Chris@49
|
53
|
Chris@49
|
54 #DEBUG = -DARMA_EXTRA_DEBUG
|
Chris@49
|
55 ## Uncomment the above line to enable low-level
|
Chris@49
|
56 ## debugging. Lots of debugging information will
|
Chris@49
|
57 ## be printed when a compiled program is run.
|
Chris@49
|
58 ## Please enable this option when reporting bugs.
|
Chris@49
|
59
|
Chris@49
|
60
|
Chris@49
|
61 #FINAL = -DARMA_NO_DEBUG
|
Chris@49
|
62 ## Uncomment the above line to disable Armadillo's checks.
|
Chris@49
|
63 ## DANGEROUS! Not recommended unless your code has been
|
Chris@49
|
64 ## thoroughly tested.
|
Chris@49
|
65
|
Chris@49
|
66
|
Chris@49
|
67 #
|
Chris@49
|
68 #
|
Chris@49
|
69 #
|
Chris@49
|
70
|
Chris@49
|
71 CXXFLAGS = $(BOOST_INCLUDE_FLAG) $(DEBUG) $(FINAL) $(OPT) $(EXTRA_OPT)
|
Chris@49
|
72
|
Chris@49
|
73 all: example1 example2
|
Chris@49
|
74
|
Chris@49
|
75 example1: example1.cpp
|
Chris@49
|
76 $(CXX) $(CXXFLAGS) -o $@ $< $(LIB_FLAGS)
|
Chris@49
|
77
|
Chris@49
|
78 example2: example2.cpp
|
Chris@49
|
79 $(CXX) $(CXXFLAGS) -o $@ $< $(LIB_FLAGS)
|
Chris@49
|
80
|
Chris@49
|
81
|
Chris@49
|
82 .PHONY: clean
|
Chris@49
|
83
|
Chris@49
|
84 clean:
|
Chris@49
|
85 rm -f example1 example2
|
Chris@49
|
86
|