Opened 4 months ago

Closed 4 months ago

#70087 closed defect (fixed)

plplot fails to build: cc1: error: argument to '-O' should be a non-negative integer, 'g', 's', 'z' or 'fast'

Reported by: barracuda156 Owned by: barracuda156
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: Cc: tenomoto (Takeshi Enomoto)
Port: plplot

Description

Okay, it passes non-existing flag, -ObjC:

[ 61%] Building C object src/CMakeFiles/plplot.dir/__/drivers/aqt.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/src && /opt/local/bin/gcc-mp-13 -DPLPLOT_HAVE_CONFIG_H -DUSINGDLL -Dplplot_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/lib/qsastime -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/qsastime -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/csa -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/nn -pipe -Os -DNDEBUG -I/opt/local/include -DUSE_INTERP_RESULT -DTcl_Import_TCL_DECLARED -arch ppc -fPIC -MD -MT src/CMakeFiles/plplot.dir/pltime.c.o -MF CMakeFiles/plplot.dir/pltime.c.o.d -o CMakeFiles/plplot.dir/pltime.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/src/pltime.c
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/src && /opt/local/bin/gcc-mp-13 -DPLPLOT_HAVE_CONFIG_H -DUSINGDLL -Dplplot_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/lib/qsastime -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/qsastime -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/csa -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/nn -pipe -Os -DNDEBUG -I/opt/local/include -DUSE_INTERP_RESULT -DTcl_Import_TCL_DECLARED -arch ppc -fPIC -ObjC -F/opt/local/Library/Frameworks -framework AquaTerm -MD -MT src/CMakeFiles/plplot.dir/__/drivers/aqt.c.o -MF CMakeFiles/plplot.dir/__/drivers/aqt.c.o.d -o CMakeFiles/plplot.dir/__/drivers/aqt.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/drivers/aqt.c
[ 61%] Building C object src/CMakeFiles/plplot.dir/pllegend.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/src && /opt/local/bin/gcc-mp-13 -DPLPLOT_HAVE_CONFIG_H -DUSINGDLL -Dplplot_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/lib/qsastime -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/qsastime -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/csa -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/nn -pipe -Os -DNDEBUG -I/opt/local/include -DUSE_INTERP_RESULT -DTcl_Import_TCL_DECLARED -arch ppc -fPIC -MD -MT src/CMakeFiles/plplot.dir/pllegend.c.o -MF CMakeFiles/plplot.dir/pllegend.c.o.d -o CMakeFiles/plplot.dir/pllegend.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/src/pllegend.c
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's', 'z' or 'fast'
[ 61%] Building C object src/CMakeFiles/plplot.dir/__/drivers/cairo.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/src && /opt/local/bin/gcc-mp-13 -DPLPLOT_HAVE_CONFIG_H -DUSINGDLL -Dplplot_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/lib/qsastime -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/qsastime -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/csa -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/nn -pipe -Os -DNDEBUG -I/opt/local/include -DUSE_INTERP_RESULT -DTcl_Import_TCL_DECLARED -arch ppc -fPIC -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include -I/opt/local/include/fribidi -I/opt/local/include -I/opt/local/include/harfbuzz -I/opt/local/include -I/opt/local/include/cairo -I/opt/local/include -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/pixman-1 -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include -MD -MT src/CMakeFiles/plplot.dir/__/drivers/cairo.c.o -MF CMakeFiles/plplot.dir/__/drivers/cairo.c.o.d -o CMakeFiles/plplot.dir/__/drivers/cairo.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/drivers/cairo.c
make[2]: *** [src/CMakeFiles/plplot.dir/__/drivers/aqt.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/usr/bin/make  -f examples/tcl/CMakeFiles/tclIndex_examples_tcl.dir/build.make examples/tcl/CMakeFiles/tclIndex_examples_tcl.dir/depend
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build'
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/examples/tcl /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/examples/tcl /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/examples/tcl/CMakeFiles/tclIndex_examples_tcl.dir/DependInfo.cmake "--color="
[ 62%] Building C object src/CMakeFiles/plplot.dir/__/drivers/mem.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/src && /opt/local/bin/gcc-mp-13 -DPLPLOT_HAVE_CONFIG_H -DUSINGDLL -Dplplot_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/lib/qsastime -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/qsastime -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/csa -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/lib/nn -pipe -Os -DNDEBUG -I/opt/local/include -DUSE_INTERP_RESULT -DTcl_Import_TCL_DECLARED -arch ppc -fPIC -MD -MT src/CMakeFiles/plplot.dir/__/drivers/mem.c.o -MF CMakeFiles/plplot.dir/__/drivers/mem.c.o.d -o CMakeFiles/plplot.dir/__/drivers/mem.c.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/drivers/mem.c
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build'
/usr/bin/make  -f examples/tcl/CMakeFiles/tclIndex_examples_tcl.dir/build.make examples/tcl/CMakeFiles/tclIndex_examples_tcl.dir/build
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build'
[ 62%] Generating tclIndex
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build/examples/tcl && /opt/local/bin/tclsh /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/plplot-5.15.0/scripts/mktclIndex -tcl
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build'
[ 86%] Built target tclIndex_examples_tcl
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build'
make[1]: *** [src/CMakeFiles/plplot.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_plplot/plplot/work/build'
make: *** [all] Error 2

Change History (9)

comment:1 Changed 4 months ago by barracuda156

I do not see where the source adds this flag btw.

comment:2 Changed 4 months ago by barracuda156

Ah, this: reinplace "s|-ObjC|-ObjC -framework AquaTerm|" ${worksrcpath}/cmake/modules/aqt.cmake.

Last edited 4 months ago by barracuda156 (previous) (diff)

comment:3 Changed 4 months ago by barracuda156

Unfortunately fixing flags does not suffice, it is broken badly further down:

[ 62%] Building C object src/CMakeFiles/plplot.dir/__/drivers/mem.c.o
cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_plplot/plplot/work/build/src && /opt/local/bin/gcc-mp-13 -DPLPLOT_HAVE_CONFIG_H -DUSINGDLL -Dplplot_EXPORTS -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_plplot/plplot/work/plplot-5.15.0/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_plplot/plplot/work/plplot-5.15.0/lib/qsastime -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_plplot/plplot/work/build -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_plplot/plplot/work/build/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_plplot/plplot/work/build/lib/qsastime -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_plplot/plplot/work/build/lib/csa -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_plplot/plplot/work/build/lib/nn -pipe -Os -DNDEBUG -I/opt/local/include -DUSE_INTERP_RESULT -DTcl_Import_TCL_DECLARED -arch ppc -fPIC -MD -MT src/CMakeFiles/plplot.dir/__/drivers/mem.c.o -MF CMakeFiles/plplot.dir/__/drivers/mem.c.o.d -o CMakeFiles/plplot.dir/__/drivers/mem.c.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_plplot/plplot/work/plplot-5.15.0/drivers/mem.c
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_plplot/plplot/work/plplot-5.15.0/drivers/aqt.c:32:
/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:149:1: error: stray '@' in program
  149 | @class NSString, Protocol;
      | ^
/usr/bin/make  -f examples/tcl/CMakeFiles/tclIndex_examples_tcl.dir/build.make examples/tcl/CMakeFiles/tclIndex_examples_tcl.dir/depend
/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:149:2: error: unknown type name 'class'; did you mean 'Class'?
  149 | @class NSString, Protocol;
      |  ^~~~~
      |  Class
/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:151:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
  151 | FOUNDATION_EXPORT NSString *NSStringFromSelector(SEL aSelector);
      |                            ^
/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:152:44: error: expected declaration specifiers or '...' before 'NSString'
  152 | FOUNDATION_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);
      |                                            ^~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:154:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
  154 | FOUNDATION_EXPORT NSString *NSStringFromClass(Class aClass);
      |                            ^
/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:155:43: error: expected declaration specifiers or '...' before 'NSString'
  155 | FOUNDATION_EXPORT Class NSClassFromString(NSString *aClassName);
      |                                           ^~~~~~~~

. . .

comment:4 in reply to:  1 ; Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to barracuda156:

I do not see where the source adds this flag btw.

It's right there in cmake/modules/aqt.cmake:

    set(aqt_COMPILE_FLAGS "-ObjC")

Replying to barracuda156:

Ah, this: reinplace "s|-ObjC|-ObjC -framework AquaTerm|" ${worksrcpath}/cmake/modules/aqt.cmake.

You can see that this reinplace does not add the -ObjC flag; it adds the -framework AquaTerm flag after the existing -ObjC flag.

Replying to barracuda156:

Unfortunately fixing flags does not suffice, it is broken badly further down:

/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:149:1: error: stray '@' in program
  149 | @class NSString, Protocol;
      | ^

What do you mean by "fixing flags"? If you mean removing -ObjC, I expect that is what caused this error. @class is Objective-C syntax. The compiler needs to be told to compile in Objective-C mode, which is presumably what the -ObjC flag was accomplishing.

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

Replying to ryandesign:

Replying to barracuda156:

I do not see where the source adds this flag btw.

It's right there in cmake/modules/aqt.cmake:

    set(aqt_COMPILE_FLAGS "-ObjC")

BBEdit search failed me.

What do you mean by "fixing flags"? If you mean removing -ObjC, I expect that is what caused this error. @class is Objective-C syntax. The compiler needs to be told to compile in Objective-C mode, which is presumably what the -ObjC flag was accomplishing.

Well, obviously a flag not supported by GCC must not be used with GCC. So flags are wrong. If GCC cannot compile the port, it should be blacklisted, or if only one module fails, it should be disabled, assuming a fix to the syntax is bothersome to come up with.

Version 0, edited 4 months ago by barracuda156 (next)

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

Replying to ryandesign:

UPD. It is still we are breaking it, but I pointed to a wrong place. This is the problem:

if {${os.platform} eq "darwin"} {
    default_variants    +aquaterm
}

This should be conditional on Clang used, and likely the port is fixed.

comment:8 in reply to:  6 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to barracuda156:

This should be conditional on Clang used, and likely the port is fixed.

What makes you think this flag is specific to clang? The flag was added to plplot in 2006 before clang existed.

https://sourceforge.net/p/plplot/plplot/ci/0db87c2b7f495f16e24c0bc4dd38a51c15c71bdc/

comment:9 Changed 4 months ago by barracuda156

Owner: set to barracuda156
Resolution: fixed
Status: newclosed

In 68f7373c5f2a8a761a41a1ab24bc614c91d10717/macports-ports (master):

plplot: use aquaterm variant only when building with clang

Fixes: #70087

Note: See TracTickets for help on using tickets.