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