Commit 977c333d authored by flechsig's avatar flechsig
Browse files

remove warnings, cleanup Makefile for RH7 and SUSE

parent dc58fc18
......@@ -3,3 +3,5 @@
*.o
*~
main
myxgi
TAGS
############################################
# adjust the path to the libraries
myfftwlib=/home/optics/Software/fftw/lib
myfftwinc=/home/optics/Software/fftw/include
myhdf5inc=/usr/include/hdf5/serial
FFTW_INCLUDE = /home/optics/Software/fftw/include
HDF5_INCLUDE = /usr/include/hdf5/serial
############################################
# Makefile for standard linux distributions
# tested on RH7 and SUSE TW
# Version Oct 2021
# tools
CC = g++
DOUBLE_PRECISION = defined
# switches
DEBUG = -DDEBUG
DEFS = -DLINUX -DUSE_DOUBLE_PRECISION -DHAVE_TIFF -DHAVE_HDF5 $(DEBUG)
CFLAGS = $(DEFS) -O3 -std=c++0x -c
LDFLAGS = -lm
LIBS = -ltiff -lpng -lhdf5 -lfftw3
#
.phony: all
PROGRAM = myxgi
SRCS = main.cpp xgi.cpp xgi.h
OBJS = main.o xgi.o
ifdef DOUBLE_PRECISION
PREC = -DUSE_DOUBLE_PRECISION
#FFTW = -L /home/optics/Software/fftw/lib -lfftw3
#FFTW = -L $(myfftwlib) -lfftw3
FFTW = -lfftw3
else
PREC =
FFTW = -lfftw3f
endif
# rules
all: $(PROGRAM)
##########################################################################
$(PROGRAM): $(OBJS)
$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
#CFLAGS = -O3 -std=c++0x $(PREC) -DHAVE_TIFF -DHAVE_HDF5 -I$(HDF5_INCLUDE) -I${FFTW_INCLUDE}
CFLAGS = -O3 -std=c++0x $(PREC) -DHAVE_TIFF -DHAVE_HDF5 -DDEBUG
LDFLAGS = -lm -ltiff -lpng -lhdf5 $(FFTW)
src = $(wildcard *.cpp)
obj = $(src:.cpp=.o)
all: $(obj)
$(CC) -o main $(obj) $(LDFLAGS)
%.o: %.cpp
$(CC) $(CFLAGS) -c -o $@ $<
$(CC) $(CFLAGS) -o $@ $<
.PHONY: clean
TAGS: $(SRCS)
etags $(SRCS)
clean:
rm $(obj)
rm -f *.o core $(PROGRAM)
# end
############################################
# adjust the path to the libraries
myfftwlib=/home/optics/Software/fftw/lib
myfftwinc=/home/optics/Software/fftw/include
myhdf5inc=/usr/include/hdf5/serial
FFTW_INCLUDE = /home/optics/Software/fftw/include
HDF5_INCLUDE = /usr/include/hdf5/serial
############################################
CC = g++
DOUBLE_PRECISION = defined
ifdef DOUBLE_PRECISION
PREC = -DUSE_DOUBLE_PRECISION
#FFTW = -L /home/optics/Software/fftw/lib -lfftw3
#FFTW = -L $(myfftwlib) -lfftw3
FFTW = -lfftw3
else
PREC =
FFTW = -lfftw3f
endif
#CFLAGS = -O3 -std=c++0x $(PREC) -DHAVE_TIFF -DHAVE_HDF5 -I$(HDF5_INCLUDE) -I${FFTW_INCLUDE}
CFLAGS = -O3 -std=c++0x $(PREC) -DHAVE_TIFF -DHAVE_HDF5 -DDEBUG
LDFLAGS = -lm -ltiff -lpng -lhdf5 $(FFTW)
src = $(wildcard *.cpp)
obj = $(src:.cpp=.o)
all: $(obj)
$(CC) -o main $(obj) $(LDFLAGS)
%.o: %.cpp
$(CC) $(CFLAGS) -c -o $@ $<
.PHONY: clean
clean:
rm $(obj)
# end
......@@ -40,19 +40,25 @@ int main(int argc, char **args)
misc.load_h5_ushort(fn,"/entry/instrument/detector/data",0);
dark.add(&misc);
}
#ifdef DEBUG
printf("debug: step %d\n", dbgstep++);
#endif
if (dark_low <= dark_high)
dark.mul(C_ONE/(dark_high +1 - dark_low));
#ifdef DEBUG
printf("debug: step %d\n", dbgstep++);
printf("debug 3: step %d\n", dbgstep++);
#endif
put_in.save_tiff("input.tif");
put_in.sub(&dark);
#ifdef DEBUG
printf("debug: step %d\n", dbgstep++);
printf("debug 4: step %d\n", dbgstep++);
#endif
//ip.verbose = 9001;
ip.n_zeropadding = 16;
//ip.ncrop = 128;
......
......@@ -599,6 +599,7 @@ int Xgi::compute(Matrix *put_in, Xgi_ip *ip, Xgi_out *put_out)
FFTFREE(fft_in);
FFTFREE(fft_out);
FFTFREE(fft_out_amp);
return 0; // UF to avoid warning
}
int Matrix::unwrap(Matrix *tgt)
......@@ -1005,6 +1006,7 @@ int Matrix::save_tiff(const char *fn)
}
_TIFFfree(buf);
TIFFClose(tif);
return 0; // UF to avoid warning
}
#else
int Matrix::save_tiff(const char *fn)
......@@ -1122,6 +1124,7 @@ int Matrix::save_png(const char *fn,FLOATING data_low, FLOATING data_high)
int Matrix::save_png(const char *fn,FLOATING data_low, FLOATING data_high)
{
printf("[E]No PNG support\n");
return 0; // UF to avoid void warning
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment