-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Changes from all commits
6b0a6e4
34baef0
0aba39c
a4c4436
b2ee0d8
a7b4cd7
fe0143b
eba38eb
82acc6a
0c2518b
b6d1457
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
cmake_minimum_required(VERSION 3.7.2) | ||
project (psp) | ||
project(psp) | ||
|
||
set(CMAKE_BUILD_TYPE "Release") | ||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") | ||
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG") | ||
|
||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
@@ -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") | ||
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG") | ||
endif() | ||
|
||
if (PSP_WASM_BUILD) | ||
#################### | ||
|
@@ -264,16 +267,31 @@ elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD) | |
##################### | ||
# VANILLA CPP BUILD # | ||
##################### | ||
if(CMAKE_BUILD_TYPE_LOWER STREQUAL debug) | ||
set(OPT_FLAGS " \ | ||
-O0 \ | ||
-g3 \ | ||
") | ||
if(WIN32) | ||
if(CMAKE_BUILD_TYPE_LOWER STREQUAL debug) | ||
set(OPT_FLAGS " \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
/DEBUG \ | ||
/Z7 \ | ||
/Zi | ||
") | ||
else() | ||
set(OPT_FLAGS " \ | ||
/NDEBUG \ | ||
/O2 \ | ||
") | ||
endif() | ||
else() | ||
set(OPT_FLAGS " \ | ||
-O3 \ | ||
-g0 \ | ||
") | ||
if(CMAKE_BUILD_TYPE_LOWER STREQUAL debug) | ||
set(OPT_FLAGS " \ | ||
-O0 \ | ||
-g3 \ | ||
") | ||
else() | ||
set(OPT_FLAGS " \ | ||
-O3 \ | ||
-g0 \ | ||
") | ||
endif() | ||
endif() | ||
set(SYNC_MODE_FLAGS "") | ||
set(ASYNC_MODE_FLAGS "") | ||
|
@@ -377,9 +395,7 @@ elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD) | |
message(FATAL_ERROR "${Red}PyArrow could not be located${ColorReset}") | ||
else() | ||
message(WARNING "${Cyan}PyArrow found: ${PYTHON_PYARROW_INCLUDE_DIR}${ColorReset}") | ||
if (NOT WIN32) | ||
message(WARNING "${Cyan}Using pre-built ${PYTHON_PYARROW_PYTHON_SHARED_LIBRARY} ${PYTHON_PYARROW_ARROW_SHARED_LIBRARY} from: ${PYTHON_PYARROW_LIBRARY_DIR}${ColorReset}") | ||
endif() | ||
message(WARNING "${Cyan}Using pre-built ${PYTHON_PYARROW_PYTHON_SHARED_LIBRARY} ${PYTHON_PYARROW_ARROW_SHARED_LIBRARY} from: ${PYTHON_PYARROW_LIBRARY_DIR}${ColorReset}") | ||
endif() | ||
include_directories(${PYTHON_PYARROW_INCLUDE_DIR}) | ||
link_directories(${PYTHON_PYARROW_LIBRARY_DIR}) | ||
|
@@ -392,7 +408,7 @@ psp_build_dep("hopscotch" "${PSP_CMAKE_MODULE_PATH}/hopscotch.txt.in") | |
psp_build_dep("ordered-map" "${PSP_CMAKE_MODULE_PATH}/ordered-map.txt.in") | ||
|
||
# For all non-MacOS and non-linux builds, or if building WASM/CPP, build minimal arrow from source | ||
if (WIN32 OR NOT PSP_PYTHON_BUILD) | ||
if (NOT PSP_PYTHON_BUILD) | ||
# build arrow + dependencies from source for Emscripten and C++ | ||
message("${Cyan}Building minimal Apache Arrow${ColorReset}") | ||
|
||
|
@@ -516,7 +532,7 @@ set (PYTHON_SOURCE_FILES | |
) | ||
|
||
if (WIN32) | ||
set(CMAKE_CXX_FLAGS " /EHsc") | ||
set(CMAKE_CXX_FLAGS " /EHsc /MP") | ||
else() | ||
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}") | ||
endif() | ||
|
@@ -548,7 +564,9 @@ elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD) | |
set(module_install_rpath "@loader_path/") | ||
else() | ||
set(module_install_rpath "\$ORIGIN") | ||
endif() | ||
endif() | ||
else() | ||
set(CMAKE_SHARED_LIBRARY_PREFIX lib) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
endif() | ||
|
||
if(PSP_PYTHON_BUILD) | ||
|
@@ -562,28 +580,45 @@ elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD) | |
|
||
target_compile_definitions(psp PRIVATE PSP_ENABLE_PYTHON=1) | ||
target_compile_definitions(binding PRIVATE PSP_ENABLE_PYTHON=1) | ||
target_compile_options(binding PRIVATE -Wdeprecated-declarations) | ||
|
||
# Link against libarrow 0.15.1 in pyarrow directory for windows | ||
if (WIN32) | ||
target_link_libraries(psp arrow) | ||
target_link_libraries(binding arrow) | ||
target_compile_definitions(binding PRIVATE WIN32=1) | ||
target_compile_definitions(binding PRIVATE _WIN32=1) | ||
|
||
target_link_libraries(psp ${Boost_FILESYSTEM_LIBRARY}) | ||
target_link_libraries(binding ${Boost_FILESYSTEM_LIBRARY}) | ||
|
||
# .dll not importable | ||
set_property(TARGET binding PROPERTY SUFFIX .pyd) | ||
else() | ||
target_link_libraries(psp ${PYTHON_PYARROW_LIBRARIES}) | ||
target_link_libraries(binding ${PYTHON_PYARROW_LIBRARIES}) | ||
target_compile_options(binding PRIVATE -Wdeprecated-declarations) | ||
set_property(TARGET psp PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_RPATH} ${module_install_rpath} ${PYTHON_PYARROW_LIBRARY_DIR}) | ||
set_property(TARGET binding PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_RPATH} ${module_install_rpath} ${PYTHON_PYARROW_LIBRARY_DIR}) | ||
endif() | ||
endif() | ||
|
||
target_link_libraries(psp ${PYTHON_PYARROW_LIBRARIES}) | ||
target_link_libraries(binding ${PYTHON_PYARROW_LIBRARIES}) | ||
|
||
target_link_libraries(psp ${PYTHON_LIBRARIES}) | ||
target_link_libraries(binding ${PYTHON_LIBRARIES}) | ||
target_link_libraries(binding psp) | ||
|
||
target_link_libraries(psp tbb) | ||
target_link_libraries(binding tbb) | ||
|
||
target_link_libraries(binding psp) | ||
|
||
add_custom_command(TARGET psp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:psp> ${PSP_PYTHON_SRC}/table/) | ||
add_custom_command(TARGET binding POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:binding> ${PSP_PYTHON_SRC}/table/) | ||
|
||
if(WIN32) | ||
# inline arrow dlls | ||
file(GLOB ARROW_DLLS "${PYTHON_PYARROW_LIBRARY_DIR}/*.dll") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
add_custom_command(TARGET binding POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${ARROW_DLLS} ${PSP_PYTHON_SRC}/table/) | ||
if(NOT TBB_FOUND) | ||
add_custom_command(TARGET binding POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:tbb> ${PSP_PYTHON_SRC}/table/) | ||
endif() | ||
endif() | ||
######################## | ||
else() | ||
add_library(psp SHARED ${SOURCE_FILES} ${HEADER_FILES}) | ||
|
@@ -600,10 +635,10 @@ elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD) | |
elseif(WIN32) | ||
target_compile_definitions(psp PRIVATE PERSPECTIVE_EXPORTS=1) | ||
target_compile_definitions(psp PRIVATE WIN32=1) | ||
target_compile_definitions(psp PRIVATE _WIN32=1) | ||
endif() | ||
|
||
target_link_libraries(psp tbb) | ||
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${TBB_LIBRARY}) | ||
endif() | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sc1f i assume all these specializations are necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, they all need to be explicitly specialized. |
||
|
||
template <> | ||
std::int32_t t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT std::int32_t t_tscalar::get() const; | ||
|
||
template <> | ||
std::int16_t t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT std::int16_t t_tscalar::get() const; | ||
|
||
template <> | ||
std::int8_t t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT std::int8_t t_tscalar::get() const; | ||
|
||
template <> | ||
std::uint64_t t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT std::uint64_t t_tscalar::get() const; | ||
|
||
template <> | ||
std::uint32_t t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT std::uint32_t t_tscalar::get() const; | ||
|
||
template <> | ||
std::uint16_t t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT std::uint16_t t_tscalar::get() const; | ||
|
||
template <> | ||
std::uint8_t t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT std::uint8_t t_tscalar::get() const; | ||
|
||
template <> | ||
t_date t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT t_date t_tscalar::get() const; | ||
|
||
template <> | ||
t_time t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT t_time t_tscalar::get() const; | ||
|
||
template <> | ||
const char* t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT const char* t_tscalar::get() const; | ||
|
||
template <> | ||
t_none t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT t_none t_tscalar::get() const; | ||
|
||
template <> | ||
double t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT double t_tscalar::get() const; | ||
|
||
template <> | ||
float t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT float t_tscalar::get() const; | ||
|
||
template <> | ||
bool t_tscalar::get() const; | ||
PERSPECTIVE_EXPORT bool t_tscalar::get() const; | ||
|
||
template <template <typename COMPARED_T> class COMPARER_T> | ||
bool | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
|
||
namespace perspective { | ||
|
||
class t_symtable { | ||
class PERSPECTIVE_EXPORT t_symtable { | ||
typedef tsl::hopscotch_map<const char*, const char*, t_cchar_umap_hash, t_cchar_umap_cmp> | ||
t_mapping; | ||
|
||
|
@@ -31,8 +31,8 @@ class t_symtable { | |
t_mapping m_mapping; | ||
}; | ||
|
||
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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sc1f this is currently being exposed as part of |
||
PERSPECTIVE_EXPORT t_tscalar get_interned_tscalar(const char* s); | ||
PERSPECTIVE_EXPORT t_tscalar get_interned_tscalar(const t_tscalar& s); | ||
|
||
} // end namespace perspective |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @texodus please confirm There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this point I see honestly zero reason to maintain this feature - |
||
}, | ||
"devDependencies": { | ||
"@finos/perspective-webpack-plugin": "^0.4.1", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sc1f note this