Closed stharrold closed 11 years ago
The makefile automatically sets the linker to gfortran under windows and OSX, but I left it on gcc under linux as we didn't have any issues on our ubuntu machines. What OS is this machine running?
I expect it should work if you set LINKER = gfortran
in the makefile.
Here's the information on the machine: login1$ uname -a Linux login1.ls4.tacc.utexas.edu 2.6.18-194.32.1.el5_TACC #2 SMP Fri Mar 18 11:27:58 CDT 2011 x86_64 x86_64 x86_64 GNU/Linux
I get a different error when using gfortran. What do you suggest? Thanks login1$ cat Makefile
USE_READLINE := TRUE
CC = gcc LINKER = gfortran CFLAGS = -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include LFLAGS = -lcfitsio -lcpgplot -lpgplot -lsofa_c -L/work/02109/ccd/White_Dwarf_Archive_Software/lib
ifeq ($(USE_READLINE),TRUE) LFLAGS += -lreadline CFLAGS += -DUSE_READLINE endif
ifeq ($(shell uname),Darwin) LINKER = gfortran LFLAGS += -L/usr/X11R6/lib -lX11 -Wl,-framework -Wl,Foundation -lpng
# Requires newer libreadline than osx provides by default - installed with hombrew
ifeq ($(USE_READLINE),TRUE)
LFLAGS += -L/usr/local/opt/readline/lib
CFLAGS += -I/usr/local/opt/readline/include
endif
endif
SRC = tsreduce.c datafile.c framedata.c helpers.c aperture.c fit.c dft_analysis.c reduction.c plots.c random.c hashmap.c OBJ = $(SRC:.c=.o)
ifeq ($(MSYSTEM),MINGW32) LINKER = gfortran CFLAGS += -I/usr/local/include LFLAGS += -L/usr/local/lib -lgdi32 -lregex endif
tsreduce: $(OBJ) $(LINKER) -o $@ $(OBJ) $(LFLAGS)
clean: -rm $(OBJ) tsreduce
.SUFFIXES: .c .c.o: $(CC) $(CFLAGS) -c $< -o $@ login1$ make gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c tsreduce.c -o tsreduce.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c datafile.c -o datafile.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c framedata.c -o framedata.o framedata.c: In function ‘framedata_load’: framedata.c:48:9: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] framedata.c: In function ‘framedata_get_metadata’: framedata.c:242:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t’ [-Wformat] framedata.c:242:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t’ [-Wformat] framedata.c: In function ‘framedata_print_metadata’: framedata.c:433:17: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘int64_t’ [-Wformat] gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c helpers.c -o helpers.o helpers.c: In function ‘get_matchingfiles’: helpers.c:500:5: warning: passing argument 4 of ‘scandir’ from incompatible pointer type [enabled by default] In file included from helpers.c:14:0: /usr/include/dirent.h:250:12: note: expected ‘int ()(const void , const void )’ but argument is of type ‘int ()(const struct dirent *, const struct dirent *_)’ helpers.c: In function ‘millisleep’: helpers.c:591:5: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration] gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c aperture.c -o aperture.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c fit.c -o fit.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c dft_analysis.c -o dft_analysis.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c reduction.c -o reduction.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c plots.c -o plots.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c random.c -o random.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c hashmap.c -o hashmap.o gfortran -o tsreduce tsreduce.o datafile.o framedata.o helpers.o aperture.o fit.o dft_analysis.o reduction.o plots.o random.o hashmap.o -lcfitsio -lcpgplot -lpgplot -lsofa_c -L/work/02109/ccd/White_Dwarf_Archive_Software/lib -lreadline /usr/bin/ld: cannot open output file tsreduce: Is a directory collect2: error: ld returned 1 exit status make: *\ [tsreduce] Error 1 login1$
Everything looks fine until
gfortran -o tsreduce tsreduce.o datafile.o framedata.o helpers.o aperture.o fit.o dft_analysis.o reduction.o plots.o random.o hashmap.o -lcfitsio -lcpgplot -lpgplot -lsofa_c -L/work/02109/ccd/White_Dwarf_Archive_Software/lib -lreadline /usr/bin/ld: cannot open output file tsreduce: Is a directory
The first thing I would check is that there isn't a directory called tsreduce in the source code folder.
Yep, I had downloaded the code to src and was trying to install from there.
What do you suggest for these new errors?
login1$ pwd
/work/02109/ccd/White_Dwarf_Archive_Software/tsreduce
login1$ make
gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c tsreduce.c -o tsreduce.o
gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c datafile.c -o datafile.o
gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c framedata.c -o framedata.o
framedata.c: In function ‘framedata_load’:
framedata.c:48:9: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
framedata.c: In function ‘framedata_get_metadata’:
framedata.c:242:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t’ [-Wformat]
framedata.c:242:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t’ [-Wformat]
framedata.c: In function ‘framedata_print_metadata’:
framedata.c:433:17: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘int64_t’ [-Wformat]
gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c helpers.c -o helpers.o
helpers.c: In function ‘get_matchingfiles’:
helpers.c:500:5: warning: passing argument 4 of ‘scandir’ from incompatible pointer type [enabled by default]
In file included from helpers.c:14:0:
/usr/include/dirent.h:250:12: note: expected ‘int ()(const void , const void )’ but argument is of type ‘int ()(const struct dirent *, const struct dirent *_)’
helpers.c: In function ‘millisleep’:
helpers.c:591:5: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration]
gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c aperture.c -o aperture.o
gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c fit.c -o fit.o
gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c dft_analysis.c -o dft_analysis.o
gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c reduction.c -o reduction.o
gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c plots.c -o plots.o
gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c random.c -o random.o
gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c hashmap.c -o hashmap.o
gfortran -o tsreduce tsreduce.o datafile.o framedata.o helpers.o aperture.o fit.o dft_analysis.o reduction.o plots.o random.o hashmap.o -lcfitsio -lcpgplot -lpgplot -lsofa_c -L/work/02109/ccd/White_Dwarf_Archive_Software/lib -lreadline
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XFree' /usr/lib/../lib64/libreadline.so: undefined reference to
PC'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XClearWindow' /usr/lib/../lib64/libreadline.so: undefined reference to
tgetflag'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XLookupString' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XCreateImage'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XGetWindowProperty' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XFreeColors'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XCreateSimpleWindow' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XOpenDisplay'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XDrawPoint' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XCopyArea'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XDeleteProperty' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XDrawLine'
/usr/lib/../lib64/libreadline.so: undefined reference to tgetent' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XCloseDisplay'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XFillArc' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XGetErrorText'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XSetForeground' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XFillRectangle'
/usr/lib/../lib64/libreadline.so: undefined reference to UP' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XFreeGC'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XDisplayName' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XDrawRectangle'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XNextEvent' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XResizeWindow'
/usr/lib/../lib64/libreadline.so: undefined reference to tputs' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XSetWindowBackground'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XCreateGC' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XSelectInput'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XFlush' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XSync'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XStoreColors' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XSendEvent'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XChangeGC' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XWarpPointer'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XPutImage' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XFillPolygon'
/usr/lib/../lib64/libreadline.so: undefined reference to tgoto' /usr/lib/../lib64/libreadline.so: undefined reference to
tgetnum'
/usr/lib/../lib64/libreadline.so: undefined reference to BC' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XDefineCursor'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XAllocColor' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XInternAtom'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XQueryPointer' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XGetVisualInfo'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XVisualIDFromVisual' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XGetWindowAttributes'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XCheckWindowEvent' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XSetErrorHandler'
/usr/lib/../lib64/libreadline.so: undefined reference to tgetstr' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XMapRaised'
/work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to `XGetSelectionOwner'
collect2: error: ld returned 1 exit status
make: *\ [tsreduce] Error 1
login1$ cat Makefile
USE_READLINE := TRUE
CC = gcc LINKER = gfortran CFLAGS = -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include LFLAGS = -lcfitsio -lcpgplot -lpgplot -lsofa_c -L/work/02109/ccd/White_Dwarf_Archive_Software/lib
ifeq ($(USE_READLINE),TRUE) LFLAGS += -lreadline CFLAGS += -DUSE_READLINE endif
ifeq ($(shell uname),Darwin) LINKER = gfortran LFLAGS += -L/usr/X11R6/lib -lX11 -Wl,-framework -Wl,Foundation -lpng
# Requires newer libreadline than osx provides by default - installed with hombrew
ifeq ($(USE_READLINE),TRUE)
LFLAGS += -L/usr/local/opt/readline/lib
CFLAGS += -I/usr/local/opt/readline/include
endif
endif
SRC = tsreduce.c datafile.c framedata.c helpers.c aperture.c fit.c dft_analysis.c reduction.c plots.c random.c hashmap.c OBJ = $(SRC:.c=.o)
ifeq ($(MSYSTEM),MINGW32) LINKER = gfortran CFLAGS += -I/usr/local/include LFLAGS += -L/usr/local/lib -lgdi32 -lregex endif
tsreduce: $(OBJ) $(LINKER) -o $@ $(OBJ) $(LFLAGS)
clean: -rm $(OBJ) tsreduce
.SUFFIXES: .c .c.o: $(CC) $(CFLAGS) -c $< -o $@ login1$
It looks like that machine doesn't have X11 installed (or doesn't have it in the system path) which is needed by pgplot. If this can't be fixed then I could modify tsreduce to allow compilation with the plotting functionality disabled.
On 7/06/2013, at 12:05 PM, stharrold notifications@github.com wrote:
Yep, I had downloaded the code to src and was trying to install from there.
What do you suggest for these new errors?
I can ssh -X into the system, and X forwarding works. I'll ask the system admin if I set up my environment wrong or something.
Ok, that means that it is installed, but not in the include / library paths.
You can find it by using locate libX11
and then add -I
On 7/06/2013, at 2:29 PM, stharrold notifications@github.com wrote:
I can ssh -X into the system, and X forwarding works. I'll ask the system admin.
— Reply to this email directly or view it on GitHub.
Thanks. Locate isn't working or is disabled on the machine, so I've asked system admin about the path to X11.
Compilation was successful but with warnings. System admin had to add additional LFLAGS. Makefile and terminal output below.
Thanks!
login1$ cat Makefile
USE_READLINE := TRUE
CC = gcc LINKER = gfortran CFLAGS = -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include LFLAGS = -lcfitsio -lcpgplot -lpgplot -lsofa_c -L/work/02109/ccd/White_Dwarf_Archive_Software/lib -L/usr/lib64 -lX11 -lncurses
ifeq ($(USE_READLINE),TRUE) LFLAGS += -lreadline CFLAGS += -DUSE_READLINE endif
ifeq ($(shell uname),Darwin) LINKER = gfortran LFLAGS += -L/usr/R6/lib -lX11 -Wl,-framework -Wl,Foundation -lpng
# Requires newer libreadline than osx provides by default - installed with hombrew
ifeq ($(USE_READLINE),TRUE)
LFLAGS += -L/usr/local/opt/readline/lib
CFLAGS += -I/usr/local/opt/readline/include
endif
endif
SRC = tsreduce.c datafile.c framedata.c helpers.c aperture.c fit.c dft_analysis.c reduction.c plots.c random.c hashmap.c OBJ = $(SRC:.c=.o)
ifeq ($(MSYSTEM),MINGW32) LINKER = gfortran CFLAGS += -I/usr/local/include LFLAGS += -L/usr/local/lib -lgdi32 -lregex endif
tsreduce: $(OBJ) $(LINKER) -o $@ $(OBJ) $(LFLAGS)
clean: -rm $(OBJ) tsreduce
.SUFFIXES: .c .c.o: $(CC) $(CFLAGS) -c $< -o $@ login1$ login1$ make gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include -DUSE_READLINE -c tsreduce.c -o tsreduce.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include -DUSE_READLINE -c datafile.c -o datafile.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include -DUSE_READLINE -c framedata.c -o framedata.o framedata.c: In function ‘framedata_load’: framedata.c:48:9: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] framedata.c: In function ‘framedata_get_metadata’: framedata.c:242:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t’ [-Wformat] framedata.c:242:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t’ [-Wformat] framedata.c: In function ‘framedata_print_metadata’: framedata.c:433:17: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘int64_t’ [-Wformat] gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include -DUSE_READLINE -c helpers.c -o helpers.o helpers.c: In function ‘get_matchingfiles’: helpers.c:500:5: warning: passing argument 4 of ‘scandir’ from incompatible pointer type [enabled by default] In file included from helpers.c:14:0: /usr/include/dirent.h:250:12: note: expected ‘int ()(const void , const void )’ but argument is of type ‘int ()(const struct dirent *, const struct dirent *_)’ helpers.c: In function ‘millisleep’: helpers.c:591:5: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration] gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include -DUSE_READLINE -c aperture.c -o aperture.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include -DUSE_READLINE -c fit.c -o fit.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include -DUSE_READLINE -c dft_analysis.c -o dft_analysis.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include -DUSE_READLINE -c reduction.c -o reduction.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include -DUSE_READLINE -c plots.c -o plots.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include -DUSE_READLINE -c random.c -o random.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -I/usr/include -DUSE_READLINE -c hashmap.c -o hashmap.o gfortran -o tsreduce tsreduce.o datafile.o framedata.o helpers.o aperture.o fit.o dft_analysis.o reduction.o plots.o random.o hashmap.o -lcfitsio -lcpgplot -lpgplot -lsofa_c -L/work/02109/ccd/White_Dwarf_Archive_Software/lib -L/usr/lib64 -lX11 -lncurses -lreadline login1$
I'm getting errors when making with gcc that weren't present in the old version of tsreduce with gfortran. I've included the terminal output and the makefile below. Do I need to add something in the makefile?
Thanks
login2$ make gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c tsreduce.c -o tsreduce.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c datafile.c -o datafile.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c framedata.c -o framedata.o framedata.c: In function ‘framedata_load’: framedata.c:48:9: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] framedata.c: In function ‘framedata_get_metadata’: framedata.c:242:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t’ [-Wformat] framedata.c:242:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t’ [-Wformat] framedata.c: In function ‘framedata_print_metadata’: framedata.c:433:17: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘int64_t’ [-Wformat] gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c helpers.c -o helpers.o helpers.c: In function ‘get_matchingfiles’: helpers.c:500:5: warning: passing argument 4 of ‘scandir’ from incompatible pointer type [enabled by default] In file included from helpers.c:14:0: /usr/include/dirent.h:250:12: note: expected ‘int ()(const void , const void )’ but argument is of type ‘int ()(const struct dirent *, const struct dirent *_)’ helpers.c: In function ‘millisleep’: helpers.c:591:5: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration] gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c aperture.c -o aperture.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c fit.c -o fit.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c dft_analysis.c -o dft_analysis.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c reduction.c -o reduction.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c plots.c -o plots.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c random.c -o random.o gcc -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include -DUSE_READLINE -c hashmap.c -o hashmap.o gcc -o tsreduce tsreduce.o datafile.o framedata.o helpers.o aperture.o fit.o dft_analysis.o reduction.o plots.o random.o hashmap.o -lcfitsio -lcpgplot -lpgplot -lsofa_c -L/work/02109/ccd/White_Dwarf_Archive_Software/lib -lreadline /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
_gfortran_concat_string' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XFree' /usr/lib/../lib64/libreadline.so: undefined reference toPC' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XClearWindow' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to_gfortran_st_write_done' /usr/lib/../lib64/libreadline.so: undefined reference to
tgetflag' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to_gfortran_transfer_integer' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XLookupString' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXCreateImage' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
_gfortran_st_read' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXGetWindowProperty' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
_gfortran_st_inquire' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXFreeColors' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XCreateSimpleWindow' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXOpenDisplay' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XDrawPoint' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to_gfortran_pow_i4_i4' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XCopyArea' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXDeleteProperty' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XDrawLine' /usr/lib/../lib64/libreadline.so: undefined reference totgetent' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XCloseDisplay' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to_gfortran_st_write' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XFillArc' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXGetErrorText' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XSetForeground' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXFillRectangle' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
_gfortran_getenv' /usr/lib/../lib64/libreadline.so: undefined reference toUP' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XFreeGC' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to_gfortran_st_read_done' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XDisplayName' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXDrawRectangle' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XNextEvent' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to_gfortran_transfer_integer_write' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XResizeWindow' /usr/lib/../lib64/libreadline.so: undefined reference totputs' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
_gfortran_compare_string' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to_gfortran_transfer_array' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XSetWindowBackground' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to_gfortran_string_index' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XCreateGC' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXSelectInput' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
_gfortran_st_close' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXFlush' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
_gfortran_transfer_character_write' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXSync' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XStoreColors' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXSendEvent' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XChangeGC' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXWarpPointer' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
_gfortran_transfer_real_write' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXPutImage' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XFillPolygon' /usr/lib/../lib64/libreadline.so: undefined reference totgoto' /usr/lib/../lib64/libreadline.so: undefined reference to
tgetnum' /usr/lib/../lib64/libreadline.so: undefined reference toBC' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
_gfortran_stop_string' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXDefineCursor' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XAllocColor' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXInternAtom' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XQueryPointer' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXGetVisualInfo' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XVisualIDFromVisual' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXGetWindowAttributes' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
_gfortran_st_open' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to_gfortran_transfer_character' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XCheckWindowEvent' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXSetErrorHandler' /usr/lib/../lib64/libreadline.so: undefined reference to
tgetstr' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXMapRaised' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to
XGetSelectionOwner' collect2: error: ld returned 1 exit status make: *\ [tsreduce] Error 1 login2$ cat MakefileCopyright 2010, 2011, 2012 Paul Chote
This file is part of Puoko-nui, which is free software. It is made available
to you under the terms of version 3 of the GNU General Public License, as
published by the Free Software Foundation. For more information, see LICENSE.
USE_READLINE := TRUE
CC = gcc LINKER = gcc CFLAGS = -g -c -Wall -pedantic -Dlinux --std=c99 -D_XOPEN_SOURCE -D_BSD_SOURCE -I/work/02109/ccd/White_Dwarf_Archive_Software/include LFLAGS = -lcfitsio -lcpgplot -lpgplot -lsofa_c -L/work/02109/ccd/White_Dwarf_Archive_Software/lib
ifeq ($(USE_READLINE),TRUE) LFLAGS += -lreadline CFLAGS += -DUSE_READLINE endif
Mac OS X (with gcc, PGPLOT installed via fink)
ifeq ($(shell uname),Darwin) LINKER = gfortran LFLAGS += -L/usr/X11R6/lib -lX11 -Wl,-framework -Wl,Foundation -lpng
endif
SRC = tsreduce.c datafile.c framedata.c helpers.c aperture.c fit.c dft_analysis.c reduction.c plots.c random.c hashmap.c OBJ = $(SRC:.c=.o)
ifeq ($(MSYSTEM),MINGW32) LINKER = gfortran CFLAGS += -I/usr/local/include LFLAGS += -L/usr/local/lib -lgdi32 -lregex endif
tsreduce: $(OBJ) $(LINKER) -o $@ $(OBJ) $(LFLAGS)
clean: -rm $(OBJ) tsreduce
.SUFFIXES: .c .c.o: $(CC) $(CFLAGS) -c $< -o $@