Loading Makefile 0 → 100644 +75 −0 Original line number Diff line number Diff line ########################################################################### # Note: This Makefile is intended for development. For production # builds, use build_dynamic/Makefile. ########################################################################### # Does not currently support -DCPU_CHECK_... BASEFLAGS=-g -mavx2 -mbmi -mbmi2 -mlzcnt -DZSTD_MULTITHREAD # BASEFLAGS=-g -msse4.2 -DZSTD_MULTITHREAD # BASEFLAGS=-g -DZSTD_MULTITHREAD include Makefile.src # Respect the environment: # Use defaults below only if not set in env or make arguments CC ?= gcc CXX ?= g++ CFLAGS ?= -O3 CXXFLAGS ?= -O2 ZLIB ?= ../zlib-1.2.11/libz-64.a BLASFLAGS64 ?= -llapack -lf77blas -latlas ARCH32 ?= # Mandatory flags added to defaults or env settings CFLAGS += -std=gnu99 $(BASEFLAGS) $(CWARN) $(CINCLUDE) CXXFLAGS += -std=c++14 $(BASEFLAGS) $(CXXWARN) LDFLAGS += -lm -lpthread -L. $(ZLIB) -lzstd # Installation defaults MKDIR ?= mkdir INSTALL ?= install STRIP_CMD ?= strip PREFIX ?= /usr/local DESTDIR ?= . UNAME := $(shell uname) ifeq ($(UNAME), Darwin) BLASFLAGS=-framework Accelerate BLASFLAGS64=-framework Accelerate LDFLAGS=-ldl -lpthread -lz -lzstd endif %.o: %.c $(CC) -c $(CFLAGS) $(ARCH32) -o $@ $< %.o: %.cc $(CXX) -c $(CXXFLAGS) $(ARCH32) -o $@ $< all: plink2 pgen_compress # for clean build, "make clean" first # Run mkdir for both plink2 and pgen_compress as we don't know which # target will run first plink2: $(OBJ_NO_ZSTD) $(MKDIR) -p bin $(CXX) $(ARCH32) $(OBJ_NO_ZSTD) -o bin/plink2 $(BLASFLAGS64) $(LDFLAGS) # basic pgenlib_internal.h usage example; also needed for tests pgen_compress: plink2_base.o pgenlib_internal.o pgen_compress.o $(MKDIR) -p bin $(CXX) plink2_base.o pgenlib_internal.o pgen_compress.o \ -o bin/pgen_compress .PHONY: install-strip install clean install-strip: install $(STRIP_CMD) $(DESTDIR)$(PREFIX)/bin/* install: all $(MKDIR) -p $(DESTDIR)$(PREFIX)/bin $(INSTALL) -c bin/* $(DESTDIR)$(PREFIX)/bin clean: rm -f $(CLEAN) Makefile.src 0 → 100644 +30 −0 Original line number Diff line number Diff line CWARN = -Wall -Wextra -Wshadow -Wformat-security -Wdouble-promotion -Wfloat-conversion CXXWARN = ${CWARN} -Wold-style-cast # Necessary for older gcc versions. CWARN2 = -Wall -Wextra -Wshadow -Wformat-security CXXWARN2 = ${CWARN2} -Wold-style-cast CSRC = SFMT.c libdeflate/lib/adler32.c libdeflate/lib/aligned_malloc.c libdeflate/lib/crc32.c libdeflate/lib/deflate_compress.c libdeflate/lib/deflate_decompress.c libdeflate/lib/gzip_compress.c libdeflate/lib/gzip_decompress.c libdeflate/lib/zlib_compress.c libdeflate/lib/zlib_decompress.c libdeflate/lib/x86/cpu_features.c ZCSRC = zstd/lib/common/debug.c zstd/lib/common/entropy_common.c zstd/lib/common/zstd_common.c zstd/lib/common/error_private.c zstd/lib/common/xxhash.c zstd/lib/common/fse_decompress.c zstd/lib/common/pool.c zstd/lib/common/threading.c zstd/lib/compress/fse_compress.c zstd/lib/compress/hist.c zstd/lib/compress/huf_compress.c zstd/lib/compress/zstd_double_fast.c zstd/lib/compress/zstd_fast.c zstd/lib/compress/zstd_lazy.c zstd/lib/compress/zstd_ldm.c zstd/lib/compress/zstd_opt.c zstd/lib/compress/zstd_compress.c zstd/lib/compress/zstdmt_compress.c zstd/lib/decompress/huf_decompress.c zstd/lib/decompress/zstd_decompress.c zstd/lib/decompress/zstd_ddict.c zstd/lib/decompress/zstd_decompress_block.c CCSRC = plink2_base.cc pgenlib_internal.cc plink2.cc plink2_adjust.cc plink2_bgzf.cc plink2_cmdline.cc plink2_common.cc plink2_compress_stream.cc plink2_data.cc plink2_decompress.cc plink2_export.cc plink2_fasta.cc plink2_filter.cc plink2_glm.cc plink2_help.cc plink2_import.cc plink2_ld.cc plink2_matrix.cc plink2_matrix_calc.cc plink2_misc.cc plink2_psam.cc plink2_pvar.cc plink2_random.cc plink2_set.cc plink2_stats.cc plink2_string.cc plink2_text.cc plink2_thread.cc plink2_zstfile.cc OBJ_NO_ZSTD = $(CSRC:.c=.o) $(CCSRC:.cc=.o) OBJ = $(CSRC:.c=.o) $(ZCSRC:.c=.o) $(CCSRC:.cc=.o) CSRC2 = $(foreach fname,$(CSRC),../$(fname)) ZCSRC2 = $(foreach fname,$(ZCSRC),../$(fname)) CCSRC2 = $(foreach fname,$(CCSRC),../$(fname)) OBJ2 = $(notdir $(OBJ)) OBJ3 = $(CSRC2:.c=.o) $(ZCSRC2:.c=.o) $(CCSRC2:.cc=.o) CINCLUDE = -Ilibdeflate -Ilibdeflate/common CINCLUDE2 = -I../libdeflate -I../libdeflate/common ZSTD_INCLUDE = -Izstd/lib -Izstd/lib/common ZSTD_INCLUDE2 = -I../zstd/lib -I../zstd/lib/common CLEAN = *.o libdeflate/lib/*.o libdeflate/lib/x86/*.o zstd/lib/common/*.o zstd/lib/compress/*.o zstd/lib/decompress/*.o bin/plink2 bin/pgen_compress CLEAN3 = $(foreach expr,$(CLEAN),../$(expr)) Python/ReadMe.md +2 −2 Original line number Diff line number Diff line Loading @@ -2,5 +2,5 @@ This provides a basic Python API for pgenlib; see python_api.txt for details. Cython and NumPy must be installed. Build this with e.g. python setup.py build_ext [sudo] python setup.py install python3 setup.py build_ext [sudo] python3 setup.py install Python/pgenlib.pyx +297 −299 File changed.Preview size limit exceeded, changes collapsed. Show changes Python/setup.py +5 −5 Original line number Diff line number Diff line #!/usr/bin/python #!/usr/bin/env python3 from distutils.core import setup from distutils.extension import Extension from setuptools import setup from setuptools.extension import Extension from Cython.Build import cythonize import numpy as np ext_modules = [ Extension('pgenlib', sources = ['pgenlib.pyx', '../pgenlib_python_support.cpp', '../pgenlib_internal.cpp'], sources = ['pgenlib.pyx', '../pgenlib_ffi_support.cc', '../pgenlib_internal.cc', '../plink2_base.cc'], language = "c++", # do not compile as c++11, since cython doesn't yet support # overload of uint32_t operator # extra_compile_args = ["-std=c++11", "-Wno-unused-function"], # extra_link_args = ["-std=c++11"], extra_compile_args = ["-std=c++98", "-Wno-unused-function"], extra_compile_args = ["-std=c++98", "-Wno-unused-function", "-Wno-macro-redefined"], extra_link_args = ["-std=c++98"], include_dirs = [np.get_include()] ) Loading Loading
Makefile 0 → 100644 +75 −0 Original line number Diff line number Diff line ########################################################################### # Note: This Makefile is intended for development. For production # builds, use build_dynamic/Makefile. ########################################################################### # Does not currently support -DCPU_CHECK_... BASEFLAGS=-g -mavx2 -mbmi -mbmi2 -mlzcnt -DZSTD_MULTITHREAD # BASEFLAGS=-g -msse4.2 -DZSTD_MULTITHREAD # BASEFLAGS=-g -DZSTD_MULTITHREAD include Makefile.src # Respect the environment: # Use defaults below only if not set in env or make arguments CC ?= gcc CXX ?= g++ CFLAGS ?= -O3 CXXFLAGS ?= -O2 ZLIB ?= ../zlib-1.2.11/libz-64.a BLASFLAGS64 ?= -llapack -lf77blas -latlas ARCH32 ?= # Mandatory flags added to defaults or env settings CFLAGS += -std=gnu99 $(BASEFLAGS) $(CWARN) $(CINCLUDE) CXXFLAGS += -std=c++14 $(BASEFLAGS) $(CXXWARN) LDFLAGS += -lm -lpthread -L. $(ZLIB) -lzstd # Installation defaults MKDIR ?= mkdir INSTALL ?= install STRIP_CMD ?= strip PREFIX ?= /usr/local DESTDIR ?= . UNAME := $(shell uname) ifeq ($(UNAME), Darwin) BLASFLAGS=-framework Accelerate BLASFLAGS64=-framework Accelerate LDFLAGS=-ldl -lpthread -lz -lzstd endif %.o: %.c $(CC) -c $(CFLAGS) $(ARCH32) -o $@ $< %.o: %.cc $(CXX) -c $(CXXFLAGS) $(ARCH32) -o $@ $< all: plink2 pgen_compress # for clean build, "make clean" first # Run mkdir for both plink2 and pgen_compress as we don't know which # target will run first plink2: $(OBJ_NO_ZSTD) $(MKDIR) -p bin $(CXX) $(ARCH32) $(OBJ_NO_ZSTD) -o bin/plink2 $(BLASFLAGS64) $(LDFLAGS) # basic pgenlib_internal.h usage example; also needed for tests pgen_compress: plink2_base.o pgenlib_internal.o pgen_compress.o $(MKDIR) -p bin $(CXX) plink2_base.o pgenlib_internal.o pgen_compress.o \ -o bin/pgen_compress .PHONY: install-strip install clean install-strip: install $(STRIP_CMD) $(DESTDIR)$(PREFIX)/bin/* install: all $(MKDIR) -p $(DESTDIR)$(PREFIX)/bin $(INSTALL) -c bin/* $(DESTDIR)$(PREFIX)/bin clean: rm -f $(CLEAN)
Makefile.src 0 → 100644 +30 −0 Original line number Diff line number Diff line CWARN = -Wall -Wextra -Wshadow -Wformat-security -Wdouble-promotion -Wfloat-conversion CXXWARN = ${CWARN} -Wold-style-cast # Necessary for older gcc versions. CWARN2 = -Wall -Wextra -Wshadow -Wformat-security CXXWARN2 = ${CWARN2} -Wold-style-cast CSRC = SFMT.c libdeflate/lib/adler32.c libdeflate/lib/aligned_malloc.c libdeflate/lib/crc32.c libdeflate/lib/deflate_compress.c libdeflate/lib/deflate_decompress.c libdeflate/lib/gzip_compress.c libdeflate/lib/gzip_decompress.c libdeflate/lib/zlib_compress.c libdeflate/lib/zlib_decompress.c libdeflate/lib/x86/cpu_features.c ZCSRC = zstd/lib/common/debug.c zstd/lib/common/entropy_common.c zstd/lib/common/zstd_common.c zstd/lib/common/error_private.c zstd/lib/common/xxhash.c zstd/lib/common/fse_decompress.c zstd/lib/common/pool.c zstd/lib/common/threading.c zstd/lib/compress/fse_compress.c zstd/lib/compress/hist.c zstd/lib/compress/huf_compress.c zstd/lib/compress/zstd_double_fast.c zstd/lib/compress/zstd_fast.c zstd/lib/compress/zstd_lazy.c zstd/lib/compress/zstd_ldm.c zstd/lib/compress/zstd_opt.c zstd/lib/compress/zstd_compress.c zstd/lib/compress/zstdmt_compress.c zstd/lib/decompress/huf_decompress.c zstd/lib/decompress/zstd_decompress.c zstd/lib/decompress/zstd_ddict.c zstd/lib/decompress/zstd_decompress_block.c CCSRC = plink2_base.cc pgenlib_internal.cc plink2.cc plink2_adjust.cc plink2_bgzf.cc plink2_cmdline.cc plink2_common.cc plink2_compress_stream.cc plink2_data.cc plink2_decompress.cc plink2_export.cc plink2_fasta.cc plink2_filter.cc plink2_glm.cc plink2_help.cc plink2_import.cc plink2_ld.cc plink2_matrix.cc plink2_matrix_calc.cc plink2_misc.cc plink2_psam.cc plink2_pvar.cc plink2_random.cc plink2_set.cc plink2_stats.cc plink2_string.cc plink2_text.cc plink2_thread.cc plink2_zstfile.cc OBJ_NO_ZSTD = $(CSRC:.c=.o) $(CCSRC:.cc=.o) OBJ = $(CSRC:.c=.o) $(ZCSRC:.c=.o) $(CCSRC:.cc=.o) CSRC2 = $(foreach fname,$(CSRC),../$(fname)) ZCSRC2 = $(foreach fname,$(ZCSRC),../$(fname)) CCSRC2 = $(foreach fname,$(CCSRC),../$(fname)) OBJ2 = $(notdir $(OBJ)) OBJ3 = $(CSRC2:.c=.o) $(ZCSRC2:.c=.o) $(CCSRC2:.cc=.o) CINCLUDE = -Ilibdeflate -Ilibdeflate/common CINCLUDE2 = -I../libdeflate -I../libdeflate/common ZSTD_INCLUDE = -Izstd/lib -Izstd/lib/common ZSTD_INCLUDE2 = -I../zstd/lib -I../zstd/lib/common CLEAN = *.o libdeflate/lib/*.o libdeflate/lib/x86/*.o zstd/lib/common/*.o zstd/lib/compress/*.o zstd/lib/decompress/*.o bin/plink2 bin/pgen_compress CLEAN3 = $(foreach expr,$(CLEAN),../$(expr))
Python/ReadMe.md +2 −2 Original line number Diff line number Diff line Loading @@ -2,5 +2,5 @@ This provides a basic Python API for pgenlib; see python_api.txt for details. Cython and NumPy must be installed. Build this with e.g. python setup.py build_ext [sudo] python setup.py install python3 setup.py build_ext [sudo] python3 setup.py install
Python/pgenlib.pyx +297 −299 File changed.Preview size limit exceeded, changes collapsed. Show changes
Python/setup.py +5 −5 Original line number Diff line number Diff line #!/usr/bin/python #!/usr/bin/env python3 from distutils.core import setup from distutils.extension import Extension from setuptools import setup from setuptools.extension import Extension from Cython.Build import cythonize import numpy as np ext_modules = [ Extension('pgenlib', sources = ['pgenlib.pyx', '../pgenlib_python_support.cpp', '../pgenlib_internal.cpp'], sources = ['pgenlib.pyx', '../pgenlib_ffi_support.cc', '../pgenlib_internal.cc', '../plink2_base.cc'], language = "c++", # do not compile as c++11, since cython doesn't yet support # overload of uint32_t operator # extra_compile_args = ["-std=c++11", "-Wno-unused-function"], # extra_link_args = ["-std=c++11"], extra_compile_args = ["-std=c++98", "-Wno-unused-function"], extra_compile_args = ["-std=c++98", "-Wno-unused-function", "-Wno-macro-redefined"], extra_link_args = ["-std=c++98"], include_dirs = [np.get_include()] ) Loading