NOAA-EMC / hpc-stack

Create a software stack for HPC's
GNU Lesser General Public License v2.1
30 stars 36 forks source link

Figure out and fix failing CI test for udunits. #50

Closed aerorahul closed 3 years ago

aerorahul commented 3 years ago

Describe the bug The udunits CI test on macOS is failing.

To Reproduce Create a branch and push. This will trigger the CI. Watch it fail.

Expected behavior The test should have passed.

System: Have not experienced this bug on any of the systems we are currently running on.

Additional context Issue has been opened with udunits at https://github.com/Unidata/UDUNITS-2/issues/97

aerorahul commented 3 years ago

The failing build is udunits with clang on macOS. Github updated the macOS runner and it contains Xcode 12. It seems clang v12 introduced errors for implicit declarations. Need to investigate further.

kgerheiser commented 3 years ago

Do you think there's any relation to https://github.com/NOAA-EMC/NCEPLIBS-external/issues/85?

Maybe the common factor is Xcode 12?

aerorahul commented 3 years ago

I think so @kgerheiser. Xcode 12 might be exposing a bug in udunits. I will turn off udunits in macOS for the time being. Since it is not a critical package, it should not impact any of the UFS or JEDI applications. We will keep this issue open till a new version of udunits is available.

edwardhartnett commented 3 years ago

You should also contact unidata or at least post on udunits issues list. Do not assume that someone is actively maintaining this - I'm not sure anyone is.

edwardhartnett commented 3 years ago

@aerorahul I think just turning off udunits is not a great fix for this. Do you plan on fixing it further?

If udunits is not a critical package, why are we building it at all?

aerorahul commented 3 years ago

I cannot fix it without UDUNITS group on fixing it. At best I can open an issue with udunits.

It is used in JEDI as an optional package.

edwardhartnett commented 3 years ago

Did you open an issue with udunits group?

Are they planning in fixing it? If so, when?

If not, can you submit a PR to udunits with a fix?

aerorahul commented 3 years ago

For reference, this is the build log for udunits and clang

../configure --prefix=/Users/runner/work/hpc-stack/hpc-stack/install-clang-mpich --disable-shared --enable-static
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ../build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of clang... gcc3
checking whether clang and cc understand -c and -o together... yes
checking how to run the C preprocessor... clang -E
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for bison... bison -y
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -ll
checking whether yytext is a pointer... yes
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran-9 accepts -g... yes
checking for library containing dirname... none required
checking for library containing log10... none required
checking for library containing XML_StopParser... -lexpat
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking for inttypes.h... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
configure: Checking for the CUNIT unit-testing package.
checking CUnit/CUnit.h usability... no
checking CUnit/CUnit.h presence... no
checking for CUnit/CUnit.h... no
configure: CUNIT not found.  Disabling unit-tests.
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for floor... yes
checking for memmove... yes
checking for memset... yes
checking for modf... yes
checking for pow... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strpbrk... yes
checking build system type... x86_64-apple-darwin19.6.0
checking host system type... x86_64-apple-darwin19.6.0
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by clang... /Applications/Xcode_12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode_12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-apple-darwin19.6.0 file names to x86_64-apple-darwin19.6.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin19.6.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode_12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from clang object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if clang supports -fno-rtti -fno-exceptions... yes
checking for clang option to produce PIC... -fno-common -DPIC
checking if clang PIC flag -fno-common -DPIC works... yes
checking if clang static flag -static works... no
checking if clang supports -c -o file.o... yes
checking if clang supports -c -o file.o... (cached) yes
checking whether the clang linker (/Applications/Xcode_12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin19.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for gfortran-9 option to produce PIC... -fno-common
checking if gfortran-9 PIC flag -fno-common works... yes
checking if gfortran-9 static flag -static works... no
checking if gfortran-9 supports -c -o file.o... yes
checking if gfortran-9 supports -c -o file.o... (cached) yes
checking whether the gfortran-9 linker (/Applications/Xcode_12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin19.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lib/Makefile
config.status: creating lib/xmlFailures/Makefile
config.status: creating lib/xmlSuccesses/Makefile
config.status: creating prog/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
+ make -j4
/Applications/Xcode_12.app/Contents/Developer/usr/bin/make  all-recursive
Making all in lib
/Applications/Xcode_12.app/Contents/Developer/usr/bin/make  all-recursive
Making all in xmlFailures
make[4]: Nothing to be done for `all'.
Making all in xmlSuccesses
make[4]: Nothing to be done for `all'.
depbase=`echo unitcore.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
    /bin/sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I../../lib -I..   -DNDEBUG  -fPIC -MT unitcore.lo -MD -MP -MF $depbase.Tpo -c -o unitcore.lo ../../lib/unitcore.c &&\
    mv -f $depbase.Tpo $depbase.Plo
depbase=`echo converter.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
    /bin/sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I../../lib -I..   -DNDEBUG  -fPIC -MT converter.lo -MD -MP -MF $depbase.Tpo -c -o converter.lo ../../lib/converter.c &&\
    mv -f $depbase.Tpo $depbase.Plo
depbase=`echo formatter.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
    /bin/sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I../../lib -I..   -DNDEBUG  -fPIC -MT formatter.lo -MD -MP -MF $depbase.Tpo -c -o formatter.lo ../../lib/formatter.c &&\
    mv -f $depbase.Tpo $depbase.Plo
depbase=`echo idToUnitMap.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
    /bin/sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I../../lib -I..   -DNDEBUG  -fPIC -MT idToUnitMap.lo -MD -MP -MF $depbase.Tpo -c -o idToUnitMap.lo ../../lib/idToUnitMap.c &&\
    mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I../../lib -I.. -DNDEBUG -fPIC -MT converter.lo -MD -MP -MF .deps/converter.Tpo -c ../../lib/converter.c -o converter.o
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I../../lib -I.. -DNDEBUG -fPIC -MT unitcore.lo -MD -MP -MF .deps/unitcore.Tpo -c ../../lib/unitcore.c -o unitcore.o
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I../../lib -I.. -DNDEBUG -fPIC -MT formatter.lo -MD -MP -MF .deps/formatter.Tpo -c ../../lib/formatter.c -o formatter.o
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I../../lib -I.. -DNDEBUG -fPIC -MT idToUnitMap.lo -MD -MP -MF .deps/idToUnitMap.Tpo -c ../../lib/idToUnitMap.c -o idToUnitMap.o
../../lib/converter.c:187:12: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
    return snprintf(buf, max, "%s", variable);
           ^
../../lib/converter.c:187:12: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
1 error generated.
../../lib/unitcore.c:415:19: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
    int n = (int)(abs(numer)/denom);
                  ^
../../lib/unitcore.c:415:19: note: use function 'fabs' instead
    int n = (int)(abs(numer)/denom);
                  ^~~
                  fabs
../../lib/formatter.c:234:8: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
            : snprintf(buf, size, "%s", id);
              ^
../../lib/formatter.c:234:8: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
make[4]: *** [converter.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
1 error generated.
make[4]: *** [formatter.lo] Error 1
1 warning generated.
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
aerorahul commented 3 years ago

Issue opened at Udunits https://github.com/Unidata/UDUNITS-2/issues/97

aerorahul commented 3 years ago

fixed by updating udunits.