Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 31 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ CBF_PREFIX ?= $(HOME)
#
CLEANTESTS = yes

CBFLIB_DONT_BUILD_HDF5?=no


MSYS2=no
CBFLIB_DONT_USE_LOCAL_HDF5?=no
Expand All @@ -301,6 +303,13 @@ NUWEB_DEP2=$(BIN)/nuweb
endif


ifeq ($(CBFLIB_DONT_BUILD_HDF5),yes)
CBFLIB_DONT_USE_LOCAL_HDF5=yes
CBFLIB_DONT_USE_LZ4=yes
CBFLIB_DONT_USE_BSHUF=yes
CBFLIB_DONT_USE_BLOSC=yes
endif


CBFLIB_DONT_HAVE_FGETLN ?= yes
ifeq ($(CBFLIB_DONT_HAVE_FGETLN),yes)
Expand Down Expand Up @@ -403,6 +412,12 @@ else
H5DUMP = /MINGW32/bin/h5dump
endif

ifeq ($(CBFLIB_DONT_BUILD_HDF5),yes)
HDF5LIBS_LOCAL =
HDF5LIBS_SYSTEM =
HDF5SOLIBS_LOCAL =
HDF5SOLIBS_SYSTEM =
endif

CBFLIB_DONT_USE_LZ4 ?= no
ifneq ($(CBFLIB_DONT_USE_LZ4),yes)
Expand Down Expand Up @@ -623,8 +638,10 @@ BSHUFFLAG =
endif



MISCFLAG = $(NOLLFLAG) $(ULPFLAG)
ifneq ($(CBFLIB_DONT_BUILD_HDF5),yes)
MISCFLAG += -DUSE_HDF5
endif

#
# PY2CBF definitions
Expand Down Expand Up @@ -679,7 +696,7 @@ EXTRALIBS = -lm
M4FLAGS = -Dfcb_bytes_in_rec=131072
TIME = time

ifneq ($(NOFORTRAN),)
ifeq ($(NOFORTRAN),yes)
F90C =
endif

Expand Down Expand Up @@ -786,8 +803,6 @@ SOURCE = $(SRC)/cbf.c \
$(SRC)/cbf_copy.c \
$(SRC)/cbf_file.c \
$(SRC)/cbf_getopt.c \
$(SRC)/cbf_hdf5.c \
$(SRC)/cbf_hdf5_filter.c \
$(SRC)/cbf_lex.c \
$(SRC)/cbf_minicbf_header.c\
$(SRC)/cbf_nibble_offset.c \
Expand All @@ -808,6 +823,10 @@ SOURCE = $(SRC)/cbf.c \
$(SRC)/md5c.c \
$(SRC)/img.c \
$(SRC_FGETLN) $(SRC_REALPATH)
ifneq ($(CBFLIB_DONT_BUILD_HDF5),yes)
SOURCE += $(SRC)/cbf_hdf5.c \
$(SRC)/cbf_hdf5_filter.c
endif

ifneq ($(CBFLIB_DONT_USE_PY2CIFRW),yes)
PY2SOURCE = $(SRC)/drel_lex.py \
Expand All @@ -823,6 +842,7 @@ PY3SOURCE = $(SRC)/drel_lex.py \
$(SRC)/drel_prep.py
endif

ifneq ($(NOFORTRAN),yes)
F90SOURCE = $(SRC)/fcb_atol_wcnt.f90 \
$(SRC)/fcb_ci_strncmparr.f90 \
$(SRC)/fcb_exit_binary.f90 \
Expand All @@ -836,8 +856,8 @@ F90SOURCE = $(SRC)/fcb_atol_wcnt.f90 \
$(SRC)/fcb_read_line.f90 \
$(SRC)/fcb_read_xds_i2.f90 \
$(SRC)/fcb_skip_whitespace.f90
endif

#
# Header files
#
Expand All @@ -854,8 +874,6 @@ HEADERS = $(INCLUDE)/cbf.h \
$(INCLUDE)/cbf_copy.h \
$(INCLUDE)/cbf_file.h \
$(INCLUDE)/cbf_getopt.h \
$(INCLUDE)/cbf_hdf5.h \
$(INCLUDE)/cbf_hdf5_filter.h \
$(INCLUDE)/cbf_lex.h \
$(INCLUDE)/cbf_minicbf_header.h\
$(INCLUDE)/cbf_nibble_offset.h \
Expand All @@ -876,6 +894,10 @@ HEADERS = $(INCLUDE)/cbf.h \
$(INCLUDE)/cbff.h \
$(INCLUDE)/md5.h \
$(INCLUDE)/img.h
ifneq ($(CBFLIB_DONT_BUILD_HDF5),yes)
HEADERS += $(INCLUDE)/cbf_hdf5.h \
$(INCLUDE)/cbf_hdf5_filter.h
endif

