Opened 5 years ago

Closed 5 years ago

#60145 closed defect (fixed)

fftw-3 @3.3.8_1 does not configure on PPC Leopard, Mac OS X 10.5.8, because of error: expected expression before ')' token

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: leopard powerpc Cc:
Port: fftw-3

Description

checking size of unsigned int... 0
checking size of long... 0
checking size of unsigned long... 0
checking size of long long... 0
checking size of unsigned long long... 0
checking size of size_t... configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_fftw-3/fftw-3/work/fftw-3.3.8':
configure: error: cannot compute sizeof (size_t)
See `config.log' for more details
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_fftw-3/fftw-3/work/fftw-3.3.8" && ./configure --prefix=/opt/local --enable-threads --disable-fortran --enable-shared --with-our-malloc --enable-fma 
Exit code: 77

/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_fftw-3/fftw-3/work/fftw-3.3.8 contains:

configure:16407: checking size of size_t
configure:16412: /Developer/usr/bin/llvm-gcc-4.2 -std=gnu99 -o conftest -pipe -O3 -fno-common -fomit-frame-pointer -fstrict-aliasing -arch ppc -Wl,-no_compact_unwind -I/opt/local/include -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc conftest.c  >&5
ld: unknown option: -no_compact_unwind
collect2: ld returned 1 exit status
configure:16412: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "fftw"
| #define PACKAGE_TARNAME "fftw"
| #define PACKAGE_VERSION "3.3.8"
| #define PACKAGE_STRING "fftw 3.3.8"
| #define PACKAGE_BUGREPORT "fftw@fftw.org"
| #define PACKAGE_URL ""
| #define PACKAGE "fftw"
| #define VERSION "3.3.8"
| #define FFTW_ENABLE_ALLOCA 1
| #define WITH_OUR_MALLOC 1
| #define ARCH_PREFERS_FMA 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define STDC_HEADERS 1
| #define HAVE_FCNTL_H 1
| #define HAVE_FENV_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_ALTIVEC_H 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_LONG_DOUBLE 1
| #define SIZEOF_INT 0
| #define SIZEOF_UNSIGNED_INT 0
| #define SIZEOF_LONG 0
| #define SIZEOF_UNSIGNED_LONG 0
| #define SIZEOF_LONG_LONG 0
| #define SIZEOF_UNSIGNED_LONG_LONG 0
| /* end confdefs.h.  */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| static long int longval () { return (long int) (sizeof (size_t)); }
| static unsigned long int ulongval () { return (long int) (sizeof (size_t)); }
| #include <stdio.h>
| #include <stdlib.h>
| int
| main ()
| {
| 
|   FILE *f = fopen ("conftest.val", "w");
|   if (! f)
|     return 1;
|   if (((long int) (sizeof (size_t))) < 0)
|     {
|       long int i = longval ();
|       if (i != ((long int) (sizeof (size_t))))
| 	return 1;
|       fprintf (f, "%ld", i);
|     }
|   else
|     {
|       unsigned long int i = ulongval ();
|       if (i != ((long int) (sizeof (size_t))))
| 	return 1;
|       fprintf (f, "%lu", i);
|     }
|   /* Do not output a trailing newline, as this causes \r\n confusion
|      on some platforms.  */
|   return ferror (f) || fclose (f) != 0;
| 
|   ;
|   return 0;
| }
configure:16416: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_fftw-3/fftw-3/work/fftw-3.3.8':
configure:16418: error: cannot compute sizeof (size_t)
See `config.log' for more details

So this should not use -no_compact_unwind!

Compiler used is powerpc-apple-darwin9-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5555) (LLVM build 2064.3) or /Developer/usr/bin/llvm-gcc-4.2.

Attachments (2)

main.log (17.3 KB) - added by ballapete (Peter "Pete" Dyballa) 5 years ago.
Main.log from PPC Leopard
config.log (76.5 KB) - added by ballapete (Peter "Pete" Dyballa) 5 years ago.
config.log with error

Download all attachments as: .zip

Change History (10)

Changed 5 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

Main.log from PPC Leopard

Changed 5 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: config.log added

config.log with error

comment:1 Changed 5 years ago by mf2k (Frank Schima)

Cc: mcalhoun@… removed
Keywords: powerpc added
Owner: set to MarcusCalhoun-Lopez
Status: newassigned

comment:2 Changed 5 years ago by kencu (Ken)

it updates with gcc7, but not the default compiler.

I did't bother trying anything in between.

comment:3 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

The configure test for -no_compact_unwind does not work.
See upstream issue for more details.

I am now looking to see how easy a fix is.

comment:4 Changed 5 years ago by kencu (Ken)

I don't believe that will turn out to be the real issue, as it builds just fine with gcc7 with the same linker and the same configure script:

