Issue 35 in casacore: Missing header file on MacOS X 10.6

8 views
Skip to first unread message

casa...@googlecode.com

unread,
Mar 14, 2011, 9:02:01 AM3/14/11
to casacor...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 35 by jdswinb...@gmail.com: Missing header file on MacOS X 10.6
http://code.google.com/p/casacore/issues/detail?id=35

r21022 added a check for defined(__MAC_10_6) at line 40 of
casa/IO/TapeIO.cc.

__MAC_10_6 is defined in /usr/include/Availability.h, which isn't being
included. It's therefore undefined, so the system proceeds to try to
include <sys/mtio.h>, which doesn't exist on OS X 10.6, and therefore fails.

The attached patch fixes the issue.

Attachments:
patch-mtio.diff 387 bytes

casa...@googlecode.com

unread,
Mar 14, 2011, 9:19:15 AM3/14/11
to casacor...@googlegroups.com

Comment #1 on issue 35 by jdswinb...@gmail.com: Missing header file on

(A more careful check demonstrates that r21022 didn't actually add the
check for __MAC_10_6, it just caused me to notice it!)

casa...@googlecode.com

unread,
Mar 15, 2011, 3:37:09 AM3/15/11
to casacor...@googlegroups.com

Comment #2 on issue 35 by gervandi...@gmail.com: Missing header file on

The patch introduces a compile error on older OS-X systems that do not have
Availability.h.
I wonder if the test on !defined(__AVAILABILITY__) should have the !
removed. I assume that this variable is only defined in Availability.h is
available.

Cheers,
Ger

casa...@googlecode.com

unread,
Mar 15, 2011, 9:17:06 AM3/15/11
to casacor...@googlegroups.com

Comment #3 on issue 35 by jdswinb...@gmail.com: Missing header file on

Hi Ger,

Yes, apologies -- that patch was just wrong. Sorry. The problem is actually
more complex than I previously understood.

__MAC_10_6 is defined in Availability.h: so far as I can see, it will
therefore never be defined in the current casacore trunk, so the check in
casa/IO/TapeIO.cc is useless.

However, even including Availability.h isn't enough: it also defines
__MAC_10_6 on OSX 10.5. Therefore, checking for __MAC_10_6 as a guide to
whether the system is running OSX 10.6 is useless.

I attach an updated patch, which looks at the value of
MAC_OS_X_VERSION_MAX_ALLOWED, defined in AvailabilityMacros.h. This
reflects the version of the SDK being used, which is, I think, what's
required; it also means that one can use a different SDK to target a
different version of OSX from the one currently running.

Unfortunately, I don't have a Mac running an earlier version of OSX which I
can easily check this patch on. Google suggests that the
AvailabilityMacros.h file was included with OSX as far back as 10.2,
though, so I hope this isn't a problem.

Attachments:
patch-mtio.diff 589 bytes

casa...@googlecode.com

unread,
Mar 15, 2011, 5:05:20 PM3/15/11
to casacor...@googlegroups.com

Comment #4 on issue 35 by jdswinb...@gmail.com: Missing header file on

Hi Ger,

Yes, apologies -- that patch was just wrong. Sorry. The problem is actually

more complex than I'd previously grasped. My understanding now is:

__MAC_10_6 is defined in /usr/include/Availability.h: so far as I can see,
that's not included by anything in casacore, so it will therefore never be
defined. The check in casa/IO/TapeIO.cc is useless.

However, even if Availability.h is included, the check doesn't seem to do
what's required. Availability.h on OSX 10.5 defines __MAC_10_6, so relying
on it as a guide to the version being used is a mistake.

I think the solution is to check the value of MAC_OS_X_VERSION_MAX_ALLOWED,
defined in /usr/include/AvailabilityMacros.h. This should correspond to the
version of the SDK being used, which is really the relevant issue (the OS X
10.6 SDK doesn't include mtio.h, but compiling for earlier versions using
earlier SDKs on 10.6 should work).

I attach an updated patch, which, I think(!), does the right thing.

Unfortunately, I don't have a Mac running an earlier version of OSX which I
can easily check this patch on. Google suggests that the
AvailabilityMacros.h file was included with OSX as far back as 10.2,

though, so I hope it will work.

Cheers,

John

Attachments:
patch-mtio.diff 589 bytes

casa...@googlecode.com

unread,
Mar 16, 2011, 4:08:23 AM3/16/11
to casacor...@googlegroups.com

Comment #5 on issue 35 by gervandi...@gmail.com: Missing header file on

John,

I have an older OS-X. It also set NOTAPE because the 10_6 variable is
undefined there. So I changed it to the following:

// MAC_OS_X_VERSION_MAX_ALLOWED reflects the version of the SDK being used
# include <AvailabilityMacros.h>
# if defined(MAC_OS_X_VERSION_10_6)
# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
# define CASA_NOTAPE 1
# endif
# endif
#

casa...@googlecode.com

unread,
Mar 16, 2011, 6:54:03 AM3/16/11
to casacor...@googlegroups.com

Comment #6 on issue 35 by jdswinb...@gmail.com: Missing header file on

Hi Ger,

Agreed, that looks fine to me.

casa...@googlecode.com

unread,
Mar 21, 2011, 3:32:41 AM3/21/11
to casacor...@googlegroups.com
Updates:
Status: Fixed

Comment #7 on issue 35 by gervandi...@gmail.com: Missing header file on

(No comment was entered for this change.)

casa...@googlecode.com

unread,
Aug 4, 2014, 3:57:58 PM8/4/14
to casacor...@googlegroups.com

Comment #8 on issue 35 by 2107...@gmail.com: Missing header file on MacOS X
10.6
http://code.google.com/p/casacore/issues/detail?id=35

Hi,

I have a problem. When I try to do that:

sudo make orphlib

out:

mt_fort.c:141:22: fatal error: sys/mtio.h: No such file or directory

I need help, thanks


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

casa...@googlecode.com

unread,
Aug 4, 2014, 3:59:40 PM8/4/14
to casacor...@googlegroups.com

Comment #9 on issue 35 by 2107...@gmail.com: Missing header file on MacOS X
10.6
http://code.google.com/p/casacore/issues/detail?id=35

Hi everybody,

I have a problem. When I try to do that:

sudo make orphlib

out:

mt_fort.c:141:22: fatal error: sys/mtio.h: No such file or directory

I need help about that, thanks

casa...@googlecode.com

unread,
Aug 5, 2014, 2:02:48 AM8/5/14
to casacor...@googlegroups.com

Comment #10 on issue 35 by gervandi...@gmail.com: Missing header file on
I don't know what casacore has to do with orphlib.
There is no file mt_fort.c in casacore, so your problem is somewhere else.

Ger
Reply all
Reply to author
Forward
0 new messages