Skip to content

Master does not compile on windows #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dieterv77 opened this issue Dec 7, 2011 · 3 comments
Closed

Master does not compile on windows #460

dieterv77 opened this issue Dec 7, 2011 · 3 comments
Labels
Build Library building on various platforms
Milestone

Comments

@dieterv77
Copy link
Contributor

I ran into issues compiling current master on windows. The problem is with the new pandas/src/numpyhelper.h file

There are two issues there:

  1. MSVC does not support "inline" in C (see http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx)
    It does support _inline in C however, which has the intended meaning as far as i can tell.
  2. MSVC does not support pointer arithmetic on void *. I fixed that with simple cast.

There's a diff below, it only show how to make it compile on windows, and is not portable. I didn't put this in a pull request because i'm not sure how you would like to make changes that are portable.

diff --git a/pandas/src/numpy_helper.h b/pandas/src/numpy_helper.h
index f5779dd..fe40e8c 100644
--- a/pandas/src/numpy_helper.h
+++ b/pandas/src/numpy_helper.h
@@ -1,30 +1,30 @@
 #include "Python.h"
 #include "numpy/ndarrayobject.h"

-inline int
+_inline int
 is_integer_object(PyObject* obj) {
   return PyArray_IsIntegerScalar(obj);
 }

-inline int
+_inline int
 is_float_object(PyObject* obj) {
   return (PyFloat_Check(obj) || PyArray_IsScalar(obj, Floating));
 }

-inline int
+_inline int
 is_bool_object(PyObject* obj) {
   return (PyBool_Check(obj) || PyArray_IsScalar(obj, Bool));
 }

-inline int
+_inline int
 is_string_object(PyObject* obj) {
   return (PyString_Check(obj) || PyUnicode_Check(obj));
 }

-inline int
+_inline int
 assign_value_1d(PyArrayObject* ap, Py_ssize_t _i, PyObject* v) {
   char *item;
   npy_intp i = (npy_intp) _i;
-  item = PyArray_DATA(ap) + i * PyArray_STRIDE(ap, 0);
+  item = (char *) PyArray_DATA(ap) + i * PyArray_STRIDE(ap, 0);
   return PyArray_DESCR(ap)->f->setitem(v, item, ap);
 }
@wesm
Copy link
Member

wesm commented Dec 7, 2011

Cython uses the following macros:


/* inline attribute */
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

so i'll just use a variant of that. thanks for figuring this out, another user also reported. Proof that I need to get a CI server set up for pandas soon

@wesm
Copy link
Member

wesm commented Dec 7, 2011

Can you verify that all works and the test suite passes? I've been building with mingw32 and not MSVC so am not immediately equipped to test

@wesm
Copy link
Member

wesm commented Dec 7, 2011

I got the MSVC compiler set up in my VM and verified that all's OK now. Tons of compiler warnings (Py_ssize_t -> int32_t casts) that I need to fix

@wesm wesm closed this as completed Dec 7, 2011
dan-nadler pushed a commit to dan-nadler/pandas that referenced this issue Sep 23, 2019
…-dev#250 ) (pandas-dev#460)

* Don't re-authenticate with every call to read/access the top level collection, unless connection is reset. Thread-safe.

Add arctic_reset method which is called by Store implementation upon init, to force reconnect/re-auth

Instead of resetting Arctic connection everytime we instantiate a new Store, only trigger re-authentication for the Databases

added multiprocessing safety for Arctic connection and tests

make only one getpid call

simplified the design, auth is called either at instantiation of the artict top level lib, or if Arctic is reset (explicitly or afer fork)

* enhanced the integration tests for arctic, excercised also the reset()

* incorporating PR comment, print is not necessary here

* PR comment change: don't require/expect from Store implementation to trigger _reset_auth(), trigger it on ArcticLibraryBinding instantiation and whenever Acttic's connection is reset

* added integration test to verify re-auth is triggered when Arctic is reset

* leftover comment was removed

* fixed bug with ArcticLibraryBinding not picking up the arctic reset, improved test coverage, split the multithreading tests to separate files

* nicer call count handling in test

* added the changes to the change log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms
Projects
None yet
Development

No branches or pull requests

2 participants