$ port -v installed fftw-3
The following ports are currently installed:
  fftw-3 @3.3.5_0 platform='darwin 9' archs='ppc' date='2017-07-02T07:47:57-0700'
  fftw-3 @3.3.5_1 platform='darwin 9' archs='ppc' date='2017-12-10T21:20:42-0800'
  fftw-3 @3.3.7_0 platform='darwin 9' archs='ppc' date='2018-04-12T00:24:25-0700'
  fftw-3 @3.3.8_0 platform='darwin 9' archs='ppc' date='2018-08-19T11:24:42-0700'
  fftw-3 @3.3.8_1 (active) platform='darwin 9' archs='ppc' date='2020-03-20T11:58:03-0700'

on 10.5 PPC building with gcc7, I get this:

configure:15255: result: no
configure:15264: checking whether C compiler accepts -Wl,-no_compact_unwind
configure:15283: /opt/local/bin/gcc-mp-7 -c -Wl,-no_compact_unwind -I/opt/local/include conftest.c >&5
configure:15283: $? = 0
configure:15293: result: yes

and on 10.5 PPC building with the default llvm-gcc-4.2, I get this:

configure:15255: result: no
configure:15264: checking whether C compiler accepts -Wl,-no_compact_unwind
configure:15283: /Developer/usr/bin/llvm-gcc-4.2 -std=gnu99 -c -Wl,-no_compact_unwind -I/opt/local/include conftest.c >&5
powerpc-apple-darwin9-llvm-gcc-4.2: -no_compact_unwind: linker input file unused because linking not done
Last edited 5 years ago by kencu (Ken) (previous) (diff)

comment:5 Changed 5 years ago by kencu (Ken)

Hmmm --- when using the default /Developer/usr/bin/llvm-gcc-4.2, the build is not using our ld64 to link...

LD='/Developer/usr/llvm-gcc-4.2/libexec/gcc/powerpc-apple-darwin9/4.2.1/ld'

That might turn out to be relevant.

comment:6 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

MacPorts GCC works fine for compiling and linking with -no_compact_unwind :

$ /opt/local/bin/gcc-mp-7 -v -Wl,-no_compact_unwind main.c
...
/opt/local/bin/ld -dynamic -arch ppc -macosx_version_min 10.5.8 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.5.o -L/opt/local/lib/gcc7/gcc/ppc-apple-darwin9/7.5.0 -L/opt/local/lib/gcc7/gcc/ppc-apple-darwin9/7.5.0/../../.. -no_compact_unwind /var/folders/C9/C9Jy09LJGbKai7NsxnaBQE+++TI/-Tmp-//ccDGqLTg.o -lgcc_s.10.5 -lgcc_ext.10.5 -lgcc -lSystem -lef_ppc -v

System GCC works fine for just compiling with -no_compact_unwind :

$ /Developer/usr/bin/llvm-gcc-4.2 -arch ppc -v -c -Wl,-no_compact_unwind main.c 

Albeit, there is a warning powerpc-apple-darwin9-llvm-gcc-4.2: -no_compact_unwind: linker input file unused because linking not done.

System GCC fails for compiling and linking with -no_compact_unwind :

$ /Developer/usr/bin/llvm-gcc-4.2 -arch ppc -v -Wl,-no_compact_unwind main.c
...
/Developer/usr/llvm-gcc-4.2/libexec/gcc/powerpc-apple-darwin9/4.2.1/collect2 -dynamic -arch ppc -macosx_version_min 10.5.8 -weak_reference_mismatches non-weak -o a.out -lcrt1.10.5.o -L/usr/lib/powerpc-apple-darwin9/4.2.1 -L/Developer/usr/llvm-gcc-4.2/lib/gcc/powerpc-apple-darwin9/4.2.1 -L/usr/lib/gcc/powerpc-apple-darwin9/4.2.1 -L/Developer/usr/llvm-gcc-4.2/lib/gcc/powerpc-apple-darwin9/4.2.1/../../.. -no_compact_unwind /var/folders/C9/C9Jy09LJGbKai7NsxnaBQE+++TI/-Tmp-//ccD7Zi4c.o -lgcc_s.10.5 -lgcc -lSystemStubs -lSystem
ld: unknown option: -no_compact_unwind
collect2: ld returned 1 exit status 

This confuses the configure script for fftw-3 because it checks if -Wl,-no_compact_unwind works only by compiling.

I believe the easiest solution is to add to the Portfile:

# see https://trac.macports.org/ticket/60145                                                                                                                                                                                                
if {${build_arch} eq "ppc" or ${build_arch} eq "ppc64"} {
    compiler.blacklist-append *gcc-3.* *gcc-4.*
}

comment:7 Changed 5 years ago by kencu (Ken)

I couldn't agree more. Just blacklist older gcc versions, and move on, as I did.

Leave the ppc test if you like, but I wouldn't personally bother to factor it so finely.

comment:8 Changed 5 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: assignedclosed

In 94cf3fd1364add08d1d8e7d82d67ec644ebbd2ad/macports-ports (master):

fftw-3: blacklist older compilers

Fixes #60145

Note: See TracTickets for help on using tickets.