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

Win32 compilation #21

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")


Expand All @@ -74,14 +77,20 @@ 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")

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)
Expand Down
39 changes: 39 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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

git submodule update --init

. ./.travis/functions.ps1

setup_build

./.travis/dependencies/eigen-3.2.ps1

install_dependencies

build_project
test_script:
- cmd: >-
cd %PROJECT_SOURCE_DIR%/build

ctest
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace roboptim
template <typename U, typename V>
void DescriptiveWrapper<U, V>::checkDimension()
{
long size = manifold_->representationDim();
long size = static_cast<long>(manifold_->representationDim());
if (fct_->inputSize() != size)
{
std::stringstream error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ namespace roboptim

/// \brief Deprecated unsafe constructor of a problem on manifold.
template<typename ... Types>
ProblemOnManifold(const mnf::Manifold& manifold, Types&& ... args)
ROBOPTIM_CORE_MANIFOLD_DEPRECATED;
ROBOPTIM_CORE_MANIFOLD_DEPRECATED
ProblemOnManifold(const mnf::Manifold& manifold, Types&& ... args);

virtual ~ProblemOnManifold();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<long>((onTangentSpace?manifold.tangentDim():manifold.representationDim()));
}

return ans;
Expand Down Expand Up @@ -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<long>(manifold.representationDim());
bool sameSize = size1 == size2;
incrementOccurenceCount(*myManifold);

Expand Down Expand Up @@ -382,7 +382,7 @@ namespace roboptim
{
if (manifold.isElementary())
{
return startIndex + (onTangentSpace?manifold.tangentDim():manifold.representationDim());
return startIndex + static_cast<long>(onTangentSpace?manifold.tangentDim():manifold.representationDim());
}
else
{
Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
28 changes: 20 additions & 8 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Member

Choose a reason for hiding this comment

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

This should be protected with a IF(WIN32) check.


# To locate built plug-in.
ADD_DEFINITIONS(-DPLUGIN_PATH="${CMAKE_BINARY_DIR}/src")
ADD_DEFINITIONS(-DTESTS_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
Expand All @@ -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.
Expand Down