Skip to content
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

updates and fixes for windows build #884

Merged
merged 11 commits into from
Feb 8, 2020
Merged

updates and fixes for windows build #884

merged 11 commits into from
Feb 8, 2020

Conversation

timkpaine
Copy link
Member

@timkpaine timkpaine commented Jan 28, 2020

A few updates and fixes for the windows build of perspective-python

  • build dlls and pyd file
  • set prefix for assets to lib for symmetry
  • inline arrow dlls and tbb dll
  • omit tests using missing platform functions
  • swap slashes in setup.py for windows paths
  • change .appveyor.yml to match travis

Still unresolved:
https://bugs.python.org/issue36439

@timkpaine timkpaine added enhancement Feature requests or improvements C++ Python labels Jan 28, 2020
[resolve`${resolve`${__dirname}/../python/perspective/dist`}/cmake`, _path.resolve(_path.resolve(__dirname, "..", "python", "perspective", "dist"), "cmake")],
[resolve`${resolve`${__dirname}/../python/perspective/dist`}/obj`, _path.resolve(_path.resolve(__dirname, "..", "python", "perspective", "dist"), "obj")]
]);
if (isWin){
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@texodus can you take a look at this, the comments seem to suggest that this was supposed to work but it does not on windows

@@ -197,6 +196,10 @@ message(WARNING "${BUILD_MESSAGE}")
#######################
include_directories("${CMAKE_SOURCE_DIR}/src/include")

if(NOT WIN32)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sc1f note this

")
if(WIN32)
if(CMAKE_BUILD_TYPE_LOWER STREQUAL debug)
set(OPT_FLAGS " \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sc1f we should set debug flags (see prev comment) instead of having this opt flags thing

endif()
endif()
else()
set(CMAKE_SHARED_LIBRARY_PREFIX lib)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sc1f we should consider not prefixing with lib, and setting the prefixes to "" (this will mean we need to change python imports from libbinding to just binding, or preferable _binding)


if(WIN32)
# inline arrow dlls
file(GLOB ARROW_DLLS "${PYTHON_PYARROW_LIBRARY_DIR}/*.dll")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sc1f @texodus open to suggestions to get around copying all arrow dlls into our directory. In a "production" environment with a custom arrow build you won't have to worry about this, but with the packaged arrow wheel bringing a ton of stuff with it, we need to ensure all the links resolve.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what the requirement being solved by copying is, nor why a ton of stuff being brought is the instigator, so I'm not really in a position to offer constructive advice here. Copying is bad of course.

@@ -207,49 +207,49 @@ template <>
t_tscalar t_tscalar::coerce_numeric<bool>() const;

template <>
std::int64_t t_tscalar::get() const;
PERSPECTIVE_EXPORT std::int64_t t_tscalar::get() const;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sc1f i assume all these specializations are necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, they all need to be explicitly specialized.

const char* get_interned_cstr(const char* s);
t_tscalar get_interned_tscalar(const char* s);
t_tscalar get_interned_tscalar(const t_tscalar& s);
PERSPECTIVE_EXPORT const char* get_interned_cstr(const char* s);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sc1f this is currently being exposed as part of libpsp's public interface (it is used in the python cpp code). should this be public?

@@ -3,7 +3,8 @@
"name": "perspective-python.node",
"version": "0.4.1",
"dependencies": {
"@finos/perspective": "^0.4.1"
"@finos/perspective": "^0.4.1",
"zerorpc": "^0.9.8"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@texodus please confirm

Copy link
Member

@texodus texodus Feb 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point I see honestly zero reason to maintain this feature - perspective-python is better in every way. I propose we delete the perspective-node binding entirely.

@@ -29,7 +39,7 @@ namespace numpy {
/**
* NumpyLoader fast-tracks the loading of Numpy arrays into Perspective, utilizing memcpy whenever possible.
*/
class PERSPECTIVE_EXPORT NumpyLoader {
class PERSPECTIVE_BINDING_EXPORT NumpyLoader {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sc1f is a class necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it follows the structure set by arrow_loader, and allows us to abstract all the numpy-specific stuff since its' all state-dependent

@@ -31,11 +31,12 @@ try {
const python_path = resolve`${__dirname}/../python/perspective`;
// Tests for client mode (when C++ assets are not present) require
// a new runtime.
execute`cd ${python_path} && TZ=UTC ${PYTHON} -m pytest \
process.env.TZ = "UTC";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sc1f note for os-agnostic

Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I have it on good authority that it looks good!

@texodus texodus merged commit a89d7e4 into master Feb 8, 2020
@texodus texodus deleted the windows branch February 8, 2020 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ enhancement Feature requests or improvements Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants