Update ms_stdint.h in metis. Export libraries correctly

release/4.3a0
Andrew Melim 2014-10-14 19:14:59 -04:00
parent 0771b1658b
commit ad74a4b8c9
7 changed files with 101 additions and 51 deletions

View File

@ -53,7 +53,7 @@ option(GTSAM_BUILD_STATIC_LIBRARY "Build a static gtsam library, instead
option(GTSAM_USE_QUATERNIONS "Enable/Disable using an internal Quaternion representation for rotations instead of rotation matrices. If enable, Rot3::EXPMAP is enforced by default." OFF) option(GTSAM_USE_QUATERNIONS "Enable/Disable using an internal Quaternion representation for rotations instead of rotation matrices. If enable, Rot3::EXPMAP is enforced by default." OFF)
option(GTSAM_POSE3_EXPMAP "Enable/Disable using Pose3::EXPMAP as the default mode. If disabled, Pose3::FIRST_ORDER will be used." OFF) option(GTSAM_POSE3_EXPMAP "Enable/Disable using Pose3::EXPMAP as the default mode. If disabled, Pose3::FIRST_ORDER will be used." OFF)
option(GTSAM_ROT3_EXPMAP "Ignore if GTSAM_USE_QUATERNIONS is OFF (Rot3::EXPMAP by default). Otherwise, enable Rot3::EXPMAP, or if disabled, use Rot3::CAYLEY." OFF) option(GTSAM_ROT3_EXPMAP "Ignore if GTSAM_USE_QUATERNIONS is OFF (Rot3::EXPMAP by default). Otherwise, enable Rot3::EXPMAP, or if disabled, use Rot3::CAYLEY." OFF)
option(GTSAM_ENABLE_CONSISTENCY_CHECKS "Enable/Disable expensive consistency checks" OFF) option(GTSAM_ENABLE_CONSISTENCY_CHECKS "Enable/Disable expensive consistency checks" OFF)
option(GTSAM_WITH_TBB "Use Intel Threaded Building Blocks (TBB) if available" ON) option(GTSAM_WITH_TBB "Use Intel Threaded Building Blocks (TBB) if available" ON)
option(GTSAM_WITH_EIGEN_MKL "Eigen will use Intel MKL if available" ON) option(GTSAM_WITH_EIGEN_MKL "Eigen will use Intel MKL if available" ON)
option(GTSAM_WITH_EIGEN_MKL_OPENMP "Eigen, when using Intel MKL, will also use OpenMP for multithreading if available" ON) option(GTSAM_WITH_EIGEN_MKL_OPENMP "Eigen, when using Intel MKL, will also use OpenMP for multithreading if available" ON)
@ -197,13 +197,13 @@ set(GTSAM_USE_SYSTEM_EIGEN OFF)
if(GTSAM_USE_SYSTEM_EIGEN) if(GTSAM_USE_SYSTEM_EIGEN)
# Use generic Eigen include paths e.g. <Eigen/Core> # Use generic Eigen include paths e.g. <Eigen/Core>
set(GTSAM_EIGEN_INCLUDE_PREFIX "") set(GTSAM_EIGEN_INCLUDE_PREFIX "")
find_package(Eigen3 REQUIRED) find_package(Eigen3 REQUIRED)
include_directories(AFTER "${EIGEN3_INCLUDE_DIR}") include_directories(AFTER "${EIGEN3_INCLUDE_DIR}")
else() else()
# Use bundled Eigen include paths e.g. <gtsam/3rdparty/Eigen/Eigen/Core> # Use bundled Eigen include paths e.g. <gtsam/3rdparty/Eigen/Eigen/Core>
set(GTSAM_EIGEN_INCLUDE_PREFIX "gtsam/3rdparty/Eigen/") set(GTSAM_EIGEN_INCLUDE_PREFIX "gtsam/3rdparty/Eigen/")
# Clear any variables set by FindEigen3 # Clear any variables set by FindEigen3
if(EIGEN3_INCLUDE_DIR) if(EIGEN3_INCLUDE_DIR)
set(EIGEN3_INCLUDE_DIR NOTFOUND CACHE STRING "" FORCE) set(EIGEN3_INCLUDE_DIR NOTFOUND CACHE STRING "" FORCE)
@ -262,7 +262,7 @@ include_directories(BEFORE ${Boost_INCLUDE_DIR})
# paths so that the compiler uses GTSAM headers in our source directory instead # paths so that the compiler uses GTSAM headers in our source directory instead
# of any previously installed GTSAM headers. # of any previously installed GTSAM headers.
include_directories(BEFORE include_directories(BEFORE
gtsam/3rdparty/UFconfig gtsam/3rdparty/UFconfig
gtsam/3rdparty/CCOLAMD/Include gtsam/3rdparty/CCOLAMD/Include
gtsam/3rdparty/metis-5.1.0/include gtsam/3rdparty/metis-5.1.0/include
gtsam/3rdparty/metis-5.1.0/libmetis gtsam/3rdparty/metis-5.1.0/libmetis
@ -322,8 +322,10 @@ endif(GTSAM_BUILD_UNSTABLE)
# Install config and export files # Install config and export files
GtsamMakeConfigFile(GTSAM "${CMAKE_CURRENT_SOURCE_DIR}/gtsam_extra.cmake.in") GtsamMakeConfigFile(GTSAM "${CMAKE_CURRENT_SOURCE_DIR}/gtsam_extra.cmake.in")
message("GTSAM export: ${GTSAM_EXPORTED_TARGETS}")
export(TARGETS ${GTSAM_EXPORTED_TARGETS} FILE GTSAM-exports.cmake) export(TARGETS ${GTSAM_EXPORTED_TARGETS} FILE GTSAM-exports.cmake)
# Check for doxygen availability - optional dependency # Check for doxygen availability - optional dependency
find_package(Doxygen) find_package(Doxygen)

View File

@ -18,7 +18,7 @@ if(NOT GTSAM_USE_SYSTEM_EIGEN)
# do the same for the unsupported eigen folder # do the same for the unsupported eigen folder
file(GLOB_RECURSE unsupported_eigen_headers "${CMAKE_CURRENT_SOURCE_DIR}/Eigen/unsupported/Eigen/*.h") file(GLOB_RECURSE unsupported_eigen_headers "${CMAKE_CURRENT_SOURCE_DIR}/Eigen/unsupported/Eigen/*.h")
file(GLOB unsupported_eigen_dir_headers_all "Eigen/unsupported/Eigen/*") file(GLOB unsupported_eigen_dir_headers_all "Eigen/unsupported/Eigen/*")
foreach(unsupported_eigen_dir ${unsupported_eigen_dir_headers_all}) foreach(unsupported_eigen_dir ${unsupported_eigen_dir_headers_all})
get_filename_component(filename ${unsupported_eigen_dir} NAME) get_filename_component(filename ${unsupported_eigen_dir} NAME)
@ -36,7 +36,7 @@ if(NOT GTSAM_USE_SYSTEM_EIGEN)
install(DIRECTORY Eigen/Eigen install(DIRECTORY Eigen/Eigen
DESTINATION include/gtsam/3rdparty/Eigen DESTINATION include/gtsam/3rdparty/Eigen
FILES_MATCHING PATTERN "*.h") FILES_MATCHING PATTERN "*.h")
install(DIRECTORY Eigen/unsupported/Eigen install(DIRECTORY Eigen/unsupported/Eigen
DESTINATION include/gtsam/3rdparty/Eigen/unsupported/ DESTINATION include/gtsam/3rdparty/Eigen/unsupported/
FILES_MATCHING PATTERN "*.h") FILES_MATCHING PATTERN "*.h")
@ -73,3 +73,5 @@ endif()
if(GTSAM_INSTALL_GEOGRAPHICLIB) if(GTSAM_INSTALL_GEOGRAPHICLIB)
add_subdirectory(GeographicLib) add_subdirectory(GeographicLib)
endif() endif()
set(GTSAM_EXPORTED_TARGETS "${GTSAM_EXPORTED_TARGETS}" PARENT_SCOPE)

View File

@ -47,3 +47,5 @@ if(GTSAM_BUILD_METIS_EXECUTABLES)
add_subdirectory("programs") add_subdirectory("programs")
endif() endif()
set(GTSAM_EXPORTED_TARGETS "${GTSAM_EXPORTED_TARGETS}" PARENT_SCOPE)

View File

@ -1,7 +1,7 @@
// ISO C9x compliant stdint.h for Microsoft Visual Studio // ISO C9x compliant stdint.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
// //
// Copyright (c) 2006 Alexander Chemeris // Copyright (c) 2006-2013 Alexander Chemeris
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met: // modification, are permitted provided that the following conditions are met:
@ -13,8 +13,9 @@
// notice, this list of conditions and the following disclaimer in the // notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution. // documentation and/or other materials provided with the distribution.
// //
// 3. The name of the author may be used to endorse or promote products // 3. Neither the name of the product nor the names of its contributors may
// derived from this software without specific prior written permission. // be used to endorse or promote products derived from this software
// without specific prior written permission.
// //
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
@ -40,30 +41,59 @@
#pragma once #pragma once
#endif #endif
#if _MSC_VER >= 1600 // [
#include <stdint.h>
#else // ] _MSC_VER >= 1600 [
#include <limits.h> #include <limits.h>
// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}' // For Visual Studio 6 in C++ mode and for many Visual Studio versions when
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
// or compiler give many errors like this: // or compiler give many errors like this:
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed // error C2733: second C linkage of overloaded function 'wmemchr' not allowed
#if (_MSC_VER < 1300) && defined(__cplusplus) #ifdef __cplusplus
extern "C++" { extern "C" {
#endif
# include <wchar.h>
#if (_MSC_VER < 1300) && defined(__cplusplus)
}
#endif #endif
# include <wchar.h>
#ifdef __cplusplus
}
#endif
// Define _W64 macros to mark types changing their size, like intptr_t.
#ifndef _W64
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
# define _W64 __w64
# else
# define _W64
# endif
#endif
// 7.18.1 Integer types // 7.18.1 Integer types
// 7.18.1.1 Exact-width integer types // 7.18.1.1 Exact-width integer types
typedef __int8 int8_t;
typedef __int16 int16_t; // Visual Studio 6 and Embedded Visual C++ 4 doesn't
typedef __int32 int32_t; // realize that, e.g. char has the same size as __int8
typedef __int64 int64_t; // so we give up on __intX for them.
#if (_MSC_VER < 1300)
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#else
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef unsigned __int8 uint8_t; typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t; typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t; #endif
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
// 7.18.1.2 Minimum-width integer types // 7.18.1.2 Minimum-width integer types
typedef int8_t int_least8_t; typedef int8_t int_least8_t;
@ -87,11 +117,11 @@ typedef uint64_t uint_fast64_t;
// 7.18.1.4 Integer types capable of holding object pointers // 7.18.1.4 Integer types capable of holding object pointers
#ifdef _WIN64 // [ #ifdef _WIN64 // [
typedef __int64 intptr_t; typedef signed __int64 intptr_t;
typedef unsigned __int64 uintptr_t; typedef unsigned __int64 uintptr_t;
#else // _WIN64 ][ #else // _WIN64 ][
typedef int intptr_t; typedef _W64 signed int intptr_t;
typedef unsigned int uintptr_t; typedef _W64 unsigned int uintptr_t;
#endif // _WIN64 ] #endif // _WIN64 ]
// 7.18.1.5 Greatest-width integer types // 7.18.1.5 Greatest-width integer types
@ -213,10 +243,17 @@ typedef uint64_t uintmax_t;
#define UINT64_C(val) val##ui64 #define UINT64_C(val) val##ui64
// 7.18.4.2 Macros for greatest-width integer constants // 7.18.4.2 Macros for greatest-width integer constants
#define INTMAX_C INT64_C // These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.
#define UINTMAX_C UINT64_C // Check out Issue 9 for the details.
#ifndef INTMAX_C // [
# define INTMAX_C INT64_C
#endif // INTMAX_C ]
#ifndef UINTMAX_C // [
# define UINTMAX_C UINT64_C
#endif // UINTMAX_C ]
#endif // __STDC_CONSTANT_MACROS ] #endif // __STDC_CONSTANT_MACROS ]
#endif // _MSC_VER >= 1600 ]
#endif // _MSC_STDINT_H_ ] #endif // _MSC_STDINT_H_ ]

View File

@ -14,4 +14,7 @@ install(TARGETS metis
RUNTIME DESTINATION include/gtsam/3rdparty/metis/lib RUNTIME DESTINATION include/gtsam/3rdparty/metis/lib
ARCHIVE DESTINATION include/gtsam/3rdparty/metis/lib) ARCHIVE DESTINATION include/gtsam/3rdparty/metis/lib)
install(TARGETS metis EXPORT GTSAM-exports ARCHIVE DESTINATION lib)
list(APPEND GTSAM_EXPORTED_TARGETS metis)
set(GTSAM_EXPORTED_TARGETS "${GTSAM_EXPORTED_TARGETS}" PARENT_SCOPE)

View File

@ -1,14 +1,14 @@
# We split the library in to separate subfolders, each containing # We split the library in to separate subfolders, each containing
# tests, timing, and an optional convenience library. # tests, timing, and an optional convenience library.
# The following variable is the master list of subdirs to add # The following variable is the master list of subdirs to add
set (gtsam_subdirs set (gtsam_subdirs
base base
geometry geometry
inference inference
symbolic symbolic
discrete discrete
linear linear
nonlinear nonlinear
slam slam
navigation navigation
) )
@ -16,12 +16,12 @@ set (gtsam_subdirs
set(gtsam_srcs) set(gtsam_srcs)
# Build 3rdparty separately # Build 3rdparty separately
message(STATUS "Building 3rdparty") message(STATUS "Building 3rdparty")
add_subdirectory(3rdparty) add_subdirectory(3rdparty)
set (3rdparty_srcs set (3rdparty_srcs
${eigen_headers} # Set by 3rdparty/CMakeLists.txt ${eigen_headers} # Set by 3rdparty/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/CCOLAMD/Source/ccolamd.c ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/CCOLAMD/Source/ccolamd.c
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/CCOLAMD/Source/ccolamd_global.c ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/CCOLAMD/Source/ccolamd_global.c
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/UFconfig/UFconfig.c) ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/UFconfig/UFconfig.c)
gtsam_assign_source_folders("${3rdparty_srcs}") # Create MSVC structure gtsam_assign_source_folders("${3rdparty_srcs}") # Create MSVC structure
@ -36,7 +36,7 @@ set (excluded_sources #"")
set (excluded_headers #"") set (excluded_headers #"")
"${CMAKE_CURRENT_SOURCE_DIR}/slam/serialization.h" "${CMAKE_CURRENT_SOURCE_DIR}/slam/serialization.h"
) )
if(GTSAM_USE_QUATERNIONS) if(GTSAM_USE_QUATERNIONS)
set(excluded_sources ${excluded_sources} "${CMAKE_CURRENT_SOURCE_DIR}/geometry/Rot3M.cpp") set(excluded_sources ${excluded_sources} "${CMAKE_CURRENT_SOURCE_DIR}/geometry/Rot3M.cpp")
else() else()
@ -58,10 +58,10 @@ foreach(subdir ${gtsam_subdirs})
set(${subdir}_srcs ${subdir_srcs}) set(${subdir}_srcs ${subdir_srcs})
# Build local library and tests # Build local library and tests
message(STATUS "Building ${subdir}") message(STATUS "Building ${subdir}")
add_subdirectory(${subdir}) add_subdirectory(${subdir})
endforeach(subdir) endforeach(subdir)
# To add additional sources to gtsam when building the full library (static or shared) # To add additional sources to gtsam when building the full library (static or shared)
# Add the subfolder with _srcs appended to the end to this list # Add the subfolder with _srcs appended to the end to this list
set(gtsam_srcs set(gtsam_srcs
@ -77,7 +77,7 @@ set(gtsam_srcs
${navigation_srcs} ${navigation_srcs}
${gtsam_core_headers} ${gtsam_core_headers}
) )
# Generate and install config and dllexport files # Generate and install config and dllexport files
configure_file(config.h.in config.h) configure_file(config.h.in config.h)
set(library_name GTSAM) # For substitution in dllexport.h.in set(library_name GTSAM) # For substitution in dllexport.h.in
@ -85,18 +85,22 @@ configure_file("${PROJECT_SOURCE_DIR}/cmake/dllexport.h.in" "dllexport.h")
list(APPEND gtsam_srcs "${PROJECT_BINARY_DIR}/gtsam/config.h" "${PROJECT_BINARY_DIR}/gtsam/dllexport.h") list(APPEND gtsam_srcs "${PROJECT_BINARY_DIR}/gtsam/config.h" "${PROJECT_BINARY_DIR}/gtsam/dllexport.h")
install(FILES "${PROJECT_BINARY_DIR}/gtsam/config.h" "${PROJECT_BINARY_DIR}/gtsam/dllexport.h" DESTINATION include/gtsam) install(FILES "${PROJECT_BINARY_DIR}/gtsam/config.h" "${PROJECT_BINARY_DIR}/gtsam/dllexport.h" DESTINATION include/gtsam)
list(APPEND GTSAM_ADDITIONAL_LIBRARIES metis)
# Versions # Versions
set(gtsam_version ${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}) set(gtsam_version ${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH})
set(gtsam_soversion ${GTSAM_VERSION_MAJOR}) set(gtsam_soversion ${GTSAM_VERSION_MAJOR})
message(STATUS "GTSAM Version: ${gtsam_version}") message(STATUS "GTSAM Version: ${gtsam_version}")
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}") message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "GTSAM Additional: ${GTSAM_ADDITIONAL_LIBRARIES}") message("GTSAM Additional: ${GTSAM_ADDITIONAL_LIBRARIES}")
message("GTSAM Exports: ${GTSAM_EXPORTED_TARGETS}")
# build shared and static versions of the library # build shared and static versions of the library
if (GTSAM_BUILD_STATIC_LIBRARY) if (GTSAM_BUILD_STATIC_LIBRARY)
message(STATUS "Building GTSAM - static") message(STATUS "Building GTSAM - static")
add_library(gtsam STATIC ${gtsam_srcs}) add_library(gtsam STATIC ${gtsam_srcs})
target_link_libraries(gtsam ${GTSAM_BOOST_LIBRARIES} metis ${GTSAM_ADDITIONAL_LIBRARIES}) target_link_libraries(gtsam ${GTSAM_BOOST_LIBRARIES} ${GTSAM_ADDITIONAL_LIBRARIES})
set_target_properties(gtsam PROPERTIES set_target_properties(gtsam PROPERTIES
OUTPUT_NAME gtsam OUTPUT_NAME gtsam
CLEAN_DIRECT_OUTPUT 1 CLEAN_DIRECT_OUTPUT 1
VERSION ${gtsam_version} VERSION ${gtsam_version}
@ -112,8 +116,8 @@ if (GTSAM_BUILD_STATIC_LIBRARY)
else() else()
message(STATUS "Building GTSAM - shared") message(STATUS "Building GTSAM - shared")
add_library(gtsam SHARED ${gtsam_srcs}) add_library(gtsam SHARED ${gtsam_srcs})
target_link_libraries(gtsam ${GTSAM_BOOST_LIBRARIES} metis ${GTSAM_ADDITIONAL_LIBRARIES}) target_link_libraries(gtsam ${GTSAM_BOOST_LIBRARIES} ${GTSAM_ADDITIONAL_LIBRARIES})
set_target_properties(gtsam PROPERTIES set_target_properties(gtsam PROPERTIES
OUTPUT_NAME gtsam OUTPUT_NAME gtsam
CLEAN_DIRECT_OUTPUT 1 CLEAN_DIRECT_OUTPUT 1
VERSION ${gtsam_version} VERSION ${gtsam_version}
@ -134,7 +138,7 @@ set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/slam/dataset.cpp"
APPEND PROPERTY COMPILE_DEFINITIONS APPEND PROPERTY COMPILE_DEFINITIONS
"SOURCE_TREE_DATASET_DIR=\"${PROJECT_SOURCE_DIR}/examples/Data\"" "SOURCE_TREE_DATASET_DIR=\"${PROJECT_SOURCE_DIR}/examples/Data\""
"INSTALLED_DATASET_DIR=\"${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam_examples/Data\"") "INSTALLED_DATASET_DIR=\"${GTSAM_TOOLBOX_INSTALL_PATH}/gtsam_examples/Data\"")
# Special cases # Special cases
if(MSVC) if(MSVC)
set_property(SOURCE set_property(SOURCE
@ -147,7 +151,7 @@ endif()
if (GTSAM_INSTALL_MATLAB_TOOLBOX) if (GTSAM_INSTALL_MATLAB_TOOLBOX)
# Set up codegen # Set up codegen
include(GtsamMatlabWrap) include(GtsamMatlabWrap)
# Generate, build and install toolbox # Generate, build and install toolbox
set(mexFlags "${GTSAM_BUILD_MEX_BINARY_FLAGS}") set(mexFlags "${GTSAM_BUILD_MEX_BINARY_FLAGS}")
if(GTSAM_BUILD_STATIC_LIBRARY) if(GTSAM_BUILD_STATIC_LIBRARY)

View File

@ -155,7 +155,7 @@ namespace gtsam {
static GTSAM_EXPORT Ordering METIS(const MetisIndex& met); static GTSAM_EXPORT Ordering METIS(const MetisIndex& met);
template<class FACTOR> template<class FACTOR>
static GTSAM_EXPORT Ordering METIS(const FactorGraph<FACTOR>& graph) static Ordering METIS(const FactorGraph<FACTOR>& graph)
{ {
return METIS(MetisIndex(graph)); return METIS(MetisIndex(graph));
} }