From 70785e28e6d794e576689994200f4cf314f9c1fb Mon Sep 17 00:00:00 2001 From: Escande Adrien Date: Wed, 1 Jun 2016 11:46:21 +0900 Subject: [PATCH 1/6] [WIN32] update cmake --- CMakeLists.txt | 13 +++++++++++-- cmake | 2 +- tests/CMakeLists.txt | 28 ++++++++++++++++++++-------- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 994e47e..045a665 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ INCLUDE(cmake/boost.cmake) INCLUDE(cmake/lapack.cmake) INCLUDE(cmake/cpack.cmake) INCLUDE(cmake/eigen.cmake) +INCLUDE(cmake/msvc-specific.cmake) SET(PROJECT_NAME roboptim-core-manifold) SET(PROJECT_DESCRIPTION "RobOptim Core - manifold support") @@ -65,7 +66,9 @@ ELSE() ENDIF() ENDIF() -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +IF(NOT WIN32) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +ENDIF(NOT WIN32) #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -O1 -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls") @@ -74,7 +77,7 @@ SET(BOOST_COMPONENTS date_time filesystem system thread program_options unit_test_framework) SEARCH_FOR_BOOST() -ADD_REQUIRED_DEPENDENCY("eigen3 >= 3.2.0") +SEARCH_FOR_EIGEN("eigen3 >= 3.2.0") ADD_REQUIRED_DEPENDENCY("roboptim-core >= 3.2" "roboptim-core_d >= 3.2") ADD_REQUIRED_DEPENDENCY("manifolds" "manifolds_d") @@ -82,6 +85,12 @@ HEADER_INSTALL("${HEADERS}") OPTION(DISABLE_TESTS "Disable test programs" OFF) +# For MSVC, set local environment variable to enable finding the built dlls +# of roboptim-core and the plugins when launching ctest with RUN_TESTS +IF(MSVC) + SET(CMAKE_MSVCIDE_RUN_PATH "\$(SolutionDir)/src/\$(Configuration)") +ENDIF(MSVC) + ADD_SUBDIRECTORY(src) IF(NOT DISABLE_TESTS) diff --git a/cmake b/cmake index fdd7363..14fd366 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit fdd7363e4a672a5af098139182fbb6e73e46623a +Subproject commit 14fd3668f967ea742f247054896f253d62438950 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b8337ea..bb895a1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,10 +24,17 @@ INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/tests) # Add Boost path to include directories. INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) +LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) # Make Boost.Test generates the main function in test cases. +IF(WIN32) + ADD_DEFINITIONS(-DBOOST_ALL_NO_LIB) +ENDIF(WIN32) ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN) +# Allow big obj file in MSVC (needed for problem factory) +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") + # To locate built plug-in. ADD_DEFINITIONS(-DPLUGIN_PATH="${CMAKE_BINARY_DIR}/src") ADD_DEFINITIONS(-DTESTS_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}") @@ -49,16 +56,21 @@ MACRO(ROBOPTIM_CORE_MANIFOLD_TEST NAME) PKG_CONFIG_USE_DEPENDENCY(${NAME} manifolds) TARGET_LINK_LIBRARIES(${NAME} roboptim-core-manifold) - # Link against Boost. + # Link against Boost if auto-link not available TARGET_LINK_LIBRARIES(${NAME} ${Boost_LIBRARIES}) - + + # Adding a project configuration file (for MSVC only) + GENERATE_MSVC_DOT_USER_FILE(${NAME}) + # Make sure the plugins will be found. - SET_PROPERTY( - TEST ${NAME} PROPERTY ENVIRONMENT - "LTDL_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src:$ENV{LTDL_LIBRARY_PATH}") - SET_PROPERTY( - TEST ${NAME} PROPERTY ENVIRONMENT - "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src:$ENV{LD_LIBRARY_PATH}") + IF(NOT WIN32) + SET_PROPERTY( + TEST ${NAME} PROPERTY ENVIRONMENT + "LTDL_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src:$ENV{LTDL_LIBRARY_PATH}") + SET_PROPERTY( + TEST ${NAME} PROPERTY ENVIRONMENT + "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src:$ENV{LD_LIBRARY_PATH}") + ENDIF(NOT WIN32) ENDMACRO(ROBOPTIM_CORE_MANIFOLD_TEST) # TODO: add tests. From 8ee35c08f63892dc88e0dc596ad65c1cef53bd10 Mon Sep 17 00:00:00 2001 From: Escande Adrien Date: Wed, 1 Jun 2016 14:58:47 +0900 Subject: [PATCH 2/6] [WIN32] small compatibility fixes --- .../core/manifold-map/decorator/problem-on-manifold.hh | 4 ++-- .../core/manifold-map/decorator/wrapper-on-manifold.hxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/roboptim/core/manifold-map/decorator/problem-on-manifold.hh b/include/roboptim/core/manifold-map/decorator/problem-on-manifold.hh index 7f2968b..cf1fbb6 100644 --- a/include/roboptim/core/manifold-map/decorator/problem-on-manifold.hh +++ b/include/roboptim/core/manifold-map/decorator/problem-on-manifold.hh @@ -47,8 +47,8 @@ namespace roboptim /// \brief Deprecated unsafe constructor of a problem on manifold. template - ProblemOnManifold(const mnf::Manifold& manifold, Types&& ... args) - ROBOPTIM_CORE_MANIFOLD_DEPRECATED; + ROBOPTIM_CORE_MANIFOLD_DEPRECATED + ProblemOnManifold(const mnf::Manifold& manifold, Types&& ... args); virtual ~ProblemOnManifold(); diff --git a/include/roboptim/core/manifold-map/decorator/wrapper-on-manifold.hxx b/include/roboptim/core/manifold-map/decorator/wrapper-on-manifold.hxx index 2d31053..77a1dd8 100644 --- a/include/roboptim/core/manifold-map/decorator/wrapper-on-manifold.hxx +++ b/include/roboptim/core/manifold-map/decorator/wrapper-on-manifold.hxx @@ -382,7 +382,7 @@ namespace roboptim { if (manifold.isElementary()) { - return startIndex + (onTangentSpace?manifold.tangentDim():manifold.representationDim()); + return startIndex + static_cast(onTangentSpace?manifold.tangentDim():manifold.representationDim()); } else { From 986b0bac4bb64126b5cf0765532e115ef1e5a564 Mon Sep 17 00:00:00 2001 From: Escande Adrien Date: Wed, 1 Jun 2016 16:02:19 +0900 Subject: [PATCH 3/6] [appveyor] appveyor script --- appveyor.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..367c231 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,37 @@ +version: 1.0.{build} +os: Visual Studio 2015 +clone_folder: C:/devel-src/roboptim-core-manifold +init: +- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +environment: + CI_OS_NAME: win32 + CI_TOOL: appveyor + CHOCO_DEPENDENCIES: "doxygen.portable" + GIT_DEPENDENCIES: "roboptim/roboptim-core#dev stanislas-brossette/manifolds#dev" +# Should be the same as clone_folder + PROJECT_SOURCE_DIR: C:/devel-src/roboptim-core-manifold +# Do not tinker with the variables below unless you know what you are doing + SOURCE_FOLDER: C:\devel-src + CMAKE_INSTALL_PREFIX: C:/devel + PATH: C:/devel/bin;C:\Libraries\boost_1_60_0\lib64-msvc-14.0;%PATH% + PKG_CONFIG_PATH: C:/devel/lib/pkgconfig + BOOST_ROOT: C:\Libraries\boost_1_60_0 + BOOST_LIBRARYDIR: C:\Libraries\boost_1_60_0\lib64-msvc-14.0 +build_script: +- ps: >- + Set-PSDebug -Trace 2 + + . ./.travis/functions.ps1 + + setup_build + + ./.travis/dependencies/eigen-3.2.ps1 + + install_dependencies + + build_project +test_script: +- cmd: >- + cd %PROJECT_SOURCE_DIR%/build + + #ctest From d7ae29b634b269c704f2c2eea41d4724d4b080a8 Mon Sep 17 00:00:00 2001 From: Escande Adrien Date: Thu, 9 Jun 2016 19:03:13 +0900 Subject: [PATCH 4/6] fix script --- appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 367c231..0cd448a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,6 +21,8 @@ build_script: - ps: >- Set-PSDebug -Trace 2 + git submodule update --init + . ./.travis/functions.ps1 setup_build @@ -34,4 +36,4 @@ test_script: - cmd: >- cd %PROJECT_SOURCE_DIR%/build - #ctest + ctest From 24f54e17b784a2cb9bbfe3f01307ae724e4675c5 Mon Sep 17 00:00:00 2001 From: Escande Adrien Date: Mon, 24 Apr 2017 16:01:45 +0900 Subject: [PATCH 5/6] fix installation folder --- src/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8d5cb41..13b9720 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,4 +27,8 @@ PKG_CONFIG_APPEND_LIBS(roboptim-core-manifold) PKG_CONFIG_USE_DEPENDENCY(roboptim-core-manifold roboptim-core) PKG_CONFIG_USE_DEPENDENCY(roboptim-core-manifold manifolds) -INSTALL(TARGETS roboptim-core-manifold DESTINATION ${CMAKE_INSTALL_LIBDIR}) +INSTALL(TARGETS roboptim-core-manifold + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) From a63f876212a613ea7f0166a459fc07c8a4a2aabd Mon Sep 17 00:00:00 2001 From: Escande Adrien Date: Mon, 24 Apr 2017 16:02:02 +0900 Subject: [PATCH 6/6] remove warnings --- .../core/manifold-map/decorator/descriptive-wrapper.hxx | 2 +- .../core/manifold-map/decorator/wrapper-on-manifold.hxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/roboptim/core/manifold-map/decorator/descriptive-wrapper.hxx b/include/roboptim/core/manifold-map/decorator/descriptive-wrapper.hxx index be05049..4d8c31b 100644 --- a/include/roboptim/core/manifold-map/decorator/descriptive-wrapper.hxx +++ b/include/roboptim/core/manifold-map/decorator/descriptive-wrapper.hxx @@ -86,7 +86,7 @@ namespace roboptim template void DescriptiveWrapper::checkDimension() { - long size = manifold_->representationDim(); + long size = static_cast(manifold_->representationDim()); if (fct_->inputSize() != size) { std::stringstream error; diff --git a/include/roboptim/core/manifold-map/decorator/wrapper-on-manifold.hxx b/include/roboptim/core/manifold-map/decorator/wrapper-on-manifold.hxx index 77a1dd8..7e000a4 100644 --- a/include/roboptim/core/manifold-map/decorator/wrapper-on-manifold.hxx +++ b/include/roboptim/core/manifold-map/decorator/wrapper-on-manifold.hxx @@ -203,7 +203,7 @@ namespace roboptim ans.first = std::max(0l, ans.first); if (ans.second < 0) { - ans.second = (onTangentSpace?manifold.tangentDim():manifold.representationDim()); + ans.second = static_cast((onTangentSpace?manifold.tangentDim():manifold.representationDim())); } return ans; @@ -268,7 +268,7 @@ namespace roboptim bool sameType = myManifold->getTypeId() == manifold.getTypeId(); bool isNotRealSpace = myManifold->getTypeId() != mnf::RealSpace(1).getTypeId(); long size1 = getRestriction(*myManifold, getCurrentOccurenceCount(*myManifold), 0).second; - long size2 = manifold.representationDim(); + long size2 = static_cast(manifold.representationDim()); bool sameSize = size1 == size2; incrementOccurenceCount(*myManifold);