Opened 3 years ago
Closed 3 years ago
#62867 closed defect (fixed)
ncarg: sh: -Wno-error=implicit-function-declaration: command not found
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | tenomoto (Takeshi Enomoto) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.4 |
Keywords: | haspatch | Cc: | Dave-Allured (Dave Allured) |
Port: | ncarg |
Description
DEBUG: system -W /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_ncarg/ncarg/work/ncl-6.6.2/config: CC=/opt/local/bin/h5cc CFLAGS=-Os -Wno-error=implicit-function-declaration -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk make -f Makefile.ini; ./ymake -config `pwd` sh: -Wno-error=implicit-function-declaration: command not found /dev/tty: Device not configured.
So there are two problems:
First, when you pass CFLAGS to ymake you need to enclose them in quotation marks:
-
Portfile
old new 169 169 # run ymake 170 170 system -W ${worksrcpath}/config \ 171 171 "CC=${configure.cc} \ 172 CFLAGS= ${configure.cflags}\172 CFLAGS=\"${configure.cflags}\" \ 173 173 make -f Makefile.ini; \ 174 174 ./ymake -config `pwd`"
Second, -Wno-error=implicit-function-declaration
needs to be removed because masking implicit function declaration errors will most likely just result in a build on Apple Silicon systems that does not work correctly:
-
Portfile
old new 106 106 } 107 107 } 108 108 109 configure.cflags-append -Wno-error=implicit-function-declaration110 109 if {${configure.sdkroot} ne ""} { 111 110 configure.cflags-append -isysroot ${configure.sdkroot} 112 111 configure.fflags-append -isysroot ${configure.sdkroot}
After removing this flag, the build should fail with Xcode 12 and later with some implicit declaration of function errors as originally reported in #61275. They will need to be fixed properly, by declaring functions before calling them, e.g. by including the appropriate headers. You don't need to do it yourself; you can report the problem to the developers and have them do it. If they won't do it and you don't want to, then using -Wno-error=implicit-function-declaration
is acceptable for Intel systems but you should then remove arm64 from supported_archs.
Change History (4)
comment:1 Changed 3 years ago by Dave-Allured (Dave Allured)
Cc: | Dave-Allured added |
---|
comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | haspatch added |
---|
comment:4 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I originally filed this ticket thinking
sh: -Wno-error=implicit-function-declaration: command not found
was the cause of the build failure I was seeing, but I see now that it's not. I filed a new ticket about the actual cause of the build failure (#64710).On my Intel system, although I get:
the build then continues and finishes.
I wondered whether
make -f Makefile.ini
and./ymake -config `pwd`
not having run properly means that ncarg was built improperly or in any way differently. But I think that's not the case. It looks to me likemake -f Makefile.ini
compiles config/ymake-filter, and config/ymake uses config/ymake-filter to create config/makefile. So currently, with the Portfile quoting problem, config/makefile doesn't get created properly when the portfile tries to run ymake, but I see in the log that it does get run automatically by the build system later.I ran two builds, one with the current portfile code and one with my revised code, and the relevant diff between the logs is:
.log
-Wno-error=implicit-function-declaration -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk make -f Makefile.ini; ./ymake -config `pwd`sh: -Wno-error=implicit-function-declaration: command not foundvar/macports/build/.../ncarg/work/ncl-6.6.2/config/ymake-filter: Command not found.:info:configure Making ymake from Makefile.ini in ./config first:info:configure cc -O -c -o ymake-filter.o ymake-filter.c:info:configure cc -O -o ymake-filter ymake-filter.o:info:configure Continuing in: /opt/local/var/macports/build/.../ncarg/work/ncl-6.6.2So here is the patch I propose:
(The
;
betweenmake -f Makefile.ini
and./ymake -config `pwd`
should be changed to&&
so that failure of the first command will cause an error rather than allowing the second command to run.)science/ncarg/Portfile
${configure.cflags}\;\According to http://ngwww.ucar.edu "NCAR Graphics is no longer supported" so I guess we won't be getting any help from them to resolve the implicit declaration of functions. Since the port already cannot build on arm64 for other reasons (#64710), continuing to suppress the implicit declaration of function errors is acceptable.