#
# m4 macro files
Expand Down Expand Up @@ -2068,7 +2090,7 @@ $(BIN)/tiff2cbf: $(LIB)/libcbf.a $(EXAMPLES)/tiff2cbf.c $(EXAMPLES)/tif_sprint.c
$(GOPTLIB) $(GOPTINC) $(TIFF)
mkdir -p $(BIN)
$(CC) $(CFLAGS) $(LDFLAGS) $(MISCFLAG) $(CBF_REGEXFLAG) $(INCLUDES) $(WARNINGS) \
-I$(TIFF)/libtiff $(EXAMPLES)/tiff2cbf.c $(GOPTLIB) -L$(LIB) \
-I$(TIFF)/libtiff $(EXAMPLES)/tiff2cbf.c $(EXAMPLES)/tif_sprint.c $(GOPTLIB) -L$(LIB) \
-lcbf -L$(TIFF_PREFIX)/lib -ltiff $(REGEX_LIBS_STATIC) $(HDF5LIBS_LOCAL) $(EXTRALIBS) $(HDF5LIBS_SYSTEM) -limg -o $@

#
Expand Down
69 changes: 49 additions & 20 deletions Makefile_DIALS
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ CBF_PREFIX ?= $(HOME)
#
CLEANTESTS = yes

CBFLIB_DONT_BUILD_HDF5?=no


MSYS2=no
CBFLIB_DONT_USE_LOCAL_HDF5?=no
Expand All @@ -301,6 +303,13 @@ NUWEB_DEP2=$(BIN)/nuweb
endif


ifeq ($(CBFLIB_DONT_BUILD_HDF5),yes)
CBFLIB_DONT_USE_LOCAL_HDF5=yes
CBFLIB_DONT_USE_LZ4=yes
CBFLIB_DONT_USE_BSHUF=yes
CBFLIB_DONT_USE_BLOSC=yes
endif


CBFLIB_DONT_HAVE_FGETLN ?= yes
ifeq ($(CBFLIB_DONT_HAVE_FGETLN),yes)
Expand Down Expand Up @@ -403,6 +412,12 @@ else
H5DUMP = /MINGW32/bin/h5dump
endif

ifeq ($(CBFLIB_DONT_BUILD_HDF5),yes)
HDF5LIBS_LOCAL =
HDF5LIBS_SYSTEM =
HDF5SOLIBS_LOCAL =
HDF5SOLIBS_SYSTEM =
endif

CBFLIB_DONT_USE_LZ4 ?= no
ifneq ($(CBFLIB_DONT_USE_LZ4),yes)
Expand Down Expand Up @@ -570,21 +585,27 @@ PYSWIG = swig -python
JSWIG = swig -java

#
# Compiler for Java
# Java SDK root directory
#
JAVAC = javac
ifeq ($(JDKDIR),)
JDKDIR = /etc/alternatives/java_sdk
endif

#
# Java archiver for compiled classes
# Launcher for Java
#
JAR = jar
JAVA = $(JDKDIR)/bin/java

#
# Java SDK root directory
# Compiler for Java
#
ifeq ($(JDKDIR),)
JDKDIR = /usr/lib/java
endif
JAVAC = $(JDKDIR)/bin/javac

#
# Java archiver for compiled classes
#
JAR = $(JDKDIR)/bin/jar


ifneq ($(CBF_DONT_USE_LONG_LONG),)
NOLLFLAG = -DCBF_DONT_USE_LONG_LONG
Expand Down Expand Up @@ -617,8 +638,10 @@ BSHUFFLAG =
endif



MISCFLAG = $(NOLLFLAG) $(ULPFLAG)
ifneq ($(CBFLIB_DONT_BUILD_HDF5),yes)
MISCFLAG += -DUSE_HDF5
endif

#
# PY2CBF definitions
Expand Down Expand Up @@ -674,7 +697,7 @@ EXTRALIBS = -lm
M4FLAGS = -Dfcb_bytes_in_rec=131072
TIME = time

ifneq ($(NOFORTRAN),)
ifeq ($(NOFORTRAN),yes)
F90C =
endif

Expand Down Expand Up @@ -781,8 +804,6 @@ SOURCE = $(SRC)/cbf.c \
$(SRC)/cbf_copy.c \
$(SRC)/cbf_file.c \
$(SRC)/cbf_getopt.c \
$(SRC)/cbf_hdf5.c \
$(SRC)/cbf_hdf5_filter.c \
$(SRC)/cbf_lex.c \
$(SRC)/cbf_minicbf_header.c\
$(SRC)/cbf_nibble_offset.c \
Expand All @@ -803,6 +824,10 @@ SOURCE = $(SRC)/cbf.c \
$(SRC)/md5c.c \
$(SRC)/img.c \
$(SRC_FGETLN) $(SRC_REALPATH)
ifneq ($(CBFLIB_DONT_BUILD_HDF5),yes)
SOURCE += $(SRC)/cbf_hdf5.c \
$(SRC)/cbf_hdf5_filter.c
endif

