From e86f279800b33f89838a73343c133befb1d53215 Mon Sep 17 00:00:00 2001 From: Morten Enemark Lund Date: Wed, 9 Jan 2019 09:54:25 +0100 Subject: [PATCH 1/4] Fix assignment of ANALOG RATE parameter ["parameters"]["ANALOG"]["RATE"]["value"] can be a tuple preventing assignment directly --- binding/python3/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/binding/python3/__init__.py b/binding/python3/__init__.py index c88608d7..99c85307 100644 --- a/binding/python3/__init__.py +++ b/binding/python3/__init__.py @@ -170,8 +170,10 @@ def write(self, path): raise ValueError("Number of frames in the data set must match the analog rate X point frame") nb_analog_subframes = int(nb_analog_frames / nb_point_frames) - self._storage['parameters']['ANALOG']['RATE']['value'][0] = nb_analog_subframes * \ - self._storage['parameters']['POINT']['RATE']['value'][0] + self._storage['parameters']['ANALOG']['RATE']['value'] = ( + nb_analog_subframes + * self._storage['parameters']['POINT']['RATE']['value'][0], + ) nb_frames = nb_point_frames else: nb_frames = nb_analog_frames From 3b8a2ec6bab3ed637ac451c4e9ba0837b9753be1 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Thu, 21 Feb 2019 16:48:01 -0500 Subject: [PATCH 2/4] Updated a comment by swapping "marker" to "point" --- binding/python3/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binding/python3/__init__.py b/binding/python3/__init__.py index 99c85307..d8b87dbd 100644 --- a/binding/python3/__init__.py +++ b/binding/python3/__init__.py @@ -189,7 +189,7 @@ def write(self, path): # Fill the parameters groups = self._storage['parameters'] - # Update some important stuff (names of markers and analogs) + # Update some important stuff (names of points and analogs) point_labels = groups['POINT']['LABELS']['value'] for point_label in point_labels: new_c3d.point(point_label) From f096c5dc459d73ba4c82d853eaef45ad1589cf00 Mon Sep 17 00:00:00 2001 From: pariterre Date: Thu, 28 Feb 2019 17:14:41 -0500 Subject: [PATCH 3/4] Made ezc3d work for Mac! --- binding/python3/CMakeLists.txt | 11 +++++++++-- example/CMakeLists.txt | 8 ++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/binding/python3/CMakeLists.txt b/binding/python3/CMakeLists.txt index a8dcc586..d3f2eb4c 100644 --- a/binding/python3/CMakeLists.txt +++ b/binding/python3/CMakeLists.txt @@ -17,8 +17,15 @@ set_property(SOURCE ${I_SOURCE_FILE} PROPERTY CPLUSPLUS ON) SWIG_ADD_LIBRARY(${PROJECT_NAME} TYPE MODULE LANGUAGE python SOURCES ${I_SOURCE_FILE}) swig_link_libraries(${PROJECT_NAME} ${PROJECT_NAME} ${PYTHON_LIBRARIES} ${NUMPY_LIBRARIES}) -SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES INSTALL_RPATH ${${PROJECT_NAME}_BIN_FOLDER}) -SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) +if(APPLE) + SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES SUFFIX ".so" INSTALL_RPATH ${${PROJECT_NAME}_BIN_FOLDER}) + SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) + set_property(TARGET _${PROJECT_NAME} APPEND PROPERTY LINK_FLAGS "-flat_namespace -undefined suppress") +else() + SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES INSTALL_RPATH ${${PROJECT_NAME}_BIN_FOLDER}) + SET_TARGET_PROPERTIES(_${PROJECT_NAME} PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) +endif() + # Install to the proper directories INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 2bb05af1..406c0e81 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -14,11 +14,15 @@ IF(CMAKE_BUILD_TYPE MATCHES "Debug") else() SET(${MASTER_PROJECT_NAME}_LIB_NAME ${MASTER_PROJECT_NAME}) endif() -if (UNIX) +if (APPLE) + string(CONCAT ${MASTER_PROJECT_NAME}_LIB_NAME "lib" ${${MASTER_PROJECT_NAME}_LIB_NAME} ".dylib") +elseif(LINUX) string(CONCAT ${MASTER_PROJECT_NAME}_LIB_NAME "lib" ${${MASTER_PROJECT_NAME}_LIB_NAME} ".so") elseif(WIN32) - message("Compilation won't work on Windows, to be corrected later...") + message("Compilation won't work on Windows, to be corrected later...") string(CONCAT ${MASTER_PROJECT_NAME}_LIB_NAME ${${MASTER_PROJECT_NAME}_LIB_NAME} ".dll") +else() + message(FATAL_ERROR "Unrecognized system") endif() set(${MASTER_PROJECT_NAME}_LIBRARY ${CMAKE_BINARY_DIR}/${${MASTER_PROJECT_NAME}_LIB_NAME}) target_link_libraries(${PROJECT_NAME} ${${MASTER_PROJECT_NAME}_LIBRARY}) From 3b18fd8e3efb5f0eadc87e7951e57a997ac040fa Mon Sep 17 00:00:00 2001 From: pariterre Date: Thu, 28 Feb 2019 17:29:30 -0500 Subject: [PATCH 4/4] Small correction when UNIX but not Mac --- example/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 406c0e81..154e0ac5 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -16,7 +16,7 @@ else() endif() if (APPLE) string(CONCAT ${MASTER_PROJECT_NAME}_LIB_NAME "lib" ${${MASTER_PROJECT_NAME}_LIB_NAME} ".dylib") -elseif(LINUX) +elseif(UNIX) string(CONCAT ${MASTER_PROJECT_NAME}_LIB_NAME "lib" ${${MASTER_PROJECT_NAME}_LIB_NAME} ".so") elseif(WIN32) message("Compilation won't work on Windows, to be corrected later...")