CMake breaks with in-tree build
On a clean checkout of the master branch:
-- The C compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/lib64/ccache/cc
-- Check for working C compiler: /usr/lib64/ccache/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Found HDF5: /usr/lib64/libhdf5.so;/usr/lib64/libsz.so;/usr/lib64/libz.so;/usr/lib64/libdl.so;/usr/lib64/libm.so (found version "1.8.12") found components: C
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1")
-- Found GSL: /usr/include (found version "1.15")
-- Found TIFF: /usr/lib64/libtiff.so (found version "4.0.3")
-- Looking for CL_VERSION_2_2
-- Looking for CL_VERSION_2_2 - found
-- Found OpenCL: /usr/lib64/libOpenCL.so (found version "2.2")
-- Checking for module 'glib-2.0'
-- Found glib-2.0, version 2.56.1
-- Checking for one of the modules 'msgpack'
-- MessagePack not found.
-- Checking for one of the modules 'libzmq'
-- Found ZMQ
-- Checking for one of the modules 'gtk+-3.0'
-- Checking for one of the modules 'gtk+-2.0'
-- Using GTK 2
-- Checking for one of the modules 'gdk-2.0'
-- Checking for one of the modules 'cairo'
-- Checking for one of the modules 'gdk-pixbuf-2.0'
-- Performing Test HAVE_DIAG_COLOR
-- Performing Test HAVE_DIAG_COLOR - Success
-- This is a Git checkout: adding revision ID to version number
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for CL/cl.h
-- Looking for CL/cl.h - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for argp_parse
-- Looking for argp_parse - found
-- Found Curses: /usr/lib64/libcurses.so
-- Could NOT find XGANDALF (missing: XGANDALF_LIBRARIES XGANDALF_INCLUDES)
-- Could NOT find PINKINDEXER (missing: PINKINDEXER_LIBRARIES PINKINDEXER_INCLUDES)
-- Could NOT find FDIP (missing: FDIP_LIBRARIES)
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7")
-- Found FLEX: /usr/bin/flex (found version "2.5.37")
-- Found BISON: /usr/bin/bison (found version "3.0.4")
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.5") found components: doxygen dot
-- Checking for one of the modules 'fftw3'
-- Looking for gzbuffer
-- Looking for gzbuffer - found
-- Looking for forkpty
-- Looking for forkpty - found
-- Looking for forkpty
-- Looking for forkpty - not found
-- Found forkpty() in pty.h
-- Configuring done
-- Generating done
-- Build files have been written to: /home/twhite/crystfel-master
[09:49] max-display001 ~/crystfel-master $ make
[ 1%] [FLEX][symopl] Building scanner with flex 2.5.37
[ 2%] [BISON][symopp] Building parser with bison 3.0.4
Scanning dependencies of target libcrystfel
[ 3%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/reflist.c.o
[ 4%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/utils.c.o
[ 4%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/cell.c.o
[ 5%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/detector.c.o
[ 6%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/thread-pool.c.o
[ 7%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/image.c.o
[ 8%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/hdf5-file.c.o
[ 8%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/geometry.c.o
[ 9%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/peakfinder8.c.o
[ 10%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/symmetry.c.o
[ 11%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/stream.c.o
[ 12%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/peaks.c.o
[ 13%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/reflist-utils.c.o
[ 13%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/filters.c.o
[ 14%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/render.c.o
[ 15%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/index.c.o
[ 16%] Building C object libcrystfel/CMakeFiles/libcrystfel.dir/src/dirax.c.o
/home/twhite/crystfel-master/libcrystfel/src/dirax.c: In function ‘run_dirax’:
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:520:2: warning: implicit declaration of function ‘forkpty’ [-Wimplicit-function-declaration]
dirax->pid = forkpty(&dirax->pty, NULL, NULL, NULL);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:528:18: error: storage size of ‘t’ isn’t known
struct termios t;
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:531:3: warning: implicit declaration of function ‘tcgetattr’ [-Wimplicit-function-declaration]
tcgetattr(STDIN_FILENO, &t);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:532:18: error: ‘ECHO’ undeclared (first use in this function)
t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:532:18: note: each undeclared identifier is reported only once for each function it appears in
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:532:25: error: ‘ECHOE’ undeclared (first use in this function)
t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:532:33: error: ‘ECHOK’ undeclared (first use in this function)
t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:532:41: error: ‘ECHONL’ undeclared (first use in this function)
t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:533:3: warning: implicit declaration of function ‘tcsetattr’ [-Wimplicit-function-declaration]
tcsetattr(STDIN_FILENO, TCSANOW, &t);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:533:27: error: ‘TCSANOW’ undeclared (first use in this function)
tcsetattr(STDIN_FILENO, TCSANOW, &t);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:528:18: warning: unused variable ‘t’ [-Wunused-variable]
struct termios t;
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c: In function ‘dirax_probe’:
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:658:18: error: storage size of ‘t’ isn’t known
struct termios t;
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:662:18: error: ‘ECHO’ undeclared (first use in this function)
t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:662:25: error: ‘ECHOE’ undeclared (first use in this function)
t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:662:33: error: ‘ECHOK’ undeclared (first use in this function)
t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:662:41: error: ‘ECHONL’ undeclared (first use in this function)
t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:663:27: error: ‘TCSANOW’ undeclared (first use in this function)
tcsetattr(STDIN_FILENO, TCSANOW, &t);
^
/home/twhite/crystfel-master/libcrystfel/src/dirax.c:658:18: warning: unused variable ‘t’ [-Wunused-variable]
struct termios t;
^
make[2]: *** [libcrystfel/CMakeFiles/libcrystfel.dir/src/dirax.c.o] Error 1
make[1]: *** [libcrystfel/CMakeFiles/libcrystfel.dir/all] Error 2
make: *** [all] Error 2
No problems at all when creating a separate build directory, cd-ing into it, then running "cmake .." instead.
I think it's caused by finding the wrong config.h - there is a separate one for libcrystfel and the main programs.
Edited by Thomas White