Opened 10 years ago

Closed 10 years ago

#44550 closed defect (fixed)

crystfel @0.5.3a: error: variable has incomplete type 'struct termios'

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: rkirian@…
Priority: Normal Milestone:
Component: ports Version: 2.3.1
Keywords: haspatch Cc:
Port: crystfel

Description

crystfel @0.5.3a failed to build for me on my OS X 10.7 test machine.

:info:build libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/Volumes/Data/macports/lion/share\" -I../lib -Wall -I../lib -pipe -Os -arch x86_64 -I/Volumes/Data/macports/lion/include -I/Volumes/Data/macports/lion/include -I/Volumes/Data/macports/lion/include -pipe -Os -arch x86_64 -MT src/dirax.lo -MD -MP -MF src/.deps/dirax.Tpo -c src/dirax.c  -fno-common -DPIC -o src/.libs/dirax.o
:info:build src/dirax.c:540:15: warning: implicit declaration of function 'forkpty' is invalid in C99 [-Wimplicit-function-declaration]
:info:build         dirax->pid = forkpty(&dirax->pty, NULL, NULL, NULL);
:info:build                      ^
:info:build src/dirax.c:548:18: error: variable has incomplete type 'struct termios'
:info:build                 struct termios t;
:info:build                                ^
:info:build src/dirax.c:548:10: note: forward declaration of 'struct termios'
:info:build                 struct termios t;
:info:build                        ^
:info:build src/dirax.c:551:3: warning: implicit declaration of function 'tcgetattr' is invalid in C99 [-Wimplicit-function-declaration]
:info:build                 tcgetattr(STDIN_FILENO, &t);
:info:build                 ^
:info:build src/dirax.c:552:18: error: use of undeclared identifier 'ECHO'
:info:build                 t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
:info:build                                ^
:info:build src/dirax.c:552:25: error: use of undeclared identifier 'ECHOE'
:info:build                 t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
:info:build                                       ^
:info:build src/dirax.c:552:33: error: use of undeclared identifier 'ECHOK'
:info:build                 t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
:info:build                                               ^
:info:build src/dirax.c:552:41: error: use of undeclared identifier 'ECHONL'
:info:build                 t.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
:info:build                                                       ^
:info:build src/dirax.c:553:3: warning: implicit declaration of function 'tcsetattr' is invalid in C99 [-Wimplicit-function-declaration]
:info:build                 tcsetattr(STDIN_FILENO, TCSANOW, &t);
:info:build                 ^
:info:build src/dirax.c:553:27: error: use of undeclared identifier 'TCSANOW'
:info:build                 tcsetattr(STDIN_FILENO, TCSANOW, &t);
:info:build                                         ^
:info:build 3 warnings and 6 errors generated.

Some info about this machine:

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.7.5
BuildVersion:	11G63
$ xcodebuild -version
Xcode 4.3.3
Build version 4E3002
$ clang -v
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

It built fine on my OS X 10.8 test machine.

Attachments (7)

main.log (53.7 KB) - added by ryandesign (Ryan Carsten Schmidt) 10 years ago.
Portfile (1.3 KB) - added by rkirian@… 10 years ago.
patch-libcrystfel-src-dirax.c.diff.1 (317 bytes) - added by rkirian@… 10 years ago.
patch-libcrystfel-src-dirax.c.diff.2 (317 bytes) - added by rkirian@… 10 years ago.
config.h (10.3 KB) - added by ryandesign (Ryan Carsten Schmidt) 10 years ago.
config.log (88.5 KB) - added by ryandesign (Ryan Carsten Schmidt) 10 years ago.
Portfile-crystfel.diff (361 bytes) - added by rkirian@… 10 years ago.

Download all attachments as: .zip

Change History (11)

Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.log added

comment:1 Changed 10 years ago by rkirian@…

I've attached a new port file and two patches. It would be great if you could try each of the patches (only patch 1 works on my machine running OS 10.9.4; unfortunately, I don't have a machine running OS 10.7). Here is some more info from the main developer of CrystFEL (Thomas White):

The termios stuff comes from pty.h on a GNU/Linux system and util.h on a BSD-style one (like OSX). There's a check for which one to use in configure.ac, but I guess it breaks on OSX 10.7. To debug this, we need to know exactly which combination of headers and libraries to use. Therefore, try replacing these lines in libcrystfel/src/dirax.c:

#if HAVE_FORKPTY_LINUX
#include <pty.h>
#elif HAVE_FORKPTY_BSD
#include <util.h>
#endif

to just this:

#include <pty.h>

and see if it works. Then try just this:

#include <util.h>

Additionally, it'd be useful to see the config.h file to see what result the test actually gave.

Changed 10 years ago by rkirian@…

Attachment: Portfile added

Changed 10 years ago by rkirian@…

Changed 10 years ago by rkirian@…

Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: config.h added

Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: config.log added

comment:2 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

I haven't tried your patches yet, but I've attached the config.h and config.log as well.

When supplying changes to a Portfile, you should submit a unified diff, not a complete new Portfile, so that we can more easily see your changes, and so that other unrelated changes that may have been made in the repository in the mean time don't inadvertently get lost.

Changed 10 years ago by rkirian@…

Attachment: Portfile-crystfel.diff added

comment:3 in reply to:  2 Changed 10 years ago by rkirian@…

Replying to ryandesign@…:

When supplying changes to a Portfile, you should submit a unified diff, not a complete new Portfile...

Thanks for your patience - I have attached a unified diff.

comment:4 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added
Resolution: fixed
Status: newclosed

Sorry I forgot about this ticket. It looks like version 0.5.4a includes a version of this patch so now that the port is updated to that version this problem should be fixed. The buildbot builders built the port successfully.

Note: See TracTickets for help on using tickets.