1# Copyright 2011-2014 Mario Mulansky
2# Copyright 2011-2014 Karsten Ahnert
3#
4# Distributed under the Boost Software License, Version 1.0.
5# (See accompanying file LICENSE_1_0.txt or
6# copy at http://www.boost.org/LICENSE_1_0.txt)
7
8# make sure BOOST_ROOT is pointing to your boost directory
9# otherwise, set it here:
10# BOOST_ROOT = /path/to/boost
11
12INCLUDES += -I../../include/ -I$(BOOST_ROOT)
13GCCFLAGS = -O3 -ffast-math -DNDEBUG
14# disabling -ffast-math might give slightly better performance
15ICCFLAGS = -Ofast -xHost -ip -inline-forceinline -DNDEBUG
16# Possible options: -fp-model source -no-fma
17GFORTFLAGS = -Ofast
18
19bin/gcc:
20	mkdir -p bin/gcc
21
22bin/intel:
23	mkdir -p bin/intel
24
25bin/gfort:
26	mkdir -p bin/gfort
27
28bin/gcc/odeint_rk4_array: odeint_rk4_array.cpp bin/gcc
29	g++ ${GCCFLAGS} ${INCLUDES} -o bin/gcc/odeint_rk4_array odeint_rk4_array.cpp
30
31bin/gcc/c_lorenz: c_lorenz.c bin/gcc
32	gcc -std=c99 -Ofast -mtune=corei7-avx c_lorenz.c -o bin/gcc/c_lorenz
33
34bin/intel/odeint_rk4_array: odeint_rk4_array.cpp bin/intel
35	icpc ${ICCFLAGS} ${INCLUDES} -o bin/intel/odeint_rk4_array odeint_rk4_array.cpp
36
37bin/intel/c_lorenz: c_lorenz.c bin/intel
38	icc -std=c99 -Ofast -xHost -ansi-alias -o bin/intel/c_lorenz c_lorenz.c
39
40bin/gfort/fortran_lorenz: fortran_lorenz.f90 bin/gfort
41	gfortran ${GFORTFLAGS} fortran_lorenz.f90 -o bin/gfort/fortran_lorenz
42
43all: bin/gcc/odeint_rk4_array bin/intel/odeint_rk4_array bin/gcc/c_lorenz bin/intel/c_lorenz bin/gfort/fortran_lorenz
44