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