Opened 4 months ago

Closed 4 months ago

#69025 closed defect (fixed)

SuiteSparse_CHOLMOD fails to build: error: two or more data types in declaration specifiers

Reported by: barracuda156 Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: tiger, leopard, snowleopard, powerpc Cc: szhorvat (Szabolcs Horvát)
Port: SuiteSparse_CHOLMOD

Description (last modified by barracuda156)

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_math_SuiteSparse/SuiteSparse_CHOLMOD/work/SuiteSparse-7.4.0/CHOLMOD/Utility/cholmod_dbound.c:14:33: error: two or more data types in declaration specifiers
   14 | #define Real                    double
      |                                 ^~~~~~
make[2]: *** [CMakeFiles/CHOLMOD.dir/Utility/cholmod_dbound.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....

https://github.com/DrTimothyAldenDavis/SuiteSparse/issues/682

Change History (8)

comment:1 Changed 4 months ago by barracuda156

Description: modified (diff)

comment:2 Changed 4 months ago by szhorvat (Szabolcs Horvát)

Take a look at the existing patch for SuiteSparse_KLU. This is very likely the same issue, i.e. that math.h (strangely!) defines Real and Image on PPC.

Since you have access to PPC, can you check if there's a way to prevent the definition of these non-standard symbols by a standard header?

P.S. I did not produce the patch for KLU. It was already there.

comment:3 Changed 4 months ago by szhorvat (Szabolcs Horvát)

For example, looking at this:

https://opensource.apple.com/source/Libm/Libm-213/ppc.subproj/math.h.auto.html

makes me wonder if defining __NOEXTENSIONS__ would fix this. Can you test that? You could even try defining _POSIX_C_SOURCE, though that may break other things.

comment:4 in reply to:  3 Changed 4 months ago by barracuda156

Replying to szhorvat:

For example, looking at this:

https://opensource.apple.com/source/Libm/Libm-213/ppc.subproj/math.h.auto.html

makes me wonder if defining __NOEXTENSIONS__ would fix this. Can you test that? You could even try defining _POSIX_C_SOURCE, though that may break other things.

Let me try, thank you for pointing at these.

comment:5 in reply to:  3 Changed 4 months ago by barracuda156

Replying to szhorvat:

For example, looking at this:

https://opensource.apple.com/source/Libm/Libm-213/ppc.subproj/math.h.auto.html

makes me wonder if defining __NOEXTENSIONS__ would fix this. Can you test that? You could even try defining _POSIX_C_SOURCE, though that may break other things.

Great, adding configure.cppflags-append -D__NOEXTENSIONS__ fixes the problem. Perhaps suggest it to upstream? It is an easy fix to pass a flag conditional on the OS and arch, which will not require any changes to the code. Perhaps we can also drop the patch to KLU then.

comment:6 Changed 4 months ago by szhorvat (Szabolcs Horvát)

I will suggest it to upstream. Are you able to tell which specific OS X versions are affected? They will probably want to make this conditional.

This is a good time to make the suggestion since the 7.5.0 release is imminent.

comment:7 in reply to:  6 Changed 4 months ago by barracuda156

Replying to szhorvat:

I will suggest it to upstream. Are you able to tell which specific OS X versions are affected? They will probably want to make this conditional.

This is a good time to make the suggestion since the 7.5.0 release is imminent.

It is there up to 10.6.8 Release: https://github.com/apple-oss-distributions/Libm/blob/845f432413a66ea992f4797c66157c9824421719/Source/PowerPC/math.h#L704-L707 There is no PowerPC support in 10.7.x anymore.

It seems that it was there from archaic versions of macOS: https://github.com/apple-oss-distributions/Libm/commit/97c2b0edc94ed024ece83540c86e33cc48639067 So anything relevant will be affected.

comment:8 Changed 4 months ago by szhorvat (Szabolcs Horvát)

Resolution: fixed
Status: assignedclosed

In e485b0a0c8125cb9d8bcc6241a9c2016514188c8/macports-ports (master):

SuiteSparse: fix build on 10.6 and earlier

Note: See TracTickets for help on using tickets.