1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
|
# Directory containing Faust .lib and .cpp architecture files:
ck1 := /opt/local/share/faust/music.lib
ck2 := /usr/local/share/faust/music.lib
ck3 := $(FAUST_LIB_PATH)/faust/music.lib
LIB := $(if $(wildcard $(ck1)),/opt/local/lib,"")
LIB := $(if $(wildcard $(ck2)),/usr/local/lib,$(LIB))
LIB := $(if $(wildcard $(ck3)),$(FAUST_LIB_PATH),$(LIB))
DESTDIR ?=
PREFIX ?= /usr/local
prefix := $(DESTDIR)$(PREFIX)
system := $(shell uname -s)
LLVM_VERSION = $(shell llvm-config --version)
ifeq ($(LLVM_VERSION), 3.1)
LLVM_VERSION = LLVM_31
CXX = /opt/local/libexec/llvm-3.1/bin/clang++
endif
ifeq ($(LLVM_VERSION), 3.2)
LLVM_VERSION = LLVM_32
CXX = /opt/local/libexec/llvm-3.2/bin/clang++
endif
ifeq ($(LLVM_VERSION), 3.3)
LLVM_VERSION = LLVM_33
CXX = /opt/local/libexec/llvm-3.3/bin/clang++
LLC = /opt/local/libexec/llvm-3.3/bin/llc
endif
ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION),3.4, 3.4.1, 3.4.2))
LLVM_VERSION = LLVM_34
CXX = /opt/local/libexec/llvm-3.4/bin/clang++
LLC = /opt/local/libexec/llvm-3.4/bin/llc
endif
ifeq ($(LLVM_VERSION), 3.4.2)
LLVM_VERSION = LLVM_34
CXX = /opt/local/libexec/llvm-3.4/bin/clang++
LLC = /opt/local/libexec/llvm-3.4/bin/llc
endif
ifeq ($(LLVM_VERSION), 3.5)
LLVM_VERSION = LLVM_35
CXX = /opt/local/libexec/llvm-3.5/bin/clang++
LLC = /opt/local/libexec/llvm-3.5/bin/llc
endif
ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.6.0 3.6.1 3.6.2))
LLVM_VERSION = LLVM_36
CXX = /opt/local/libexec/llvm-3.6/bin/clang++
LLC = /opt/local/libexec/llvm-3.6/bin/llc
endif
ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.7.0 3.7.1 3.7.2))
LLVM_VERSION = LLVM_37
CXX = /opt/local/libexec/llvm-3.7/bin/clang++
LLC = /opt/local/libexec/llvm-3.7/bin/llc
endif
ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.8.0 3.8.1))
LLVM_VERSION = LLVM_38
CXX = /opt/local/libexec/llvm-3.8/bin/clang++
LLC = /opt/local/libexec/llvm-3.8/bin/llc
endif
ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.9.0 3.9.1))
LLVM_VERSION = LLVM_39
CXX = /opt/local/libexec/llvm-3.9/bin/clang++
LLC = /opt/local/libexec/llvm-3.9/bin/llc
endif
ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 4.0.0 4.0.1))
LLVM_VERSION = LLVM_40
CXX = /opt/local/libexec/llvm-4.0/bin/clang++
LLC = /opt/local/libexec/llvm-4.0/bin/llc
endif
ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 5.0.0 5.0.1))
LLVM_VERSION = LLVM_50
CXX = /opt/local/libexec/llvm-5.0/bin/clang++
LLC = /opt/local/libexec/llvm-5.0/bin/llc
endif
ifeq ($(system), Darwin)
#MYGCCFLAGS := '-O3 -mfpmath=sse -msse -msse2 -msse3 -ffast-math '
#MYGCCFLAGS := '-O3 -mfpmath=sse -msse -msse2 -msse3 -ffast-math -fvectorize -fslp-vectorize'
MYGCCFLAGS := '-O3 -march=native -fvectorize -fslp-vectorize-aggressive'
else
MYGCCFLAGS := '-O3 -march=native -mfpmath=sse -msse -msse2 -msse3 -ffast-math -ftree-vectorize'
endif
MYICCFLAGS := '-O3 -xHost -ftz -fno-alias -fp-model fast=2'
VSIZE := 1024
all : icc gcc
icc : ialsascal ialsavec ialsavec2 ialsavec4 ialsaomp2 ialsasch ialsasch2
gcc : galsascal galsavec galsavec2 galsavec4 galsaomp2 galsasch galsasch2
#osx : gcoreaudioscal gcoreaudiovec1 gcoreaudiovec2 gcoreaudiovec3 gcoreaudiovec4 gcoreaudiosch gcoreaudiosch2
osx : gcoreaudioscal gcoreaudiovec1 gcoreaudiovec2 gcoreaudiosch gcoreaudiollvm bscal bvec1 bvec2 bscalllvm
#osx : bscal bvec1 bvec2 bscalllvm
### intel-compiler single-precision x {scalar, vector and openMP}
ialsascal :
install -d ialsascaldir
$(MAKE) DEST='ialsascaldir/' ARCH='alsa-gtk-bench.cpp' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
ialsasch :
install -d ialsaschdir
$(MAKE) DEST='ialsaschdir/' ARCH='alsa-gtk-bench.cpp' VEC='-sch -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
ialsasch2 :
install -d ialsasch2dir
$(MAKE) DEST='ialsasch2dir/' ARCH='alsa-gtk-bench.cpp' VEC='-sch -g -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
ialsavec :
install -d ialsavecdir
$(MAKE) DEST='ialsavecdir/' ARCH='alsa-gtk-bench.cpp' VEC='-vec -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
ialsavec1 :
install -d ialsavec1dir
$(MAKE) DEST='ialsavec1dir/' ARCH='alsa-gtk-bench.cpp' VEC='-vec -lv 1 -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
ialsavec2 :
install -d ialsavec2dir
$(MAKE) DEST='ialsavec2dir/' ARCH='alsa-gtk-bench.cpp' VEC='-vec -dfs -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
ialsavec3 :
install -d ialsavec3dir
$(MAKE) DEST='ialsavec3dir/' ARCH='alsa-gtk-bench.cpp' VEC='-vec -g -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
ialsavec4 :
install -d ialsavec4dir
$(MAKE) DEST='ialsavec4dir/' ARCH='alsa-gtk-bench.cpp' VEC='-vec -g -vs 16' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
ialsaomp :
install -d ialsaompdir
$(MAKE) DEST='ialsaompdir/' ARCH='alsa-gtk-bench.cpp' VEC='-omp -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS='-openmp '$(MYICCFLAGS) -f Makefile.compile
ialsaomp2 :
install -d ialsaomp2dir
$(MAKE) DEST='ialsaomp2dir/' ARCH='alsa-gtk-bench.cpp' VEC='-omp -g -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS='-openmp '$(MYICCFLAGS) -f Makefile.compile
### gcc-compiler single-precision x {scalar, vector and openMP}
galsascal :
install -d galsascaldir
$(MAKE) DEST='galsascaldir/' ARCH='alsa-gtk-bench.cpp' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='g++' CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
galsasch :
install -d galsaschdir
$(MAKE) DEST='galsaschdir/' ARCH='alsa-gtk-bench.cpp' VEC='-sch -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='g++' CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
galsasch2 :
install -d galsasch2dir
$(MAKE) DEST='galsasch2dir/' ARCH='alsa-gtk-bench.cpp' VEC='-sch -g -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='g++' CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
galsavec :
install -d galsavecdir
$(MAKE) DEST='galsavecdir/' ARCH='alsa-gtk-bench.cpp' VEC='-vec -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='g++' CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
galsavec1 :
install -d galsavec1dir
$(MAKE) DEST='galsavec1dir/' ARCH='alsa-gtk-bench.cpp' VEC='-vec -lv 1 -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='g++' CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
galsavec2 :
install -d galsavec2dir
$(MAKE) DEST='galsavec2dir/' ARCH='alsa-gtk-bench.cpp' VEC='-vec -dfs -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='g++' CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
galsavec3 :
install -d galsavec3dir
$(MAKE) DEST='galsavec3dir/' ARCH='alsa-gtk-bench.cpp' VEC='-vec -g -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='g++' CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
galsavec4 :
install -d galsavec4dir
$(MAKE) DEST='galsavec4dir/' ARCH='alsa-gtk-bench.cpp' VEC='-vec -g -vs 16' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='g++' CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
galsaomp :
install -d galsaompdir
$(MAKE) DEST='galsaompdir/' ARCH='alsa-gtk-bench.cpp' VEC='-omp -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='g++' CXXFLAGS='-fopenmp '$(MYGCCFLAGS) -f Makefile.compile
galsaomp2 :
install -d galsaomp2dir
$(MAKE) DEST='galsaomp2dir/' ARCH='alsa-gtk-bench.cpp' VEC='-omp -g -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='g++' CXXFLAGS='-fopenmp '$(MYGCCFLAGS) -f Makefile.compile
# OSX
gcoreaudiollvm : coreaudio-gtk-llvm-bench.cpp
$(CXX) -O3 -D$(LLVM_VERSION) -emit-llvm -S ../architecture/scheduler.cpp -o scheduler.ll
$(CXX) -O3 coreaudio-gtk-llvm-bench.cpp /usr/local/lib/libfaust.a -lpthread -framework CoreAudio -framework AudioUnit -framework CoreServices `pkg-config --cflags --libs gtk+-2.0` `llvm-config --ldflags --libs all --system-libs` -o gcoreaudiollvm
bscalllvm : console-bench-llvm.cpp
$(CXX) -O3 console-bench-llvm.cpp /usr/local/lib/libfaust.a `llvm-config --ldflags --libs all --system-libs` -o bscalllvm
bscal :
install -d bscaldir
$(MAKE) DEST='bscaldir/' ARCH='console-bench.cpp' LIB='' CXX=$(CXX) CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
bvec1 :
install -d bvec1dir
$(MAKE) DEST='bvec1dir/' ARCH='console-bench.cpp' VEC='-vec -lv 1 -vs $(VSIZE)' LIB='' CXX=$(CXX) CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
bvec2:
install -d bvec2dir
$(MAKE) DEST='bvec2dir/' ARCH='console-bench.cpp' VEC='-vec -dfs -vs $(VSIZE)' LIB='' CXX=$(CXX) CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
gcoreaudioscal :
install -d gcoreaudioscaldir
$(MAKE) DEST='gcoreaudioscaldir/' ARCH='coreaudio-gtk-bench.cpp' LIB='-lpthread -framework CoreAudio -framework AudioUnit -framework CoreServices `pkg-config --cflags --libs gtk+-2.0`' CXX=$(CXX) CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
gcoreaudiovec1 :
install -d gcoreaudiovec1dir
$(MAKE) DEST='gcoreaudiovec1dir/' ARCH='coreaudio-gtk-bench.cpp' VEC='-vec -lv 1 -vs $(VSIZE)' LIB='-lpthread -framework CoreAudio -framework AudioUnit -framework CoreServices `pkg-config --cflags --libs gtk+-2.0`' CXX=$(CXX) CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
gcoreaudiovec2 :
install -d gcoreaudiovec2dir
$(MAKE) DEST='gcoreaudiovec2dir/' ARCH='coreaudio-gtk-bench.cpp' VEC='-vec -dfs -vs $(VSIZE)' LIB='-lpthread -framework CoreAudio -framework AudioUnit -framework CoreServices `pkg-config --cflags --libs gtk+-2.0`' CXX=$(CXX) CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
gcoreaudiovec3 :
install -d gcoreaudiovec3dir
$(MAKE) DEST='gcoreaudiovec3dir/' ARCH='coreaudio-gtk-bench.cpp' VEC='-vec -g -vs $(VSIZE)' LIB='-lpthread -framework CoreAudio -framework AudioUnit -framework CoreServices `pkg-config --cflags --libs gtk+-2.0`' CXX=$(CXX) CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
gcoreaudiovec4 :
install -d gcoreaudiovec4dir
$(MAKE) DEST='gcoreaudiovec4dir/' ARCH='coreaudio-gtk-bench.cpp' VEC='-vec -dfs -g -vs $(VSIZE)' LIB='-lpthread -framework CoreAudio -framework AudioUnit -framework CoreServices `pkg-config --cflags --libs gtk+-2.0`' CXX=$(CXX) CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
gcoreaudiosch :
install -d gcoreaudioschdir
$(MAKE) DEST='gcoreaudioschdir/' ARCH='coreaudio-gtk-bench.cpp' VEC='-sch -vs $(VSIZE)' LIB='-lpthread -framework CoreAudio -framework AudioUnit -framework CoreServices `pkg-config --cflags --libs gtk+-2.0`' CXX=$(CXX) CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
gcoreaudiosch2 :
install -d gcoreaudiosch2dir
$(MAKE) DEST='gcoreaudiosch2dir/' ARCH='coreaudio-gtk-bench.cpp' VEC='-sch -g -vs $(VSIZE)' LIB='-lpthread -framework CoreAudio -framework AudioUnit -framework CoreServices `pkg-config --cflags --libs gtk+-2.0`' CXX=$(CXX) CXXFLAGS=$(MYGCCFLAGS) -f Makefile.compile
### intel-compiler double-precision x {scalar, vector and openMP}
idalsascal :
install -d idalsascaldir
$(MAKE) DEST='idalsascaldir/' ARCH='alsa-gtk-bench.cpp' VEC='-double' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
idalsavec :
install -d idalsavecdir
$(MAKE) DEST='idalsavecdir/' ARCH='alsa-gtk-bench.cpp' VEC='-double -vec -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
idalsaomp :
install -d idalsaompdir
$(MAKE) DEST='idalsaompdir/' ARCH='alsa-gtk-bench.cpp' VEC='-double -omp -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS='-openmp '$(MYICCFLAGS) -f Makefile.compile
### intel-compiler quad-precision x {scalar, vector and openMP}
iqalsascal :
install -d iqalsascaldir
$(MAKE) DEST='iqalsascaldir/' ARCH='alsa-gtk-bench.cpp' VEC='-quad' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
iqalsavec :
install -d iqalsavecdir
$(MAKE) DEST='iqalsavecdir/' ARCH='alsa-gtk-bench.cpp' VEC='-quad -vec -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS=$(MYICCFLAGS) -f Makefile.compile
iqalsaomp :
install -d iqalsaompdir
$(MAKE) DEST='iqalsaompdir/' ARCH='alsa-gtk-bench.cpp' VEC='-quad -omp -vs $(VSIZE)' LIB='-lpthread -lasound `pkg-config --cflags --libs gtk+-2.0`' CXX='icc' CXXFLAGS='-openmp '$(MYICCFLAGS) -f Makefile.compile
install:
([ -e scheduler.ll ]) && cp scheduler.ll $(prefix)/lib/faust || echo scheduler.ll not found
.PHONY: depend clean
depend :
makedepend *.cpp -w120 -Y -I $(PREFIX)/include
clean :
rm -rf *dir
([ -e gcoreaudiollvm ] && rm gcoreaudiollvm) || echo gcoreaudiollvm not found
([ -e bscalllvm ] && rm bscalllvm) || echo gcoreaudiollvm not found
([ -e scheduler.ll ] && rm scheduler.ll ) || echo scheduler.ll not found
# DO NOT DELETE
alsa-gtk-bench.o: /usr/local/include/faust/dsp/dsp.h
console-bench-llvm.o: /usr/local/include/faust/audio/coreaudio-dsp.h /usr/local/include/faust/audio/audio.h
console-bench-llvm.o: /usr/local/include/faust/dsp/dsp.h /usr/local/include/faust/dsp/dsp-bench.h
console-bench-llvm.o: /usr/local/include/faust/gui/MapUI.h /usr/local/include/faust/gui/UI.h
console-bench-llvm.o: /usr/local/include/faust/gui/PathBuilder.h /usr/local/include/faust/dsp/llvm-dsp.h
console-bench-llvm.o: /usr/local/include/faust/gui/meta.h /usr/local/include/faust/misc.h
console-bench.o: /usr/local/include/faust/audio/coreaudio-dsp.h /usr/local/include/faust/audio/audio.h
console-bench.o: /usr/local/include/faust/dsp/dsp.h /usr/local/include/faust/dsp/dsp-bench.h
console-bench.o: /usr/local/include/faust/gui/MapUI.h /usr/local/include/faust/gui/UI.h
console-bench.o: /usr/local/include/faust/gui/PathBuilder.h /usr/local/include/faust/dsp/llvm-dsp.h
console-bench.o: /usr/local/include/faust/gui/meta.h /usr/local/include/faust/misc.h
coreaudio-gtk-bench.o: /usr/local/include/faust/audio/coreaudio-dsp.h /usr/local/include/faust/audio/audio.h
coreaudio-gtk-bench.o: /usr/local/include/faust/dsp/dsp.h /usr/local/include/faust/dsp/dsp-bench.h
coreaudio-gtk-bench.o: /usr/local/include/faust/gui/MapUI.h /usr/local/include/faust/gui/UI.h
coreaudio-gtk-bench.o: /usr/local/include/faust/gui/PathBuilder.h /usr/local/include/faust/misc.h
coreaudio-gtk-bench.o: /usr/local/include/faust/gui/meta.h
coreaudio-gtk-llvm-bench.o: /usr/local/include/faust/audio/coreaudio-dsp.h /usr/local/include/faust/audio/audio.h
coreaudio-gtk-llvm-bench.o: /usr/local/include/faust/dsp/dsp.h /usr/local/include/faust/dsp/dsp-bench.h
coreaudio-gtk-llvm-bench.o: /usr/local/include/faust/gui/MapUI.h /usr/local/include/faust/gui/UI.h
coreaudio-gtk-llvm-bench.o: /usr/local/include/faust/gui/PathBuilder.h /usr/local/include/faust/dsp/llvm-dsp.h
coreaudio-gtk-llvm-bench.o: /usr/local/include/faust/gui/meta.h /usr/local/include/faust/misc.h
|