📄 configure
字号:
else echo "$ac_t""no" 1>&6fi cplex_dir='.' if test -n "$ac_cv_path_cplex" then cplex_dir="`echo $ac_cv_path_cplex | sed 's%/[^/]*$%%'`" fi cpx_hdr_dirs="$cplex_dir /usr/include /usr/local/include" cpx_lib_dirs="$cplex_dir /usr/lib /usr/ccs/lib /usr/local/lib" # Look for cplex.h echo $ac_n "checking for cplex.h""... $ac_c" 1>&6echo "configure:1937: checking for cplex.h" >&5if eval "test \"`echo '$''{'ac_cv_cplex_header'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else ac_cv_cplex_header='' for cv_ff_dir in $cpx_hdr_dirs do if test "-r" "$cv_ff_dir/cplex.h" then ac_cv_cplex_header="$cv_ff_dir/cplex.h" break fi done fiecho "$ac_t""$ac_cv_cplex_header" 1>&6 # Look for libcplex.a echo $ac_n "checking for libcplex.a""... $ac_c" 1>&6echo "configure:1958: checking for libcplex.a" >&5if eval "test \"`echo '$''{'ac_cv_cplex_lib'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else ac_cv_cplex_lib='' for cv_ff_dir in $cpx_lib_dirs do if test "-r" "$cv_ff_dir/libcplex.a" then ac_cv_cplex_lib="$cv_ff_dir/libcplex.a" break fi done fiecho "$ac_t""$ac_cv_cplex_lib" 1>&6 if test -z "$ac_cv_cplex_header" || test -z "$ac_cv_cplex_lib" then # Start looking for CPLEX version 3 stuff... # Look for cpxdefs.inc echo $ac_n "checking for cpxdefs.inc""... $ac_c" 1>&6echo "configure:1982: checking for cpxdefs.inc" >&5if eval "test \"`echo '$''{'ac_cv_cplex_header'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else ac_cv_cplex_header='' for cv_ff_dir in $cpx_hdr_dirs do if test "-r" "$cv_ff_dir/cpxdefs.inc" then ac_cv_cplex_header="$cv_ff_dir/cpxdefs.inc" break fi done fiecho "$ac_t""$ac_cv_cplex_header" 1>&6 # Look for cplex.a echo $ac_n "checking for cplex.a""... $ac_c" 1>&6echo "configure:2003: checking for cplex.a" >&5if eval "test \"`echo '$''{'ac_cv_cplex_lib'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else ac_cv_cplex_lib='' for cv_ff_dir in $cpx_lib_dirs do if test "-r" "$cv_ff_dir/cplex.a" then ac_cv_cplex_lib="$cv_ff_dir/cplex.a" break fi done fiecho "$ac_t""$ac_cv_cplex_lib" 1>&6 fi # We assume at this point, the variables ac_cv_cplex_header and # ac_cv_cplex_lib have been set to the absolute pathnames of the # appropriate files, if they are available. # # The next thing to do is determine the version number of the # cplex being referenced, putting it in ac_cv_cplex_version. # Note: we use the version number in the header and assume that # the library matches! if test -n "$ac_cv_cplex_header" && \ test -r "$ac_cv_cplex_header" && \ test -n "$ac_cv_cplex_lib" then # We have both a header and a library. Now we need the version. echo $ac_n "checking cplex version number""... $ac_c" 1>&6echo "configure:2040: checking cplex version number" >&5 if test -n "$CPLEX_HEADER" || test -n "$CPLEX_LIB" then # User overrode, don't believe the cached value! cpxh="$ac_cv_cplex_header" hdrname="`echo $cpxh | sed 's@^.*/@@'`" if test "$hdrname" = "cpxdefs.inc" then ac_cv_cplex_version=30 else vers="`grep Version <$cpxh | head -1 | \ sed 's@^.*Version[ ]*@@' | \ sed 's@\([0-9][0-9]*\)\.\([0-9]\).*$@\1\2@'`" ac_cv_cplex_version="$vers" fi else if eval "test \"`echo '$''{'ac_cv_cplex_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else cpxh="$ac_cv_cplex_header" hdrname="`echo $cpxh | sed 's@^.*/@@'`" if test "$hdrname" = "cpxdefs.inc" then ac_cv_cplex_version=30 else vers="`grep Version <$cpxh | head -1 | \ sed 's@^.*Version[ ]*@@' | \ sed 's@\([0-9][0-9]*\)\.\([0-9]\).*$@\1\2@'`" ac_cv_cplex_version="$vers" fifi fi echo "$ac_t""$ac_cv_cplex_version" 1>&6 fifi# Decide (finally) which LP solver to use!if test "$with_cplex" != no && \ test -n "$ac_cv_cplex_header" && \ test -r "$ac_cv_cplex_header" && \ test -n "$ac_cv_cplex_lib" && \ test -r "$ac_cv_cplex_lib" && \ test -n "$ac_cv_cplex_version"then # We have decided to use cplex! hdrdir="`echo $ac_cv_cplex_header | sed 's%/[^/]*$%%'`" LP_PKG=cplex LP_CFLAGS="-I$hdrdir" LP_DEPS="$ac_cv_cplex_header" LP_LIBS="$ac_cv_cplex_lib" cat >> confdefs.h <<EOF#define CPLEX $ac_cv_cplex_versionEOF # Check if we need to use -lpthread echo $ac_n "checking if CPLEX needs -lpthread""... $ac_c" 1>&6echo "configure:2102: checking if CPLEX needs -lpthread" >&5if eval "test \"`echo '$''{'ac_cv_cplex_libpthread'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else cpx_save_LIBS=${LIBS} cpx_save_CPPFLAGS=${CPPFLAGS} LIBS="${LIB} ${ac_cv_cplex_lib}" cpxhdrdir="`echo $ac_cv_cplex_header | sed -e 's!/[^/]*$!!'`" CPPFLAGS="${CPPFLAGS} -I${cpxhdrdir}" cat > conftest.$ac_ext <<EOF#line 2113 "configure"#include "confdefs.h"#if CPLEX < 40 #include "cpxdefs.inc"#else #include "cplex.h"#endifint main() { #if CPLEX >= 50 int status;/* CPXENVptr cpx_env; */ CPXLPptr lp;/* cplex_env = CPXopenCPLEX (&status); */ lp = NULL; CPXprimopt ((void *) 0, lp); CPXdualopt ((void *) 0, lp);#else #if CPLEX >= 40 int status; CPXENVptr cpx_env; CPXLPptr lp; cplex_env = CPXopenCPLEX (&status); lp = NULL; CPXoptimize (cpx_env, lp); CPXdualopt (cpx_env, lp); #else CPXLPptr lp; lp = NULL; optimize (lp); dualopt (lp); #endif#endif; return 0; }EOFif { (eval echo configure:2153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_cplex_libpthread=noelse echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* # Link did not work. Try adding -lpthread. LIBS="${LIBS} -lpthread" cat > conftest.$ac_ext <<EOF#line 2163 "configure"#include "confdefs.h"#if CPLEX < 40 #include "cpxdefs.inc"#else #include "cplex.h"#endifint main() { #if CPLEX >= 50 int status;/* CPXENVptr cpx_env; */ CPXLPptr lp;/* cplex_env = CPXopenCPLEX (&status); */ lp = NULL; CPXprimopt ((void *) 0, lp); CPXdualopt ((void *) 0, lp);#else #if CPLEX >= 40 int status; CPXENVptr cpx_env; CPXLPptr lp; cplex_env = CPXopenCPLEX (&status); lp = NULL; CPXoptimize (cpx_env, lp); CPXdualopt (cpx_env, lp); #else CPXLPptr lp; lp = NULL; optimize (lp); dualopt (lp); #endif#endif; return 0; }EOFif { (eval echo configure:2203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_cplex_libpthread=yeselse echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cplex_libpthread=nofirm -f conftest*firm -f conftest* LIBS=${cpx_save_LIBS} CPPFLAGS=${cpx_save_CPPFLAGS} fiecho "$ac_t""$ac_cv_cplex_libpthread" 1>&6 if test "$ac_cv_cplex_libpthread" = yes then LP_LIBS="${LP_LIBS} -lpthread" fielse # We are unable to use cplex. Use lp_solve instead. if (test -n "$ac_cv_cplex_header" || \ test -n "$ac_cv_cplex_lib" || \ test -n "$ac_cv_prog_cplex") && \ test "$with_cplex" != no then # Warn user that we are falling back to lp_solve! echo "configure: warning: CPLEX not completely found -- using lp_solve instead..." 1>&2 fi LP_PKG=lp_solve LP_CFLAGS='-I$(LP_SOLVE_DIR)' LP_DEPS='$(LP_SOLVE_DIR)/lpkit.h' LP_LIBS='$(LP_SOLVE_DIR)/libLPS.a' cat >> confdefs.h <<\EOF#define LPSOLVE 1EOFfidefine_machdesc=no# Check whether --with-machine or --without-machine was given.if test "${with_machine+set}" = set; then withval="$with_machine" ac_cv_machine_description_string="$withval" define_machdesc=yeselse if test -n "$ac_cv_machine_description_string" then define_machdesc=yes fifiif test $define_machdesc = yesthen cat >> confdefs.h <<EOF#define MACHDESC "${ac_cv_machine_description_string}"EOFfi# Override the cached GMP settings if environment vars are set!if test -n "$GMP_HEADER"then if test ! -r "$GMP_HEADER" then { echo "configure: error: File given by \$GMP_HEADER unreadable!" 1>&2; exit 1; } fi ac_cv_gmp_header="$GMP_HEADER"fiif test -n "$GMP_LIB"then if test ! -r "$GMP_LIB" then { echo "configure: error: File given by \$GMP_LIB unreadable!" 1>&2; exit 1; } fi ac_cv_gmp_lib="$GMP_LIB"fi# Check whether --with-gmp or --without-gmp was given.if test "${with_gmp+set}" = set; then withval="$with_gmp" if test "$withval" = nothen with_gmp=no # Expunge GMP from the cache! ac_cv_gmp_header='' ac_cv_gmp_lib=''else if test "$withval" != yes then echo "Arg to --with-gmp must be yes or no!" 1>&2 exit 1 fi with_gmp=yesfifiif test -n "$ac_cv_gmp_header" && test -n "$ac_cv_gmp_lib" && \ test "$with_gmp" != nothen GMP_INCLUDE_DIR="`echo $ac_cv_gmp_header | sed -e 's@[^/]*$@@' -e 's@/$@@'`" if test -z "$GMP_INCLUDE_DIR"; then GMP_INCLUDE_DIR='.'; fi GMP_CFLAGS='-I$(GMP_INCLUDE_DIR)' GMP_LIBS="$ac_cv_gmp_lib" cat >> confdefs.h <<\EOF#define HAVE_GMP 1EOFfitest "x$prefix" = xNONE && prefix=$ac_default_prefixtest "x$exec_prefix" = xNONE && exec_prefix='${prefix}'ac_expand_text1=""ac_expand_text2="`eval echo \"$prefix\"`"while test "$ac_expand_text1" != "$ac_expand_text2"do ac_expand_text3="`eval echo \"$ac_expand_text2\"`" ac_expand_text1="$ac_expand_text2" ac_expand_text2="$ac_expand_text3"donecat >> confdefs.h <<EOF#define INSTALLDIR_PREFIX "$ac_expand_text1"EOFac_expand_text1=""ac_expand_text2="`eval echo \"$exec_prefix\"`"while test "$ac_expand_text1" != "$ac_expand_text2"do ac_expand_text3="`eval echo \"$ac_expand_text2\"`" ac_expand_text1="$ac_expand_text2" ac_expand_text2="$ac_expand_text3"donecat >> confdefs.h <<EOF#define INSTALLDIR_EXEC_PREFIX "$ac_expand_text1"EOFac_expand_text1=""ac_expand_text2="`eval echo \"$bindir\"`"while test "$ac_expand_text1" != "$ac_expand_text2"do ac_expand_text3="`eval echo \"$ac_expand_text2\"`" ac_expand_text1="$ac_expand_text2" ac_expand_text2="$ac_expand_text3"donecat >> confdefs.h <<EOF#define INSTALLDIR_BINDIR "$ac_expand_text1"EOFac_expand_text1=""ac_expand_text2="`eval echo \"$datadir\"`"while test "$ac_expand_text1" != "$ac_expand_text2"do ac_expand_text3="`eval echo \"$ac_expand_text2\"`" ac_expand_text1="$ac_expand_text2" ac_expand_text2="$ac_expand_text3"donecat >> confdefs.h <<EOF#define INSTALLDIR_DATADIR "$ac_expand_text1"EOFac_expand_text1=""ac_expand_text2="`eval echo \"$libdir\"`"while test "$ac_expand_text1" != "$ac_expand_text2"do ac_expand_text3="`eval echo \"$ac_expand_text2\"`" ac_expand_text1="$ac_expand_text2" ac_expand_text2="$ac_expand_text3"donecat >> confdefs.h <<EOF#define INSTALLDIR_LIBDIR "$ac_expand_text1"EOFac_expand_text1=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -