diff --git a/configure.ac b/configure.ac index 007753e5..df6ed9fc 100644 --- a/configure.ac +++ b/configure.ac @@ -1269,9 +1269,6 @@ if test "X$have_posix_memalign" != "X0"; then LIBINT_ALIGN_SIZE=0 fi AC_DEFINE_UNQUOTED(LIBINT_ALIGN_SIZE, $LIBINT_ALIGN_SIZE) -else # no posix_memalign = death - echo "did not find posix_memalign ... this SHOULD NOT happen. Cannot proceed." - exit 1 fi dnl ------------------ Check for support for C++11 standard features -------------- diff --git a/src/bin/libint/tactic.cc b/src/bin/libint/tactic.cc index 4650d4a6..08dc1b2b 100644 --- a/src/bin/libint/tactic.cc +++ b/src/bin/libint/tactic.cc @@ -109,9 +109,9 @@ RandomChoiceTactic::RR RandomChoiceTactic::optimal_rr( const rr_stack& stack) const { if (!stack.empty()) { unsigned int size = stack.size(); - unsigned long rand = random(); + unsigned long rand_ = random(); const unsigned long range = RAND_MAX; - long choice = (long)(rand * size - 1) / range; + long choice = (long)(rand_ * size - 1) / range; return stack[choice]; } else return RR(); diff --git a/src/bin/libint/tactic.h b/src/bin/libint/tactic.h index 4cdec983..b560c09c 100644 --- a/src/bin/libint/tactic.h +++ b/src/bin/libint/tactic.h @@ -27,6 +27,11 @@ #ifndef _libint2_src_bin_libint_tactic_h_ #define _libint2_src_bin_libint_tactic_h_ ++#ifdef _WIN32 ++#define random rand ++#define srandom srand ++#endif + namespace libint2 { class DirectedGraph; @@ -208,10 +213,10 @@ class StdRandomizePolicy { } unsigned int noise(unsigned int nrrs) const { - unsigned long rand = random(); + unsigned long rand_ = random(); const unsigned long range = RAND_MAX; const unsigned int result = - static_cast(std::floor(nrrs * scale_ * rand / range)); + static_cast(std::floor(nrrs * scale_ * rand_ / range)); return result; }