diff --git a/configure b/configure index bdea1887..527fdec0 100755 --- a/configure +++ b/configure @@ -686,6 +686,8 @@ GAMS_PATH gamspath GMSGENEXE GMSGENSCRIPT +COIN_HAS_LAPACK_FALSE +COIN_HAS_LAPACK_TRUE GAMSLIBCFLAGS COIN_HAS_GUROBI_FALSE COIN_HAS_GUROBI_TRUE @@ -950,6 +952,8 @@ with_xpress_cflags with_gurobi with_gurobi_lflags with_gurobi_cflags +with_lapack +with_lapack_lflags with_gams ' ac_precious_vars='build_alias @@ -1774,6 +1778,12 @@ Optional Packages: --with-gurobi-cflags Compiler flags for Gurobi appropriate for your environment. (Most often, -I specs for header file directories.) + --with-lapack Use lapack. If an argument is given, 'yes' is + equivalent to --with-lapack, 'no' is + equivalent to --without-lapack. Any other argument + is applied as for --with-lapack-lflags + --with-lapack-lflags Linker flags for lapack appropriate for your + environment. (Most often, -l specs for libraries.) --with-gams specify directory of GAMS distribution Some influential environment variables: @@ -22046,29 +22056,61 @@ fi done -# if we have Ipopt, check if we have GotoBlas or MKL Blas functions to set number of threads -if test $coin_has_ipopt = yes ; then +# if we have Lapack, check if we have GotoBlas or MKL Blas functions to set number of threads - ac_save_LIBS="$LIBS" - LIBS="$ipopt_lflags $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LAPACK" >&5 +printf %s "checking for LAPACK... " >&6; } - if test -n "$ipopt_pcfiles" ; then - temp_LFLAGS=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --libs $pkg_static $ipopt_pcfiles` - LIBS="$temp_LFLAGS $LIBS" + + + + + + +# Check whether --with-lapack was given. +if test ${with_lapack+y} +then : + withval=$with_lapack; +fi + + + +# Check whether --with-lapack-lflags was given. +if test ${with_lapack_lflags+y} +then : + withval=$with_lapack_lflags; +fi + + + + + + + + coin_has_lapack=no + lapack_keep_looking=yes + + if test "$with_lapack" != "no" ; then + if test "$with_lapack" != "yes" ; then + with_lapack_lflags="$with_lapack" fi + if test -n "$with_lapack_lflags" ; then + ac_save_LIBS="$LIBS" + LIBS="$with_lapack_lflags $LIBS" - goto_set_num_threads_namemangling=unknown + + dsyev_namemangling=unknown for ac_extra in "no extra underscore" "extra underscore" ; do for ac_case in "lower case" "upper case" ; do for ac_trail in "underscore" "no underscore" ; do case $ac_case in "lower case") - ac_name=goto_set_num_threads + ac_name=dsyev ;; "upper case") - ac_name=GOTO_SET_NUM_THREADS + ac_name=DSYEV ;; esac if test "$ac_trail" = "underscore" ; then @@ -22077,8 +22119,7 @@ if test $coin_has_ipopt = yes ; then if test "$ac_extra" = "extra underscore" ; then ac_name=${ac_name}_ fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for function $ac_name in $LIBS" >&5 -printf %s "checking for function $ac_name in $LIBS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22096,15 +22137,14 @@ return $ac_name (); _ACEOF if ac_fn_c_try_link "$LINENO" then : - goto_set_num_threads_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" + dsyev_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" ac_success=yes else $as_nop ac_success=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_success" >&5 -printf "%s\n" "$ac_success" >&6; } + if test $ac_success = yes ; then break 3 fi @@ -22114,34 +22154,43 @@ printf "%s\n" "$ac_success" >&6; } LIBS=$ac_save_LIBS if test $ac_success = yes ; then + coin_has_lapack=yes + lapack_what="user-specified ($with_lapack_lflags)" + lapack_keep_looking=no + lapack_lflags=$with_lapack_lflags + else as_fn_error $? "Cannot link to user-specified Lapack $with_lapack_lflags." "$LINENO" 5 + fi -printf "%s\n" "#define HAVE_GOTO_SETNUMTHREADS 1" >>confdefs.h - - - + fi + else + lapack_keep_looking=no + lapack_what="user-specified" fi - ac_save_LIBS="$LIBS" - LIBS="$ipopt_lflags $LIBS" + if test "$lapack_keep_looking" = yes ; then + case $build in + *-linux*) + case " " in + *\ int64\ * ) coin_mkl="-lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lm" ;; + *) coin_mkl="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lm" ;; + esac - if test -n "$ipopt_pcfiles" ; then - temp_LFLAGS=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --libs $pkg_static $ipopt_pcfiles` - LIBS="$temp_LFLAGS $LIBS" - fi + ac_save_LIBS="$LIBS" + LIBS="$coin_mkl $LIBS" - omp_set_num_threads_namemangling=unknown + dsyev_namemangling=unknown for ac_extra in "no extra underscore" "extra underscore" ; do for ac_case in "lower case" "upper case" ; do for ac_trail in "underscore" "no underscore" ; do case $ac_case in "lower case") - ac_name=omp_set_num_threads + ac_name=dsyev ;; "upper case") - ac_name=OMP_SET_NUM_THREADS + ac_name=DSYEV ;; esac if test "$ac_trail" = "underscore" ; then @@ -22150,8 +22199,7 @@ printf "%s\n" "#define HAVE_GOTO_SETNUMTHREADS 1" >>confdefs.h if test "$ac_extra" = "extra underscore" ; then ac_name=${ac_name}_ fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for function $ac_name in $LIBS" >&5 -printf %s "checking for function $ac_name in $LIBS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22169,15 +22217,14 @@ return $ac_name (); _ACEOF if ac_fn_c_try_link "$LINENO" then : - omp_set_num_threads_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" + dsyev_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" ac_success=yes else $as_nop ac_success=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_success" >&5 -printf "%s\n" "$ac_success" >&6; } + if test $ac_success = yes ; then break 3 fi @@ -22187,158 +22234,879 @@ printf "%s\n" "$ac_success" >&6; } LIBS=$ac_save_LIBS if test $ac_success = yes ; then + coin_has_lapack=yes + lapack_lflags="$coin_mkl" + lapack_what="Intel MKL ($lapack_lflags)" -printf "%s\n" "#define HAVE_OMP_SETNUMTHREADS 1" >>confdefs.h + fi + ;; - fi + *-*-solaris*) + case " " in + *\ int64\ * ) ;; + *) + ac_save_LIBS="$LIBS" + LIBS="-lsunperf $LIBS" -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -printf %s "checking for dlopen in -ldl... " >&6; } -if test ${ac_cv_lib_dl_dlopen+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + dsyev_namemangling=unknown + + for ac_extra in "no extra underscore" "extra underscore" ; do + for ac_case in "lower case" "upper case" ; do + for ac_trail in "underscore" "no underscore" ; do + case $ac_case in + "lower case") + ac_name=dsyev + ;; + "upper case") + ac_name=DSYEV + ;; + esac + if test "$ac_trail" = "underscore" ; then + ac_name=${ac_name}_ + fi + if test "$ac_extra" = "extra underscore" ; then + ac_name=${ac_name}_ + fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -char dlopen (); +char $ac_name (); int main (void) { -return dlopen (); +return $ac_name (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : - ac_cv_lib_dl_dlopen=yes + dsyev_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" + ac_success=yes else $as_nop - ac_cv_lib_dl_dlopen=no + ac_success=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes -then : - GAMSBONMIN_LFLAGS="$GAMSBONMIN_LFLAGS -ldl" - GAMSCBC_LFLAGS="$GAMSCBC_LFLAGS -ldl" - GAMSCOUENNE_LFLAGS="$GAMSCOUENNE_LFLAGS -ldl" - GAMSIPOPT_LFLAGS="$GAMSIPOPT_LFLAGS -ldl" - GAMSOSI_LFLAGS="$GAMSOSI_LFLAGS -ldl" - GAMSSCIP_LFLAGS="$GAMSSCIP_LFLAGS -ldl" - GAMSSOPLEX_LFLAGS="$GAMSSOPLEX_LFLAGS -ldl" + if test $ac_success = yes ; then + break 3 + fi + done + done + done + LIBS=$ac_save_LIBS -fi + if test $ac_success = yes ; then + coin_has_lapack=yes + lapack_lflags=-lsunperf + lapack_what="Sun Performance Library ($lapack_lflags)" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + fi + ;; + esac + ;; + *-cygwin* | *-mingw* | *-msys*) + old_IFS="$IFS" + IFS=";" + coin_mkl="" + for d in $LIB ; do + # turn $d into unix-style short path (no spaces); cannot do -us, + # so first do -ws, then -u + d=`cygpath -ws "$d"` + d=`cygpath -u "$d"` + if test "$enable_shared" = yes ; then + if test -e "$d/mkl_core_dll.lib" ; then + case " " in + *\ int64\ * ) coin_mkl="$d/mkl_intel_ilp64_dll.lib $d/mkl_sequential_dll.lib $d/mkl_core_dll.lib" ;; + *) coin_mkl="$d/mkl_intel_lp64_dll.lib $d/mkl_sequential_dll.lib $d/mkl_core_dll.lib" ;; + esac + break + fi + else + if test -e "$d/mkl_core.lib" ; then + case " " in + *\ int64\ * ) coin_mkl="$d/mkl_intel_ilp64.lib $d/mkl_sequential.lib $d/mkl_core.lib" ;; + *) coin_mkl="$d/mkl_intel_lp64.lib $d/mkl_sequential.lib $d/mkl_core.lib" ;; + esac + break + fi + fi + done + IFS="$old_IFS" + if test -n "$coin_mkl" ; then -# name of gensolver script and exe -case $build in - *-mingw* | *-cygwin* | *-msys* ) - GMSGENSCRIPT=gmsgennt.cmd - GMSGENEXE=gmsgennx.exe - ;; - *) - GMSGENSCRIPT=gmsgenus.run - GMSGENEXE=gmsgenux.out - ;; -esac + ac_save_LIBS="$LIBS" + LIBS="$coin_mkl $LIBS" + dsyev_namemangling=unknown -############### -# GAMS system # -############### + for ac_extra in "no extra underscore" "extra underscore" ; do + for ac_case in "lower case" "upper case" ; do + for ac_trail in "underscore" "no underscore" ; do + case $ac_case in + "lower case") + ac_name=dsyev + ;; + "upper case") + ac_name=DSYEV + ;; + esac + if test "$ac_trail" = "underscore" ; then + ac_name=${ac_name}_ + fi + if test "$ac_extra" = "extra underscore" ; then + ac_name=${ac_name}_ + fi -GAMS_PATH=UNAVAILABLE + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# Check whether --with-gams was given. -if test ${with_gams+y} -then : - withval=$with_gams; if test "$withval" != no ; then - as_ac_File=`printf "%s\n" "ac_cv_file_$withval/gams" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $withval/gams" >&5 -printf %s "checking for $withval/gams... " >&6; } -if eval test \${$as_ac_File+y} -then : - printf %s "(cached) " >&6 -else $as_nop - test "$cross_compiling" = yes && - as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 -if test -r "$withval/gams"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -eval ac_res=\$$as_ac_File - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_ac_File"\" = x"yes" +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $ac_name (); +int +main (void) +{ +return $ac_name (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" then : - GAMS_PATH=$withval + dsyev_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" + ac_success=yes else $as_nop - GAMS_PATH=UNAVAILABLE + ac_success=no fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + if test $ac_success = yes ; then + break 3 + fi + done + done + done + LIBS=$ac_save_LIBS + + if test $ac_success = yes ; then + coin_has_lapack=yes + lapack_lflags="$coin_mkl" + lapack_what="Intel MKL ($lapack_lflags)" - fi -else $as_nop - # Extract the first word of "gams", so it can be a program name with args. -set dummy gams; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_gamspath+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $gamspath in - [\\/]* | ?:[\\/]*) - ac_cv_path_gamspath="$gamspath" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_gamspath="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 fi -done - done -IFS=$as_save_IFS - test -z "$ac_cv_path_gamspath" && ac_cv_path_gamspath="UNAVAILABLE" - ;; -esac + fi + ;; + + *-darwin*) + case " " in + *\ int64\ * ) coin_mkl="-lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lm" ;; + *) coin_mkl="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lm" ;; + esac + + ac_save_LIBS="$LIBS" + LIBS="$coin_mkl $LIBS" + + + dsyev_namemangling=unknown + + for ac_extra in "no extra underscore" "extra underscore" ; do + for ac_case in "lower case" "upper case" ; do + for ac_trail in "underscore" "no underscore" ; do + case $ac_case in + "lower case") + ac_name=dsyev + ;; + "upper case") + ac_name=DSYEV + ;; + esac + if test "$ac_trail" = "underscore" ; then + ac_name=${ac_name}_ + fi + if test "$ac_extra" = "extra underscore" ; then + ac_name=${ac_name}_ + fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $ac_name (); +int +main (void) +{ +return $ac_name (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + dsyev_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" + ac_success=yes +else $as_nop + ac_success=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + if test $ac_success = yes ; then + break 3 + fi + done + done + done + LIBS=$ac_save_LIBS + + if test $ac_success = yes ; then + coin_has_lapack=yes + lapack_lflags="$coin_mkl" + lapack_what="Intel MKL ($lapack_lflags)" + + + fi + + if test "$coin_has_lapack" = no ; then + case " " in + *\ int64\ * ) ;; + *) + ac_save_LIBS="$LIBS" + LIBS="-framework Accelerate $LIBS" + + + dsyev_namemangling=unknown + + for ac_extra in "no extra underscore" "extra underscore" ; do + for ac_case in "lower case" "upper case" ; do + for ac_trail in "underscore" "no underscore" ; do + case $ac_case in + "lower case") + ac_name=dsyev + ;; + "upper case") + ac_name=DSYEV + ;; + esac + if test "$ac_trail" = "underscore" ; then + ac_name=${ac_name}_ + fi + if test "$ac_extra" = "extra underscore" ; then + ac_name=${ac_name}_ + fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $ac_name (); +int +main (void) +{ +return $ac_name (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + dsyev_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" + ac_success=yes +else $as_nop + ac_success=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + if test $ac_success = yes ; then + break 3 + fi + done + done + done + LIBS=$ac_save_LIBS + + if test $ac_success = yes ; then + coin_has_lapack=yes + lapack_lflags="-framework Accelerate" + lapack_what="Accelerate framework ($lapack_lflags)" + + + fi + + ;; + esac + fi + ;; + esac + if test "$coin_has_lapack" = yes ; then + lapack_keep_looking=no + fi + fi + + if test "$lapack_keep_looking" = yes ; then + case " " in + *\ int64\ * ) ;; + *) + + + if test -n "$PKG_CONFIG" ; then + if PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --exists "lapack blas" ; then + LAPACK_VERSIONS=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --modversion "lapack blas" 2>/dev/null | tr '\n' ' '` + lapack_what="generic module (lapack.pc blas.pc)" + + ac_save_LIBS="$LIBS" + + + if test -n "lapack" ; then + temp_LFLAGS=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --libs $pkg_static lapack` + LIBS="$temp_LFLAGS $LIBS" + fi + + + dsyev_namemangling=unknown + + for ac_extra in "no extra underscore" "extra underscore" ; do + for ac_case in "lower case" "upper case" ; do + for ac_trail in "underscore" "no underscore" ; do + case $ac_case in + "lower case") + ac_name=dsyev + ;; + "upper case") + ac_name=DSYEV + ;; + esac + if test "$ac_trail" = "underscore" ; then + ac_name=${ac_name}_ + fi + if test "$ac_extra" = "extra underscore" ; then + ac_name=${ac_name}_ + fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $ac_name (); +int +main (void) +{ +return $ac_name (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + dsyev_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" + ac_success=yes +else $as_nop + ac_success=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + if test $ac_success = yes ; then + break 3 + fi + done + done + done + LIBS=$ac_save_LIBS + + if test $ac_success = yes ; then + coin_has_lapack=yes + lapack_keep_looking=no + lapack_pcfiles="lapack blas" + else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: lapack.pc and blas.pc present, but could not find dsyev when trying to link with LAPACK." >&5 +printf "%s\n" "$as_me: WARNING: lapack.pc and blas.pc present, but could not find dsyev when trying to link with LAPACK." >&2;} + fi + + + else + LAPACK_PKG_ERRORS=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG $pkg_short_errors --errors-to-stdout --print-errors "lapack blas"` + + fi + else + as_fn_error $? "\"Cannot check for existence of module lapack without pkgconf\"" "$LINENO" 5 + fi + + ;; + esac + fi + + if test "$lapack_keep_looking" = yes ; then + case " " in + *\ int64\ * ) coin_lapack="-llapack64 -lblas64" ;; + *) coin_lapack="-llapack -lblas" ;; + esac + + ac_save_LIBS="$LIBS" + LIBS="$coin_lapack $LIBS" + + + dsyev_namemangling=unknown + + for ac_extra in "no extra underscore" "extra underscore" ; do + for ac_case in "lower case" "upper case" ; do + for ac_trail in "underscore" "no underscore" ; do + case $ac_case in + "lower case") + ac_name=dsyev + ;; + "upper case") + ac_name=DSYEV + ;; + esac + if test "$ac_trail" = "underscore" ; then + ac_name=${ac_name}_ + fi + if test "$ac_extra" = "extra underscore" ; then + ac_name=${ac_name}_ + fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $ac_name (); +int +main (void) +{ +return $ac_name (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + dsyev_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" + ac_success=yes +else $as_nop + ac_success=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + if test $ac_success = yes ; then + break 3 + fi + done + done + done + LIBS=$ac_save_LIBS + + if test $ac_success = yes ; then + coin_has_lapack=yes + lapack_lflags="$coin_lapack" + lapack_what="generic library ($lapack_lflags)" + + fi + + fi + + case "$coin_has_lapack" in + yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $coin_has_lapack: $lapack_what" >&5 +printf "%s\n" "$coin_has_lapack: $lapack_what" >&6; } + ;; + no) + if test -n "$lapack_what" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $coin_has_lapack ($lapack_what)" >&5 +printf "%s\n" "$coin_has_lapack ($lapack_what)" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $coin_has_lapack" >&5 +printf "%s\n" "$coin_has_lapack" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: CHK_LAPACK: unexpected result '$coin_has_lapack'" >&5 +printf "%s\n" "$as_me: WARNING: CHK_LAPACK: unexpected result '$coin_has_lapack'" >&2;} + ;; + esac + + if test $coin_has_lapack = yes; then + COIN_HAS_LAPACK_TRUE= + COIN_HAS_LAPACK_FALSE='#' +else + COIN_HAS_LAPACK_TRUE='#' + COIN_HAS_LAPACK_FALSE= +fi + + + if test $coin_has_lapack = yes ; then + +printf "%s\n" "#define GAMSLINKS_HAS_LAPACK 1" >>confdefs.h + + + + + case "${dsyev_namemangling}" in + "lower case, no underscore, no extra underscore") + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC(name,NAME) name" >>confdefs.h + + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC_(name,NAME) name" >>confdefs.h + ;; + "lower case, no underscore, extra underscore") + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC(name,NAME) name" >>confdefs.h + + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC_(name,NAME) name ## _" >>confdefs.h + ;; + "lower case, underscore, no extra underscore") + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC(name,NAME) name ## _" >>confdefs.h + + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC_(name,NAME) name ## _" >>confdefs.h + ;; + "lower case, underscore, extra underscore") + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC(name,NAME) name ## _" >>confdefs.h + + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC_(name,NAME) name ## __" >>confdefs.h + ;; + "upper case, no underscore, no extra underscore") + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC(name,NAME) NAME" >>confdefs.h + + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC_(name,NAME) NAME" >>confdefs.h + ;; + "upper case, no underscore, extra underscore") + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC(name,NAME) NAME" >>confdefs.h + + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC_(name,NAME) NAME ## _" >>confdefs.h + ;; + "upper case, underscore, no extra underscore") + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC(name,NAME) NAME ## _" >>confdefs.h + + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC_(name,NAME) NAME ## _" >>confdefs.h + ;; + "upper case, underscore, extra underscore") + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC(name,NAME) NAME ## _" >>confdefs.h + + printf "%s\n" "#define GAMSLINKS_LAPACK_FUNC_(name,NAME) NAME ## __" >>confdefs.h + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unsupported or unknown name-mangling scheme: ${dsyev_namemangling}" >&5 +printf "%s\n" "$as_me: WARNING: Unsupported or unknown name-mangling scheme: ${dsyev_namemangling}" >&2;} + ;; + esac + + + fi + +if test $coin_has_lapack = yes; then + + ac_save_LIBS="$LIBS" + LIBS="$lapack_lflags $LIBS" + + if test -n "$lapack_pcfiles" ; then + temp_LFLAGS=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --libs $pkg_static $lapack_pcfiles` + LIBS="$temp_LFLAGS $LIBS" + fi + + + goto_set_num_threads_namemangling=unknown + + for ac_extra in "no extra underscore" "extra underscore" ; do + for ac_case in "lower case" "upper case" ; do + for ac_trail in "underscore" "no underscore" ; do + case $ac_case in + "lower case") + ac_name=goto_set_num_threads + ;; + "upper case") + ac_name=GOTO_SET_NUM_THREADS + ;; + esac + if test "$ac_trail" = "underscore" ; then + ac_name=${ac_name}_ + fi + if test "$ac_extra" = "extra underscore" ; then + ac_name=${ac_name}_ + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for function $ac_name in $LIBS" >&5 +printf %s "checking for function $ac_name in $LIBS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $ac_name (); +int +main (void) +{ +return $ac_name (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + goto_set_num_threads_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" + ac_success=yes +else $as_nop + ac_success=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_success" >&5 +printf "%s\n" "$ac_success" >&6; } + if test $ac_success = yes ; then + break 3 + fi + done + done + done + LIBS=$ac_save_LIBS + + if test $ac_success = yes ; then + +printf "%s\n" "#define HAVE_GOTO_SETNUMTHREADS 1" >>confdefs.h + + + + fi + + + ac_save_LIBS="$LIBS" + LIBS="$lapack_lflags $LIBS" + + if test -n "$lapack_pcfiles" ; then + temp_LFLAGS=`PKG_CONFIG_PATH="$COIN_PKG_CONFIG_PATH" $PKG_CONFIG --libs $pkg_static $lapack_pcfiles` + LIBS="$temp_LFLAGS $LIBS" + fi + + + omp_set_num_threads_namemangling=unknown + + for ac_extra in "no extra underscore" "extra underscore" ; do + for ac_case in "lower case" "upper case" ; do + for ac_trail in "underscore" "no underscore" ; do + case $ac_case in + "lower case") + ac_name=omp_set_num_threads + ;; + "upper case") + ac_name=OMP_SET_NUM_THREADS + ;; + esac + if test "$ac_trail" = "underscore" ; then + ac_name=${ac_name}_ + fi + if test "$ac_extra" = "extra underscore" ; then + ac_name=${ac_name}_ + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for function $ac_name in $LIBS" >&5 +printf %s "checking for function $ac_name in $LIBS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char $ac_name (); +int +main (void) +{ +return $ac_name (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + omp_set_num_threads_namemangling="${ac_case}, ${ac_trail}, ${ac_extra}" + ac_success=yes +else $as_nop + ac_success=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_success" >&5 +printf "%s\n" "$ac_success" >&6; } + if test $ac_success = yes ; then + break 3 + fi + done + done + done + LIBS=$ac_save_LIBS + + if test $ac_success = yes ; then + +printf "%s\n" "#define HAVE_OMP_SETNUMTHREADS 1" >>confdefs.h + + + + fi + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + + GAMSBONMIN_LFLAGS="$GAMSBONMIN_LFLAGS -ldl" + GAMSCBC_LFLAGS="$GAMSCBC_LFLAGS -ldl" + GAMSCOUENNE_LFLAGS="$GAMSCOUENNE_LFLAGS -ldl" + GAMSIPOPT_LFLAGS="$GAMSIPOPT_LFLAGS -ldl" + GAMSOSI_LFLAGS="$GAMSOSI_LFLAGS -ldl" + GAMSSCIP_LFLAGS="$GAMSSCIP_LFLAGS -ldl" + GAMSSOPLEX_LFLAGS="$GAMSSOPLEX_LFLAGS -ldl" + +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# name of gensolver script and exe +case $build in + *-mingw* | *-cygwin* | *-msys* ) + GMSGENSCRIPT=gmsgennt.cmd + GMSGENEXE=gmsgennx.exe + ;; + *) + GMSGENSCRIPT=gmsgenus.run + GMSGENEXE=gmsgenux.out + ;; +esac + + + +############### +# GAMS system # +############### + +GAMS_PATH=UNAVAILABLE + +# Check whether --with-gams was given. +if test ${with_gams+y} +then : + withval=$with_gams; if test "$withval" != no ; then + as_ac_File=`printf "%s\n" "ac_cv_file_$withval/gams" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $withval/gams" >&5 +printf %s "checking for $withval/gams... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else $as_nop + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$withval/gams"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + GAMS_PATH=$withval +else $as_nop + GAMS_PATH=UNAVAILABLE +fi + + fi + +else $as_nop + # Extract the first word of "gams", so it can be a program name with args. +set dummy gams; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_gamspath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $gamspath in + [\\/]* | ?:[\\/]*) + ac_cv_path_gamspath="$gamspath" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_gamspath="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_gamspath" && ac_cv_path_gamspath="UNAVAILABLE" + ;; +esac fi gamspath=$ac_cv_path_gamspath if test -n "$gamspath"; then @@ -22937,6 +23705,10 @@ if test -z "${COIN_HAS_GUROBI_TRUE}" && test -z "${COIN_HAS_GUROBI_FALSE}"; then as_fn_error $? "conditional \"COIN_HAS_GUROBI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${COIN_HAS_LAPACK_TRUE}" && test -z "${COIN_HAS_LAPACK_FALSE}"; then + as_fn_error $? "conditional \"COIN_HAS_LAPACK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 diff --git a/configure.ac b/configure.ac index 45180821..0c1b8b79 100644 --- a/configure.ac +++ b/configure.ac @@ -95,13 +95,14 @@ AC_CHECK_FUNCS([vsnprintf _vsnprintf],[break]) # check for strtok variants AC_CHECK_FUNCS([strtok_r strtok_s strtok],[break]) -# if we have Ipopt, check if we have GotoBlas or MKL Blas functions to set number of threads -if test $coin_has_ipopt = yes ; then - AC_COIN_TRY_LINK([goto_set_num_threads],[$ipopt_lflags],[$ipopt_pcfiles], - AC_DEFINE([HAVE_GOTO_SETNUMTHREADS],[1],[Define to 1 if Ipopt has goto_set_num_threads]) +# if we have Lapack, check if we have GotoBlas or MKL Blas functions to set number of threads +AC_COIN_CHK_LAPACK +if test $coin_has_lapack = yes; then + AC_COIN_TRY_LINK([goto_set_num_threads],[$lapack_lflags],[$lapack_pcfiles], + AC_DEFINE([HAVE_GOTO_SETNUMTHREADS],[1],[Define to 1 if Lapack has goto_set_num_threads]) ) - AC_COIN_TRY_LINK([omp_set_num_threads],[$ipopt_lflags],[$ipopt_pcfiles], - AC_DEFINE([HAVE_OMP_SETNUMTHREADS],[1],[Define to 1 if Ipopt has omp_set_num_threads]) + AC_COIN_TRY_LINK([omp_set_num_threads],[$lapack_lflags],[$lapack_pcfiles], + AC_DEFINE([HAVE_OMP_SETNUMTHREADS],[1],[Define to 1 if Lapack has omp_set_num_threads]) ) fi diff --git a/src/utils/config.h.in b/src/utils/config.h.in index 61cde76f..60846d7c 100644 --- a/src/utils/config.h.in +++ b/src/utils/config.h.in @@ -36,6 +36,9 @@ /* Define to 1 if Ipopt is available. */ #undef GAMSLINKS_HAS_IPOPT +/* Define to 1 if the LAPACK package is available */ +#undef GAMSLINKS_HAS_LAPACK + /* Define to 1 if the Mosek package is available */ #undef GAMSLINKS_HAS_MOSEK @@ -63,6 +66,13 @@ /* Define to 1 if the Xpress package is available */ #undef GAMSLINKS_HAS_XPRESS +/* Define to a macro mangling the given C identifier (in lower and upper + case). */ +#undef GAMSLINKS_LAPACK_FUNC + +/* As GAMSLINKS_LAPACK_FUNC, but for C identifiers containing underscores. */ +#undef GAMSLINKS_LAPACK_FUNC_ + /* Version number of project */ #undef GAMSLINKS_VERSION @@ -87,13 +97,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H -/* Define to 1 if Ipopt has goto_set_num_threads */ +/* Define to 1 if Lapack has goto_set_num_threads */ #undef HAVE_GOTO_SETNUMTHREADS /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if Ipopt has omp_set_num_threads */ +/* Define to 1 if Lapack has omp_set_num_threads */ #undef HAVE_OMP_SETNUMTHREADS /* Define to 1 if you have the `snprintf' function. */