pchote / tsreduce

Reduction code for the VUW Puoko-nui photometer
1 stars 1 forks source link

trouble making with gcc #8

Closed stharrold closed 11 years ago

stharrold commented 11 years ago

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 toXFree' /usr/lib/../lib64/libreadline.so: undefined reference to PC' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXClearWindow' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to _gfortran_st_write_done' /usr/lib/../lib64/libreadline.so: undefined reference totgetflag' /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 toXLookupString' /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_gfortran_st_read' /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_gfortran_st_inquire' /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 toXCreateSimpleWindow' /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 toXDrawPoint' /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 toXCopyArea' /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 toXDrawLine' /usr/lib/../lib64/libreadline.so: undefined reference to tgetent' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXCloseDisplay' /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 toXFillArc' /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 toXSetForeground' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XFillRectangle' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to_gfortran_getenv' /usr/lib/../lib64/libreadline.so: undefined reference to UP' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXFreeGC' /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 toXDisplayName' /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 toXNextEvent' /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 toXResizeWindow' /usr/lib/../lib64/libreadline.so: undefined reference to tputs' /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 toXSetWindowBackground' /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 toXCreateGC' /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_gfortran_st_close' /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_gfortran_transfer_character_write' /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 toXStoreColors' /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 toXChangeGC' /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_gfortran_transfer_real_write' /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 toXFillPolygon' /usr/lib/../lib64/libreadline.so: undefined reference to tgoto' /usr/lib/../lib64/libreadline.so: undefined reference totgetnum' /usr/lib/../lib64/libreadline.so: undefined reference to BC' /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 to XDefineCursor' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXAllocColor' /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 toXQueryPointer' /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 toXVisualIDFromVisual' /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_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 toXCheckWindowEvent' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XSetErrorHandler' /usr/lib/../lib64/libreadline.so: undefined reference totgetstr' /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 toXGetSelectionOwner' collect2: error: ld returned 1 exit status make: *\ [tsreduce] Error 1 login2$ cat Makefile

Copyright 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

# 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 $@

pchote commented 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.

stharrold commented 11 years ago

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

Copyright 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 = 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

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

# 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$

pchote commented 11 years ago

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.

stharrold commented 11 years ago

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 toPC' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference to XClearWindow' /usr/lib/../lib64/libreadline.so: undefined reference totgetflag' /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 XGetWindowProperty' /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 toXCopyArea' /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 toXDrawLine' /usr/lib/../lib64/libreadline.so: undefined reference to tgetent' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXCloseDisplay' /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' /usr/lib/../lib64/libreadline.so: undefined reference to UP' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXFreeGC' /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 toXResizeWindow' /usr/lib/../lib64/libreadline.so: undefined reference to tputs' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXSetWindowBackground' /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 XFlush' /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 XPutImage' /work/02109/ccd/White_Dwarf_Archive_Software/lib/libpgplot.so: undefined reference toXFillPolygon' /usr/lib/../lib64/libreadline.so: undefined reference to tgoto' /usr/lib/../lib64/libreadline.so: undefined reference totgetnum' /usr/lib/../lib64/libreadline.so: undefined reference to BC' /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 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 login1$ cat Makefile

Copyright 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 = 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

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

# 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$

pchote commented 11 years ago

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?

stharrold commented 11 years ago

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.

pchote commented 11 years ago

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/include in the CFLAGS and -L/lib in the LFLAGS.

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.

stharrold commented 11 years ago

Thanks. Locate isn't working or is disabled on the machine, so I've asked system admin about the path to X11.

stharrold commented 11 years ago

Compilation was successful but with warnings. System admin had to add additional LFLAGS. Makefile and terminal output below.

Thanks!

login1$ cat Makefile

Copyright 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 = 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

Mac OS X (with gcc, PGPLOT installed via fink)

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$