[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 | |
---|
| 49 | FEDIR = frontend |
---|
| 50 | FE_CFLAGS := -g -fPIC -O3 -fopenmp |
---|
| 51 | FE_CPPFLAGS := -Ithirdparty/blosc -Ithirdparty/sqlite -DGENERICIO_NO_MPI |
---|
| 52 | |
---|
| 53 | MPIDIR = mpi |
---|
[754e14c] | 54 | MPI_CFLAGS := -g -O3 -fopenmp |
---|
[00587dc] | 55 | MPI_CPPFLAGS := -Ithirdparty/blosc |
---|
| 56 | |
---|
| 57 | $(FEDIR): |
---|
| 58 | mkdir -p $(FEDIR) |
---|
| 59 | |
---|
| 60 | $(FEDIR)/%.o: thirdparty/blosc/%.c | $(FEDIR) |
---|
| 61 | $(CC) $(FE_CFLAGS) $(FE_CPPFLAGS) -c -o $@ $< |
---|
| 62 | |
---|
| 63 | $(FEDIR)/%.o: %.cxx | $(FEDIR) |
---|
| 64 | $(CXX) $(FE_CFLAGS) $(FE_CPPFLAGS) -c -o $@ $< |
---|
| 65 | |
---|
[981e22c] | 66 | FE_BLOSC_O := $(FEDIR)/blosc.o $(FEDIR)/blosclz.o $(FEDIR)/shuffle.o $(FEDIR)/bitshuffle-generic.o $(FEDIR)/shuffle-generic.o |
---|
| 67 | |
---|
| 68 | $(FEDIR)/GenericIOPrint: $(FEDIR)/GenericIOPrint.o $(FEDIR)/GenericIO.o $(FE_BLOSC_O) |
---|
[00587dc] | 69 | $(CXX) $(FE_CFLAGS) -o $@ $^ |
---|
| 70 | |
---|
[981e22c] | 71 | $(FEDIR)/GenericIOVerify: $(FEDIR)/GenericIOVerify.o $(FEDIR)/GenericIO.o $(FE_BLOSC_O) |
---|
[00587dc] | 72 | $(CXX) $(FE_CFLAGS) -o $@ $^ |
---|
| 73 | |
---|
| 74 | FE_UNAME := $(shell uname -s) |
---|
| 75 | ifeq ($(FE_UNAME),Darwin) |
---|
| 76 | FE_SHARED := -bundle |
---|
| 77 | else |
---|
| 78 | FE_SHARED := -shared |
---|
| 79 | endif |
---|
| 80 | $(FEDIR)/GenericIOSQLite.so: $(FEDIR)/GenericIOSQLite.o $(FEDIR)/GenericIO.o |
---|
| 81 | $(CXX) $(FE_CFLAGS) $(FE_SHARED) -o $@ $^ |
---|
| 82 | |
---|
| 83 | 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 |
---|
| 84 | |
---|
| 85 | $(FEDIR)/sqbuild: |
---|
| 86 | mkdir -p $(FEDIR)/sqbuild |
---|
| 87 | |
---|
| 88 | $(FEDIR)/sqbuild/%.o: thirdparty/sqlite/%.c | $(FEDIR)/sqbuild |
---|
| 89 | $(CC) $(FE_CFLAGS) $(FE_CPPFLAGS) $(SQLITE_CPPFLAGS) -c -o $@ $< |
---|
| 90 | |
---|
| 91 | $(FEDIR)/sqlite3: $(FEDIR)/sqbuild/sqlite3.o $(FEDIR)/sqbuild/shell.o |
---|
| 92 | $(CC) $(FE_CFLAGS) -o $@ $^ -pthread -lreadline -lrt -ldl |
---|
| 93 | |
---|
| 94 | $(MPIDIR): |
---|
| 95 | mkdir -p $(MPIDIR) |
---|
| 96 | |
---|
| 97 | $(MPIDIR)/%.o: thirdparty/blosc/%.c | $(MPIDIR) |
---|
| 98 | $(MPICC) $(MPI_CFLAGS) $(MPI_CPPFLAGS) -c -o $@ $< |
---|
| 99 | |
---|
| 100 | $(MPIDIR)/%.o: %.cxx | $(MPIDIR) |
---|
| 101 | $(MPICXX) $(MPI_CFLAGS) $(MPI_CPPFLAGS) -c -o $@ $< |
---|
| 102 | |
---|
[981e22c] | 103 | MPI_BLOSC_O := $(MPIDIR)/blosc.o $(MPIDIR)/blosclz.o $(MPIDIR)/shuffle.o $(MPIDIR)/bitshuffle-generic.o $(MPIDIR)/shuffle-generic.o |
---|
| 104 | |
---|
| 105 | $(MPIDIR)/GenericIOPrint: $(MPIDIR)/GenericIOPrint.o $(MPIDIR)/GenericIO.o $(MPI_BLOSC_O) |
---|
[00587dc] | 106 | $(MPICXX) $(MPI_CFLAGS) -o $@ $^ |
---|
| 107 | |
---|
[981e22c] | 108 | $(MPIDIR)/GenericIOVerify: $(MPIDIR)/GenericIOVerify.o $(MPIDIR)/GenericIO.o $(MPI_BLOSC_O) |
---|
[00587dc] | 109 | $(MPICXX) $(MPI_CFLAGS) -o $@ $^ |
---|
| 110 | |
---|
[981e22c] | 111 | $(MPIDIR)/GenericIOBenchmarkRead: $(MPIDIR)/GenericIOBenchmarkRead.o $(MPIDIR)/GenericIO.o $(MPI_BLOSC_O) |
---|
[406b50a] | 112 | $(MPICXX) $(MPI_CFLAGS) -o $@ $^ |
---|
| 113 | |
---|
[981e22c] | 114 | $(MPIDIR)/GenericIOBenchmarkWrite: $(MPIDIR)/GenericIOBenchmarkWrite.o $(MPIDIR)/GenericIO.o $(MPI_BLOSC_O) |
---|
[406b50a] | 115 | $(MPICXX) $(MPI_CFLAGS) -o $@ $^ |
---|
| 116 | |
---|
[00587dc] | 117 | frontend-progs: $(FEDIR)/GenericIOPrint $(FEDIR)/GenericIOVerify |
---|
| 118 | fe-progs: frontend-progs |
---|
| 119 | |
---|
[406b50a] | 120 | mpi-progs: $(MPIDIR)/GenericIOPrint $(MPIDIR)/GenericIOVerify $(MPIDIR)/GenericIOBenchmarkRead $(MPIDIR)/GenericIOBenchmarkWrite |
---|
[00587dc] | 121 | |
---|
| 122 | frontend-sqlite: $(FEDIR)/GenericIOSQLite.so $(FEDIR)/sqlite3 |
---|
| 123 | fe-sqlite: frontend-sqlite |
---|
| 124 | |
---|
| 125 | clean: |
---|
| 126 | rm -rf frontend mpi |
---|
| 127 | |
---|