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

failure during make on Catalina (Mac OS X) #43

Closed jmonkiew closed 3 years ago

jmonkiew commented 3 years ago

Hello, I'm trying to install on an Intel mac running OS X 10.15. I'm getting this error:

bash-3.2$ sudo make
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C xgterm
cc -L/usr/X11/lib -o xgterm button.o charproc.o cursor.o data.o gtermio.o input.o main.o menu.o misc.o screen.o scrollbar.o tabs.o util.o VTPrsTbl.o \
        -L../obm -lobm \
        -lXpm -ltcl -lXaw3d -lXmu -lXt -lXext -lX11 -lncurses -lm
ld: archive has no table of contents file '../obm/libobm.a' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [xgterm] Error 1
make: *** [xgterm] Error 2
bash-3.2$ 
olebole commented 3 years ago

That looks that the file libobm.a is somehow defective. Can you try to start with a clean repository, i.e. after a make clean? (and you don't need the sudo)

jmonkiew commented 3 years ago

I ran "make clean" and then "make". Here's the (lengthy) output, attached as a text file. It does look like the same file is still a problem. (Edit: I did also download a fresh version of the tar file, just in case. Same result.)

Is it possible for me to grab the iraf-2.0+2020.06.15.tar file from the previous version from somewhere? It looks like user pmassey was able to get that working with Catalina.

error_1.txt

olebole commented 3 years ago

The last lines in the log are

ar cr libobm.a ObmW/[A-Za-z]*.o Obm.o client.o param.o server.o widget.o gterm.o marker.o geom.o html.o
/opt/local/bin/ranlib: object: libobm.a(Arrow.o) malformed object (unknown load command 1)
ar: internal ranlib command failed
make[1]: *** [libobm.a] Error 1
make: *** [obm/libobm.a] Error 2

This shows that you probably have some additional development tools installed in /opt/local/bin/, which interfere with the current XCode version. I would guess that this is the cause here. Do you remember why this went there? Googling the error message brought me to https://github.com/pyenv/pyenv/issues/1267, which recommends that a leftover of an old MacPorts installation messed up your system (but how can this be on a new machine?), and it may help to either remove /opt/local/bin/ranlib, or do a brew remove cctools.

One other way to work around this could be to remove /opt/local/bin from your PATH environment variable (f.e. set PATH to ${HOME}/.iraf/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin before running make (please re-run make clean before to remove potential corrupted object files).

Ofcourse you can try another version (just click to Releases on the right column on the Github main page) to see all releases), but I am sure that this will not solve the problem, since the problem is most probably the left-over /opt/local/bin/ranlib.

jmonkiew commented 3 years ago

Hmm, I found some references to macports in my .bash_profile, which migrated over from the previous computer. While googling it, I also found some reference to this being a sign of an interrupted migration, which did in fact happen--the initial migration to the new laptop stalled when I tried to do it over wifi.

But having removed it, I got this error:

_ar cr libobm.a ObmW/[A-Za-z]*.o Obm.o client.o param.o server.o widget.o gterm.o marker.o geom.o html.o
fatal error: ar: can't find or exec: /opt/local/bin/ranlib (No such file or directory)
ar: internal ranlib command failed
make[1]: *** [libobm.a] Error 1
make: *** [obm/libobm.a] Error 2_

... I found that ar was pointing to some circa 2015 version of ar in that same /opt/local/bin directory, and there was another one in /usr/bin. So I moved the older one to ar_old, to force it to use the other version. So now I'm getting this:

error_2.txt

olebole commented 3 years ago

The problem here is probably that your IRAF installation is not really complete; specifically the iraf variable is not properly set. The failing compilation affects an IRAF module for ximtool, which displays the WCS coordinates when moving the cursor around on the ximtool display. If you don't need that, or if you just need xgterm, you are done (according to your log file, xgterm and ximtool were installed in /usr/local/bin).

jmonkiew commented 3 years ago

Great, that's probably good enough. Thank you!