airoldilab / sgd

An R package for large scale estimation with stochastic gradient descent
60 stars 18 forks source link

Windows support #86

Open dustinvtran opened 8 years ago

dustinvtran commented 8 years ago

See note from Brian Ripley on how to fix Windows support.

See e.g. https://www.r-project.org/nosvn/R.check/r-patched-solaris-x86/sgd-00install.html .

The Boost use of 'I' is conflicting with the definition as part of C99 complex on that platfrom. I think you need to take that up with the bigmemory maintainers: as you do not use complex numbers, you need to be able to ensure HAVE_COMPLEX does not get defined.

The native C++ compiler (which is C++98) gives

"./sgd/base_sgd.h", line 42: Error: Overloading ambiguity between "std::log10(double)" and "std::log10(float)".

That line is

pos_(0, i) = int(round(pow(10, i * log10(n_iters) / (size_-1))));

where the argument to log10 needs a cast to double, and that should also be '10.' . See 'Writing R Extensions'.

With those corrections the native compiler works (it often does not with RcppArmadillo).

Brian D. Ripley, ripley@stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford 1 South Parks Road, Oxford OX1 3TG, UK