commit ca56afe397349b569b4bc8b01fdf6865597eacde
parent 7d405feec15870ba98b48b10d7de7709b8be7e92
Author: Fabian Wermelinger <fabianw@mavt.ethz.ch>
Date: Mon, 28 Nov 2016 15:44:50 +0100
updated make targets + added "third" target
Diffstat:
3 files changed, 207 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
@@ -0,0 +1,26 @@
+include ./Makefile.config
+
+CC = mpic++
+# CC = g++
+
+HDR = $(wildcard src/*.h)
+SRC = $(wildcard src/*.cpp)
+OBJ = ${SRC:.cpp=.o}
+
+.PHONY: clean third
+
+easyIso: $(OBJ)
+ $(CC) $(CPPFLAGS) $(INC) -o easyIso++ $(OBJ) $(LIB)
+
+third:
+ cd third_party; \
+ $(MAKE) CC=$(CC) -f Makefile cleanall; \
+ $(MAKE) CC=$(CC) -f Makefile all
+
+%.o: %.cpp
+ $(CC) $(CPPFLAGS) $(INC) -c $< -o $@
+
+clean:
+ find . -iname "*~" -exec rm -f {} \;
+ rm -f $(OBJ)
+ rm -f easyIso++
diff --git a/Makefile.config b/Makefile.config
@@ -0,0 +1,180 @@
+SHELL := /bin/bash
+
+CC ?= mpic++
+# CC ?= g++
+
+config ?= release
+bs ?= 16
+align ?= 16
+omp ?= 0
+hdf ?= 1
+cubismz ?= 0
+prec ?= float
+
+#compression stage-1 (floating point)
+wavz ?= 1
+fpc ?= 0
+fpzip ?= 0
+shuffle ?= 0
+zerobits ?= 0
+drain ?= 0
+
+#compression stage-2 (encoding)
+zlib ?= 1
+lz4 ?= 0
+lzf ?= 0
+lzma ?= 0
+zopfli ?=0
+#fpc2 ?= 0 # this works but I do not know what we compress (mix below)
+#fpzip2 ?= 0 # this does not seem to work when the stream is a mix of integers and floats
+#
+
+#fpc3 ?= 0 # for wavz + fpc
+#fpzip3 ?= 0 # for wavz + fpz
+shuffle3 ?= 0 # for wavz + shuffle3
+
+INC = -Iinclude
+INC += -Isrc
+LIB = -Llib
+
+CFLAGS =
+CPPFLAGS = -std=c++11
+
+ifeq "$(omp)" "1"
+ CFLAGS += -fopenmp
+ CPPFLAGS += -fopenmp -D_USE_OMP_
+endif
+
+ifeq "$(hdf)" "1"
+ifneq "$(findstring kilo,$(shell hostname))" ""
+ INC += -I${HOME}/local/hdf5-1.8.17/build/include
+ LIB += -L${HOME}/local/hdf5-1.8.17/build/lib -lhdf5
+else
+ INC += -I/usr/local/include
+ LIB += -lhdf5
+endif
+ CPPFLAGS += -D_USE_HDF_
+endif
+
+ifeq "$(cubismz)" "1"
+ INC += -Ithird_party/CubismZ/CubismApps/Compressor/source
+ LIB += -lCubismZ
+ CPPFLAGS += -D_USE_CUBISMZ_
+endif
+
+ifeq "$(prec)" "float"
+ CPPFLAGS += -D_FLOAT_PRECISION_ -D_SP_COMP_
+endif
+
+ifneq "$(config)" "release"
+ CFLAGS += -g -O0
+ CPPFLAGS += -g -O0
+else
+ CFLAGS += -O3 -DNDEBUG
+ CPPFLAGS += -O3 -DNDEBUG
+endif
+
+# Compression Options
+ifeq "$(wavz)" "1"
+ CPPFLAGS += -D_USE_WAVZ_
+endif
+
+ifeq "$(fpc)" "1"
+ CPPFLAGS += -D_USE_FPC_
+endif
+
+ifeq "$(fpzip)" "1"
+ CPPFLAGS += -D_USE_FPZIP_
+endif
+
+ifeq "$(drain)" "1"
+ CPPFLAGS += -D_USE_DRAIN_
+endif
+
+ifeq "$(shuffle)" "1"
+ CPPFLAGS += -D_USE_SHUFFLE_
+endif
+
+ifeq "$(zerobits)" "4"
+ CPPFLAGS += -D_USE_ZEROBITS_
+ CPPFLAGS += -D_ZEROBITS_=4
+endif
+ifeq "$(zerobits)" "8"
+ CPPFLAGS += -D_USE_ZEROBITS_
+ CPPFLAGS += -D_ZEROBITS_=8
+endif
+ifeq "$(zerobits)" "12"
+ CPPFLAGS += -D_USE_ZEROBITS_
+ CPPFLAGS += -D_ZEROBITS_=12
+endif
+ifeq "$(zerobits)" "16"
+ CPPFLAGS += -D_USE_ZEROBITS_
+ CPPFLAGS += -D_ZEROBITS_=16
+endif
+
+
+# Encoding Options
+ifeq "$(zlib)" "1"
+ CPPFLAGS += -D_USE_ZLIB_
+ifneq "$(findstring kilo,$(shell hostname))" ""
+ LIB += -lz
+endif
+endif
+
+ifeq "$(lz4)" "1"
+ CPPFLAGS += -D_USE_LZ4_
+endif
+
+ifeq "$(lzf)" "1"
+ CPPFLAGS += -D_USE_LZF_
+endif
+
+ifeq "$(lzma)" "1"
+ CPPFLAGS += -D_USE_LZMA_
+endif
+
+ifeq "$(zopfli)" "1"
+ CPPFLAGS += -D_USE_ZOPFLI_
+endif
+
+ifeq "$(fpc2)" "1"
+ CPPFLAGS += -D_USE_FPC2_
+endif
+
+ifeq "$(fpzip2)" "1"
+ CPPFLAGS += -D_USE_FPZIP2_
+endif
+
+# Extensions to the Wavelet-based Compression (wavz)
+
+#ifeq "$(fpc3)" "1"
+# CPPFLAGS += -D_USE_FPC3_ -I../../../tools/fpc
+# LIB += -L../../../tools/fpc -lfpc
+#endif
+#ifeq "$(fpzip3)" "1"
+# CPPFLAGS += -D_USE_FPZIP3_ -I../../../tools/fpzip/inc
+# LIB += -L../../../tools/fpzip/lib -lfpzip
+#endif
+ifeq "$(shuffle3)" "1"
+ CPPFLAGS += -D_USE_SHUFFLE3_
+endif
+
+# various machines
+ifneq "$(findstring mira,$(shell hostname))" ""
+ CPPFLAGS += -I${HOME}/usr/zlib/include
+ CFLAGS += -I${HOME}/usr/zlib/include
+ LIB += -L${HOME}/usr/zlib/lib
+ CPPFLAGS += -I/soft/libraries/hdf5/1.8.14/cnk-gcc/current/include
+ LIB += -L/soft/libraries/hdf5/1.8.14/cnk-gcc/current/lib
+endif
+
+ifneq "$(findstring cetus,$(shell hostname))" ""
+ CPPFLAGS += -I${HOME}/usr/zlib/include
+ CFLAGS += -I${HOME}/usr/zlib/include
+ LIB += -L${HOME}/usr/zlib/lib
+ CPPFLAGS += -I/soft/libraries/hdf5/1.8.14/cnk-gcc/current/include
+ LIB += -L/soft/libraries/hdf5/1.8.14/cnk-gcc/current/lib
+endif
+
+# CPPFLAGS += -Wall -Wextra -Wno-deprecated -D_ALIGNBYTES_=$(align) -D_BLOCKSIZE_=$(bs)
+CPPFLAGS += -D_ALIGNBYTES_=$(align) -D_BLOCKSIZE_=$(bs)
diff --git a/third_party/Makefile.cubismz b/third_party/Makefile.cubismz
@@ -18,6 +18,7 @@ CubismZ_SRC = CubismZ/CubismApps/Compressor/source/WaveletCompressor.cpp
OBJLib1 = ${CubismZ_SRC:.cpp=.o}
all: $(OBJLib1)
+ mkdir -p ../lib
ar rcs ../lib/libCubismZ.a $(OBJLib1)
ranlib ../lib/libCubismZ.a