ifneq ($(CBFLIB_DONT_USE_PY2CIFRW),yes)
PY2SOURCE = $(SRC)/drel_lex.py \
Expand All @@ -818,6 +843,7 @@ PY3SOURCE = $(SRC)/drel_lex.py \
$(SRC)/drel_prep.py
endif

ifneq ($(NOFORTRAN),yes)
F90SOURCE = $(SRC)/fcb_atol_wcnt.f90 \
$(SRC)/fcb_ci_strncmparr.f90 \
$(SRC)/fcb_exit_binary.f90 \
Expand All @@ -831,8 +857,8 @@ F90SOURCE = $(SRC)/fcb_atol_wcnt.f90 \
$(SRC)/fcb_read_line.f90 \
$(SRC)/fcb_read_xds_i2.f90 \
$(SRC)/fcb_skip_whitespace.f90
endif

#
# Header files
#
Expand All @@ -849,8 +875,6 @@ HEADERS = $(INCLUDE)/cbf.h \
$(INCLUDE)/cbf_copy.h \
$(INCLUDE)/cbf_file.h \
$(INCLUDE)/cbf_getopt.h \
$(INCLUDE)/cbf_hdf5.h \
$(INCLUDE)/cbf_hdf5_filter.h \
$(INCLUDE)/cbf_lex.h \
$(INCLUDE)/cbf_minicbf_header.h\
$(INCLUDE)/cbf_nibble_offset.h \
Expand All @@ -871,6 +895,10 @@ HEADERS = $(INCLUDE)/cbf.h \
$(INCLUDE)/cbff.h \
$(INCLUDE)/md5.h \
$(INCLUDE)/img.h
ifneq ($(CBFLIB_DONT_BUILD_HDF5),yes)
HEADERS += $(INCLUDE)/cbf_hdf5.h \
$(INCLUDE)/cbf_hdf5_filter.h
endif

#
# m4 macro files
Expand Down Expand Up @@ -1723,7 +1751,7 @@ $(PY2CBF)/pycbf_testfelaxes.py \
$(PY2CBF)/xmas/readmarheader.py \
$(PY2CBF)/xmas/xmasheaders.py \
$(PY2CBF)/xmas/xmas_cif_template.cif : $(NUWEB_DEP) $(NUWEB_DEP2) $(PY2CBF)/pycbf.w
(cd $(PY2CBF); $(NUWEB) pycbf.w)
(cd $(PY2CBF); $(NUWEB) pycbf.w )
touch $(PY2CBF)/py2setup_py.m4

$(PY2CBF)/_py2cbf.$(PY2CBFEXT): $(PY2CBF) shared \
Expand Down Expand Up @@ -1797,7 +1825,8 @@ $(PY3CBF)/xmas/readmarheader.py \
$(PY3CBF)/xmas/xmasheaders.py \
$(PY3CBF)/xmas/xmas_cif_template.cif: $(NUWEB_DEP) $(NUWEB_DEP2) $(PY3CBF)/pycbf.w
(cd $(PY3CBF); $(NUWEB) pycbf.w )
touch $(PY3CBF)/py3setup_py.m4
touch $(PY3CBF)/py3setup_py.m4


$(PY3CBF)/_pycbf.$(PY3CBFEXT): $(PY3CBF) shared \
$(PY3CBF)/py3setup.py \
Expand Down Expand Up @@ -2137,7 +2166,7 @@ $(BIN)/ctestcbf: $(EXAMPLES)/testcbf.c $(LIB)/libcbf.a
$(BIN)/testcbf.class: $(EXAMPLES)/testcbf.java $(JCBF)/cbflib-$(VERSION).jar $(SOLIB)/libcbf_wrap.so
mkdir -p $(BIN)
$(JAVAC) -cp $(JCBF)/cbflib-$(VERSION).jar -d $(BIN) $(EXAMPLES)/testcbf.java

ifneq ($(CBF_USE_ULP),)
#
# testulp test program
Expand Down Expand Up @@ -2705,7 +2734,7 @@ py3cbfuserinstall: $(PY3CBF)/_pycbf.$(PY3CBFEXT) $(PY3CBF)/py3cbfuserinstall

javatests: $(BIN)/ctestcbf $(BIN)/testcbf.class $(SOLIB)/libcbf_wrap.so
$(LDPREFIX) $(BIN)/ctestcbf > testcbfc.txt
$(LDPREFIX) java -cp $(JCBF)/cbflib-$(VERSION).jar:$(BIN) testcbf > testcbfj.txt
$(LDPREFIX) $(JAVA) -cp $(JCBF)/cbflib-$(VERSION).jar:$(BIN) testcbf > testcbfj.txt
$(DIFF) testcbfc.txt testcbfj.txt

dectristests: $(BIN)/cbf_template_t $(TEMPLATES)/cbf_test_orig.out
Expand Down
Loading