max@0
|
1 # NOTE:
|
max@0
|
2 # This file is mainly useful when doing a manual installation of Armadillo.
|
max@0
|
3 # It is overwritten by CMake when doing an automatic installation.
|
max@0
|
4 #
|
max@0
|
5 # You may need to edit this file to reflect the type and capabilities
|
max@0
|
6 # of your system. The defaults are for a Linux system and will need
|
max@0
|
7 # to be changed for other systems (e.g. Mac OS X).
|
max@0
|
8
|
max@0
|
9
|
max@0
|
10 CXX=g++
|
max@0
|
11 #CXX=g++-4.2
|
max@0
|
12 ## Under MacOS you may have an old compiler as default (e.g. GCC 4.0).
|
max@0
|
13 ## However, GCC 4.2 or later is available and preferable due to better
|
max@0
|
14 ## handling of template code.
|
max@0
|
15
|
max@0
|
16 #CXX=CC
|
max@0
|
17 ## When using the Sun Studio compiler
|
max@0
|
18
|
max@0
|
19
|
max@0
|
20 ARMA_INCLUDE_FLAG = -I ../include
|
max@0
|
21 ## If you've installed Armadillo's headers manually,
|
max@0
|
22 ## you may need to tell the compiler where they are.
|
max@0
|
23 ## For example, change ../include to /usr/local/include
|
max@0
|
24 ## and uncomment the above line.
|
max@0
|
25
|
max@0
|
26
|
max@0
|
27 #BOOST_INCLUDE_FLAG = -I /usr/include
|
max@0
|
28 ## If you have Boost libraries, change /usr/include
|
max@0
|
29 ## to point to where they are installed and uncomment
|
max@0
|
30 ## the above line.
|
max@0
|
31
|
max@0
|
32
|
max@0
|
33 #EXTRA_LIB_FLAGS = -llapack -lblas
|
max@0
|
34 ## The above line is an example of the extra libraries
|
max@0
|
35 ## that can be used by Armadillo. You will also need
|
max@0
|
36 ## to modify "include/armadillo_bits/config.hpp"
|
max@0
|
37 ## to indicate which extra libraries are present.
|
max@0
|
38 ## If you're using Mac OS, comment out the line and
|
max@0
|
39 ## instead use the line below.
|
max@0
|
40
|
max@0
|
41
|
max@0
|
42 #EXTRA_LIB_FLAGS = -framework Accelerate
|
max@0
|
43 ## Uncomment the above line when using Mac OS
|
max@0
|
44 ## and modify "include/armadillo_bits/config.hpp"
|
max@0
|
45 ## to indicate that LAPACK and BLAS libraries
|
max@0
|
46 ## are present
|
max@0
|
47
|
max@0
|
48
|
max@0
|
49 #EXTRA_LIB_FLAGS = -library=sunperf
|
max@0
|
50 ## When using the Sun Studio compiler
|
max@0
|
51
|
max@0
|
52
|
max@0
|
53 LIB_FLAGS = $(EXTRA_LIB_FLAGS)
|
max@0
|
54 ## NOTE: on Ubuntu and Debian based systems you may need to add
|
max@0
|
55 ## -lgfortran to LIB_FLAGS
|
max@0
|
56
|
max@0
|
57
|
max@0
|
58 OPT = -O1
|
max@0
|
59 ## As the Armadillo library uses recursive templates,
|
max@0
|
60 ## compilation times depend on the level of optimisation:
|
max@0
|
61 ##
|
max@0
|
62 ## -O0: quick compilation, but the resulting program will be slow
|
max@0
|
63 ## -O1: produces programs which achieve most of the possible speedup
|
max@0
|
64 ## -O3: produces programs which have almost all possible speedups,
|
max@0
|
65 ## but compilation takes considerably longer
|
max@0
|
66
|
max@0
|
67
|
max@0
|
68 #OPT = -xO4 -xannotate=no
|
max@0
|
69 ## When using the Sun Studio compiler
|
max@0
|
70
|
max@0
|
71
|
max@0
|
72 #EXTRA_OPT = -fwhole-program
|
max@0
|
73 ## Uncomment the above line if you're compiling
|
max@0
|
74 ## all source files into one program in a single hit.
|
max@0
|
75
|
max@0
|
76
|
max@0
|
77 #DEBUG = -DARMA_EXTRA_DEBUG
|
max@0
|
78 ## Uncomment the above line to enable low-level
|
max@0
|
79 ## debugging. Lots of debugging information will
|
max@0
|
80 ## be printed when a compiled program is run.
|
max@0
|
81 ## Please enable this option when reporting bugs.
|
max@0
|
82
|
max@0
|
83
|
max@0
|
84 #FINAL = -DARMA_NO_DEBUG
|
max@0
|
85 ## Uncomment the above line to disable Armadillo's checks.
|
max@0
|
86 ## DANGEROUS! Not recommended unless your code has been
|
max@0
|
87 ## thoroughly tested.
|
max@0
|
88
|
max@0
|
89
|
max@0
|
90 #
|
max@0
|
91 #
|
max@0
|
92 #
|
max@0
|
93
|
max@0
|
94 CXXFLAGS = $(ARMA_INCLUDE_FLAG) $(BOOST_INCLUDE_FLAG) $(DEBUG) $(FINAL) $(OPT) $(EXTRA_OPT)
|
max@0
|
95
|
max@0
|
96 all: example1 example2
|
max@0
|
97
|
max@0
|
98 example1: example1.cpp
|
max@0
|
99 $(CXX) $(CXXFLAGS) -o $@ $< $(LIB_FLAGS)
|
max@0
|
100
|
max@0
|
101 example2: example2.cpp
|
max@0
|
102 $(CXX) $(CXXFLAGS) -o $@ $< $(LIB_FLAGS)
|
max@0
|
103
|
max@0
|
104
|
max@0
|
105 .PHONY: clean
|
max@0
|
106
|
max@0
|
107 clean:
|
max@0
|
108 rm -f example1 example2
|
max@0
|
109
|