I'm trying to build gsl 2.7
on aws Graviton3 using 

$ armclang --version
Arm C/C++/Fortran Compiler version 23.10 (build number 32) (based on LLVM 
17.0.0)

I configure with:

../configure CC=armclang F77=armflang F90=armflang 'CFLAGS=-std=c99 
-Wbad-function-cast -Wall -Wextra -Wpedantic -Wshadow -g -fopenmp 
-mcpu=neoverse-512tvb -march=armv8.4-a+sve' 'FCFLAGS=-Wall -Wextra -Wpedantic 
-Wshadow -g -fopenmp -mcpu=neoverse-512tvb -march=armv8.4-a+sve' --build=armv8


That completes fine.

The build also completes fine.

However, when I do "make -j 1 check" I get to this error:

libtool: link: armclang -std=c99 -Wbad-function-cast -Wall -Wextra -Wpedantic 
-Wshadow -g -fopenmp -mcpu=neoverse-512tvb -march=armv8.4-a+sve -o test test.o  
./.libs/libgslmultifit.a ../linalg/.libs/libgsllinalg.a 
../permutation/.libs/libgslpermutation.a ../blas/.libs/libgslblas.a 
../cblas/.libs/libgslcblas.a ../matrix/.libs/libgslmatrix.a 
../sort/.libs/libgslsort.a ../statistics/.libs/libgslstatistics.a 
../vector/.libs/libgslvector.a ../block/.libs/libgslblock.a 
../complex/.libs/libgslcomplex.a ../ieee-utils/.libs/libgslieeeutils.a 
../err/.libs/libgslerr.a ../test/.libs/libgsltest.a ../utils/.libs/libutils.a 
../sys/.libs/libgslsys.a ../rng/.libs/libgslrng.a 
../specfunc/.libs/libgslspecfunc.a ../min/.libs/libgslmin.a -lm -fopenmp
/bm/ashterenli/install/arm-compiler-for-linux_23.10_AmazonLinux-2/gcc-12.2.0_AmazonLinux-2/lib/gcc/aarch64-linux-gnu/12.2.0/../../../../aarch64-linux-gnu/bin/ld:
 ../specfunc/.libs/libgslspecfunc.a(trig.o): in function `gsl_sf_hypot_e':
trig.c:(.text+0xa5c): undefined reference to `GSL_MIN_DBL'
/bm/ashterenli/install/arm-compiler-for-linux_23.10_AmazonLinux-2/gcc-12.2.0_AmazonLinux-2/lib/gcc/aarch64-linux-gnu/12.2.0/../../../../aarch64-linux-gnu/bin/ld:
 trig.c:(.text+0xa6c): undefined reference to `GSL_MAX_DBL'
/bm/ashterenli/install/arm-compiler-for-linux_23.10_AmazonLinux-2/gcc-12.2.0_AmazonLinux-2/lib/gcc/aarch64-linux-gnu/12.2.0/../../../../aarch64-linux-gnu/bin/ld:
 ../min/.libs/libgslmin.a(convergence.o): in function `gsl_min_test_interval':
convergence.c:(.text+0x16c): undefined reference to `GSL_MIN_DBL'
armclang: error: linker command failed with exit code 1 (use -v to see 
invocation)
make[2]: *** [test] Error 1
make[2]: Leaving directory `/home/ec2-user/tmp/1706196600/gsl-2.7/bld/multifit'
make[1]: *** [check-am] Error 2


I don't really understand it.

The compiler does support inlining --- from configure:

checking for inline... inline
checking for GNU-style extern inline... no
checking for C99-style inline... yes

and the configure variables are set correctly:

ac_cv_c_c99inline=yes
ac_cv_c_extern_inline=no
ac_cv_c_inline=inline


which means both HAVE_INLINE and HAVE_C99_INLINE should be set ---
L157-158 in configure.ac:

142    if test "$ac_cv_c_extern_inline" != no ; then
143       AC_DEFINE(HAVE_INLINE,[1],[Define if you have inline])
144    else
145       AC_CACHE_CHECK([for C99-style inline], ac_cv_c_c99inline,
146       [ac_cv_c_c99inline=no
147       dnl next line is a necessary condition
148       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern inline void* foo() { 
foo(); return &foo ; };]],
149       [[  return foo() != 0 ]])],[ac_cv_c_c99inline="yes"],[])
150       dnl but not sufficient, extern must work but inline on its own should 
not
151       if test "$ac_cv_c_c99inline" != no ; then
152             AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[inline void* foo() { 
foo(); return &foo ; };]],
153             [[  return foo() != 0 ]])],[],ac_cv_c_c99inline="no")
154       fi
155       ])
156       if test "$ac_cv_c_c99inline" != no ; then
157          AC_DEFINE(HAVE_INLINE,[1],[Define if you have inline])
158          AC_DEFINE(HAVE_C99_INLINE,[1],[Define if you have inline with C99 
behavior])
159       fi
160    fi


which means --- from gsl_inline.h --- that INLINE_DECL and
INLINE_FUN are both set to "inline" in L51-52:


 49 #ifdef HAVE_INLINE
 50 #  if defined(__GNUC_STDC_INLINE__) || defined(GSL_C99_INLINE) || 
defined(HAVE_C99_INLINE)
 51 #    define INLINE_DECL inline  /* use C99 inline */
 52 #    define INLINE_FUN inline
 53 #  else
 54 #    define INLINE_DECL         /* use GNU extern inline */
 55 #    define INLINE_FUN extern inline
 56 #  endif
 57 #else
 58 #  define INLINE_DECL /* */
 59 #endif


which finally means that GSL_MAX_DBL and GSL_MIN_DBL should be set in L51-52 in 
gsl_minmax.h:


 47 #ifdef HAVE_INLINE
 48   49 INLINE_FUN int GSL_MAX_INT (int a, int b);
 50 INLINE_FUN int GSL_MIN_INT (int a, int b);
 51 INLINE_FUN double GSL_MAX_DBL (double a, double b);
 52 INLINE_FUN double GSL_MIN_DBL (double a, double b);


Any ideas?

Thank you

Anton


Reply via email to