This is an automated email from the ASF dual-hosted git repository. cjolivier01 pushed a commit to branch cython in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
commit bf29e3940554603a2a4597404035895697a1e443 Author: Olivier <cooli...@amazon.com> AuthorDate: Fri Mar 9 09:26:25 2018 -0800 cython timing tests --- cmake/CythonUtil.cmake | 29 ++++++++++++++++++----------- python/mxnet/cython/mxcython.pyx | 1 + src/cython/cpp_api.cc | 1 + tools/cython/clean_cython.sh | 8 +++++--- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/cmake/CythonUtil.cmake b/cmake/CythonUtil.cmake index f98bf61..beb86f2 100644 --- a/cmake/CythonUtil.cmake +++ b/cmake/CythonUtil.cmake @@ -176,17 +176,24 @@ function(cython_install_into_source_dir string(REGEX REPLACE "/" "." _full_module_name "${_full_module_name}") string(REGEX REPLACE "\\\\" "." _full_module_name "${_full_module_name}") #message(STATUS "_full_module_name: ${_full_module_name}") -if(UNIX) - add_custom_target( - ${_full_module_name} ALL - DEPENDS ${${_dependencies}} - COMMAND ln -sf ${_file} ${_dest_file}) -else() - add_custom_target( - ${_full_module_name} ALL - DEPENDS ${${_dependencies}} - COMMAND ${CMAKE_COMMAND} -E copy ${_file} ${_dest_file}) -endif() + #message(STATUS "**** LINK: ${_cy_module_directory}/* -> ${_dest_file_dir}/") + if(UNIX) + #message("add_custom_target(${_full_module_name} ALL)") + add_custom_target( + ${_full_module_name} ALL + #DEPENDS ${${_dependencies}} + #COMMAND ln -sf ${_file} ${_dest_file} + #COMMAND echo "***************************************************" + COMMAND ln -sf ${_cy_module_directory}/* ${_dest_file_dir}/ + ) + else() + add_custom_target( + ${_full_module_name} ALL + #DEPENDS ${${_dependencies}} + #COMMAND ${CMAKE_COMMAND} -E copy ${_file} ${_dest_file} + COMMAND ${CMAKE_COMMAND} -E copy ${_cy_module_directory}/* ${_dest_file_dir} + ) + endif() endforeach() endfunction() diff --git a/python/mxnet/cython/mxcython.pyx b/python/mxnet/cython/mxcython.pyx index 914de61..6beb2bb 100644 --- a/python/mxnet/cython/mxcython.pyx +++ b/python/mxnet/cython/mxcython.pyx @@ -60,6 +60,7 @@ cdef class CythonTestClass: # mxnet.cython.cy3.mxcython.def test_cpp_class(): + def test_cpp_class(): cdef int recArea rec_ptr = new Rectangle(1, 2, 3, 4) diff --git a/src/cython/cpp_api.cc b/src/cython/cpp_api.cc index 85735c5..44c8009 100644 --- a/src/cython/cpp_api.cc +++ b/src/cython/cpp_api.cc @@ -29,6 +29,7 @@ extern "C" int CythonPrintFromCPP(const char *foo) { return 0; } + extern "C" int Printf(const char *fmt, ...) { va_list args; va_start(args, fmt); diff --git a/tools/cython/clean_cython.sh b/tools/cython/clean_cython.sh index 7f2d5f8..9a648e0 100755 --- a/tools/cython/clean_cython.sh +++ b/tools/cython/clean_cython.sh @@ -15,6 +15,8 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -ROOTDIR=$(dirname $0)/.. -for i in $(find $ROOTDIR/python/mxnet -type f -name "*.so"); do rm -f $i; done -for i in $(find $ROOTDIR/python/mxnet -type d -name "cython_debug"); do rm -rf $i; done +ROOTDIR=$(realpath $(dirname $0))/../.. +#echo "Root dir: $ROOTDIR" +for i in $(find $ROOTDIR/python/mxnet -name "*.so"); do rm -fv $i; done +for i in $(find $ROOTDIR/python/mxnet -name "*.cxx"); do rm -fv $i; done +for i in $(find $ROOTDIR/python/mxnet -type d -name "cython_debug"); do rm -rfv $i; done -- To stop receiving notification emails like this one, please contact cjolivie...@apache.org.