Chris@49: # The generated "Makefile" from "Makefile.cmake" is only usable after Chris@49: # the Armadillo library has been configured and installed by CMake. Chris@49: Chris@49: CXX=g++ Chris@49: #CXX=g++-4.2 Chris@49: ## Under MacOS you may have an old compiler as default (e.g. GCC 4.0). Chris@49: ## However, GCC 4.2 or later is available and preferable due to better Chris@49: ## handling of template code. Chris@49: Chris@49: #CXX=CC Chris@49: ## When using the Sun Studio compiler Chris@49: Chris@49: Chris@49: # flags configured by CMake Chris@49: ifeq (${ARMA_OS},macos) Chris@49: EXTRA_LIB_FLAGS = -framework Accelerate Chris@49: endif Chris@49: Chris@49: #EXTRA_LIB_FLAGS = -library=sunperf Chris@49: ## When using the Sun Studio compiler Chris@49: Chris@49: Chris@49: ifeq (${ARMA_USE_BOOST},true) Chris@49: BOOST_INCLUDE_FLAG = -I ${Boost_INCLUDE_DIR} Chris@49: endif Chris@49: Chris@49: Chris@49: Chris@49: LIB_FLAGS = -larmadillo $(EXTRA_LIB_FLAGS) Chris@49: ## NOTE: on Ubuntu and Debian based systems you may need to add Chris@49: ## -lgfortran to LIB_FLAGS Chris@49: Chris@49: Chris@49: Chris@49: OPT = -O2 Chris@49: ## As the Armadillo library uses recursive templates, Chris@49: ## compilation times depend on the level of optimisation: Chris@49: ## Chris@49: ## -O0: quick compilation, but the resulting program will be slow Chris@49: ## -O1: good trade-off between compilation time and execution speed Chris@49: ## -O2: produces programs which have almost all possible speedups, Chris@49: ## but compilation takes longer Chris@49: Chris@49: Chris@49: #OPT = -xO4 -xannotate=no Chris@49: ## When using the Sun Studio compiler Chris@49: Chris@49: Chris@49: #EXTRA_OPT = -fwhole-program Chris@49: ## Uncomment the above line if you're compiling Chris@49: ## all source files into one program in a single hit. Chris@49: Chris@49: Chris@49: #DEBUG = -DARMA_EXTRA_DEBUG Chris@49: ## Uncomment the above line to enable low-level Chris@49: ## debugging. Lots of debugging information will Chris@49: ## be printed when a compiled program is run. Chris@49: ## Please enable this option when reporting bugs. Chris@49: Chris@49: Chris@49: #FINAL = -DARMA_NO_DEBUG Chris@49: ## Uncomment the above line to disable Armadillo's checks. Chris@49: ## DANGEROUS! Not recommended unless your code has been Chris@49: ## thoroughly tested. Chris@49: Chris@49: Chris@49: # Chris@49: # Chris@49: # Chris@49: Chris@49: CXXFLAGS = $(BOOST_INCLUDE_FLAG) $(DEBUG) $(FINAL) $(OPT) $(EXTRA_OPT) Chris@49: Chris@49: all: example1 example2 Chris@49: Chris@49: example1: example1.cpp Chris@49: $(CXX) $(CXXFLAGS) -o $@ $< $(LIB_FLAGS) Chris@49: Chris@49: example2: example2.cpp Chris@49: $(CXX) $(CXXFLAGS) -o $@ $< $(LIB_FLAGS) Chris@49: Chris@49: Chris@49: .PHONY: clean Chris@49: Chris@49: clean: Chris@49: rm -f example1 example2 Chris@49: