[da65757] | 1 | # Copyright (C) 2015, UChicago Argonne, LLC |
---|
| 2 | # All Rights Reserved |
---|
| 3 | # |
---|
| 4 | # Generic IO (ANL-15-066) |
---|
| 5 | # Hal Finkel, Argonne National Laboratory |
---|
| 6 | # |
---|
| 7 | # OPEN SOURCE LICENSE |
---|
| 8 | # |
---|
| 9 | # Under the terms of Contract No. DE-AC02-06CH11357 with UChicago Argonne, |
---|
| 10 | # LLC, the U.S. Government retains certain rights in this software. |
---|
| 11 | # |
---|
| 12 | # Redistribution and use in source and binary forms, with or without |
---|
| 13 | # modification, are permitted provided that the following conditions are met: |
---|
| 14 | # |
---|
| 15 | # 1. Redistributions of source code must retain the above copyright notice, |
---|
| 16 | # this list of conditions and the following disclaimer. |
---|
| 17 | # |
---|
| 18 | # 2. Redistributions in binary form must reproduce the above copyright |
---|
| 19 | # notice, this list of conditions and the following disclaimer in the |
---|
| 20 | # documentation and/or other materials provided with the distribution. |
---|
| 21 | # |
---|
| 22 | # 3. Neither the names of UChicago Argonne, LLC or the Department of Energy |
---|
| 23 | # nor the names of its contributors may be used to endorse or promote |
---|
| 24 | # products derived from this software without specific prior written |
---|
| 25 | # permission. |
---|
| 26 | # |
---|
| 27 | # ***************************************************************************** |
---|
| 28 | # |
---|
| 29 | # DISCLAIMER |
---|
| 30 | # THE SOFTWARE IS SUPPLIED “AS IS” WITHOUT WARRANTY OF ANY KIND. NEITHER THE |
---|
| 31 | # UNTED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR |
---|
| 32 | # UCHICAGO ARGONNE, LLC, NOR ANY OF THEIR EMPLOYEES, MAKES ANY WARRANTY, |
---|
| 33 | # EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE |
---|
| 34 | # ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY INFORMATION, DATA, APPARATUS, |
---|
| 35 | # PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT INFRINGE |
---|
| 36 | # PRIVATELY OWNED RIGHTS. |
---|
| 37 | # |
---|
| 38 | # ***************************************************************************** |
---|
| 39 | |
---|
[00587dc] | 40 | CC = gcc |
---|
| 41 | CXX = g++ |
---|
| 42 | |
---|
| 43 | MPICC = mpicc |
---|
| 44 | MPICXX = mpicxx |
---|
| 45 | |
---|
| 46 | all: fe-progs mpi-progs |
---|
| 47 | sql: fe-sqlite |
---|
| 48 | |
---|
[8ebc79b] | 49 | BLOSC_CPPFLAGS := \ |
---|
| 50 | -Ithirdparty/blosc \ |
---|
| 51 | -DHAVE_LZ4 -DHAVE_SNAPPY -DHAVE_ZLIB -DHAVE_ZSTD \ |
---|
| 52 | -Ithirdparty/blosc/internal-complibs/zlib-1.2.8 \ |
---|
| 53 | -Ithirdparty/blosc/internal-complibs/lz4-1.7.2 \ |
---|
| 54 | -Ithirdparty/blosc/internal-complibs/snappy-1.1.1 \ |
---|
| 55 | -Ithirdparty/blosc/internal-complibs/zstd-0.7.4 \ |
---|
| 56 | -Ithirdparty/blosc/internal-complibs/zstd-0.7.4/legacy \ |
---|
| 57 | -Ithirdparty/blosc/internal-complibs/zstd-0.7.4/compress \ |
---|
| 58 | -Ithirdparty/blosc/internal-complibs/zstd-0.7.4/common \ |
---|
| 59 | -Ithirdparty/blosc/internal-complibs/zstd-0.7.4/dictBuilder \ |
---|
[6461f57] | 60 | -Ithirdparty/blosc/internal-complibs/zstd-0.7.4/decompress \ |
---|
| 61 | -Ithirdparty/SZ/sz/include |
---|
[8ebc79b] | 62 | |
---|
[bd84570] | 63 | BASE_CPPFLAGS := $(BLOSC_CPPFLAGS) -I. -D__STDC_CONSTANT_MACROS |
---|
[8ebc79b] | 64 | |
---|
[5e1952a] | 65 | UNAME_S := $(shell uname -s) |
---|
| 66 | ifeq ($(UNAME_S),Linux) |
---|
| 67 | OPENMPFLAG=-fopenmp |
---|
| 68 | endif |
---|
| 69 | |
---|
[00587dc] | 70 | FEDIR = frontend |
---|
[e7b1f5b] | 71 | FE_CFLAGS := -g -fPIC -O3 $(OPENMPFLAG) -std=gnu99 |
---|
[8ebc79b] | 72 | FE_CPPFLAGS := $(BASE_CPPFLAGS) -Ithirdparty/sqlite -DGENERICIO_NO_MPI |
---|
[00587dc] | 73 | |
---|
| 74 | MPIDIR = mpi |
---|
[e7b1f5b] | 75 | MPI_CFLAGS := -g -O3 $(OPENMPFLAG) -std=gnu99 |
---|
[8ebc79b] | 76 | MPI_CPPFLAGS := $(BASE_CPPFLAGS) |
---|
[00587dc] | 77 | |
---|
| 78 | $(FEDIR): |
---|
| 79 | mkdir -p $(FEDIR) |
---|
| 80 | |
---|
[8ebc79b] | 81 | $(FEDIR)/%.o: %.c | $(FEDIR) |
---|
| 82 | mkdir -p $(dir $@) |
---|
[00587dc] | 83 | $(CC) $(FE_CFLAGS) $(FE_CPPFLAGS) -c -o $@ $< |
---|
| 84 | |
---|
| 85 | $(FEDIR)/%.o: %.cxx | $(FEDIR) |
---|
[8ebc79b] | 86 | mkdir -p $(dir $@) |
---|
[00587dc] | 87 | $(CXX) $(FE_CFLAGS) $(FE_CPPFLAGS) -c -o $@ $< |
---|
| 88 | |
---|
[8ebc79b] | 89 | BLOSC_O := \ |
---|
| 90 | thirdparty/blosc/blosc.o \ |
---|
| 91 | thirdparty/blosc/blosclz.o \ |
---|
| 92 | thirdparty/blosc/shuffle.o \ |
---|
| 93 | thirdparty/blosc/bitshuffle-generic.o \ |
---|
| 94 | thirdparty/blosc/shuffle-generic.o \ |
---|
| 95 | thirdparty/blosc/internal-complibs/zlib-1.2.8/gzwrite.o \ |
---|
| 96 | thirdparty/blosc/internal-complibs/zlib-1.2.8/crc32.o \ |
---|
| 97 | thirdparty/blosc/internal-complibs/zlib-1.2.8/inffast.o \ |
---|
| 98 | thirdparty/blosc/internal-complibs/zlib-1.2.8/zutil.o \ |
---|
| 99 | thirdparty/blosc/internal-complibs/zlib-1.2.8/infback.o \ |
---|
| 100 | thirdparty/blosc/internal-complibs/zlib-1.2.8/deflate.o \ |
---|
| 101 | thirdparty/blosc/internal-complibs/zlib-1.2.8/inflate.o \ |
---|
| 102 | thirdparty/blosc/internal-complibs/zlib-1.2.8/gzread.o \ |
---|
| 103 | thirdparty/blosc/internal-complibs/zlib-1.2.8/gzlib.o \ |
---|
| 104 | thirdparty/blosc/internal-complibs/zlib-1.2.8/gzclose.o \ |
---|
| 105 | thirdparty/blosc/internal-complibs/zlib-1.2.8/uncompr.o \ |
---|
| 106 | thirdparty/blosc/internal-complibs/zlib-1.2.8/compress.o \ |
---|
| 107 | thirdparty/blosc/internal-complibs/zlib-1.2.8/inftrees.o \ |
---|
| 108 | thirdparty/blosc/internal-complibs/zlib-1.2.8/trees.o \ |
---|
| 109 | thirdparty/blosc/internal-complibs/zlib-1.2.8/adler32.o \ |
---|
| 110 | thirdparty/blosc/internal-complibs/lz4-1.7.2/lz4.o \ |
---|
| 111 | thirdparty/blosc/internal-complibs/lz4-1.7.2/lz4hc.o \ |
---|
| 112 | thirdparty/blosc/internal-complibs/zstd-0.7.4/legacy/zstd_v01.o \ |
---|
| 113 | thirdparty/blosc/internal-complibs/zstd-0.7.4/legacy/zstd_v02.o \ |
---|
| 114 | thirdparty/blosc/internal-complibs/zstd-0.7.4/legacy/zstd_v03.o \ |
---|
| 115 | thirdparty/blosc/internal-complibs/zstd-0.7.4/legacy/zstd_v06.o \ |
---|
| 116 | thirdparty/blosc/internal-complibs/zstd-0.7.4/legacy/zstd_v04.o \ |
---|
| 117 | thirdparty/blosc/internal-complibs/zstd-0.7.4/legacy/zstd_v05.o \ |
---|
| 118 | thirdparty/blosc/internal-complibs/zstd-0.7.4/compress/fse_compress.o \ |
---|
| 119 | thirdparty/blosc/internal-complibs/zstd-0.7.4/compress/zstd_compress.o \ |
---|
| 120 | thirdparty/blosc/internal-complibs/zstd-0.7.4/compress/huf_compress.o \ |
---|
| 121 | thirdparty/blosc/internal-complibs/zstd-0.7.4/compress/zbuff_compress.o \ |
---|
| 122 | thirdparty/blosc/internal-complibs/zstd-0.7.4/common/entropy_common.o \ |
---|
| 123 | thirdparty/blosc/internal-complibs/zstd-0.7.4/common/xxhash.o \ |
---|
| 124 | thirdparty/blosc/internal-complibs/zstd-0.7.4/common/zstd_common.o \ |
---|
| 125 | thirdparty/blosc/internal-complibs/zstd-0.7.4/common/fse_decompress.o \ |
---|
| 126 | thirdparty/blosc/internal-complibs/zstd-0.7.4/dictBuilder/zdict.o \ |
---|
| 127 | thirdparty/blosc/internal-complibs/zstd-0.7.4/dictBuilder/divsufsort.o \ |
---|
| 128 | thirdparty/blosc/internal-complibs/zstd-0.7.4/decompress/zstd_decompress.o \ |
---|
| 129 | thirdparty/blosc/internal-complibs/zstd-0.7.4/decompress/huf_decompress.o \ |
---|
| 130 | thirdparty/blosc/internal-complibs/zstd-0.7.4/decompress/zbuff_decompress.o \ |
---|
| 131 | thirdparty/blosc/internal-complibs/snappy-1.1.1/snappy-c.o \ |
---|
| 132 | thirdparty/blosc/internal-complibs/snappy-1.1.1/snappy.o \ |
---|
| 133 | thirdparty/blosc/internal-complibs/snappy-1.1.1/snappy-sinksource.o \ |
---|
[6461f57] | 134 | thirdparty/blosc/internal-complibs/snappy-1.1.1/snappy-stubs-internal.o \ |
---|
| 135 | thirdparty/SZ/sz/src/ByteToolkit.o \ |
---|
| 136 | thirdparty/SZ/sz/src/dataCompression.o \ |
---|
| 137 | thirdparty/SZ/sz/src/DynamicIntArray.o \ |
---|
| 138 | thirdparty/SZ/sz/src/iniparser.o \ |
---|
| 139 | thirdparty/SZ/sz/src/CompressElement.o \ |
---|
| 140 | thirdparty/SZ/sz/src/DynamicByteArray.o \ |
---|
| 141 | thirdparty/SZ/sz/src/rw.o \ |
---|
| 142 | thirdparty/SZ/sz/src/TightDataPointStorageI.o \ |
---|
| 143 | thirdparty/SZ/sz/src/TightDataPointStorageD.o \ |
---|
| 144 | thirdparty/SZ/sz/src/TightDataPointStorageF.o \ |
---|
| 145 | thirdparty/SZ/sz/src/conf.o \ |
---|
| 146 | thirdparty/SZ/sz/src/DynamicDoubleArray.o \ |
---|
| 147 | thirdparty/SZ/sz/src/TypeManager.o \ |
---|
| 148 | thirdparty/SZ/sz/src/dictionary.o \ |
---|
| 149 | thirdparty/SZ/sz/src/DynamicFloatArray.o \ |
---|
| 150 | thirdparty/SZ/sz/src/VarSet.o \ |
---|
| 151 | thirdparty/SZ/sz/src/callZlib.o \ |
---|
| 152 | thirdparty/SZ/sz/src/Huffman.o \ |
---|
| 153 | thirdparty/SZ/sz/src/sz_float.o \ |
---|
| 154 | thirdparty/SZ/sz/src/sz_double.o \ |
---|
| 155 | thirdparty/SZ/sz/src/sz_int8.o \ |
---|
| 156 | thirdparty/SZ/sz/src/sz_int16.o \ |
---|
| 157 | thirdparty/SZ/sz/src/sz_int32.o \ |
---|
| 158 | thirdparty/SZ/sz/src/sz_int64.o \ |
---|
| 159 | thirdparty/SZ/sz/src/sz_uint8.o \ |
---|
| 160 | thirdparty/SZ/sz/src/sz_uint16.o \ |
---|
| 161 | thirdparty/SZ/sz/src/sz_uint32.o \ |
---|
| 162 | thirdparty/SZ/sz/src/sz_uint64.o \ |
---|
| 163 | thirdparty/SZ/sz/src/szd_uint8.o \ |
---|
| 164 | thirdparty/SZ/sz/src/szd_uint16.o \ |
---|
| 165 | thirdparty/SZ/sz/src/szd_uint32.o \ |
---|
| 166 | thirdparty/SZ/sz/src/szd_uint64.o \ |
---|
| 167 | thirdparty/SZ/sz/src/szd_float.o \ |
---|
| 168 | thirdparty/SZ/sz/src/szd_double.o \ |
---|
| 169 | thirdparty/SZ/sz/src/szd_int8.o \ |
---|
| 170 | thirdparty/SZ/sz/src/szd_int16.o \ |
---|
| 171 | thirdparty/SZ/sz/src/szd_int32.o \ |
---|
| 172 | thirdparty/SZ/sz/src/szd_int64.o \ |
---|
[03ba282] | 173 | thirdparty/SZ/sz/src/utility.o \ |
---|
[6461f57] | 174 | thirdparty/SZ/sz/src/sz.o \ |
---|
| 175 | thirdparty/SZ/sz/src/sz_float_pwr.o \ |
---|
| 176 | thirdparty/SZ/sz/src/sz_double_pwr.o \ |
---|
| 177 | thirdparty/SZ/sz/src/szd_float_pwr.o \ |
---|
[2c47b73] | 178 | thirdparty/SZ/sz/src/szd_double_pwr.o \ |
---|
| 179 | thirdparty/SZ/sz/src/sz_double_ts.o \ |
---|
| 180 | thirdparty/SZ/sz/src/sz_float_ts.o \ |
---|
| 181 | thirdparty/SZ/sz/src/szd_double_ts.o \ |
---|
| 182 | thirdparty/SZ/sz/src/szd_float_ts.o |
---|
[8ebc79b] | 183 | |
---|
| 184 | FE_BLOSC_O := $(addprefix $(FEDIR)/,$(BLOSC_O)) |
---|
[981e22c] | 185 | |
---|
| 186 | $(FEDIR)/GenericIOPrint: $(FEDIR)/GenericIOPrint.o $(FEDIR)/GenericIO.o $(FE_BLOSC_O) |
---|
[00587dc] | 187 | $(CXX) $(FE_CFLAGS) -o $@ $^ |
---|
| 188 | |
---|
[981e22c] | 189 | $(FEDIR)/GenericIOVerify: $(FEDIR)/GenericIOVerify.o $(FEDIR)/GenericIO.o $(FE_BLOSC_O) |
---|
[00587dc] | 190 | $(CXX) $(FE_CFLAGS) -o $@ $^ |
---|
| 191 | |
---|
| 192 | FE_UNAME := $(shell uname -s) |
---|
| 193 | ifeq ($(FE_UNAME),Darwin) |
---|
| 194 | FE_SHARED := -bundle |
---|
| 195 | else |
---|
| 196 | FE_SHARED := -shared |
---|
| 197 | endif |
---|
[bd84570] | 198 | |
---|
| 199 | $(FEDIR)/libpygio.so: $(FEDIR)/GenericIO.o $(FEDIR)/python/lib/gio.o $(FE_BLOSC_O) |
---|
| 200 | $(CXX) $(FE_CFLAGS) $(FE_SHARED) -o $@ $^ |
---|
| 201 | |
---|
| 202 | $(FEDIR)/GenericIOSQLite.so: $(FEDIR)/GenericIOSQLite.o $(FEDIR)/GenericIO.o $(FE_BLOSC_O) |
---|
[00587dc] | 203 | $(CXX) $(FE_CFLAGS) $(FE_SHARED) -o $@ $^ |
---|
| 204 | |
---|
| 205 | SQLITE_CPPFLAGS := -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_ENABLE_FTS3=3 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_ENABLE_LOAD_EXTENSION=1 -DHAVE_READLINE=1 |
---|
| 206 | |
---|
| 207 | $(FEDIR)/sqbuild: |
---|
| 208 | mkdir -p $(FEDIR)/sqbuild |
---|
| 209 | |
---|
| 210 | $(FEDIR)/sqbuild/%.o: thirdparty/sqlite/%.c | $(FEDIR)/sqbuild |
---|
| 211 | $(CC) $(FE_CFLAGS) $(FE_CPPFLAGS) $(SQLITE_CPPFLAGS) -c -o $@ $< |
---|
| 212 | |
---|
| 213 | $(FEDIR)/sqlite3: $(FEDIR)/sqbuild/sqlite3.o $(FEDIR)/sqbuild/shell.o |
---|
| 214 | $(CC) $(FE_CFLAGS) -o $@ $^ -pthread -lreadline -lrt -ldl |
---|
| 215 | |
---|
| 216 | $(MPIDIR): |
---|
| 217 | mkdir -p $(MPIDIR) |
---|
| 218 | |
---|
[8ebc79b] | 219 | $(MPIDIR)/%.o: %.c | $(MPIDIR) |
---|
| 220 | mkdir -p $(dir $@) |
---|
[00587dc] | 221 | $(MPICC) $(MPI_CFLAGS) $(MPI_CPPFLAGS) -c -o $@ $< |
---|
| 222 | |
---|
| 223 | $(MPIDIR)/%.o: %.cxx | $(MPIDIR) |
---|
[8ebc79b] | 224 | mkdir -p $(dir $@) |
---|
[00587dc] | 225 | $(MPICXX) $(MPI_CFLAGS) $(MPI_CPPFLAGS) -c -o $@ $< |
---|
| 226 | |
---|
[8ebc79b] | 227 | MPI_BLOSC_O := $(addprefix $(MPIDIR)/,$(BLOSC_O)) |
---|
[981e22c] | 228 | |
---|
| 229 | $(MPIDIR)/GenericIOPrint: $(MPIDIR)/GenericIOPrint.o $(MPIDIR)/GenericIO.o $(MPI_BLOSC_O) |
---|
[00587dc] | 230 | $(MPICXX) $(MPI_CFLAGS) -o $@ $^ |
---|
| 231 | |
---|
[981e22c] | 232 | $(MPIDIR)/GenericIOVerify: $(MPIDIR)/GenericIOVerify.o $(MPIDIR)/GenericIO.o $(MPI_BLOSC_O) |
---|
[00587dc] | 233 | $(MPICXX) $(MPI_CFLAGS) -o $@ $^ |
---|
| 234 | |
---|
[981e22c] | 235 | $(MPIDIR)/GenericIOBenchmarkRead: $(MPIDIR)/GenericIOBenchmarkRead.o $(MPIDIR)/GenericIO.o $(MPI_BLOSC_O) |
---|
[406b50a] | 236 | $(MPICXX) $(MPI_CFLAGS) -o $@ $^ |
---|
| 237 | |
---|
[981e22c] | 238 | $(MPIDIR)/GenericIOBenchmarkWrite: $(MPIDIR)/GenericIOBenchmarkWrite.o $(MPIDIR)/GenericIO.o $(MPI_BLOSC_O) |
---|
[406b50a] | 239 | $(MPICXX) $(MPI_CFLAGS) -o $@ $^ |
---|
| 240 | |
---|
[fc4fc2f] | 241 | $(MPIDIR)/GenericIORewrite: $(MPIDIR)/GenericIORewrite.o $(MPIDIR)/GenericIO.o $(MPI_BLOSC_O) |
---|
| 242 | $(MPICXX) $(MPI_CFLAGS) -o $@ $^ |
---|
| 243 | |
---|
[ef727a6] | 244 | frontend-progs: $(FEDIR)/GenericIOPrint $(FEDIR)/GenericIOVerify $(FEDIR)/libpygio.so |
---|
[00587dc] | 245 | fe-progs: frontend-progs |
---|
| 246 | |
---|
[fc4fc2f] | 247 | mpi-progs: $(MPIDIR)/GenericIOPrint $(MPIDIR)/GenericIOVerify $(MPIDIR)/GenericIOBenchmarkRead $(MPIDIR)/GenericIOBenchmarkWrite $(MPIDIR)/GenericIORewrite |
---|
[00587dc] | 248 | |
---|
| 249 | frontend-sqlite: $(FEDIR)/GenericIOSQLite.so $(FEDIR)/sqlite3 |
---|
| 250 | fe-sqlite: frontend-sqlite |
---|
| 251 | |
---|
| 252 | clean: |
---|
[fb69232] | 253 | rm -rf frontend mpi python/genericio.pyc |
---|
[00587dc] | 254 | |
---|