iraf-community / x11iraf

X11/GUI utilities and applications for IRAF (xgterm, ximtool, xtapemon)
https://iraf-community.github.io/x11iraf
21 stars 8 forks source link

Problem with "make" on Mac Intel running Catalina #33

Closed pmassey closed 3 years ago

pmassey commented 3 years ago

When I go to do a "make" in the irafx11-2.0-2020.06.15 subdirectory, it ends with an error:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C obm
cc -I/usr/X11/include -D__DARWIN__   -c -o gterm.o gterm.c
gterm.c:246:19: warning: incompatible function pointer types assigning to
      'ObmCreateFunc' (aka 'struct obmObject *(*)()') from 'ObmFunc'
      (aka 'int (*)()') [-Wincompatible-function-pointer-types]
        classrec->Create = (ObmFunc) GtermCreate;
                         ^ ~~~~~~~~~~~~~~~~~~~~~
gterm.c:544:45: warning: passing 'char **' to parameter of type
      'const char *const *' discards qualifiers in nested pointer types
      [-Wincompatible-pointer-types-discards-qualifiers]
        message = (argc > 1) ? Tcl_Concat (argc-1, &argv[1]) : NULL;
                                                   ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/tcl.framework/Headers/tclDecls.h:528:58: note: 
      passing argument to parameter 'argv' here
EXTERN char *           Tcl_Concat(int argc, CONST84 char *CONST *argv);
                                                                  ^
gterm.c:2020:17: warning: cast to 'XtPointer' (aka 'void *') from smaller
      integer type 'int' [-Wint-to-void-pointer-cast]
            drawable = (XtPointer) atoi(object);
                       ^
gterm.c:2971:6: error: implicit declaration of function 'createPixmap' is
      invalid in C99 [-Werror,-Wimplicit-function-declaration]
            createPixmap (obm, s_pixmap, nx, ny, 8, pixmap, NULL, 0, 0);
            ^
gterm.c:2971:6: note: did you mean 'XCreatePixmap'?
/usr/X11/include/X11/Xlib.h:1597:15: note: 'XCreatePixmap' declared here
extern Pixmap XCreatePixmap(
              ^
gterm.c:4113:48: warning: passing 'char ***' to parameter of type
      'const char ***' discards qualifiers in nested pointer types
      [-Wincompatible-pointer-types-discards-qualifiers]
            if (Tcl_SplitList (tcl, argv[2], &nitems, &items) != TCL_OK)
                                                      ^~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/tcl.framework/Headers/tclDecls.h:1453:21: note: 
      passing argument to parameter 'argvPtr' here
                                CONST84 char ***argvPtr);
                                                ^
4 warnings and 1 error generated.
make[1]: *** [gterm.o] Error 1
make: *** [obm/libobm.a] Error 2

Note that I do have the latest Xcode installed:

[guanaco:~/x11iraf-2.0-2020.06.15] massey% xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

I'd appreciate any advice you can give me.

Thanks! --Phil Massey

olebole commented 3 years ago

I don't see this sind probably my xcode is older (does anyone know how to update? I am not an expert here).

The relevant error is

gterm.c:2971:6: error: implicit declaration of function 'createPixmap' is
      invalid in C99 [-Werror,-Wimplicit-function-declaration]
            createPixmap (obm, s_pixmap, nx, ny, 8, pixmap, NULL, 0, 0);
            ^

The problem here is that x11iraf is quite old code, and there are still many places (I counted ~250) that have implicit function declarations. It will take some time to fix them. For the now, you could try to work around this with setting -Wno-implicit-function-generation:

CFLAGS=-Wno-implicit-function-declaration make

Could you report back whether this worked for you?

pmassey commented 3 years ago

Hi Ole,

Thanks for your help! Yes, that worked fine; I was able to do the make. BTW, I’m running xcode 11.3.1.

One thing I’ll note: after I invoke xgterm it comes up with a warning message in the xgterm window saying

Warning: no access to tty (Undefined error: 0). Thus no job control in this shell.

Not sure if this will prove to be a problem or not!

Best regards, Phil

On Nov 28, 2020, at 05:56, Ole Streicher notifications@github.com wrote:

I don't see this sind probably my xcode is older (does anyone know how to update? I am not an expert here).

The relevant error is

gterm.c:2971:6: error: implicit declaration of function 'createPixmap' is invalid in C99 [-Werror,-Wimplicit-function-declaration] createPixmap (obm, s_pixmap, nx, ny, 8, pixmap, NULL, 0, 0); ^ The problem here is that x11iraf is quite old code, and there are still many places (I counted ~250) that have implicit function declarations. It will take some time to fix them. For the now, you could try to work around this with setting -Wno-implicit-function-generation:

CFLAGS=-Wno-implicit-function-declaration make Could you report back whether this worked for you?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/iraf-community/x11iraf/issues/33#issuecomment-735228112, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHBFZVQ3PUYDACEEZ6TJVLSSDXRPANCNFSM4UFK5DUQ.

olebole commented 3 years ago

One thing I’ll note: after I invoke xgterm it comes up with a warning message in the xgterm window saying

Warning: no access to tty (Undefined error: 0).
Thus no job control in this shell.

This should not affect IRAF itself, but it prevents from using job control in the shell (Ctrl-Z, Ctrl-C and such). I will look into this.