Merge branch 'release/2.4.0'

Conflicts:
	gtsam/slam/tests/testBetweenFactor.cpp
release/4.3a0
cbeall3 2015-03-07 00:02:54 -05:00
commit 69f2dcce60
819 changed files with 205118 additions and 3698 deletions

1982
.cproject

File diff suppressed because it is too large Load Diff

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/build/
/*.DS_Store

View File

@ -4,8 +4,8 @@ cmake_minimum_required(VERSION 2.6)
# Set the version number for the library # Set the version number for the library
set (GTSAM_VERSION_MAJOR 2) set (GTSAM_VERSION_MAJOR 2)
set (GTSAM_VERSION_MINOR 3) set (GTSAM_VERSION_MINOR 4)
set (GTSAM_VERSION_PATCH 1) set (GTSAM_VERSION_PATCH 0)
############################################################################### ###############################################################################
@ -130,7 +130,12 @@ endif()
############################################################################### ###############################################################################
# Option for using system Eigen or GTSAM-bundled Eigen # Option for using system Eigen or GTSAM-bundled Eigen
option(GTSAM_USE_SYSTEM_EIGEN "Find and use system-installed Eigen. If 'off', use the one bundled with GTSAM" OFF) ### Disabled until our patches are included in Eigen ###
### See: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=704 (Householder QR MKL selection)
### http://eigen.tuxfamily.org/bz/show_bug.cgi?id=705 (Fix MKL LLT return code)
### http://eigen.tuxfamily.org/bz/show_bug.cgi?id=716 (Improved comma initialization)
# option(GTSAM_USE_SYSTEM_EIGEN "Find and use system-installed Eigen. If 'off', use the one bundled with GTSAM" OFF)
set(GTSAM_USE_SYSTEM_EIGEN OFF)
# Switch for using system Eigen or GTSAM-bundled Eigen # Switch for using system Eigen or GTSAM-bundled Eigen
if(GTSAM_USE_SYSTEM_EIGEN) if(GTSAM_USE_SYSTEM_EIGEN)
@ -153,7 +158,7 @@ endif()
configure_file(gtsam/3rdparty/gtsam_eigen_includes.h.in gtsam/3rdparty/gtsam_eigen_includes.h) configure_file(gtsam/3rdparty/gtsam_eigen_includes.h.in gtsam/3rdparty/gtsam_eigen_includes.h)
# Install the configuration file for Eigen # Install the configuration file for Eigen
install(FILES ${CMAKE_BINARY_DIR}/gtsam/3rdparty/gtsam_eigen_includes.h DESTINATION include/gtsam/3rdparty) install(FILES ${PROJECT_BINARY_DIR}/gtsam/3rdparty/gtsam_eigen_includes.h DESTINATION include/gtsam/3rdparty)
############################################################################### ###############################################################################
@ -169,8 +174,8 @@ include_directories(BEFORE ${Boost_INCLUDE_DIR})
include_directories(BEFORE include_directories(BEFORE
gtsam/3rdparty/UFconfig gtsam/3rdparty/UFconfig
gtsam/3rdparty/CCOLAMD/Include gtsam/3rdparty/CCOLAMD/Include
${CMAKE_SOURCE_DIR} ${PROJECT_SOURCE_DIR}
${CMAKE_BINARY_DIR} # So we can include generated config header files ${PROJECT_BINARY_DIR} # So we can include generated config header files
CppUnitLite) CppUnitLite)
if(MSVC) if(MSVC)

View File

@ -15,4 +15,9 @@ endif()
# Load exports # Load exports
include(${OUR_CMAKE_DIR}/@PACKAGE_NAME@-exports.cmake) include(${OUR_CMAKE_DIR}/@PACKAGE_NAME@-exports.cmake)
message(STATUS "GTSAM include directory: ${@CMAKE_PROJECT_NAME@_INCLUDE_DIR}") # Load project-specific flags, if present
if(EXISTS "${OUR_CMAKE_DIR}/@EXTRA_FILE@")
include("${OUR_CMAKE_DIR}/@EXTRA_FILE@")
endif()
message(STATUS "@CMAKE_PROJECT_NAME@ include directory: ${@CMAKE_PROJECT_NAME@_INCLUDE_DIR}")

View File

@ -0,0 +1,42 @@
# -*- cmake -*-
# - Find Google perftools
# Find the Google perftools includes and libraries
# This module defines
# GOOGLE_PERFTOOLS_INCLUDE_DIR, where to find heap-profiler.h, etc.
# GOOGLE_PERFTOOLS_FOUND, If false, do not try to use Google perftools.
# also defined for general use are
# TCMALLOC_LIBRARY, where to find the tcmalloc library.
FIND_PATH(GOOGLE_PERFTOOLS_INCLUDE_DIR google/heap-profiler.h
/usr/local/include
/usr/include
)
SET(TCMALLOC_NAMES ${TCMALLOC_NAMES} tcmalloc)
FIND_LIBRARY(TCMALLOC_LIBRARY
NAMES ${TCMALLOC_NAMES}
PATHS /usr/lib /usr/local/lib
)
IF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
SET(TCMALLOC_LIBRARIES ${TCMALLOC_LIBRARY})
SET(GOOGLE_PERFTOOLS_FOUND "YES")
ELSE (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
SET(GOOGLE_PERFTOOLS_FOUND "NO")
ENDIF (TCMALLOC_LIBRARY AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
IF (GOOGLE_PERFTOOLS_FOUND)
IF (NOT GOOGLE_PERFTOOLS_FIND_QUIETLY)
MESSAGE(STATUS "Found Google perftools: ${GOOGLE_PERFTOOLS_LIBRARIES}")
ENDIF (NOT GOOGLE_PERFTOOLS_FIND_QUIETLY)
ELSE (GOOGLE_PERFTOOLS_FOUND)
IF (GOOGLE_PERFTOOLS_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Google perftools library")
ENDIF (GOOGLE_PERFTOOLS_FIND_REQUIRED)
ENDIF (GOOGLE_PERFTOOLS_FOUND)
MARK_AS_ADVANCED(
TCMALLOC_LIBRARY
GOOGLE_PERFTOOLS_INCLUDE_DIR
)

241
cmake/FindMKL.cmake Normal file
View File

@ -0,0 +1,241 @@
# This file is adapted from the one in OpenMEEG: http://www-sop.inria.fr/athena/software/OpenMEEG/
# - Try to find the Intel Math Kernel Library
# Once done this will define
#
# MKL_FOUND - system has MKL
# MKL_ROOT_DIR - path to the MKL base directory
# MKL_INCLUDE_DIR - the MKL include directory
# MKL_LIBRARIES - MKL libraries
#
# There are few sets of libraries:
# Array indexes modes:
# LP - 32 bit indexes of arrays
# ILP - 64 bit indexes of arrays
# Threading:
# SEQUENTIAL - no threading
# INTEL - Intel threading library
# GNU - GNU threading library
# MPI support
# NOMPI - no MPI support
# INTEL - Intel MPI library
# OPEN - Open MPI library
# SGI - SGI MPT Library
# linux
IF(UNIX AND NOT APPLE)
IF(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
SET(MKL_ARCH_DIR "intel64")
ELSE()
SET(MKL_ARCH_DIR "32")
ENDIF()
ENDIF()
# macos
IF(APPLE)
SET(MKL_ARCH_DIR "intel64")
ENDIF()
IF(FORCE_BUILD_32BITS)
set(MKL_ARCH_DIR "32")
ENDIF()
# windows
IF(WIN32)
IF(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
SET(MKL_ARCH_DIR "intel64")
ELSE()
SET(MKL_ARCH_DIR "ia32")
ENDIF()
ENDIF()
SET(MKL_THREAD_VARIANTS SEQUENTIAL GNUTHREAD INTELTHREAD)
SET(MKL_MODE_VARIANTS ILP LP)
SET(MKL_MPI_VARIANTS NOMPI INTELMPI OPENMPI SGIMPT)
FIND_PATH(MKL_ROOT_DIR
include/mkl_cblas.h
PATHS
$ENV{MKLDIR}
/opt/intel/mkl/
/opt/intel/mkl/*/
/opt/intel/cmkl/
/opt/intel/cmkl/*/
/Library/Frameworks/Intel_MKL.framework/Versions/Current/lib/universal
"C:/Program Files (x86)/Intel/ComposerXE-2011/mkl"
"C:/Program Files (x86)/Intel/Composer XE 2013/mkl"
"C:/Program Files/Intel/MKL/*/"
"C:/Program Files/Intel/ComposerXE-2011/mkl"
"C:/Program Files/Intel/Composer XE 2013/mkl"
)
FIND_PATH(MKL_INCLUDE_DIR
mkl_cblas.h
PATHS
${MKL_ROOT_DIR}/include
${INCLUDE_INSTALL_DIR}
)
FIND_PATH(MKL_FFTW_INCLUDE_DIR
fftw3.h
PATH_SUFFIXES fftw
PATHS
${MKL_ROOT_DIR}/include
${INCLUDE_INSTALL_DIR}
NO_DEFAULT_PATH
)
IF(WIN32)
SET(MKL_LIB_SEARCHPATH $ENV{ICC_LIB_DIR} $ENV{MKL_LIB_DIR} "${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}" "${MKL_ROOT_DIR}/../compiler" "${MKL_ROOT_DIR}/../compiler/lib/${MKL_ARCH_DIR}")
IF (MKL_INCLUDE_DIR MATCHES "10.")
IF(CMAKE_CL_64)
SET(MKL_LIBS mkl_solver_lp64 mkl_core mkl_intel_lp64 mkl_intel_thread libguide mkl_lapack95_lp64 mkl_blas95_lp64)
ELSE()
SET(MKL_LIBS mkl_solver mkl_core mkl_intel_c mkl_intel_s mkl_intel_thread libguide mkl_lapack95 mkl_blas95)
ENDIF()
ELSEIF(MKL_INCLUDE_DIR MATCHES "2013") # version 11 ...
IF(CMAKE_CL_64)
SET(MKL_LIBS mkl_core mkl_intel_lp64 mkl_intel_thread libiomp5md mkl_lapack95_lp64 mkl_blas95_lp64)
ELSE()
SET(MKL_LIBS mkl_core mkl_intel_c mkl_intel_s mkl_intel_thread libiomp5md mkl_lapack95 mkl_blas95)
ENDIF()
ELSE() # old MKL 9
SET(MKL_LIBS mkl_solver mkl_c libguide mkl_lapack mkl_ia32)
ENDIF()
IF (MKL_INCLUDE_DIR MATCHES "10.3")
SET(MKL_LIBS ${MKL_LIBS} libiomp5md)
ENDIF()
FOREACH (LIB ${MKL_LIBS})
FIND_LIBRARY(${LIB}_PATH ${LIB} PATHS ${MKL_LIB_SEARCHPATH} ENV LIBRARY_PATH)
IF(${LIB}_PATH)
SET(MKL_LIBRARIES ${MKL_LIBRARIES} ${${LIB}_PATH})
ELSE()
MESSAGE(STATUS "Could not find ${LIB}: disabling MKL")
ENDIF()
ENDFOREACH()
SET(MKL_FOUND ON)
ELSE() # UNIX and macOS
FIND_LIBRARY(MKL_CORE_LIBRARY
mkl_core
PATHS
${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}
${MKL_ROOT_DIR}/lib/
)
# Threading libraries
FIND_LIBRARY(MKL_SEQUENTIAL_LIBRARY
mkl_sequential
PATHS
${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}
${MKL_ROOT_DIR}/lib/
)
FIND_LIBRARY(MKL_INTELTHREAD_LIBRARY
mkl_intel_thread
PATHS
${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}
${MKL_ROOT_DIR}/lib/
)
FIND_LIBRARY(MKL_GNUTHREAD_LIBRARY
mkl_gnu_thread
PATHS
${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}
${MKL_ROOT_DIR}/lib/
)
# Intel Libraries
IF("${MKL_ARCH_DIR}" STREQUAL "32")
FIND_LIBRARY(MKL_LP_LIBRARY
mkl_intel
PATHS
${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}
${MKL_ROOT_DIR}/lib/
)
FIND_LIBRARY(MKL_ILP_LIBRARY
mkl_intel
PATHS
${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}
${MKL_ROOT_DIR}/lib/
)
else()
FIND_LIBRARY(MKL_LP_LIBRARY
mkl_intel_lp64
PATHS
${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}
${MKL_ROOT_DIR}/lib/
)
FIND_LIBRARY(MKL_ILP_LIBRARY
mkl_intel_ilp64
PATHS
${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}
${MKL_ROOT_DIR}/lib/
)
ENDIF()
# Lapack
FIND_LIBRARY(MKL_LAPACK_LIBRARY
mkl_lapack
PATHS
${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}
${MKL_ROOT_DIR}/lib/
)
IF(NOT MKL_LAPACK_LIBRARY)
FIND_LIBRARY(MKL_LAPACK_LIBRARY
mkl_lapack95_lp64
PATHS
${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}
${MKL_ROOT_DIR}/lib/
)
ENDIF()
# iomp5
IF("${MKL_ARCH_DIR}" STREQUAL "32")
IF(UNIX AND NOT APPLE)
FIND_LIBRARY(MKL_IOMP5_LIBRARY
iomp5
PATHS
${MKL_ROOT_DIR}/../lib/ia32
)
ELSE()
SET(MKL_IOMP5_LIBRARY "") # no need for mac
ENDIF()
else()
IF(UNIX AND NOT APPLE)
FIND_LIBRARY(MKL_IOMP5_LIBRARY
iomp5
PATHS
${MKL_ROOT_DIR}/../lib/intel64
)
ELSE()
SET(MKL_IOMP5_LIBRARY "") # no need for mac
ENDIF()
ENDIF()
foreach (MODEVAR ${MKL_MODE_VARIANTS})
foreach (THREADVAR ${MKL_THREAD_VARIANTS})
if (MKL_CORE_LIBRARY AND MKL_${MODEVAR}_LIBRARY AND MKL_${THREADVAR}_LIBRARY)
set(MKL_${MODEVAR}_${THREADVAR}_LIBRARIES
${MKL_${MODEVAR}_LIBRARY} ${MKL_${THREADVAR}_LIBRARY} ${MKL_CORE_LIBRARY}
${MKL_LAPACK_LIBRARY} ${MKL_IOMP5_LIBRARY})
# message("${MODEVAR} ${THREADVAR} ${MKL_${MODEVAR}_${THREADVAR}_LIBRARIES}") # for debug
endif()
endforeach()
endforeach()
SET(MKL_LIBRARIES ${MKL_LP_GNUTHREAD_LIBRARIES})
MARK_AS_ADVANCED(MKL_CORE_LIBRARY MKL_LP_LIBRARY MKL_ILP_LIBRARY
MKL_SEQUENTIAL_LIBRARY MKL_INTELTHREAD_LIBRARY MKL_GNUTHREAD_LIBRARY)
ENDIF()
INCLUDE(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MKL DEFAULT_MSG MKL_INCLUDE_DIR MKL_LIBRARIES)
#if(MKL_FOUND)
# LINK_DIRECTORIES(${MKL_ROOT_DIR}/lib/${MKL_ARCH_DIR}) # hack
#endif()
MARK_AS_ADVANCED(MKL_INCLUDE_DIR MKL_LIBRARIES)

View File

@ -64,21 +64,37 @@ if (WIN32)
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug") set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
if (MSVC71) if (MSVC71)
set (_TBB_COMPILER "vc7.1") set (_TBB_COMPILER "vc7.1")
set (TBB_COMPILER "vc7.1")
endif(MSVC71) endif(MSVC71)
if (MSVC80) if (MSVC80)
set(_TBB_COMPILER "vc8") set(_TBB_COMPILER "vc8")
set(TBB_COMPILER "vc8")
endif(MSVC80) endif(MSVC80)
if (MSVC90) if (MSVC90)
set(_TBB_COMPILER "vc9") set(_TBB_COMPILER "vc9")
set(TBB_COMPILER "vc9")
endif(MSVC90) endif(MSVC90)
if(MSVC10) if(MSVC10)
set(_TBB_COMPILER "vc10") set(_TBB_COMPILER "vc10")
set(TBB_COMPILER "vc10")
endif(MSVC10) endif(MSVC10)
if(MSVC11) if(MSVC11)
set(_TBB_COMPILER "vc11") set(_TBB_COMPILER "vc11")
set(TBB_COMPILER "vc11")
endif(MSVC11) endif(MSVC11)
# Todo: add other Windows compilers such as ICL. # Todo: add other Windows compilers such as ICL.
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE}) if(TBB_ARCHITECTURE)
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
elseif("$ENV{TBB_ARCH_PLATFORM}" STREQUAL "")
# Try to guess the architecture
if(CMAKE_CL_64)
set(_TBB_ARCHITECTURE intel64)
set(TBB_ARCHITECTURE intel64)
else()
set(_TBB_ARCHITECTURE ia32)
set(TBB_ARCHITECTURE ia32)
endif()
endif()
endif (WIN32) endif (WIN32)
if (UNIX) if (UNIX)
@ -159,7 +175,7 @@ if (NOT _TBB_INSTALL_DIR)
endif (NOT _TBB_INSTALL_DIR) endif (NOT _TBB_INSTALL_DIR)
# sanity check # sanity check
if (NOT _TBB_INSTALL_DIR) if (NOT _TBB_INSTALL_DIR)
message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}") message (STATUS "TBB: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}")
else (NOT _TBB_INSTALL_DIR) else (NOT _TBB_INSTALL_DIR)
# finally: set the cached CMake variable TBB_INSTALL_DIR # finally: set the cached CMake variable TBB_INSTALL_DIR
if (NOT TBB_INSTALL_DIR) if (NOT TBB_INSTALL_DIR)
@ -211,7 +227,10 @@ if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
# Jiri: It doesn't hurt to look in more places, so I store the hints from # Jiri: It doesn't hurt to look in more places, so I store the hints from
# ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER # ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER
# variables and search them both. # variables and search them both.
set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR}) set (
_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR}
_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/lib/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}" ${_TBB_LIBRARY_DIR}
)
endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL "")) endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
# GvdB: Mac OS X distribution places libraries directly in lib directory. # GvdB: Mac OS X distribution places libraries directly in lib directory.
@ -269,8 +288,8 @@ if (TBB_INCLUDE_DIR)
endif (TBB_INCLUDE_DIR) endif (TBB_INCLUDE_DIR)
if (NOT TBB_FOUND) if (NOT TBB_FOUND)
message("ERROR: Intel TBB NOT found!") message(STATUS "TBB: Intel TBB NOT found!")
message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}") message(STATUS "TBB: Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}")
# do only throw fatal, if this pkg is REQUIRED # do only throw fatal, if this pkg is REQUIRED
if (TBB_FIND_REQUIRED) if (TBB_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find TBB library.") message(FATAL_ERROR "Could NOT find TBB library.")

View File

@ -3,14 +3,14 @@
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}") list(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}")
# Default to Release mode # Default to Release mode
if(NOT FIRST_PASS_DONE AND NOT CMAKE_BUILD_TYPE) if(NOT FIRST_PASS_DONE AND NOT CMAKE_BUILD_TYPE AND NOT MSVC AND NOT XCODE_VERSION)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: None Debug Release Timing Profiling RelWithDebInfo." "Choose the type of build, options are: None Debug Release Timing Profiling RelWithDebInfo."
FORCE) FORCE)
endif() endif()
# Add option for using build type postfixes to allow installing multiple build modes # Add option for using build type postfixes to allow installing multiple build modes
if(MSVC) if(MSVC OR XCODE_VERSION)
option(GTSAM_BUILD_TYPE_POSTFIXES "Enable/Disable appending the build type to the name of compiled libraries" ON) option(GTSAM_BUILD_TYPE_POSTFIXES "Enable/Disable appending the build type to the name of compiled libraries" ON)
else() else()
option(GTSAM_BUILD_TYPE_POSTFIXES "Enable/Disable appending the build type to the name of compiled libraries" OFF) option(GTSAM_BUILD_TYPE_POSTFIXES "Enable/Disable appending the build type to the name of compiled libraries" OFF)
@ -21,27 +21,29 @@ if(NOT FIRST_PASS_DONE)
if(MSVC) if(MSVC)
set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /W3 /GR /EHsc /MP /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during debug builds." FORCE) set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /W3 /GR /EHsc /MP /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /W3 /GR /EHsc /MP /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during debug builds." FORCE) set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /W3 /GR /EHsc /MP /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /Zi /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during relwithdebinfo builds." FORCE) set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /Zi /d2Zi+ /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during relwithdebinfo builds." FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /Zi /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during relwithdebinfo builds." FORCE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /Zi /d2Zi+ /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during relwithdebinfo builds." FORCE)
set(CMAKE_C_FLAGS_RELEASE "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during release builds." FORCE) set(CMAKE_C_FLAGS_RELEASE "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during release builds." FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during release builds." FORCE) set(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during release builds." FORCE)
set(CMAKE_C_FLAGS_TIMING "${CMAKE_C_FLAGS_RELEASE} /DENABLE_TIMING" CACHE STRING "Flags used by the compiler during timing builds." FORCE) set(CMAKE_C_FLAGS_TIMING "${CMAKE_C_FLAGS_RELEASE} /DENABLE_TIMING" CACHE STRING "Flags used by the compiler during timing builds." FORCE)
set(CMAKE_CXX_FLAGS_TIMING "${CMAKE_CXX_FLAGS_RELEASE} /DENABLE_TIMING" CACHE STRING "Flags used by the compiler during timing builds." FORCE) set(CMAKE_CXX_FLAGS_TIMING "${CMAKE_CXX_FLAGS_RELEASE} /DENABLE_TIMING" CACHE STRING "Flags used by the compiler during timing builds." FORCE)
set(CMAKE_EXE_LINKER_FLAGS_TIMING "${CMAKE_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during timing builds." FORCE) set(CMAKE_EXE_LINKER_FLAGS_TIMING "${CMAKE_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during timing builds." FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_TIMING "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during timing builds." FORCE) set(CMAKE_SHARED_LINKER_FLAGS_TIMING "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during timing builds." FORCE)
mark_as_advanced(CMAKE_C_FLAGS_TIMING CMAKE_CXX_FLAGS_TIMING CMAKE_EXE_LINKER_FLAGS_TIMING CMAKE_SHARED_LINKER_FLAGS_TIMING) set(CMAKE_MODULE_LINKER_FLAGS_TIMING "${CMAKE_MODULE_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during timing builds." FORCE)
mark_as_advanced(CMAKE_C_FLAGS_TIMING CMAKE_CXX_FLAGS_TIMING CMAKE_EXE_LINKER_FLAGS_TIMING CMAKE_SHARED_LINKER_FLAGS_TIMING CMAKE_MODULE_LINKER_FLAGS_TIMING)
set(CMAKE_C_FLAGS_PROFILING "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /Zi /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during profiling builds." FORCE) set(CMAKE_C_FLAGS_PROFILING "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /Zi /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during profiling builds." FORCE)
set(CMAKE_CXX_FLAGS_PROFILING "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /Zi /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during profiling builds." FORCE) set(CMAKE_CXX_FLAGS_PROFILING "/MD /O2 /DNDEBUG /W3 /GR /EHsc /MP /Zi /DWINDOWS_LEAN_AND_MEAN" CACHE STRING "Flags used by the compiler during profiling builds." FORCE)
set(CMAKE_EXE_LINKER_FLAGS_PROFILING "${CMAKE_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during profiling builds." FORCE) set(CMAKE_EXE_LINKER_FLAGS_PROFILING "${CMAKE_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during profiling builds." FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_PROFILING "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during profiling builds." FORCE) set(CMAKE_SHARED_LINKER_FLAGS_PROFILING "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during profiling builds." FORCE)
mark_as_advanced(CMAKE_C_FLAGS_PROFILING CMAKE_CXX_FLAGS_PROFILING CMAKE_EXE_LINKER_FLAGS_PROFILING CMAKE_SHARED_LINKER_FLAGS_PROFILING) set(CMAKE_MODULE_LINKER_FLAGS_PROFILING "${CMAKE_MODULE_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during profiling builds." FORCE)
mark_as_advanced(CMAKE_C_FLAGS_PROFILING CMAKE_CXX_FLAGS_PROFILING CMAKE_EXE_LINKER_FLAGS_PROFILING CMAKE_SHARED_LINKER_FLAGS_PROFILING CMAKE_MODULE_LINKER_FLAGS_PROFILING)
else() else()
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-inline -Wall" CACHE STRING "Flags used by the compiler during debug builds." FORCE) set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-inline -Wall" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-inline -Wall" CACHE STRING "Flags used by the compiler during debug builds." FORCE) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-inline -Wall" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O3 -Wall -DNDEBUG" CACHE STRING "Flags used by the compiler during relwithdebinfo builds." FORCE) set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O3 -Wall -DNDEBUG" CACHE STRING "Flags used by the compiler during relwithdebinfo builds." FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3 -Wall -DNDEBUG" CACHE STRING "Flags used by the compiler during relwithdebinfo builds." FORCE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3 -Wall -DNDEBUG" CACHE STRING "Flags used by the compiler during relwithdebinfo builds." FORCE)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall" CACHE STRING "Flags used by the compiler during release builds." FORCE) set(CMAKE_C_FLAGS_RELEASE "-O3 -Wall -DNDEBUG -Wall" CACHE STRING "Flags used by the compiler during release builds." FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall" CACHE STRING "Flags used by the compiler during release builds." FORCE) set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -DNDEBUG -Wall" CACHE STRING "Flags used by the compiler during release builds." FORCE)
set(CMAKE_C_FLAGS_TIMING "${CMAKE_C_FLAGS_RELEASE} -DENABLE_TIMING" CACHE STRING "Flags used by the compiler during timing builds." FORCE) set(CMAKE_C_FLAGS_TIMING "${CMAKE_C_FLAGS_RELEASE} -DENABLE_TIMING" CACHE STRING "Flags used by the compiler during timing builds." FORCE)
set(CMAKE_CXX_FLAGS_TIMING "${CMAKE_CXX_FLAGS_RELEASE} -DENABLE_TIMING" CACHE STRING "Flags used by the compiler during timing builds." FORCE) set(CMAKE_CXX_FLAGS_TIMING "${CMAKE_CXX_FLAGS_RELEASE} -DENABLE_TIMING" CACHE STRING "Flags used by the compiler during timing builds." FORCE)
set(CMAKE_EXE_LINKER_FLAGS_TIMING "${CMAKE_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during timing builds." FORCE) set(CMAKE_EXE_LINKER_FLAGS_TIMING "${CMAKE_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "Linker flags during timing builds." FORCE)
@ -55,6 +57,13 @@ if(NOT FIRST_PASS_DONE)
endif() endif()
endif() endif()
# Clang on Mac uses a template depth that is less than standard and is too small
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if(NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "5.0")
add_definitions(-ftemplate-depth=1024)
endif()
endif()
# Set up build type library postfixes # Set up build type library postfixes
if(GTSAM_BUILD_TYPE_POSTFIXES) if(GTSAM_BUILD_TYPE_POSTFIXES)
foreach(build_type Debug Timing RelWithDebInfo MinSizeRel) foreach(build_type Debug Timing RelWithDebInfo MinSizeRel)
@ -65,20 +74,23 @@ endif()
# Make common binary output directory when on Windows # Make common binary output directory when on Windows
if(WIN32) if(WIN32)
set(RUNTIME_OUTPUT_PATH "${PROJECT_BINARY_DIR}/bin") set(RUNTIME_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/bin") set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/lib") set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
endif() endif()
# Set up build type list for cmake-gui # Set up build type list for cmake-gui
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 2.8 OR ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_EQUAL 2.8) if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS None Debug Release Timing Profiling RelWithDebInfo MinSizeRel) if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 2.8 OR ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_EQUAL 2.8)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS None Debug Release Timing Profiling RelWithDebInfo MinSizeRel)
endif()
endif() endif()
# Set up build types for MSVC and XCode # Set up build types for MSVC and XCode
if(CMAKE_CONFIGURATION_TYPES AND NOT FIRST_PASS_DONE) if(NOT FIRST_PASS_DONE)
set(CMAKE_CONFIGURATION_TYPES Debug Release Timing Profiling RelWithDebInfo MinSizeRel set(CMAKE_CONFIGURATION_TYPES Debug Release Timing Profiling RelWithDebInfo MinSizeRel
CACHE STRING "Build types available to MSVC and XCode" FORCE) CACHE STRING "Build types available to MSVC and XCode" FORCE)
mark_as_advanced(FORCE CMAKE_CONFIGURATION_TYPES)
endif() endif()
# Check build types # Check build types

View File

@ -2,19 +2,29 @@
function(GtsamMakeConfigFile PACKAGE_NAME) function(GtsamMakeConfigFile PACKAGE_NAME)
if(WIN32 AND NOT CYGWIN) if(WIN32 AND NOT CYGWIN)
set(DEF_INSTALL_CMAKE_DIR CMake) set(DEF_INSTALL_CMAKE_DIR CMake)
else() else()
set(DEF_INSTALL_CMAKE_DIR lib/cmake/${PACKAGE_NAME}) set(DEF_INSTALL_CMAKE_DIR lib/cmake/${PACKAGE_NAME})
endif() endif()
file(RELATIVE_PATH CONF_REL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${DEF_INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/include") # Configure extra file
file(RELATIVE_PATH CONF_REL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${DEF_INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/lib") if(NOT "${ARGV1}" STREQUAL "")
configure_file(${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}Config.cmake" @ONLY) get_filename_component(name "${ARGV1}" NAME_WE)
message(STATUS "Wrote ${PROJECT_BINARY_DIR}/${PACKAGE_NAME}Config.cmake") set(EXTRA_FILE "${name}.cmake")
configure_file(${ARGV1} "${PROJECT_BINARY_DIR}/${EXTRA_FILE}" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/${EXTRA_FILE}" DESTINATION "${CMAKE_INSTALL_PREFIX}/${DEF_INSTALL_CMAKE_DIR}")
else()
set(EXTRA_FILE "_does_not_exist_")
endif()
# Install config and exports files (for find scripts) file(RELATIVE_PATH CONF_REL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${DEF_INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/include")
install(FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}Config.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/${DEF_INSTALL_CMAKE_DIR}") file(RELATIVE_PATH CONF_REL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${DEF_INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/lib")
install(EXPORT ${PACKAGE_NAME}-exports DESTINATION ${DEF_INSTALL_CMAKE_DIR}) configure_file(${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}Config.cmake" @ONLY)
message(STATUS "Wrote ${PROJECT_BINARY_DIR}/${PACKAGE_NAME}Config.cmake")
# Install config and exports files (for find scripts)
install(FILES "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}Config.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/${DEF_INSTALL_CMAKE_DIR}")
install(EXPORT ${PACKAGE_NAME}-exports DESTINATION ${DEF_INSTALL_CMAKE_DIR})
endfunction() endfunction()

View File

@ -1,9 +1,9 @@
# Set up cache options # Set up cache options
option(GTSAM_MEX_BUILD_STATIC_MODULE "Build MATLAB wrapper statically (increases build time)" OFF) option(GTSAM_MEX_BUILD_STATIC_MODULE "Build MATLAB wrapper statically (increases build time)" OFF)
set(GTSAM_BUILD_MEX_BINARY_FLAGS "" CACHE STRING "Extra flags for running Matlab MEX compilation") set(GTSAM_BUILD_MEX_BINARY_FLAGS "" CACHE STRING "Extra flags for running Matlab MEX compilation")
set(GTSAM_TOOLBOX_INSTALL_PATH "" CACHE PATH "Matlab toolbox destination, blank defaults to CMAKE_INSTALL_PREFIX/borg/toolbox") set(GTSAM_TOOLBOX_INSTALL_PATH "" CACHE PATH "Matlab toolbox destination, blank defaults to CMAKE_INSTALL_PREFIX/gtsam_toolbox")
if(NOT GTSAM_TOOLBOX_INSTALL_PATH) if(NOT GTSAM_TOOLBOX_INSTALL_PATH)
set(GTSAM_TOOLBOX_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/borg/toolbox") set(GTSAM_TOOLBOX_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/gtsam_toolbox")
endif() endif()
# GTSAM_MEX_BUILD_STATIC_MODULE is not for Windows - on Windows any static # GTSAM_MEX_BUILD_STATIC_MODULE is not for Windows - on Windows any static
@ -28,11 +28,183 @@ endif()
# finding the LaTeX mex program (totally unrelated to MATLAB Mex) when LaTeX is # finding the LaTeX mex program (totally unrelated to MATLAB Mex) when LaTeX is
# on the system path. # on the system path.
list(REVERSE matlab_bin_directories) # Reverse list so the highest version (sorted alphabetically) is preferred list(REVERSE matlab_bin_directories) # Reverse list so the highest version (sorted alphabetically) is preferred
find_program(MEX_COMMAND ${mex_program_name} find_program(mex_command ${mex_program_name}
PATHS ${matlab_bin_directories} ENV PATH PATHS ${matlab_bin_directories} ENV PATH
DOC "Command to use for executing mex (if on path, 'mex' will work)" NO_DEFAULT_PATH)
NO_SYSTEM_ENVIRONMENT_PATH) mark_as_advanced(FORCE mex_command)
# Now that we have mex, trace back to find the Matlab installation root
get_filename_component(mex_command "${mex_command}" REALPATH)
get_filename_component(mex_path "${mex_command}" PATH)
get_filename_component(MATLAB_ROOT "${mex_path}/.." ABSOLUTE)
set(MATLAB_ROOT "${MATLAB_ROOT}" CACHE PATH "Path to MATLAB installation root (e.g. /usr/local/MATLAB/R2012a)")
# User-friendly wrapping function. Builds a mex module from the provided
# interfaceHeader. For example, for the interface header /path/to/gtsam.h,
# this will build the wrap module 'gtsam'.
# Params:
# interfaceHeader : Absolute or relative path to the interface definition file
# linkLibraries : All dependent CMake target names, library names, or full library paths
# extraIncludeDirs : Extra include directories, in addition to those already passed to include_directories(...)
# extraMexFlags : Any additional compiler flags
function(wrap_and_install_library interfaceHeader linkLibraries extraIncludeDirs extraMexFlags)
wrap_library_internal("${interfaceHeader}" "${otherLibraries}" "${extraIncludeDirs}" "${mexFlags}")
install_wrapped_library_internal("${interfaceHeader}")
endfunction()
function(wrap_library_internal interfaceHeader linkLibraries extraIncludeDirs extraMexFlags)
if(UNIX AND NOT APPLE)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(mexModuleExt mexa64)
else()
set(mexModuleExt mexglx)
endif()
elseif(APPLE)
set(mexModuleExt mexmaci64)
elseif(MSVC)
if(CMAKE_CL_64)
set(mexModuleExt mexw64)
else()
set(mexModuleExt mexw32)
endif()
endif()
# Wrap codegen interface
#usage: wrap interfacePath moduleName toolboxPath headerPath
# interfacePath : *absolute* path to directory of module interface file
# moduleName : the name of the module, interface file must be called moduleName.h
# toolboxPath : the directory in which to generate the wrappers
# headerPath : path to matlab.h
# Extract module name from interface header file name
get_filename_component(interfaceHeader "${interfaceHeader}" ABSOLUTE)
get_filename_component(modulePath "${interfaceHeader}" PATH)
get_filename_component(moduleName "${interfaceHeader}" NAME_WE)
# Paths for generated files
set(generated_files_path "${PROJECT_BINARY_DIR}/wrap/${moduleName}")
set(generated_cpp_file "${PROJECT_BINARY_DIR}/wrap/${moduleName}/${moduleName}_wrapper.cpp")
set(compiled_mex_modules_root "${PROJECT_BINARY_DIR}/wrap/${moduleName}_mex")
message(STATUS "Building wrap module ${moduleName}")
# Find matlab.h in GTSAM
if("${PROJECT_NAME}" STREQUAL "GTSAM")
set(matlab_h_path "${PROJECT_SOURCE_DIR}")
else()
if(NOT GTSAM_INCLUDE_DIR)
message(FATAL_ERROR "You must call find_package(GTSAM) before using wrap")
endif()
list(GET GTSAM_INCLUDE_DIR 0 installed_includes_path)
set(matlab_h_path "${installed_includes_path}/wrap")
endif()
# Add -shared or -static suffix to targets
set(correctedOtherLibraries "")
set(otherLibraryTargets "")
foreach(lib ${moduleName} ${otherLibraries})
if(TARGET ${lib})
list(APPEND correctedOtherLibraries ${lib})
list(APPEND otherLibraryTargets ${lib})
elseif(TARGET ${lib}-shared) # Prefer the shared library if we have both shared and static)
list(APPEND correctedOtherLibraries ${lib}-shared)
list(APPEND otherLibraryTargets ${lib}-shared)
elseif(TARGET ${lib}-static)
list(APPEND correctedOtherLibraries ${lib}-static)
list(APPEND otherLibraryTargets ${lib}-static)
else()
list(APPEND correctedOtherLibraries ${lib})
endif()
endforeach()
# Set up generation of module source file
file(MAKE_DIRECTORY "${generated_files_path}")
add_custom_command(
OUTPUT ${generated_cpp_file}
DEPENDS ${interfaceHeader} wrap ${module_library_target} ${otherLibraryTargets}
COMMAND
wrap
${modulePath}
${moduleName}
${generated_files_path}
${matlab_h_path}
VERBATIM
WORKING_DIRECTORY ${generated_files_path})
# Set up building of mex module
string(REPLACE ";" " " extraMexFlagsSpaced "${extraMexFlags}")
string(REPLACE ";" " " mexFlagsSpaced "${GTSAM_BUILD_MEX_BINARY_FLAGS}")
add_library(${moduleName}_wrapper MODULE ${generated_cpp_file} ${interfaceHeader})
target_link_libraries(${moduleName}_wrapper ${correctedOtherLibraries})
set_target_properties(${moduleName}_wrapper PROPERTIES
OUTPUT_NAME "${moduleName}_wrapper"
PREFIX ""
SUFFIX ".${mexModuleExt}"
LIBRARY_OUTPUT_DIRECTORY "${compiled_mex_modules_root}"
ARCHIVE_OUTPUT_DIRECTORY "${compiled_mex_modules_root}"
RUNTIME_OUTPUT_DIRECTORY "${compiled_mex_modules_root}"
CLEAN_DIRECT_OUTPUT 1)
set_property(TARGET ${moduleName}_wrapper APPEND_STRING PROPERTY COMPILE_FLAGS " ${extraMexFlagsSpaced} ${mexFlagsSpaced} \"-I${MATLAB_ROOT}/extern/include\" -DMATLAB_MEX_FILE -DMX_COMPAT_32")
set_property(TARGET ${moduleName}_wrapper APPEND PROPERTY INCLUDE_DIRECTORIES ${extraIncludeDirs})
# Disable build type postfixes for the mex module - we install in different directories for each build type instead
foreach(build_type ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER "${build_type}" build_type_upper)
set_target_properties(${moduleName}_wrapper PROPERTIES ${build_type_upper}_POSTFIX "")
endforeach()
# Set up platform-specific flags
if(MSVC)
if(CMAKE_CL_64)
set(mxLibPath "${MATLAB_ROOT}/extern/lib/win64/microsoft")
else()
set(mxLibPath "${MATLAB_ROOT}/extern/lib/win32/microsoft")
endif()
target_link_libraries(${moduleName}_wrapper "${mxLibPath}/libmex.lib" "${mxLibPath}/libmx.lib" "${mxLibPath}/libmat.lib")
set_target_properties(${moduleName}_wrapper PROPERTIES LINK_FLAGS "/export:mexFunction")
set_property(SOURCE "${generated_cpp_file}" APPEND PROPERTY COMPILE_FLAGS "/bigobj")
elseif(APPLE)
set(mxLibPath "${MATLAB_ROOT}/bin/maci64")
target_link_libraries(${moduleName}_wrapper "${mxLibPath}/libmex.dylib" "${mxLibPath}/libmx.dylib" "${mxLibPath}/libmat.dylib")
endif()
# Hacking around output issue with custom command
# Deletes generated build folder
add_custom_target(wrap_${moduleName}_distclean
COMMAND cmake -E remove_directory ${generated_files_path}
COMMAND cmake -E remove_directory ${compiled_mex_modules_root})
endfunction()
function(install_wrapped_library_internal interfaceHeader)
get_filename_component(moduleName "${interfaceHeader}" NAME_WE)
set(generated_files_path "${PROJECT_BINARY_DIR}/wrap/${moduleName}")
# NOTE: only installs .m and mex binary files (not .cpp) - the trailing slash on the directory name
# here prevents creating the top-level module name directory in the destination.
message(STATUS "Installing Matlab Toolbox to ${GTSAM_TOOLBOX_INSTALL_PATH}")
if(GTSAM_BUILD_TYPE_POSTFIXES)
foreach(build_type ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER "${build_type}" build_type_upper)
if("${build_type_upper}" STREQUAL "RELEASE")
set(build_type_tag "") # Don't create release mode tag on installed directory
else()
set(build_type_tag "${build_type}")
endif()
# Split up filename to strip trailing '/' in GTSAM_TOOLBOX_INSTALL_PATH if there is one
get_filename_component(location "${GTSAM_TOOLBOX_INSTALL_PATH}" PATH)
get_filename_component(name "${GTSAM_TOOLBOX_INSTALL_PATH}" NAME)
install(DIRECTORY "${generated_files_path}/" DESTINATION "${location}/${name}${build_type_tag}" CONFIGURATIONS "${build_type}" FILES_MATCHING PATTERN "*.m")
install(TARGETS ${moduleName}_wrapper
LIBRARY DESTINATION "${location}/${name}${build_type_tag}" CONFIGURATIONS "${build_type}"
RUNTIME DESTINATION "${location}/${name}${build_type_tag}" CONFIGURATIONS "${build_type}")
endforeach()
else()
install(DIRECTORY "${generated_files_path}/" DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH} FILES_MATCHING PATTERN "*.m")
install(TARGETS ${moduleName}_wrapper
LIBRARY DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH}
RUNTIME DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH})
endif()
endfunction()
# Function to setup codegen and building of the wrap toolbox # Function to setup codegen and building of the wrap toolbox
# #
@ -44,208 +216,19 @@ find_program(MEX_COMMAND ${mex_program_name}
# toolboxPath : the directory in which to generate/build wrappers # toolboxPath : the directory in which to generate/build wrappers
# wrap_header_path : path to the installed wrap header # wrap_header_path : path to the installed wrap header
function(wrap_library_generic moduleName mexFlags modulePath otherLibraries toolbox_path wrap_header_path) function(wrap_library_generic moduleName mexFlags modulePath otherLibraries toolbox_path wrap_header_path)
set(module_markup_header_file "${moduleName}.h") if(NOT "${CMAKE_PROJECT_NAME}" STREQUAL "GTSAM")
set(module_markup_header_path "${CMAKE_CURRENT_SOURCE_DIR}/${modulePath}/${module_markup_header_file}") message("Your project uses wrap_library or wrap_library_generic - this is deprecated, please use the more user-friendly function wrap_and_install_library")
# Add wrap cpp file first
set(mexSources "")
list(APPEND mexSources ${moduleName}_wrapper.cpp)
# Add boost libraries
string(TOUPPER ${CMAKE_BUILD_TYPE} build_type_toupper)
if("${build_type_toupper}" STREQUAL "DEBUG")
list(APPEND otherLibraries ${Boost_SERIALIZATION_LIBRARY_DEBUG} ${Boost_FILESYSTEM_LIBRARY_DEBUG}
${Boost_SYSTEM_LIBRARY_DEBUG} ${Boost_THREAD_LIBRARY_DEBUG} ${Boost_DATE_TIME_LIBRARY_DEBUG}
${Boost_REGEX_LIBRARY_DEBUG})
if(Boost_TIMER_LIBRARY_DEBUG AND NOT GTSAM_DISABLE_NEW_TIMERS) # Only present in Boost >= 1.48.0
list(APPEND otherLibraries ${Boost_TIMER_LIBRARY_DEBUG} ${Boost_CHRONO_LIBRARY_DEBUG})
if(GTSAM_MEX_BUILD_STATIC_MODULE)
list(APPEND otherLibraries -Wl,--no-as-needed -lrt)
endif()
endif()
else()
list(APPEND otherLibraries ${Boost_SERIALIZATION_LIBRARY_RELEASE} ${Boost_FILESYSTEM_LIBRARY_RELEASE}
${Boost_SYSTEM_LIBRARY_RELEASE} ${Boost_THREAD_LIBRARY_RELEASE} ${Boost_DATE_TIME_LIBRARY_RELEASE}
${Boost_REGEX_LIBRARY_RELEASE})
if(Boost_TIMER_LIBRARY_RELEASE AND NOT GTSAM_DISABLE_NEW_TIMERS) # Only present in Boost >= 1.48.0
list(APPEND otherLibraries ${Boost_TIMER_LIBRARY_RELEASE} ${Boost_CHRONO_LIBRARY_RELEASE})
if(GTSAM_MEX_BUILD_STATIC_MODULE)
list(APPEND otherLibraries -Wl,--no-as-needed -lrt)
endif()
endif()
endif() endif()
# Sort otherLibraries into files and targets, add -shared or -static to other dependency library names # Append module name to link libraries to keep original behavior
set(otherLibraryTargets "") list(APPEND otherLibraries ${moduleName})
set(otherLibraryLinks "")
set(otherLibraryArchives "")
foreach(lib ${moduleName} ${otherLibraries})
if(TARGET ${lib})
list(APPEND otherLibraryTargets ${lib})
elseif(TARGET ${lib}-shared) # Prefer the shared library if we have both shared and static
list(APPEND otherLibraryTargets ${lib}-shared)
elseif(TARGET ${lib}-static)
list(APPEND otherLibraryTargets ${lib}-static)
else()
if(${lib} MATCHES "^.+\\.a$")
list(APPEND otherLibraryArchives ${lib})
else()
list(APPEND otherLibraryLinks ${lib})
endif()
endif()
endforeach()
# Get path to libraries with current build type # Set up arguments
foreach(target ${otherLibraryTargets}) set(interfaceHeader ${modulePath}/${moduleName}.h)
if(GTSAM_MEX_BUILD_STATIC_MODULE)
# If building the wrapper statically, add the target's sources to the mex sources
get_target_property(librarySources ${target} SOURCES)
list(APPEND mexSources ${librarySources})
else()
# If not building wrapper staticically, link to the target library
get_target_property(libraryFile ${target} LOCATION_${build_type_toupper})
get_target_property(targetType ${target} TYPE)
if(WIN32 AND NOT targetType STREQUAL STATIC_LIBRARY)
# On Windows with a shared library, we link to the import library file
get_filename_component(libraryDir ${libraryFile} PATH)
get_filename_component(libraryName ${libraryFile} NAME_WE)
get_filename_component(oneUpDir ${libraryDir} NAME)
string(TOUPPER "${oneUpDir}" oneUpDir)
if("${oneUpDir}" STREQUAL BIN OR "${oneUpDir}" STREQUAL LIB)
# One level up is 'bin' or 'lib' so we do not have an extra
# subdirectory for the build configuration.
set(libraryFile "${libraryDir}/../lib/${libraryName}.lib")
else()
# One level up was neither 'bin' nor 'lib' so assume we also
# have a subdirectory for the build configuration.
set(libraryFile "${libraryDir}/../../lib/${build_type_toupper}/${libraryName}.lib")
endif()
endif()
list(APPEND otherLibraryLinks ${libraryFile})
endif()
endforeach()
# Bad hack - if static wrapper and this is GTSAM, add colamd to the include path # Call internal function
if(GTSAM_MEX_BUILD_STATIC_MODULE AND (${moduleName} STREQUAL "gtsam" OR ${moduleName} STREQUAL "gtsam_unstable")) wrap_library_internal("${interfaceHeader}" "${otherLibraries}" "" "${mexFlags}")
list(APPEND mexFlags
"-I${PROJECT_SOURCE_DIR}/gtsam/3rdparty/CCOLAMD/Include" "-I${PROJECT_SOURCE_DIR}/gtsam/3rdparty/UFconfig")
endif()
# If using Boost shared libs, set up auto linking for shared libs
if(NOT Boost_USE_STATIC_LIBS)
list(APPEND mexFlags "-DBOOST_ALL_DYN_LINK")
endif()
# Add the CXXFLAGS from building the library
if(MSVC)
set(compile_flag_var "COMPFLAGS")
set(link_flag_var "LINKFLAGS")
set(cxx_flags_extra "/bigobj")
else()
set(compile_flag_var "CXXFLAGS")
set(link_flag_var "LDFLAGS")
set(cxx_flags_extra "")
endif()
list(APPEND mexFlags "${compile_flag_var}=$${compile_flag_var} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${build_type_toupper}} ${cxx_flags_extra}")
# If building a static module on UNIX, extract dependent .a libraries and add their .o files
if(UNIX AND GTSAM_MEX_BUILD_STATIC_MODULE)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/wrap/external_archives)
foreach(archive ${otherLibraryArchives})
get_filename_component(archive_name ${archive} NAME_WE)
set(extraction_dir ${CMAKE_BINARY_DIR}/wrap/external_archives/${archive_name})
file(MAKE_DIRECTORY ${extraction_dir})
# Extract archive
execute_process(
COMMAND ar x ${archive}
WORKING_DIRECTORY ${extraction_dir})
# Get list of .o's in archive
execute_process(
COMMAND ar t ${archive}
OUTPUT_VARIABLE object_files OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE "\n" ";" object_list ${object_files})
set(object_list_absolute "")
foreach(object ${object_list})
list(APPEND object_list_absolute ${extraction_dir}/${object})
endforeach()
list(APPEND mexSources ${object_list_absolute})
endforeach()
set(otherLibraryArchives "")
endif()
# Add libraries to command line
string(REPLACE ";" " " otherLibraryArchivesSpaced "${otherLibraryArchives}")
list(APPEND mexFlags "${link_flag_var}=$${link_flag_var} ${otherLibraryArchivesSpaced}")
list(APPEND mexFlags ${otherLibraryLinks})
# Add -g if debug mode
if(${build_type_toupper} STREQUAL DEBUG OR ${build_type_toupper} STREQUAL RELWITHDEBINFO)
list(APPEND mexFlags -g)
endif()
# Verbose mex - print mex compilation flags to help notice flag problems
list(APPEND mexFlags -v)
# Add sources
set(mexSourcesFiltered "")
foreach(src ${mexSources})
if(src MATCHES "^.+\\.cpp$" OR src MATCHES "^.+\\.c$" OR src MATCHES "^.+\\.o$")
list(APPEND mexSourcesFiltered ${src})
endif()
endforeach()
set(mexFlags ${mexSourcesFiltered} ${mexFlags})
string(REPLACE ";" "' '" mexFlagsForDisplay "${mexFlags}")
message(STATUS "Building Matlab Wrapper, mexFlags: [ '${mexFlagsForDisplay}' ]")
# Wrap codegen interface
#usage: wrap interfacePath moduleName toolboxPath headerPath
# interfacePath : *absolute* path to directory of module interface file
# moduleName : the name of the module, interface file must be called moduleName.h
# toolboxPath : the directory in which to generate the wrappers
# headerPath : path to matlab.h
# Code generation command
# FIXME: doesn't get cleaned properly because cmake doesn't track the dependency
# TODO: convert to a custom_command with output specified
get_target_property(wrap_LOCATION wrap LOCATION_${CMAKE_BUILD_TYPE})
add_custom_target(wrap_${moduleName}
ALL # Forces wrap to always be run, but no files are touched if they don't change
COMMAND
${wrap_LOCATION}
${CMAKE_CURRENT_SOURCE_DIR}/${modulePath}
${moduleName}
${toolbox_path}
${wrap_header_path}
VERBATIM)
add_dependencies(wrap_${moduleName} wrap ${module_markup_header_path})
# Hacking around output issue with custom command
# Deletes generated build folder
add_custom_target(wrap_${moduleName}_distclean
COMMAND
cmake -E remove_directory ${toolbox_path})
# Make building mex binaries a part of the all (and install) target
set(build_all "ALL")
# If building wrapper statically, we compile all the library sources
# with mex, so need no extra dependencies, but if not building statically,
# we depend on the libraries since we will link to them.
if(GTSAM_MEX_BUILD_STATIC_MODULE)
set(wrap_build_dependencies "")
else()
set(wrap_build_dependencies ${moduleTarget} ${otherLibraryTargets})
endif()
# Actual build target for building mex files
add_custom_target(wrap_${moduleName}_build ${build_all}
COMMAND "${MEX_COMMAND}" ${mexFlags}
VERBATIM
WORKING_DIRECTORY ${toolbox_path})
add_dependencies(wrap_${moduleName}_build wrap_${moduleName} ${wrap_build_dependencies})
endfunction(wrap_library_generic) endfunction(wrap_library_generic)
# Function to setup codegen, building and installation of the wrap toolbox # Function to setup codegen, building and installation of the wrap toolbox
@ -260,15 +243,39 @@ endfunction(wrap_library_generic)
# otherLibraries : list of library targets this should depend on # otherLibraries : list of library targets this should depend on
function(wrap_library moduleName mexFlags modulePath otherLibraries) function(wrap_library moduleName mexFlags modulePath otherLibraries)
# Toolbox generation path goes in build folder # Toolbox generation path goes in build folder
set(toolbox_base_path ${CMAKE_BINARY_DIR}/wrap) set(toolbox_base_path ${PROJECT_BINARY_DIR}/wrap)
set(toolbox_path ${toolbox_base_path}/${moduleName}) set(toolbox_path ${toolbox_base_path}/${moduleName})
# Call generic version of function # Call generic version of function
wrap_library_generic("${moduleName}" "${mexFlags}" "${modulePath}" "${otherLibraries}" "${toolbox_path}" "${GTSAM_WRAP_HEADER_PATH}") wrap_library_generic("${moduleName}" "${mexFlags}" "${modulePath}" "${otherLibraries}" "${toolbox_path}" "${GTSAM_WRAP_HEADER_PATH}")
install_wrapped_library_internal("${modulePath}/${moduleName}.h")
# NOTE: only installs .m and mex binary files (not .cpp) - the trailing slash on the directory name
# here prevents creating the top-level module name directory in the destination.
message(STATUS "Installing Matlab Toolbox to ${GTSAM_TOOLBOX_INSTALL_PATH}")
install(DIRECTORY ${toolbox_path}/ DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH} FILES_MATCHING PATTERN "*.m")
install(DIRECTORY ${toolbox_path}/ DESTINATION ${GTSAM_TOOLBOX_INSTALL_PATH} FILES_MATCHING PATTERN "*.mex*")
endfunction(wrap_library) endfunction(wrap_library)
# Helper function to install MATLAB scripts and handle multiple build types where the scripts
# should be installed to all build type toolboxes
function(install_matlab_scripts source_directory patterns)
set(patterns_args "")
foreach(pattern ${patterns})
list(APPEND patterns_args PATTERN "${pattern}")
endforeach()
if(GTSAM_BUILD_TYPE_POSTFIXES)
foreach(build_type ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER "${build_type}" build_type_upper)
if("${build_type_upper}" STREQUAL "RELEASE")
set(build_type_tag "") # Don't create release mode tag on installed directory
else()
set(build_type_tag "${build_type}")
endif()
# Split up filename to strip trailing '/' in GTSAM_TOOLBOX_INSTALL_PATH if there is one
get_filename_component(location "${GTSAM_TOOLBOX_INSTALL_PATH}" PATH)
get_filename_component(name "${GTSAM_TOOLBOX_INSTALL_PATH}" NAME)
install(DIRECTORY "${source_directory}" DESTINATION "${location}/${name}${build_type_tag}" CONFIGURATIONS "${build_type}" FILES_MATCHING ${patterns_args} PATTERN ".svn" EXCLUDE)
endforeach()
else()
install(DIRECTORY "${source_directory}" DESTINATION "${GTSAM_TOOLBOX_INSTALL_PATH}" FILES_MATCHING ${patterns_args} PATTERN ".svn" EXCLUDE)
endif()
endfunction()

View File

@ -0,0 +1,67 @@
#Setup cache options
option(GTSAM_BUILD_PYTHON "Build Python wrapper statically (increases build time)" OFF)
set(GTSAM_BUILD_PYTHON_FLAGS "" CACHE STRING "Extra flags for running Matlab PYTHON compilation")
set(GTSAM_PYTHON_INSTALL_PATH "" CACHE PATH "Python toolbox destination, blank defaults to CMAKE_INSTALL_PREFIX/borg/python")
if(NOT GTSAM_PYTHON_INSTALL_PATH)
set(GTSAM_PYTHON_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/borg/python")
endif()
#Author: Paul Furgale Modified by Andrew Melim
function(wrap_python TARGET_NAME PYTHON_MODULE_DIRECTORY)
# Boost
find_package(Boost COMPONENTS python filesystem system REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
# Find Python
FIND_PACKAGE(PythonLibs 2.7 REQUIRED)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
IF(APPLE)
# The apple framework headers don't include the numpy headers for some reason.
GET_FILENAME_COMPONENT(REAL_PYTHON_INCLUDE ${PYTHON_INCLUDE_DIRS} REALPATH)
IF( ${REAL_PYTHON_INCLUDE} MATCHES Python.framework)
message("Trying to find extra headers for numpy from ${REAL_PYTHON_INCLUDE}.")
message("Looking in ${REAL_PYTHON_INCLUDE}/../../Extras/lib/python/numpy/core/include/numpy")
FIND_PATH(NUMPY_INCLUDE_DIR arrayobject.h
${REAL_PYTHON_INCLUDE}/../../Extras/lib/python/numpy/core/include/numpy
${REAL_PYTHON_INCLUDE}/numpy
)
IF(${NUMPY_INCLUDE_DIR} MATCHES NOTFOUND)
message("Unable to find numpy include directories: ${NUMPY_INCLUDE_DIR}")
ELSE()
message("Found headers at ${NUMPY_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(${NUMPY_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${NUMPY_INCLUDE_DIR}/..)
ENDIF()
ENDIF()
ENDIF(APPLE)
# Create a static library version
add_library(${TARGET_NAME} SHARED ${ARGN})
target_link_libraries(${TARGET_NAME} ${Boost_PYTHON_LIBRARY} ${PYTHON_LIBRARY} gtsam-shared)
set_target_properties(${TARGET_NAME} PROPERTIES
OUTPUT_NAME ${TARGET_NAME}
CLEAN_DIRECT_OUTPUT 1
VERSION 1
SOVERSION 0)
# On OSX and Linux, the python library must end in the extension .so. Build this
# filename here.
get_property(PYLIB_OUTPUT_FILE TARGET ${TARGET_NAME} PROPERTY LOCATION)
get_filename_component(PYLIB_OUTPUT_NAME ${PYLIB_OUTPUT_FILE} NAME_WE)
set(PYLIB_SO_NAME ${PYLIB_OUTPUT_NAME}.so)
# Cause the library to be output in the correct directory.
add_custom_command(TARGET ${TARGET_NAME}
POST_BUILD
COMMAND cp -v ${PYLIB_OUTPUT_FILE} ${PYTHON_MODULE_DIRECTORY}/${PYLIB_SO_NAME}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Copying library files to python directory" )
get_directory_property(AMCF ADDITIONAL_MAKE_CLEAN_FILES)
list(APPEND AMCF ${PYTHON_MODULE_DIRECTORY}/${PYLIB_SO_NAME})
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${AMCF}")
endfunction(wrap_python)

View File

@ -136,7 +136,7 @@ macro(gtsam_add_grouped_scripts group pattern target_prefix pretty_prefix_name l
endif() endif()
# Add TOPSRCDIR # Add TOPSRCDIR
set_property(SOURCE ${script_src} APPEND PROPERTY COMPILE_DEFINITIONS "TOPSRCDIR=\"${CMAKE_SOURCE_DIR}\"") set_property(SOURCE ${script_src} APPEND PROPERTY COMPILE_DEFINITIONS "TOPSRCDIR=\"${PROJECT_SOURCE_DIR}\"")
# Disable building during make all/install # Disable building during make all/install
if (GTSAM_DISABLE_TESTS_ON_INSTALL) if (GTSAM_DISABLE_TESTS_ON_INSTALL)
@ -184,7 +184,7 @@ macro(gtsam_add_grouped_scripts group pattern target_prefix pretty_prefix_name l
set_property(SOURCE ${rest_script_srcs} APPEND PROPERTY COMPILE_DEFINITIONS "main=static no_main") set_property(SOURCE ${rest_script_srcs} APPEND PROPERTY COMPILE_DEFINITIONS "main=static no_main")
# Add TOPSRCDIR # Add TOPSRCDIR
set_property(SOURCE ${script_srcs} APPEND PROPERTY COMPILE_DEFINITIONS "TOPSRCDIR=\"${CMAKE_SOURCE_DIR}\"") set_property(SOURCE ${script_srcs} APPEND PROPERTY COMPILE_DEFINITIONS "TOPSRCDIR=\"${PROJECT_SOURCE_DIR}\"")
# Add test # Add test
add_dependencies(${target_prefix}.${group} ${script_bin}) add_dependencies(${target_prefix}.${group} ${script_bin})

View File

@ -18,7 +18,7 @@ project(myproject CXX C)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake")
# Ensure that local folder is searched before library folders # Ensure that local folder is searched before library folders
include_directories(BEFORE "${CMAKE_SOURCE_DIR}") include_directories(BEFORE "${PROJECT_SOURCE_DIR}")
# Load build type flags and default to Debug mode # Load build type flags and default to Debug mode
include(GtsamBuildTypes) include(GtsamBuildTypes)
@ -115,7 +115,7 @@ install(TARGETS ${PROJECT_NAME}-static ARCHIVE DESTINATION lib )
# Note the need for a full path # Note the need for a full path
set(disabled_tests set(disabled_tests
"dummy" "dummy"
#"${CMAKE_SOURCE_DIR}/myproject/geometry/tests/testCovarianceEllipse.cpp" #"${PROJECT_SOURCE_DIR}/myproject/geometry/tests/testCovarianceEllipse.cpp"
) )
list(REMOVE_ITEM myproject_tests_source ${disabled_tests}) list(REMOVE_ITEM myproject_tests_source ${disabled_tests})

View File

@ -0,0 +1,38 @@
# This file should be used as a template for creating new projects using the CMake tools
# This project has the following features
# - GTSAM linking
# - Unit tests via CppUnitLite
# - Scripts
###################################################################################
# To create your own project, replace "myproject" with the actual name of your project
cmake_minimum_required(VERSION 2.6)
enable_testing()
project(myproject CXX C)
# Add the cmake subfolder to the cmake module path - necessary to use macros
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# Ensure that local folder is searched before library folders
include_directories(BEFORE "${PROJECT_SOURCE_DIR}")
# Load build type flags and default to Debug mode
include(GtsamBuildTypes)
###################################################################################
# Find GTSAM components
find_package(GTSAM REQUIRED) # Uses installed package
include_directories(${GTSAM_INCLUDE_DIR})
###################################################################################
# Build static library from common sources
add_library(${PROJECT_NAME} STATIC ${PROJECT_NAME}/MySourceFiles.cpp)
target_link_libraries(${PROJECT_NAME} gtsam-shared)
###################################################################################
# Build tests (CMake tracks the dependecy to link with GTSAM through our project's static library)
gtsam_add_subdir_tests(${PROJECT_NAME} "${PROJECT_NAME}" "${PROJECT_NAME}" "")
###################################################################################
# Build scripts (CMake tracks the dependecy to link with GTSAM through our project's static library)
gtsam_add_executables("${PROJECT_NAME}/myScripts.cpp" "${PROJECT_NAME}" "${PROJECT_NAME}" "")

1
doc/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/*.DS_Store

1
doc/images/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/*.DS_Store

13728
doc/stats.html Normal file

File diff suppressed because one or more lines are too long

1
examples/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/*.DS_Store

View File

@ -4,6 +4,16 @@ endif()
# Build example executables # Build example executables
FILE(GLOB example_srcs "*.cpp") FILE(GLOB example_srcs "*.cpp")
set (excluded_examples #"")
"${CMAKE_CURRENT_SOURCE_DIR}/DiscreteBayesNet_FG.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/UGM_chain.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/UGM_small.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/elaboratePoint2KalmanFilter.cpp"
)
list(REMOVE_ITEM example_srcs ${excluded_examples})
foreach(example_src ${example_srcs} ) foreach(example_src ${example_srcs} )
get_filename_component(example_base ${example_src} NAME_WE) get_filename_component(example_base ${example_src} NAME_WE)
set( example_bin ${example_base} ) set( example_bin ${example_base} )

View File

@ -70,7 +70,7 @@ int main(int argc, char* argv[]) {
/* 2. add factors to the graph */ /* 2. add factors to the graph */
// add measurement factors // add measurement factors
SharedDiagonal measurementNoise = Diagonal::Sigmas(Vector_(2, 0.5, 0.5)); SharedDiagonal measurementNoise = Diagonal::Sigmas((Vector(2) << 0.5, 0.5));
boost::shared_ptr<ResectioningFactor> factor; boost::shared_ptr<ResectioningFactor> factor;
graph.push_back( graph.push_back(
boost::make_shared<ResectioningFactor>(measurementNoise, X(1), calib, boost::make_shared<ResectioningFactor>(measurementNoise, X(1), calib,

View File

@ -0,0 +1,112 @@
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
/**
* @file CreateSFMExampleData.cpp
* @brief Create some example data that for inclusion in the data folder
* @author Frank Dellaert
*/
#include <gtsam/slam/dataset.h>
#include <gtsam/geometry/CalibratedCamera.h>
#include <boost/foreach.hpp>
#include <boost/assign/std/vector.hpp>
using namespace boost::assign;
using namespace std;
using namespace gtsam;
/* ************************************************************************* */
void createExampleBALFile(const string& filename, const vector<Point3>& P,
const Pose3& pose1, const Pose3& pose2, const Cal3Bundler& K =
Cal3Bundler()) {
// Class that will gather all data
SfM_data data;
// Create two cameras
Rot3 aRb = Rot3::yaw(M_PI_2);
Point3 aTb(0.1, 0, 0);
Pose3 identity, aPb(aRb, aTb);
data.cameras.push_back(SfM_Camera(pose1, K));
data.cameras.push_back(SfM_Camera(pose2, K));
BOOST_FOREACH(const Point3& p, P) {
// Create the track
SfM_Track track;
track.p = p;
track.r = 1;
track.g = 1;
track.b = 1;
// Project points in both cameras
for (size_t i = 0; i < 2; i++)
track.measurements.push_back(make_pair(i, data.cameras[i].project(p)));
// Add track to data
data.tracks.push_back(track);
}
writeBAL(filename, data);
}
/* ************************************************************************* */
void create5PointExample1() {
// Create two cameras poses
Rot3 aRb = Rot3::yaw(M_PI_2);
Point3 aTb(0.1, 0, 0);
Pose3 pose1, pose2(aRb, aTb);
// Create test data, we need at least 5 points
vector<Point3> P;
P += Point3(0, 0, 1), Point3(-0.1, 0, 1), Point3(0.1, 0, 1), //
Point3(0, 0.5, 0.5), Point3(0, -0.5, 0.5);
// Assumes example is run in ${GTSAM_TOP}/build/examples
const string filename = "../../examples/data/5pointExample1.txt";
createExampleBALFile(filename, P, pose1, pose2);
}
/* ************************************************************************* */
void create5PointExample2() {
// Create two cameras poses
Rot3 aRb = Rot3::yaw(M_PI_2);
Point3 aTb(10, 0, 0);
Pose3 pose1, pose2(aRb, aTb);
// Create test data, we need at least 5 points
vector<Point3> P;
P += Point3(0, 0, 100), Point3(-10, 0, 100), Point3(10, 0, 100), //
Point3(0, 50, 50), Point3(0, -50, 50), Point3(-20, 0, 80), Point3(20, -50, 80);
// Assumes example is run in ${GTSAM_TOP}/build/examples
const string filename = "../../examples/data/5pointExample2.txt";
Cal3Bundler K(500, 0, 0);
createExampleBALFile(filename, P, pose1, pose2,K);
}
/* ************************************************************************* */
int main(int argc, char* argv[]) {
create5PointExample1();
create5PointExample2();
return 0;
}
/* ************************************************************************* */

1
examples/Data/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/*.DS_Store

View File

@ -0,0 +1,53 @@
2 5 10
0 0 0 -0
1 0 -6.123233995736766344e-18 -0.10000000000000000555
0 1 -0.10000000000000000555 -0
1 1 -1.2246467991473532688e-17 -0.2000000000000000111
0 2 0.10000000000000000555 -0
1 2 0 -0
0 3 0 -1
1 3 1 -0.20000000000000006661
0 4 0 1
1 4 -1 -0.19999999999999995559
3.141592653589793116
0
0
-0
0
0
1
0
0
2.2214414690791830509
2.2214414690791826068
0
-6.123233995736766344e-18
-0.10000000000000000555
0
1
0
0
0
0
1
-0.10000000000000000555
0
1
0.10000000000000000555
0
1
0
0.5
0.5
0
-0.5
0.5

View File

@ -0,0 +1,65 @@
2 7 14
0 0 0 -0
1 0 -3.0616169978683830426e-15 -50
0 1 -50 -0
1 1 -6.1232339957367660852e-15 -100
0 2 50 -0
1 2 0 -0
0 3 0 -500
1 3 500 -100.00000000000002842
0 4 0 500
1 4 -500 -99.999999999999957367
0 5 -125 -0
1 5 -1.1481063742006437494e-14 -187.5
0 6 125 312.5
1 6 -312.5 62.500000000000028422
3.141592653589793116
0
0
-0
0
0
500
0
0
2.2214414690791830509
2.2214414690791826068
0
-6.1232339957367662824e-16
-10
0
500
0
0
0
0
100
-10
0
100
10
0
100
0
50
50
0
-50
50
-20
0
80
20
-50
80

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,80 @@
3 7 19
0 0 -385.989990234375 387.1199951171875
1 0 -38.439998626708984375 492.1199951171875
2 0 -667.91998291015625 123.1100006103515625
0 1 383.8800048828125 -15.299989700317382812
1 1 559.75 -106.15000152587890625
0 2 591.54998779296875 136.44000244140625
1 2 863.8599853515625 -23.469970703125
2 2 494.720001220703125 112.51999664306640625
0 3 592.5 125.75
1 3 861.08001708984375 -35.219970703125
2 3 498.540008544921875 101.55999755859375
0 4 348.720001220703125 558.3800048828125
1 4 776.030029296875 483.529998779296875
2 4 7.7800288200378417969 326.350006103515625
0 5 14.010009765625 96.420013427734375
1 5 207.1300048828125 118.3600006103515625
0 6 202.7599945068359375 340.989990234375
1 6 543.18011474609375 294.80999755859375
2 6 -58.419979095458984375 110.8300018310546875
0.29656188120312942935
-0.035318354384285870207
0.31252101755032046793
0.47230274932665988752
-0.3572340863744113415
-2.0517704282499575896
1430.031982421875
-7.5572756941255647689e-08
3.2377570134516087119e-14
0.28532097381985194184
-0.27699838370789808817
0.048601169984112867206
-1.2598695987143850861
-0.049063798188844320869
-1.9586867140445654023
1432.137451171875
-7.3171918302250560373e-08
3.1759419042137054801e-14
0.057491325683772541433
0.34853090049579965592
0.47985129303736057116
8.1963904289063389541
6.5146840788718787252
-3.8392804395897406344
1572.047119140625
-1.5962623223231275915e-08
-1.6507904730136101212e-14
-11.317351620610928364
3.3594874875767186673
-42.755222607849105998
4.2648515634753199066
-8.4629358700849355301
-22.252086323427270997
10.996977688149536689
-9.2123370180278048025
-29.206739014051372294
10.935342607054865383
-9.4338917557810741954
-29.112263909175499776
15.714024935401759819
1.3745079651566265433
-59.286834979937104606
-1.3624227800805182031
-4.1979357415396094666
-21.034430148188398846
6.7690173115899296974
-4.7352452433700786827
-53.605307875695892506

View File

@ -0,0 +1,80 @@
3 7 19
0 0 -3.859900e+02 3.871200e+02
1 0 -3.844000e+01 4.921200e+02
2 0 -6.679200e+02 1.231100e+02
0 1 3.838800e+02 -1.529999e+01
1 1 5.597500e+02 -1.061500e+02
0 2 5.915500e+02 1.364400e+02
1 2 8.638600e+02 -2.346997e+01
2 2 4.947200e+02 1.125200e+02
0 3 5.925000e+02 1.257500e+02
1 3 8.610800e+02 -3.521997e+01
2 3 4.985400e+02 1.015600e+02
0 4 3.487200e+02 5.583800e+02
1 4 7.760300e+02 4.835300e+02
2 4 7.780029e+00 3.263500e+02
0 5 1.401001e+01 9.642001e+01
1 5 2.071300e+02 1.183600e+02
0 6 2.027600e+02 3.409900e+02
1 6 5.431801e+02 2.948100e+02
2 6 -5.841998e+01 1.108300e+02
-1.6943983532198115e-02
1.1171804676513932e-02
2.4643508831711991e-03
7.3030995682610689e-01
-2.6490818471043420e-01
-1.7127892627337182e+00
1.4300319432711681e+03
-7.5572758535864072e-08
3.2377569465570913e-14
1.5049725341485708e-02
-1.8504564785154357e-01
-2.9278402790141456e-01
-1.0590476152349551e+00
-3.6017862414345798e-02
-1.5720340175803784e+00
1.4321374541298685e+03
-7.3171919892612292e-08
3.1759419019880947e-14
-3.0793597986873011e-01
3.2077907982952031e-01
2.2253985096991455e-01
8.5034483295909009e+00
6.7499603629668741e+00
-3.6383814384447088e+00
1.5720470590375264e+03
-1.5962623661947355e-08
-1.6507904848058800e-14
-1.2055995050700867e+01
1.2838775976205760e+01
-4.1099369264082803e+01
6.4168905904672933e+00
3.8897031177598462e-01
-2.3586282709150449e+01
1.3051100355717297e+01
3.8387587111611952e+00
-2.9777932175344951e+01
1.3060946673472820e+01
3.5910521225905803e+00
-2.9759080795372942e+01
1.4265764475421857e+01
2.4096216156436530e+01
-5.4823971067225500e+01
-2.5292283211391348e-01
2.2166082122808284e+00
-2.1712127480255084e+01
7.6465738085189585e+00
1.4185331909846619e+01
-5.2070299568846060e+01

View File

@ -93,8 +93,8 @@ public:
// Consequently, the Jacobians are: // Consequently, the Jacobians are:
// [ derror_x/dx derror_x/dy derror_x/dtheta ] = [1 0 0] // [ derror_x/dx derror_x/dy derror_x/dtheta ] = [1 0 0]
// [ derror_y/dx derror_y/dy derror_y/dtheta ] = [0 1 0] // [ derror_y/dx derror_y/dy derror_y/dtheta ] = [0 1 0]
if (H) (*H) = Matrix_(2,3, 1.0,0.0,0.0, 0.0,1.0,0.0); if (H) (*H) = (Matrix(2,3) << 1.0,0.0,0.0, 0.0,1.0,0.0);
return Vector_(2, q.x() - mx_, q.y() - my_); return (Vector(2) << q.x() - mx_, q.y() - my_);
} }
// The second is a 'clone' function that allows the factor to be copied. Under most // The second is a 'clone' function that allows the factor to be copied. Under most
@ -118,17 +118,17 @@ int main(int argc, char** argv) {
// 2a. Add odometry factors // 2a. Add odometry factors
// For simplicity, we will use the same noise model for each odometry factor // For simplicity, we will use the same noise model for each odometry factor
noiseModel::Diagonal::shared_ptr odometryNoise = noiseModel::Diagonal::Sigmas(Vector_(3, 0.2, 0.2, 0.1)); noiseModel::Diagonal::shared_ptr odometryNoise = noiseModel::Diagonal::Sigmas((Vector(3) << 0.2, 0.2, 0.1));
// Create odometry (Between) factors between consecutive poses // Create odometry (Between) factors between consecutive poses
graph.add(BetweenFactor<Pose2>(1, 2, Pose2(2.0, 0.0, 0.0), odometryNoise)); graph.add(BetweenFactor<Pose2>(1, 2, Pose2(2.0, 0.0, 0.0), odometryNoise));
graph.add(BetweenFactor<Pose2>(2, 3, Pose2(2.0, 0.0, 0.0), odometryNoise)); graph.add(BetweenFactor<Pose2>(2, 3, Pose2(2.0, 0.0, 0.0), odometryNoise));
// 2b. Add "GPS-like" measurements // 2b. Add "GPS-like" measurements
// We will use our custom UnaryFactor for this. // We will use our custom UnaryFactor for this.
noiseModel::Diagonal::shared_ptr unaryNoise = noiseModel::Diagonal::Sigmas(Vector_(2, 0.1, 0.1)); // 10cm std on x,y noiseModel::Diagonal::shared_ptr unaryNoise = noiseModel::Diagonal::Sigmas((Vector(2) << 0.1, 0.1)); // 10cm std on x,y
graph.push_back(boost::make_shared<UnaryFactor>(1, 0.0, 0.0, unaryNoise)); graph.add(boost::make_shared<UnaryFactor>(1, 0.0, 0.0, unaryNoise));
graph.push_back(boost::make_shared<UnaryFactor>(2, 2.0, 0.0, unaryNoise)); graph.add(boost::make_shared<UnaryFactor>(2, 2.0, 0.0, unaryNoise));
graph.push_back(boost::make_shared<UnaryFactor>(3, 4.0, 0.0, unaryNoise)); graph.add(boost::make_shared<UnaryFactor>(3, 4.0, 0.0, unaryNoise));
graph.print("\nFactor Graph:\n"); // print graph.print("\nFactor Graph:\n"); // print
// 3. Create the data structure to hold the initialEstimate estimate to the solution // 3. Create the data structure to hold the initialEstimate estimate to the solution

View File

@ -64,13 +64,13 @@ int main(int argc, char** argv) {
// Add a prior on the first pose, setting it to the origin // Add a prior on the first pose, setting it to the origin
// A prior factor consists of a mean and a noise model (covariance matrix) // A prior factor consists of a mean and a noise model (covariance matrix)
Pose2 priorMean(0.0, 0.0, 0.0); // prior at origin Pose2 priorMean(0.0, 0.0, 0.0); // prior at origin
noiseModel::Diagonal::shared_ptr priorNoise = noiseModel::Diagonal::Sigmas(Vector_(3, 0.3, 0.3, 0.1)); noiseModel::Diagonal::shared_ptr priorNoise = noiseModel::Diagonal::Sigmas((Vector(3) << 0.3, 0.3, 0.1));
graph.add(PriorFactor<Pose2>(1, priorMean, priorNoise)); graph.add(PriorFactor<Pose2>(1, priorMean, priorNoise));
// Add odometry factors // Add odometry factors
Pose2 odometry(2.0, 0.0, 0.0); Pose2 odometry(2.0, 0.0, 0.0);
// For simplicity, we will use the same noise model for each odometry factor // For simplicity, we will use the same noise model for each odometry factor
noiseModel::Diagonal::shared_ptr odometryNoise = noiseModel::Diagonal::Sigmas(Vector_(3, 0.2, 0.2, 0.1)); noiseModel::Diagonal::shared_ptr odometryNoise = noiseModel::Diagonal::Sigmas((Vector(3) << 0.2, 0.2, 0.1));
// Create odometry (Between) factors between consecutive poses // Create odometry (Between) factors between consecutive poses
graph.add(BetweenFactor<Pose2>(1, 2, odometry, odometryNoise)); graph.add(BetweenFactor<Pose2>(1, 2, odometry, odometryNoise));
graph.add(BetweenFactor<Pose2>(2, 3, odometry, odometryNoise)); graph.add(BetweenFactor<Pose2>(2, 3, odometry, odometryNoise));

View File

@ -80,18 +80,18 @@ int main(int argc, char** argv) {
// Add a prior on pose x1 at the origin. A prior factor consists of a mean and a noise model (covariance matrix) // Add a prior on pose x1 at the origin. A prior factor consists of a mean and a noise model (covariance matrix)
Pose2 prior(0.0, 0.0, 0.0); // prior mean is at origin Pose2 prior(0.0, 0.0, 0.0); // prior mean is at origin
noiseModel::Diagonal::shared_ptr priorNoise = noiseModel::Diagonal::Sigmas(Vector_(3, 0.3, 0.3, 0.1)); // 30cm std on x,y, 0.1 rad on theta noiseModel::Diagonal::shared_ptr priorNoise = noiseModel::Diagonal::Sigmas((Vector(3) << 0.3, 0.3, 0.1)); // 30cm std on x,y, 0.1 rad on theta
graph.add(PriorFactor<Pose2>(x1, prior, priorNoise)); // add directly to graph graph.add(PriorFactor<Pose2>(x1, prior, priorNoise)); // add directly to graph
// Add two odometry factors // Add two odometry factors
Pose2 odometry(2.0, 0.0, 0.0); // create a measurement for both factors (the same in this case) Pose2 odometry(2.0, 0.0, 0.0); // create a measurement for both factors (the same in this case)
noiseModel::Diagonal::shared_ptr odometryNoise = noiseModel::Diagonal::Sigmas(Vector_(3, 0.2, 0.2, 0.1)); // 20cm std on x,y, 0.1 rad on theta noiseModel::Diagonal::shared_ptr odometryNoise = noiseModel::Diagonal::Sigmas((Vector(3) << 0.2, 0.2, 0.1)); // 20cm std on x,y, 0.1 rad on theta
graph.add(BetweenFactor<Pose2>(x1, x2, odometry, odometryNoise)); graph.add(BetweenFactor<Pose2>(x1, x2, odometry, odometryNoise));
graph.add(BetweenFactor<Pose2>(x2, x3, odometry, odometryNoise)); graph.add(BetweenFactor<Pose2>(x2, x3, odometry, odometryNoise));
// Add Range-Bearing measurements to two different landmarks // Add Range-Bearing measurements to two different landmarks
// create a noise model for the landmark measurements // create a noise model for the landmark measurements
noiseModel::Diagonal::shared_ptr measurementNoise = noiseModel::Diagonal::Sigmas(Vector_(2, 0.1, 0.2)); // 0.1 rad std on bearing, 20cm on range noiseModel::Diagonal::shared_ptr measurementNoise = noiseModel::Diagonal::Sigmas((Vector(2) << 0.1, 0.2)); // 0.1 rad std on bearing, 20cm on range
// create the measurement values - indices are (pose id, landmark id) // create the measurement values - indices are (pose id, landmark id)
Rot2 bearing11 = Rot2::fromDegrees(45), Rot2 bearing11 = Rot2::fromDegrees(45),
bearing21 = Rot2::fromDegrees(90), bearing21 = Rot2::fromDegrees(90),

View File

@ -71,11 +71,11 @@ int main(int argc, char** argv) {
// 2a. Add a prior on the first pose, setting it to the origin // 2a. Add a prior on the first pose, setting it to the origin
// A prior factor consists of a mean and a noise model (covariance matrix) // A prior factor consists of a mean and a noise model (covariance matrix)
noiseModel::Diagonal::shared_ptr priorNoise = noiseModel::Diagonal::Sigmas(Vector_(3, 0.3, 0.3, 0.1)); noiseModel::Diagonal::shared_ptr priorNoise = noiseModel::Diagonal::Sigmas((Vector(3) << 0.3, 0.3, 0.1));
graph.add(PriorFactor<Pose2>(1, Pose2(0, 0, 0), priorNoise)); graph.add(PriorFactor<Pose2>(1, Pose2(0, 0, 0), priorNoise));
// For simplicity, we will use the same noise model for odometry and loop closures // For simplicity, we will use the same noise model for odometry and loop closures
noiseModel::Diagonal::shared_ptr model = noiseModel::Diagonal::Sigmas(Vector_(3, 0.2, 0.2, 0.1)); noiseModel::Diagonal::shared_ptr model = noiseModel::Diagonal::Sigmas((Vector(3) << 0.2, 0.2, 0.1));
// 2b. Add odometry factors // 2b. Add odometry factors
// Create odometry (Between) factors between consecutive poses // Create odometry (Between) factors between consecutive poses

View File

@ -10,7 +10,7 @@
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
/** /**
* @file Pose2SLAMExample_graph->cpp * @file Pose2SLAMExample_graph.cpp
* @brief Read graph from file and perform GraphSLAM * @brief Read graph from file and perform GraphSLAM
* @date June 3, 2012 * @date June 3, 2012
* @author Frank Dellaert * @author Frank Dellaert
@ -20,28 +20,24 @@
#include <gtsam/slam/PriorFactor.h> #include <gtsam/slam/PriorFactor.h>
#include <gtsam/nonlinear/Marginals.h> #include <gtsam/nonlinear/Marginals.h>
#include <gtsam/nonlinear/LevenbergMarquardtOptimizer.h> #include <gtsam/nonlinear/LevenbergMarquardtOptimizer.h>
#include <gtsam/nonlinear/NonlinearFactorGraph.h>
#include <gtsam/nonlinear/Values.h>
#include <gtsam/geometry/Pose2.h> #include <gtsam/geometry/Pose2.h>
#include <boost/tuple/tuple.hpp>
#include <cmath>
using namespace std; using namespace std;
using namespace gtsam; using namespace gtsam;
int main(int argc, char** argv) { int main (int argc, char** argv) {
// Read File and create graph and initial estimate // Read File, create graph and initial estimate
// we are in build/examples, data is in examples/Data // we are in build/examples, data is in examples/Data
NonlinearFactorGraph::shared_ptr graph ; NonlinearFactorGraph::shared_ptr graph;
Values::shared_ptr initial; Values::shared_ptr initial;
SharedDiagonal model = noiseModel::Diagonal::Sigmas(Vector_(3, 0.05, 0.05, 5.0*M_PI/180.0)); SharedDiagonal model = noiseModel::Diagonal::Sigmas((Vector(3) << 0.05, 0.05, 5.0 * M_PI / 180.0));
boost::tie(graph,initial) = load2D("../../examples/Data/w100-odom.graph",model); boost::tie(graph, initial) = load2D("../../examples/Data/w100.graph", model);
initial->print("Initial estimate:\n"); initial->print("Initial estimate:\n");
// Add a Gaussian prior on first poses // Add a Gaussian prior on first poses
Pose2 priorMean(0.0, 0.0, 0.0); // prior at origin Pose2 priorMean(0.0, 0.0, 0.0); // prior at origin
SharedDiagonal priorNoise = noiseModel::Diagonal::Sigmas(Vector_(3, 0.01, 0.01, 0.01)); SharedDiagonal priorNoise = noiseModel::Diagonal::Sigmas((Vector(3) << 0.01, 0.01, 0.01));
graph->add(PriorFactor<Pose2>(0, priorMean, priorNoise)); graph->add(PriorFactor<Pose2>(0, priorMean, priorNoise));
// Single Step Optimization using Levenberg-Marquardt // Single Step Optimization using Levenberg-Marquardt
@ -53,5 +49,5 @@ int main(int argc, char** argv) {
cout.precision(2); cout.precision(2);
cout << "\nP3:\n" << marginals.marginalCovariance(99) << endl; cout << "\nP3:\n" << marginals.marginalCovariance(99) << endl;
return 0; return 0;
} }

View File

@ -0,0 +1,71 @@
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
/**
* @file Pose2SLAMExample_graphviz.cpp
* @brief Save factor graph as graphviz dot file
* @date Sept 6, 2013
* @author Frank Dellaert
*/
#include <gtsam/slam/PriorFactor.h>
#include <gtsam/slam/BetweenFactor.h>
#include <gtsam/nonlinear/Marginals.h>
#include <gtsam/nonlinear/LevenbergMarquardtOptimizer.h>
#include <gtsam/geometry/Pose2.h>
#include <fstream>
using namespace std;
using namespace gtsam;
int main (int argc, char** argv) {
// 1. Create a factor graph container and add factors to it
NonlinearFactorGraph graph;
// 2a. Add a prior on the first pose, setting it to the origin
noiseModel::Diagonal::shared_ptr priorNoise = noiseModel::Diagonal::Sigmas((Vector(3) << 0.3, 0.3, 0.1));
graph.add(PriorFactor<Pose2>(1, Pose2(0, 0, 0), priorNoise));
// For simplicity, we will use the same noise model for odometry and loop closures
noiseModel::Diagonal::shared_ptr model = noiseModel::Diagonal::Sigmas((Vector(3) << 0.2, 0.2, 0.1));
// 2b. Add odometry factors
graph.add(BetweenFactor<Pose2>(1, 2, Pose2(2, 0, 0 ), model));
graph.add(BetweenFactor<Pose2>(2, 3, Pose2(2, 0, M_PI_2), model));
graph.add(BetweenFactor<Pose2>(3, 4, Pose2(2, 0, M_PI_2), model));
graph.add(BetweenFactor<Pose2>(4, 5, Pose2(2, 0, M_PI_2), model));
// 2c. Add the loop closure constraint
graph.add(BetweenFactor<Pose2>(5, 2, Pose2(2, 0, M_PI_2), model));
// 3. Create the data structure to hold the initial estimate to the solution
// For illustrative purposes, these have been deliberately set to incorrect values
Values initial;
initial.insert(1, Pose2(0.5, 0.0, 0.2 ));
initial.insert(2, Pose2(2.3, 0.1, -0.2 ));
initial.insert(3, Pose2(4.1, 0.1, M_PI_2));
initial.insert(4, Pose2(4.0, 2.0, M_PI ));
initial.insert(5, Pose2(2.1, 2.1, -M_PI_2));
// Single Step Optimization using Levenberg-Marquardt
Values result = LevenbergMarquardtOptimizer(graph, initial).optimize();
// save factor graph as graphviz dot file
// Render to PDF using "fdp Pose2SLAMExample.dot -Tpdf > graph.pdf"
ofstream os("Pose2SLAMExample.dot");
graph.saveGraph(os, result);
// Also print out to console
graph.saveGraph(cout, result);
return 0;
}

View File

@ -68,12 +68,12 @@ int main(int argc, char** argv) {
// 2a. Add a prior on the first pose, setting it to the origin // 2a. Add a prior on the first pose, setting it to the origin
// A prior factor consists of a mean and a noise model (covariance matrix) // A prior factor consists of a mean and a noise model (covariance matrix)
Pose2 prior(0.0, 0.0, 0.0); // prior at origin Pose2 prior(0.0, 0.0, 0.0); // prior at origin
noiseModel::Diagonal::shared_ptr priorNoise = noiseModel::Diagonal::Sigmas(Vector_(3, 0.3, 0.3, 0.1)); noiseModel::Diagonal::shared_ptr priorNoise = noiseModel::Diagonal::Sigmas((Vector(3) << 0.3, 0.3, 0.1));
graph.add(PriorFactor<Pose2>(1, prior, priorNoise)); graph.add(PriorFactor<Pose2>(1, prior, priorNoise));
// 2b. Add odometry factors // 2b. Add odometry factors
// For simplicity, we will use the same noise model for each odometry factor // For simplicity, we will use the same noise model for each odometry factor
noiseModel::Diagonal::shared_ptr odometryNoise = noiseModel::Diagonal::Sigmas(Vector_(3, 0.2, 0.2, 0.1)); noiseModel::Diagonal::shared_ptr odometryNoise = noiseModel::Diagonal::Sigmas((Vector(3) << 0.2, 0.2, 0.1));
// Create odometry (Between) factors between consecutive poses // Create odometry (Between) factors between consecutive poses
graph.add(BetweenFactor<Pose2>(1, 2, Pose2(2.0, 0.0, M_PI_2), odometryNoise)); graph.add(BetweenFactor<Pose2>(1, 2, Pose2(2.0, 0.0, M_PI_2), odometryNoise));
graph.add(BetweenFactor<Pose2>(2, 3, Pose2(2.0, 0.0, M_PI_2), odometryNoise)); graph.add(BetweenFactor<Pose2>(2, 3, Pose2(2.0, 0.0, M_PI_2), odometryNoise));
@ -85,7 +85,7 @@ int main(int argc, char** argv) {
// these constraints may be identified in many ways, such as appearance-based techniques // these constraints may be identified in many ways, such as appearance-based techniques
// with camera images. // with camera images.
// We will use another Between Factor to enforce this constraint, with the distance set to zero, // We will use another Between Factor to enforce this constraint, with the distance set to zero,
noiseModel::Diagonal::shared_ptr model = noiseModel::Diagonal::Sigmas(Vector_(3, 0.2, 0.2, 0.1)); noiseModel::Diagonal::shared_ptr model = noiseModel::Diagonal::Sigmas((Vector(3) << 0.2, 0.2, 0.1));
graph.add(BetweenFactor<Pose2>(5, 1, Pose2(0.0, 0.0, 0.0), model)); graph.add(BetweenFactor<Pose2>(5, 1, Pose2(0.0, 0.0, 0.0), model));
graph.print("\nFactor Graph:\n"); // print graph.print("\nFactor Graph:\n"); // print

118
examples/SFMExample.cpp Normal file
View File

@ -0,0 +1,118 @@
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
/**
* @file SFMExample.cpp
* @brief A structure-from-motion problem on a simulated dataset
* @author Duy-Nguyen Ta
*/
/**
* A structure-from-motion example with landmarks
* - The landmarks form a 10 meter cube
* - The robot rotates around the landmarks, always facing towards the cube
*/
// For loading the data
#include "SFMdata.h"
// Camera observations of landmarks (i.e. pixel coordinates) will be stored as Point2 (x, y).
#include <gtsam/geometry/Point2.h>
// Each variable in the system (poses and landmarks) must be identified with a unique key.
// We can either use simple integer keys (1, 2, 3, ...) or symbols (X1, X2, L1).
// Here we will use Symbols
#include <gtsam/nonlinear/Symbol.h>
// In GTSAM, measurement functions are represented as 'factors'. Several common factors
// have been provided with the library for solving robotics/SLAM/Bundle Adjustment problems.
// Here we will use Projection factors to model the camera's landmark observations.
// Also, we will initialize the robot at some location using a Prior factor.
#include <gtsam/slam/PriorFactor.h>
#include <gtsam/slam/ProjectionFactor.h>
// When the factors are created, we will add them to a Factor Graph. As the factors we are using
// are nonlinear factors, we will need a Nonlinear Factor Graph.
#include <gtsam/nonlinear/NonlinearFactorGraph.h>
// Finally, once all of the factors have been added to our factor graph, we will want to
// solve/optimize to graph to find the best (Maximum A Posteriori) set of variable values.
// GTSAM includes several nonlinear optimizers to perform this step. Here we will use a
// trust-region method known as Powell's Degleg
#include <gtsam/nonlinear/DoglegOptimizer.h>
// The nonlinear solvers within GTSAM are iterative solvers, meaning they linearize the
// nonlinear functions around an initial linearization point, then solve the linear system
// to update the linearization point. This happens repeatedly until the solver converges
// to a consistent set of variable values. This requires us to specify an initial guess
// for each variable, held in a Values container.
#include <gtsam/nonlinear/Values.h>
#include <vector>
using namespace std;
using namespace gtsam;
/* ************************************************************************* */
int main(int argc, char* argv[]) {
// Define the camera calibration parameters
Cal3_S2::shared_ptr K(new Cal3_S2(50.0, 50.0, 0.0, 50.0, 50.0));
// Define the camera observation noise model
noiseModel::Isotropic::shared_ptr measurementNoise = noiseModel::Isotropic::Sigma(2, 1.0); // one pixel in u and v
// Create the set of ground-truth landmarks
vector<Point3> points = createPoints();
// Create the set of ground-truth poses
vector<Pose3> poses = createPoses();
// Create a factor graph
NonlinearFactorGraph graph;
// Add a prior on pose x1. This indirectly specifies where the origin is.
noiseModel::Diagonal::shared_ptr poseNoise = noiseModel::Diagonal::Sigmas((Vector(6) << Vector3::Constant(0.3), Vector3::Constant(0.1))); // 30cm std on x,y,z 0.1 rad on roll,pitch,yaw
graph.add(PriorFactor<Pose3>(Symbol('x', 0), poses[0], poseNoise)); // add directly to graph
// Simulated measurements from each camera pose, adding them to the factor graph
for (size_t i = 0; i < poses.size(); ++i) {
for (size_t j = 0; j < points.size(); ++j) {
SimpleCamera camera(poses[i], *K);
Point2 measurement = camera.project(points[j]);
graph.add(GenericProjectionFactor<Pose3, Point3, Cal3_S2>(measurement, measurementNoise, Symbol('x', i), Symbol('l', j), K));
}
}
// Because the structure-from-motion problem has a scale ambiguity, the problem is still under-constrained
// Here we add a prior on the position of the first landmark. This fixes the scale by indicating the distance
// between the first camera and the first landmark. All other landmark positions are interpreted using this scale.
noiseModel::Isotropic::shared_ptr pointNoise = noiseModel::Isotropic::Sigma(3, 0.1);
graph.add(PriorFactor<Point3>(Symbol('l', 0), points[0], pointNoise)); // add directly to graph
graph.print("Factor Graph:\n");
// Create the data structure to hold the initial estimate to the solution
// Intentionally initialize the variables off from the ground truth
Values initialEstimate;
for (size_t i = 0; i < poses.size(); ++i)
initialEstimate.insert(Symbol('x', i), poses[i].compose(Pose3(Rot3::rodriguez(-0.1, 0.2, 0.25), Point3(0.05, -0.10, 0.20))));
for (size_t j = 0; j < points.size(); ++j)
initialEstimate.insert(Symbol('l', j), points[j].compose(Point3(-0.25, 0.20, 0.15)));
initialEstimate.print("Initial Estimates:\n");
/* Optimize the graph and print results */
Values result = DoglegOptimizer(graph, initialEstimate).optimize();
result.print("Final results:\n");
return 0;
}
/* ************************************************************************* */

View File

@ -0,0 +1,94 @@
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
/**
* @file SFMExample.cpp
* @brief Solve a structure-from-motion problem from a "Bundle Adjustment in the Large" file
* @author Frank Dellaert
*/
// For an explanation of headers, see SFMExample.cpp
#include <gtsam/nonlinear/Symbol.h>
#include <gtsam/nonlinear/NonlinearFactorGraph.h>
#include <gtsam/nonlinear/LevenbergMarquardtOptimizer.h>
#include <gtsam/slam/PriorFactor.h>
#include <gtsam/slam/GeneralSFMFactor.h>
#include <gtsam/slam/dataset.h> // for loading BAL datasets !
#include <vector>
using namespace std;
using namespace gtsam;
using symbol_shorthand::C;
using symbol_shorthand::P;
// We will be using a projection factor that ties a SFM_Camera to a 3D point.
// An SFM_Camera is defined in datase.h as a camera with unknown Cal3Bundler calibration
// and has a total of 9 free parameters
typedef GeneralSFMFactor<SfM_Camera,Point3> MyFactor;
/* ************************************************************************* */
int main (int argc, char* argv[]) {
// Find default file, but if an argument is given, try loading a file
string filename = findExampleDataFile("dubrovnik-3-7-pre");
if (argc>1) filename = string(argv[1]);
// Load the SfM data from file
SfM_data mydata;
const bool success = readBAL(filename, mydata);
assert(success);
cout << boost::format("read %1% tracks on %2% cameras\n") % mydata.number_tracks() % mydata.number_cameras();
// Create a factor graph
NonlinearFactorGraph graph;
// We share *one* noiseModel between all projection factors
noiseModel::Isotropic::shared_ptr noise =
noiseModel::Isotropic::Sigma(2, 1.0); // one pixel in u and v
// Add measurements to the factor graph
size_t j = 0;
BOOST_FOREACH(const SfM_Track& track, mydata.tracks) {
BOOST_FOREACH(const SfM_Measurement& m, track.measurements) {
size_t i = m.first;
Point2 uv = m.second;
graph.add(MyFactor(uv, noise, C(i), P(j))); // note use of shorthand symbols C and P
}
j += 1;
}
// Add a prior on pose x1. This indirectly specifies where the origin is.
// and a prior on the position of the first landmark to fix the scale
graph.add(PriorFactor<SfM_Camera>(C(0), mydata.cameras[0], noiseModel::Isotropic::Sigma(9, 0.1)));
graph.add(PriorFactor<Point3> (P(0), mydata.tracks[0].p, noiseModel::Isotropic::Sigma(3, 0.1)));
// Create initial estimate
Values initial;
size_t i = 0; j = 0;
BOOST_FOREACH(const SfM_Camera& camera, mydata.cameras) initial.insert(C(i++), camera);
BOOST_FOREACH(const SfM_Track& track, mydata.tracks) initial.insert(P(j++), track.p);
/* Optimize the graph and print results */
Values result;
try {
LevenbergMarquardtParams params;
params.setVerbosity("ERROR");
LevenbergMarquardtOptimizer lm(graph, initial, params);
result = lm.optimize();
} catch (exception& e) {
cout << e.what();
}
cout << "final error: " << graph.error(result) << endl;
return 0;
}
/* ************************************************************************* */

68
examples/SFMdata.h Normal file
View File

@ -0,0 +1,68 @@
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
/**
* @file SFMMdata.h
* @brief Simple example for the structure-from-motion problems
* @author Duy-Nguyen Ta
*/
/**
* A structure-from-motion example with landmarks
* - The landmarks form a 10 meter cube
* - The robot rotates around the landmarks, always facing towards the cube
*/
// As this is a full 3D problem, we will use Pose3 variables to represent the camera
// positions and Point3 variables (x, y, z) to represent the landmark coordinates.
// Camera observations of landmarks (i.e. pixel coordinates) will be stored as Point2 (x, y).
// We will also need a camera object to hold calibration information and perform projections.
#include <gtsam/geometry/Pose3.h>
#include <gtsam/geometry/Point3.h>
// We will also need a camera object to hold calibration information and perform projections.
#include <gtsam/geometry/SimpleCamera.h>
/* ************************************************************************* */
std::vector<gtsam::Point3> createPoints() {
// Create the set of ground-truth landmarks
std::vector<gtsam::Point3> points;
points.push_back(gtsam::Point3(10.0,10.0,10.0));
points.push_back(gtsam::Point3(-10.0,10.0,10.0));
points.push_back(gtsam::Point3(-10.0,-10.0,10.0));
points.push_back(gtsam::Point3(10.0,-10.0,10.0));
points.push_back(gtsam::Point3(10.0,10.0,-10.0));
points.push_back(gtsam::Point3(-10.0,10.0,-10.0));
points.push_back(gtsam::Point3(-10.0,-10.0,-10.0));
points.push_back(gtsam::Point3(10.0,-10.0,-10.0));
return points;
}
/* ************************************************************************* */
std::vector<gtsam::Pose3> createPoses() {
// Create the set of ground-truth poses
std::vector<gtsam::Pose3> poses;
double radius = 30.0;
int i = 0;
double theta = 0.0;
gtsam::Point3 up(0,0,1);
gtsam::Point3 target(0,0,0);
for(; i < 8; ++i, theta += 2*M_PI/8) {
gtsam::Point3 position = gtsam::Point3(radius*cos(theta), radius*sin(theta), 0.0);
gtsam::SimpleCamera camera = gtsam::SimpleCamera::Lookat(position, target, up);
poses.push_back(camera.pose());
}
return poses;
}
/* ************************************************************************* */

View File

@ -0,0 +1,96 @@
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
/**
* @file SelfCalibrationExample.cpp
* @brief Based on VisualSLAMExample, but with unknown (yet fixed) calibration.
* @author Frank Dellaert
*/
/*
* See the detailed documentation in Visual SLAM.
* The only documentation below with deal with the self-calibration.
*/
// For loading the data
#include "SFMdata.h"
// Camera observations of landmarks (i.e. pixel coordinates) will be stored as Point2 (x, y).
#include <gtsam/geometry/Point2.h>
// Inference and optimization
#include <gtsam/nonlinear/Symbol.h>
#include <gtsam/nonlinear/NonlinearFactorGraph.h>
#include <gtsam/nonlinear/DoglegOptimizer.h>
#include <gtsam/nonlinear/Values.h>
// SFM-specific factors
#include <gtsam/slam/PriorFactor.h>
#include <gtsam/slam/GeneralSFMFactor.h> // does calibration !
// Standard headers
#include <vector>
using namespace std;
using namespace gtsam;
/* ************************************************************************* */
int main(int argc, char* argv[]) {
// Create the set of ground-truth
vector<Point3> points = createPoints();
vector<Pose3> poses = createPoses();
// Create the factor graph
NonlinearFactorGraph graph;
// Add a prior on pose x1.
noiseModel::Diagonal::shared_ptr poseNoise = noiseModel::Diagonal::Sigmas((Vector(6) << Vector3::Constant(0.3), Vector3::Constant(0.1))); // 30cm std on x,y,z 0.1 rad on roll,pitch,yaw
graph.add(PriorFactor<Pose3>(Symbol('x', 0), poses[0], poseNoise));
// Simulated measurements from each camera pose, adding them to the factor graph
Cal3_S2 K(50.0, 50.0, 0.0, 50.0, 50.0);
noiseModel::Isotropic::shared_ptr measurementNoise = noiseModel::Isotropic::Sigma(2, 1.0);
for (size_t i = 0; i < poses.size(); ++i) {
for (size_t j = 0; j < points.size(); ++j) {
SimpleCamera camera(poses[i], K);
Point2 measurement = camera.project(points[j]);
// The only real difference with the Visual SLAM example is that here we use a
// different factor type, that also calculates the Jacobian with respect to calibration
graph.add(GeneralSFMFactor2<Cal3_S2>(measurement, measurementNoise, Symbol('x', i), Symbol('l', j), Symbol('K', 0)));
}
}
// Add a prior on the position of the first landmark.
noiseModel::Isotropic::shared_ptr pointNoise = noiseModel::Isotropic::Sigma(3, 0.1);
graph.add(PriorFactor<Point3>(Symbol('l', 0), points[0], pointNoise)); // add directly to graph
// Add a prior on the calibration.
noiseModel::Diagonal::shared_ptr calNoise = noiseModel::Diagonal::Sigmas((Vector(5) << 500, 500, 0.1, 100, 100));
graph.add(PriorFactor<Cal3_S2>(Symbol('K', 0), K, calNoise));
// Create the initial estimate to the solution
// now including an estimate on the camera calibration parameters
Values initialEstimate;
initialEstimate.insert(Symbol('K', 0), Cal3_S2(60.0, 60.0, 0.0, 45.0, 45.0));
for (size_t i = 0; i < poses.size(); ++i)
initialEstimate.insert(Symbol('x', i), poses[i].compose(Pose3(Rot3::rodriguez(-0.1, 0.2, 0.25), Point3(0.05, -0.10, 0.20))));
for (size_t j = 0; j < points.size(); ++j)
initialEstimate.insert(Symbol('l', j), points[j].compose(Point3(-0.25, 0.20, 0.15)));
/* Optimize the graph and print results */
Values result = DoglegOptimizer(graph, initialEstimate).optimize();
result.print("Final results:\n");
return 0;
}
/* ************************************************************************* */

View File

@ -22,14 +22,11 @@
* - The robot rotates around the landmarks, always facing towards the cube * - The robot rotates around the landmarks, always facing towards the cube
*/ */
// As this is a full 3D problem, we will use Pose3 variables to represent the camera // For loading the data
// positions and Point3 variables (x, y, z) to represent the landmark coordinates. #include "SFMdata.h"
// Camera observations of landmarks (i.e. pixel coordinates) will be stored as Point2 (x, y). // Camera observations of landmarks (i.e. pixel coordinates) will be stored as Point2 (x, y).
// We will also need a camera object to hold calibration information and perform projections.
#include <gtsam/geometry/Pose3.h>
#include <gtsam/geometry/Point3.h>
#include <gtsam/geometry/Point2.h> #include <gtsam/geometry/Point2.h>
#include <gtsam/geometry/SimpleCamera.h>
// Each variable in the system (poses and landmarks) must be identified with a unique key. // Each variable in the system (poses and landmarks) must be identified with a unique key.
// We can either use simple integer keys (1, 2, 3, ...) or symbols (X1, X2, L1). // We can either use simple integer keys (1, 2, 3, ...) or symbols (X1, X2, L1).
@ -67,28 +64,10 @@ int main(int argc, char* argv[]) {
noiseModel::Isotropic::shared_ptr measurementNoise = noiseModel::Isotropic::Sigma(2, 1.0); // one pixel in u and v noiseModel::Isotropic::shared_ptr measurementNoise = noiseModel::Isotropic::Sigma(2, 1.0); // one pixel in u and v
// Create the set of ground-truth landmarks // Create the set of ground-truth landmarks
std::vector<gtsam::Point3> points; vector<Point3> points = createPoints();
points.push_back(gtsam::Point3(10.0,10.0,10.0));
points.push_back(gtsam::Point3(-10.0,10.0,10.0));
points.push_back(gtsam::Point3(-10.0,-10.0,10.0));
points.push_back(gtsam::Point3(10.0,-10.0,10.0));
points.push_back(gtsam::Point3(10.0,10.0,-10.0));
points.push_back(gtsam::Point3(-10.0,10.0,-10.0));
points.push_back(gtsam::Point3(-10.0,-10.0,-10.0));
points.push_back(gtsam::Point3(10.0,-10.0,-10.0));
// Create the set of ground-truth poses // Create the set of ground-truth poses
std::vector<gtsam::Pose3> poses; vector<Pose3> poses = createPoses();
double radius = 30.0;
int i = 0;
double theta = 0.0;
gtsam::Point3 up(0,0,1);
gtsam::Point3 target(0,0,0);
for(; i < 8; ++i, theta += 2*M_PI/8) {
gtsam::Point3 position = Point3(radius*cos(theta), radius*sin(theta), 0.0);
gtsam::SimpleCamera camera = SimpleCamera::Lookat(position, target, up);
poses.push_back(camera.pose());
}
// Create an iSAM2 object. Unlike iSAM1, which performs periodic batch steps to maintain proper linearization // Create an iSAM2 object. Unlike iSAM1, which performs periodic batch steps to maintain proper linearization
// and efficient variable ordering, iSAM2 performs partial relinearization/reordering at each step. A parameter // and efficient variable ordering, iSAM2 performs partial relinearization/reordering at each step. A parameter
@ -124,7 +103,7 @@ int main(int argc, char* argv[]) {
// adding it to iSAM. // adding it to iSAM.
if( i == 0) { if( i == 0) {
// Add a prior on pose x0 // Add a prior on pose x0
noiseModel::Diagonal::shared_ptr poseNoise = noiseModel::Diagonal::Sigmas(Vector_(6, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1)); // 30cm std on x,y,z 0.1 rad on roll,pitch,yaw noiseModel::Diagonal::shared_ptr poseNoise = noiseModel::Diagonal::Sigmas((Vector(6) << Vector3::Constant(0.3),Vector3::Constant(0.1))); // 30cm std on x,y,z 0.1 rad on roll,pitch,yaw
graph.add(PriorFactor<Pose3>(Symbol('x', 0), poses[0], poseNoise)); graph.add(PriorFactor<Pose3>(Symbol('x', 0), poses[0], poseNoise));
// Add a prior on landmark l0 // Add a prior on landmark l0

View File

@ -22,14 +22,11 @@
* - The robot rotates around the landmarks, always facing towards the cube * - The robot rotates around the landmarks, always facing towards the cube
*/ */
// As this is a full 3D problem, we will use Pose3 variables to represent the camera // For loading the data
// positions and Point3 variables (x, y, z) to represent the landmark coordinates. #include "SFMdata.h"
// Camera observations of landmarks (i.e. pixel coordinates) will be stored as Point2 (x, y). // Camera observations of landmarks (i.e. pixel coordinates) will be stored as Point2 (x, y).
// We will also need a camera object to hold calibration information and perform projections.
#include <gtsam/geometry/Pose3.h>
#include <gtsam/geometry/Point3.h>
#include <gtsam/geometry/Point2.h> #include <gtsam/geometry/Point2.h>
#include <gtsam/geometry/SimpleCamera.h>
// Each variable in the system (poses and landmarks) must be identified with a unique key. // Each variable in the system (poses and landmarks) must be identified with a unique key.
// We can either use simple integer keys (1, 2, 3, ...) or symbols (X1, X2, L1). // We can either use simple integer keys (1, 2, 3, ...) or symbols (X1, X2, L1).
@ -67,28 +64,10 @@ int main(int argc, char* argv[]) {
noiseModel::Isotropic::shared_ptr measurementNoise = noiseModel::Isotropic::Sigma(2, 1.0); // one pixel in u and v noiseModel::Isotropic::shared_ptr measurementNoise = noiseModel::Isotropic::Sigma(2, 1.0); // one pixel in u and v
// Create the set of ground-truth landmarks // Create the set of ground-truth landmarks
std::vector<gtsam::Point3> points; vector<Point3> points = createPoints();
points.push_back(gtsam::Point3(10.0,10.0,10.0));
points.push_back(gtsam::Point3(-10.0,10.0,10.0));
points.push_back(gtsam::Point3(-10.0,-10.0,10.0));
points.push_back(gtsam::Point3(10.0,-10.0,10.0));
points.push_back(gtsam::Point3(10.0,10.0,-10.0));
points.push_back(gtsam::Point3(-10.0,10.0,-10.0));
points.push_back(gtsam::Point3(-10.0,-10.0,-10.0));
points.push_back(gtsam::Point3(10.0,-10.0,-10.0));
// Create the set of ground-truth poses // Create the set of ground-truth poses
std::vector<gtsam::Pose3> poses; vector<Pose3> poses = createPoses();
double radius = 30.0;
int i = 0;
double theta = 0.0;
gtsam::Point3 up(0,0,1);
gtsam::Point3 target(0,0,0);
for(; i < 8; ++i, theta += 2*M_PI/8) {
gtsam::Point3 position = Point3(radius*cos(theta), radius*sin(theta), 0.0);
gtsam::SimpleCamera camera = SimpleCamera::Lookat(position, target, up);
poses.push_back(camera.pose());
}
// Create a NonlinearISAM object which will relinearize and reorder the variables every "relinearizeInterval" updates // Create a NonlinearISAM object which will relinearize and reorder the variables every "relinearizeInterval" updates
int relinearizeInterval = 3; int relinearizeInterval = 3;
@ -118,7 +97,7 @@ int main(int argc, char* argv[]) {
// adding it to iSAM. // adding it to iSAM.
if( i == 0) { if( i == 0) {
// Add a prior on pose x0 // Add a prior on pose x0
noiseModel::Diagonal::shared_ptr poseNoise = noiseModel::Diagonal::Sigmas(Vector_(6, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1)); // 30cm std on x,y,z 0.1 rad on roll,pitch,yaw noiseModel::Diagonal::shared_ptr poseNoise = noiseModel::Diagonal::Sigmas((Vector(6) << Vector3::Constant(0.3), Vector3::Constant(0.1))); // 30cm std on x,y,z 0.1 rad on roll,pitch,yaw
graph.add(PriorFactor<Pose3>(Symbol('x', 0), poses[0], poseNoise)); graph.add(PriorFactor<Pose3>(Symbol('x', 0), poses[0], poseNoise));
// Add a prior on landmark l0 // Add a prior on landmark l0

49
gtsam.h
View File

@ -563,6 +563,49 @@ virtual class Pose3 : gtsam::Value {
void serialize() const; void serialize() const;
}; };
#include <gtsam/geometry/Unit3.h>
virtual class Unit3 : gtsam::Value {
// Standard Constructors
Unit3();
Unit3(const gtsam::Point3& pose);
// Testable
void print(string s) const;
bool equals(const gtsam::Unit3& pose, double tol) const;
// Other functionality
Matrix basis() const;
Matrix skew() const;
// Manifold
static size_t Dim();
size_t dim() const;
gtsam::Unit3 retract(Vector v) const;
Vector localCoordinates(const gtsam::Unit3& s) const;
};
#include <gtsam/geometry/EssentialMatrix.h>
virtual class EssentialMatrix : gtsam::Value {
// Standard Constructors
EssentialMatrix(const gtsam::Rot3& aRb, const gtsam::Unit3& aTb);
// Testable
void print(string s) const;
bool equals(const gtsam::EssentialMatrix& pose, double tol) const;
// Manifold
static size_t Dim();
size_t dim() const;
gtsam::EssentialMatrix retract(Vector v) const;
Vector localCoordinates(const gtsam::EssentialMatrix& s) const;
// Other methods:
gtsam::Rot3 rotation() const;
gtsam::Unit3 direction() const;
Matrix matrix() const;
double error(Vector vA, Vector vB);
};
virtual class Cal3_S2 : gtsam::Value { virtual class Cal3_S2 : gtsam::Value {
// Standard Constructors // Standard Constructors
Cal3_S2(); Cal3_S2();
@ -2273,6 +2316,12 @@ virtual class PoseRotationPrior : gtsam::NoiseModelFactor {
typedef gtsam::PoseRotationPrior<gtsam::Pose2> PoseRotationPrior2D; typedef gtsam::PoseRotationPrior<gtsam::Pose2> PoseRotationPrior2D;
typedef gtsam::PoseRotationPrior<gtsam::Pose3> PoseRotationPrior3D; typedef gtsam::PoseRotationPrior<gtsam::Pose3> PoseRotationPrior3D;
#include <gtsam/slam/EssentialMatrixFactor.h>
virtual class EssentialMatrixFactor : gtsam::NoiseModelFactor {
EssentialMatrixFactor(size_t key, const gtsam::Point2& pA, const gtsam::Point2& pB,
const gtsam::noiseModel::Base* noiseModel);
};
#include <gtsam/slam/dataset.h> #include <gtsam/slam/dataset.h>
pair<gtsam::NonlinearFactorGraph*, gtsam::Values*> load2D(string filename, pair<gtsam::NonlinearFactorGraph*, gtsam::Values*> load2D(string filename,
gtsam::noiseModel::Diagonal* model, int maxID, bool addNoise, bool smart); gtsam::noiseModel::Diagonal* model, int maxID, bool addNoise, bool smart);

View File

@ -3,17 +3,28 @@ install(FILES CCOLAMD/Include/ccolamd.h DESTINATION include/gtsam/3rdparty/CCOLA
install(FILES UFconfig/UFconfig.h DESTINATION include/gtsam/3rdparty/UFconfig) install(FILES UFconfig/UFconfig.h DESTINATION include/gtsam/3rdparty/UFconfig)
if(NOT GTSAM_USE_SYSTEM_EIGEN) if(NOT GTSAM_USE_SYSTEM_EIGEN)
# Find plain .h files
file(GLOB_RECURSE eigen_headers "${CMAKE_CURRENT_SOURCE_DIR}/Eigen/Eigen/*.h")
# Find header files without extension
file(GLOB eigen_dir_headers_all "Eigen/Eigen/*")
foreach(eigen_dir ${eigen_dir_headers_all})
get_filename_component(filename ${eigen_dir} NAME)
if (NOT ((${filename} MATCHES "CMakeLists.txt") OR (${filename} MATCHES "src") OR (${filename} MATCHES ".svn")))
list(APPEND eigen_headers "${CMAKE_CURRENT_SOURCE_DIR}/Eigen/Eigen/${filename}")
install(FILES Eigen/Eigen/${filename} DESTINATION include/gtsam/3rdparty/Eigen/Eigen)
endif()
endforeach(eigen_dir)
# Add to project source
set(eigen_headers ${eigen_headers} PARENT_SCOPE)
# install Eigen - only the headers in our 3rdparty directory # install Eigen - only the headers in our 3rdparty directory
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")
file(GLOB eigen_dir_headers_all "Eigen/Eigen/*")
# ensure that Eigen folders without extensions get added
foreach(eigen_dir ${eigen_dir_headers_all})
get_filename_component(filename ${eigen_dir} NAME)
if (NOT ((${filename} MATCHES "CMakeLists.txt") OR (${filename} MATCHES "src") OR (${filename} MATCHES ".svn")))
install(FILES Eigen/Eigen/${filename} DESTINATION include/gtsam/3rdparty/Eigen/Eigen)
endif()
endforeach(eigen_dir)
endif() endif()
############ NOTE: When updating GeographicLib be sure to disable building their examples
############ by commenting out their line add_subdirectory (examples).
add_subdirectory(GeographicLib)

View File

@ -33,7 +33,7 @@
#ifndef EIGEN_LLT_MKL_H #ifndef EIGEN_LLT_MKL_H
#define EIGEN_LLT_MKL_H #define EIGEN_LLT_MKL_H
#include "Eigen/src/Core/util/MKL_support.h" #include "../Core/util/MKL_support.h"
#include <iostream> #include <iostream>
namespace Eigen { namespace Eigen {
@ -60,7 +60,7 @@ template<> struct mkl_llt<EIGTYPE> \
lda = m.outerStride(); \ lda = m.outerStride(); \
\ \
info = LAPACKE_##MKLPREFIX##potrf( matrix_order, uplo, size, (MKLTYPE*)a, lda ); \ info = LAPACKE_##MKLPREFIX##potrf( matrix_order, uplo, size, (MKLTYPE*)a, lda ); \
info = (info==0) ? Success : NumericalIssue; \ info = (info==0) ? -1 : 1; \
return info; \ return info; \
} \ } \
}; \ }; \

View File

@ -25,10 +25,14 @@ namespace Eigen {
* \sa \ref MatrixBaseCommaInitRef "MatrixBase::operator<<", CommaInitializer::finished() * \sa \ref MatrixBaseCommaInitRef "MatrixBase::operator<<", CommaInitializer::finished()
*/ */
template<typename XprType> template<typename XprType>
struct CommaInitializer struct CommaInitializer :
public internal::dense_xpr_base<CommaInitializer<XprType> >::type
{ {
typedef typename XprType::Scalar Scalar; typedef typename internal::dense_xpr_base<CommaInitializer<XprType> >::type Base;
typedef typename XprType::Index Index; EIGEN_DENSE_PUBLIC_INTERFACE(CommaInitializer)
typedef typename internal::conditional<internal::must_nest_by_value<XprType>::ret,
XprType, const XprType&>::type ExpressionTypeNested;
typedef typename XprType::InnerIterator InnerIterator;
inline CommaInitializer(XprType& xpr, const Scalar& s) inline CommaInitializer(XprType& xpr, const Scalar& s)
: m_xpr(xpr), m_row(0), m_col(1), m_currentBlockRows(1) : m_xpr(xpr), m_row(0), m_col(1), m_currentBlockRows(1)
@ -104,11 +108,81 @@ struct CommaInitializer
*/ */
inline XprType& finished() { return m_xpr; } inline XprType& finished() { return m_xpr; }
// The following implement the DenseBase interface
inline Index rows() const { return m_xpr.rows(); }
inline Index cols() const { return m_xpr.cols(); }
inline Index outerStride() const { return m_xpr.outerStride(); }
inline Index innerStride() const { return m_xpr.innerStride(); }
inline CoeffReturnType coeff(Index row, Index col) const
{
return m_xpr.coeff(row, col);
}
inline CoeffReturnType coeff(Index index) const
{
return m_xpr.coeff(index);
}
inline const Scalar& coeffRef(Index row, Index col) const
{
return m_xpr.const_cast_derived().coeffRef(row, col);
}
inline const Scalar& coeffRef(Index index) const
{
return m_xpr.const_cast_derived().coeffRef(index);
}
inline Scalar& coeffRef(Index row, Index col)
{
return m_xpr.const_cast_derived().coeffRef(row, col);
}
inline Scalar& coeffRef(Index index)
{
return m_xpr.const_cast_derived().coeffRef(index);
}
template<int LoadMode>
inline const PacketScalar packet(Index row, Index col) const
{
return m_xpr.template packet<LoadMode>(row, col);
}
template<int LoadMode>
inline void writePacket(Index row, Index col, const PacketScalar& x)
{
m_xpr.const_cast_derived().template writePacket<LoadMode>(row, col, x);
}
template<int LoadMode>
inline const PacketScalar packet(Index index) const
{
return m_xpr.template packet<LoadMode>(index);
}
template<int LoadMode>
inline void writePacket(Index index, const PacketScalar& x)
{
m_xpr.const_cast_derived().template writePacket<LoadMode>(index, x);
}
const XprType& _expression() const { return m_xpr; }
XprType& m_xpr; // target expression XprType& m_xpr; // target expression
Index m_row; // current row id Index m_row; // current row id
Index m_col; // current col id Index m_col; // current col id
Index m_currentBlockRows; // current block height Index m_currentBlockRows; // current block height
}; };
namespace internal {
template<typename XprType>
struct traits<CommaInitializer<XprType> > : traits<XprType>
{
};
}
/** \anchor MatrixBaseCommaInitRef /** \anchor MatrixBaseCommaInitRef
* Convenient operator to set the coefficients of a matrix. * Convenient operator to set the coefficients of a matrix.

View File

@ -33,7 +33,7 @@
#ifndef EIGEN_COMPLEX_SCHUR_MKL_H #ifndef EIGEN_COMPLEX_SCHUR_MKL_H
#define EIGEN_COMPLEX_SCHUR_MKL_H #define EIGEN_COMPLEX_SCHUR_MKL_H
#include "Eigen/src/Core/util/MKL_support.h" #include "../Core/util/MKL_support.h"
namespace Eigen { namespace Eigen {

View File

@ -33,7 +33,7 @@
#ifndef EIGEN_REAL_SCHUR_MKL_H #ifndef EIGEN_REAL_SCHUR_MKL_H
#define EIGEN_REAL_SCHUR_MKL_H #define EIGEN_REAL_SCHUR_MKL_H
#include "Eigen/src/Core/util/MKL_support.h" #include "../Core/util/MKL_support.h"
namespace Eigen { namespace Eigen {

View File

@ -33,7 +33,7 @@
#ifndef EIGEN_SAEIGENSOLVER_MKL_H #ifndef EIGEN_SAEIGENSOLVER_MKL_H
#define EIGEN_SAEIGENSOLVER_MKL_H #define EIGEN_SAEIGENSOLVER_MKL_H
#include "Eigen/src/Core/util/MKL_support.h" #include "../Core/util/MKL_support.h"
namespace Eigen { namespace Eigen {

View File

@ -33,7 +33,7 @@
#ifndef EIGEN_PARTIALLU_LAPACK_H #ifndef EIGEN_PARTIALLU_LAPACK_H
#define EIGEN_PARTIALLU_LAPACK_H #define EIGEN_PARTIALLU_LAPACK_H
#include "Eigen/src/Core/util/MKL_support.h" #include "../Core/util/MKL_support.h"
namespace Eigen { namespace Eigen {

View File

@ -34,7 +34,7 @@
#ifndef EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H #ifndef EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H
#define EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H #define EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H
#include "Eigen/src/Core/util/MKL_support.h" #include "../Core/util/MKL_support.h"
namespace Eigen { namespace Eigen {
@ -63,12 +63,12 @@ ColPivHouseholderQR<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynami
\ \
m_nonzero_pivots = 0; \ m_nonzero_pivots = 0; \
m_maxpivot = RealScalar(0);\ m_maxpivot = RealScalar(0);\
m_colsPermutation.resize(cols); \ m_colsPermutation.resize((int)cols); \
m_colsPermutation.indices().setZero(); \ m_colsPermutation.indices().setZero(); \
\ \
lapack_int lda = m_qr.outerStride(), i; \ lapack_int lda = (lapack_int) m_qr.outerStride(), i; \
lapack_int matrix_order = MKLCOLROW; \ lapack_int matrix_order = MKLCOLROW; \
LAPACKE_##MKLPREFIX##geqp3( matrix_order, rows, cols, (MKLTYPE*)m_qr.data(), lda, (lapack_int*)m_colsPermutation.indices().data(), (MKLTYPE*)m_hCoeffs.data()); \ LAPACKE_##MKLPREFIX##geqp3( matrix_order, (lapack_int)rows, (lapack_int)cols, (MKLTYPE*)m_qr.data(), lda, (lapack_int*)m_colsPermutation.indices().data(), (MKLTYPE*)m_hCoeffs.data()); \
m_isInitialized = true; \ m_isInitialized = true; \
m_maxpivot=m_qr.diagonal().cwiseAbs().maxCoeff(); \ m_maxpivot=m_qr.diagonal().cwiseAbs().maxCoeff(); \
m_hCoeffs.adjointInPlace(); \ m_hCoeffs.adjointInPlace(); \

View File

@ -251,56 +251,62 @@ void householder_qr_inplace_unblocked(MatrixQR& mat, HCoeffs& hCoeffs, typename
} }
/** \internal */ /** \internal */
template<typename MatrixQR, typename HCoeffs> template<typename MatrixQR, typename HCoeffs,
void householder_qr_inplace_blocked(MatrixQR& mat, HCoeffs& hCoeffs, typename MatrixQRScalar = typename MatrixQR::Scalar,
typename MatrixQR::Index maxBlockSize=32, bool InnerStrideIsOne = (MatrixQR::InnerStrideAtCompileTime == 1 && HCoeffs::InnerStrideAtCompileTime == 1)>
typename MatrixQR::Scalar* tempData = 0) struct householder_qr_inplace_blocked
{ {
typedef typename MatrixQR::Index Index; // This is specialized for MKL-supported Scalar types in HouseholderQR_MKL.h
typedef typename MatrixQR::Scalar Scalar; static void run(MatrixQR& mat, HCoeffs& hCoeffs,
typedef Block<MatrixQR,Dynamic,Dynamic> BlockType; typename MatrixQR::Index maxBlockSize=32,
typename MatrixQR::Scalar* tempData = 0)
Index rows = mat.rows();
Index cols = mat.cols();
Index size = (std::min)(rows, cols);
typedef Matrix<Scalar,Dynamic,1,ColMajor,MatrixQR::MaxColsAtCompileTime,1> TempType;
TempType tempVector;
if(tempData==0)
{ {
tempVector.resize(cols); typedef typename MatrixQR::Index Index;
tempData = tempVector.data(); typedef typename MatrixQR::Scalar Scalar;
} typedef Block<MatrixQR,Dynamic,Dynamic> BlockType;
Index blockSize = (std::min)(maxBlockSize,size); Index rows = mat.rows();
Index cols = mat.cols();
Index size = (std::min)(rows, cols);
Index k = 0; typedef Matrix<Scalar,Dynamic,1,ColMajor,MatrixQR::MaxColsAtCompileTime,1> TempType;
for (k = 0; k < size; k += blockSize) TempType tempVector;
{ if(tempData==0)
Index bs = (std::min)(size-k,blockSize); // actual size of the block
Index tcols = cols - k - bs; // trailing columns
Index brows = rows-k; // rows of the block
// partition the matrix:
// A00 | A01 | A02
// mat = A10 | A11 | A12
// A20 | A21 | A22
// and performs the qr dec of [A11^T A12^T]^T
// and update [A21^T A22^T]^T using level 3 operations.
// Finally, the algorithm continue on A22
BlockType A11_21 = mat.block(k,k,brows,bs);
Block<HCoeffs,Dynamic,1> hCoeffsSegment = hCoeffs.segment(k,bs);
householder_qr_inplace_unblocked(A11_21, hCoeffsSegment, tempData);
if(tcols)
{ {
BlockType A21_22 = mat.block(k,k+bs,brows,tcols); tempVector.resize(cols);
apply_block_householder_on_the_left(A21_22,A11_21,hCoeffsSegment.adjoint()); tempData = tempVector.data();
}
Index blockSize = (std::min)(maxBlockSize,size);
Index k = 0;
for (k = 0; k < size; k += blockSize)
{
Index bs = (std::min)(size-k,blockSize); // actual size of the block
Index tcols = cols - k - bs; // trailing columns
Index brows = rows-k; // rows of the block
// partition the matrix:
// A00 | A01 | A02
// mat = A10 | A11 | A12
// A20 | A21 | A22
// and performs the qr dec of [A11^T A12^T]^T
// and update [A21^T A22^T]^T using level 3 operations.
// Finally, the algorithm continue on A22
BlockType A11_21 = mat.block(k,k,brows,bs);
Block<HCoeffs,Dynamic,1> hCoeffsSegment = hCoeffs.segment(k,bs);
householder_qr_inplace_unblocked(A11_21, hCoeffsSegment, tempData);
if(tcols)
{
BlockType A21_22 = mat.block(k,k+bs,brows,tcols);
apply_block_householder_on_the_left(A21_22,A11_21,hCoeffsSegment.adjoint());
}
} }
} }
} };
template<typename _MatrixType, typename Rhs> template<typename _MatrixType, typename Rhs>
struct solve_retval<HouseholderQR<_MatrixType>, Rhs> struct solve_retval<HouseholderQR<_MatrixType>, Rhs>
@ -352,7 +358,7 @@ HouseholderQR<MatrixType>& HouseholderQR<MatrixType>::compute(const MatrixType&
m_temp.resize(cols); m_temp.resize(cols);
internal::householder_qr_inplace_blocked(m_qr, m_hCoeffs, 48, m_temp.data()); internal::householder_qr_inplace_blocked<MatrixType, HCoeffsType>::run(m_qr, m_hCoeffs, 48, m_temp.data());
m_isInitialized = true; m_isInitialized = true;
return *this; return *this;

View File

@ -34,28 +34,30 @@
#ifndef EIGEN_QR_MKL_H #ifndef EIGEN_QR_MKL_H
#define EIGEN_QR_MKL_H #define EIGEN_QR_MKL_H
#include "Eigen/src/Core/util/MKL_support.h" #include "../Core/util/MKL_support.h"
namespace Eigen { namespace Eigen {
namespace internal { namespace internal {
/** \internal Specialization for the data types supported by MKL */ /** \internal Specialization for the data types supported by MKL */
#define EIGEN_MKL_QR_NOPIV(EIGTYPE, MKLTYPE, MKLPREFIX) \ #define EIGEN_MKL_QR_NOPIV(EIGTYPE, MKLTYPE, MKLPREFIX) \
template<typename MatrixQR, typename HCoeffs> \ template<typename MatrixQR, typename HCoeffs> \
void householder_qr_inplace_blocked(MatrixQR& mat, HCoeffs& hCoeffs, \ struct householder_qr_inplace_blocked<MatrixQR, HCoeffs, EIGTYPE, true> \
typename MatrixQR::Index maxBlockSize=32, \
EIGTYPE* tempData = 0) \
{ \ { \
lapack_int m = mat.rows(); \ static void run(MatrixQR& mat, HCoeffs& hCoeffs, \
lapack_int n = mat.cols(); \ typename MatrixQR::Index = 32, \
lapack_int lda = mat.outerStride(); \ typename MatrixQR::Scalar* = 0) \
lapack_int matrix_order = (MatrixQR::IsRowMajor) ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; \ { \
LAPACKE_##MKLPREFIX##geqrf( matrix_order, m, n, (MKLTYPE*)mat.data(), lda, (MKLTYPE*)hCoeffs.data()); \ lapack_int m = (lapack_int) mat.rows(); \
hCoeffs.adjointInPlace(); \ lapack_int n = (lapack_int) mat.cols(); \
\ lapack_int lda = (lapack_int) mat.outerStride(); \
} lapack_int matrix_order = (MatrixQR::IsRowMajor) ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; \
LAPACKE_##MKLPREFIX##geqrf( matrix_order, m, n, (MKLTYPE*)mat.data(), lda, (MKLTYPE*)hCoeffs.data()); \
hCoeffs.adjointInPlace(); \
} \
};
EIGEN_MKL_QR_NOPIV(double, double, d) EIGEN_MKL_QR_NOPIV(double, double, d)
EIGEN_MKL_QR_NOPIV(float, float, s) EIGEN_MKL_QR_NOPIV(float, float, s)

View File

@ -33,7 +33,7 @@
#ifndef EIGEN_JACOBISVD_MKL_H #ifndef EIGEN_JACOBISVD_MKL_H
#define EIGEN_JACOBISVD_MKL_H #define EIGEN_JACOBISVD_MKL_H
#include "Eigen/src/Core/util/MKL_support.h" #include "../Core/util/MKL_support.h"
namespace Eigen { namespace Eigen {

View File

@ -0,0 +1,143 @@
A library for geographic projections.
Written by Charles Karney <charles@karney.com> and licensed under
the MIT/X11 License. For more information, see
http://geographiclib.sourceforge.net/
Files
00README.txt -- this file
AUTHORS -- the authors of the library
LICENSE.txt -- the MIT/X11 License
INSTALL -- brief installation instructions
NEWS -- a history of changes
include/GeographicLib/ and src/
Config.h.in, Config.h -- system dependent configuration
Constants.hpp -- WGS84 constants
Math.hpp -- math routines
Utility.hpp -- I/O and date routines
Accumulator.[ch]pp -- quad precision adder
PolarStereographic.[ch]pp -- polar stereographic projection
TransverseMercator.[ch]pp -- transverse Mercator projection
UTMUPS.[ch]pp -- UTM and UPS
MGRS.[ch]pp -- MGRS
TransverseMercatorExact.[ch]pp -- exact TM projection
EllipticFunction.[ch]pp -- elliptic functions
GeoCoords.[ch]pp -- hold geographic location
DMS.[ch]pp -- handle degrees minutes seconds
Geocentric.[ch]pp -- geocentric coordinates
LocalCartesian.[ch]pp -- local cartesian coordinates
Geodesic.[ch]pp -- geodesic calculations
GeodesicLine.[ch]pp -- calculations on a single geodesic
PolygonArea.[ch]pp -- polygon area
AzimuthalEquidistant.[ch]pp -- azimuthal equidistant projection
Gnomonic.[ch]pp -- gnomonic projection
CassiniSoldner.[ch]pp -- Cassini-Soldner equidistant projection
Geoid.[ch]pp -- geoid heights
Gravity{Model,Circle}.[ch]pp -- gravity models
Magnetic{Model,Circle}.[ch]pp -- geomagentic models
{Spherical,Circular}Engine.[ch]pp -- spherical harmonic sums
SphericalHarmonic{,1,2}.hpp -- frontend for spherical harmonics
LambertConformalConic.[ch]pp -- Lambert conformal conic projection
AlbersEqualArea.[ch]pp -- Albers equal area projection
Gnomonic.[ch]pp -- Ellipsoidal gnomonic projection
OSGB.[ch]pp -- Ordnance Survey grid system
Geohash.[ch]pp -- conversions for geohashes
Ellipsoid.[ch]pp -- ellipsoid properties
examples/
example-*.cpp -- simple usage examples for all the classes
GeoidToGTX.cpp -- a parallelization example
tools/
GeoConvert.cpp -- geographic conversion utility
TransverseMercatorTest.cpp -- TM tester
GeodSolve.cpp -- geodesic utility
CartConvert.cpp -- convert to geocentric and local cartesian
EquidistantTest.cpp -- exercise AzimuthalEquidistant and CassiniSoldner
GeoidEval.cpp -- evaluate geoid heights
Gravity.cpp -- evaluate gravity
MagneticField.cpp -- evaluate magnetic field
Planimeter.cpp -- computer polygon areas
geographiclib-get-geoids -- download geoid datasets
geographiclib-get-magnetic -- download geomagnetic models
windows/
GeographicLib-vc9.sln -- MS Studio 2008 solution
Geographic-vc9.vcproj -- project for library
GeoConvert-vc9.vcproj -- project for GeoConvert
TransverseMercatorTest-vc9.vcproj -- project for TransverseMercatorTest
Geod-vc9.vcproj -- project for Geod
Planimeter-vc9.vcproj -- project for Planimeter
CartConvert-vc9.vcproj -- project for CartConvert
EquidistantTest-vc9.vcproj -- project for EquidistantTest
GeoidEval-vc9.vcproj -- project for GeoidEval
Gravity-vc9.vcproj -- project for Gravity
MagneticField-vc9.vcproj -- project for MagneticField
also files for MS Studio 2005 (with vc8)
also files for MS Studio 2010 (with vc10)
NETGeographic-vc10.vcxproj -- project for .NET wrapper
maxima/
tm.mac -- Maxima code for high precision TM
ellint.mac -- Maxima code for elliptic functions needed by tm.mac
tmseries.mac -- Maxima code for series approximations for TM
geod.mac -- Maxima code for series approximations for Geodesic
geodesic.mac -- Maxima code for geodesic problems
matlab/
geographiclibinterface.m -- Matlab code to compile Matlab interfaces
utmupsforward.{cpp,m} -- Matlab code to convert geographic to UTM/UPS
utmupsreverse.{cpp,m} -- Matlab code to convert UTM/UPS to geographic
mgrsforward.{cpp,m} -- Matlab code to convert UTM/UPS to MGRS
mgrsreverse.{cpp,m} -- Matlab code to convert MGRS to UTM/UPS
geodesicdirect.{cpp,m} -- Matlab code for the direct geodesic problem
geodesicinverse.{cpp,m} -- Matlab code for the inverse geodesic problem
geodesicline.{cpp,m} -- Matlab code for geodesic lines
geoidheight.{cpp,m} -- Matlab code to look up geoid heights
polygonarea.{cpp,m} -- Matlab code for polygon areas
geoddoc.m -- documentation for native Matlab geodesic routines
geodreckon.m -- native Matlab implementation of direct geodesic problem
geoddistance.m -- native Matlab implementation of inverse geodesic problem
geodarea.m -- native Matlab implementation of polygon area
defaultellipsoid.m, ecc2flat.m, flat2ecc.m -- auxiliary functions
geodproj.m -- documentation for geodesic projections
*_{fwd,inv}.m -- native Matlab implementation of geodesic projections
private/*.m -- internal functions for geodesic routines
doc/
doxyfile.in -- Doxygen config file
Geographic.dox -- main page of Doxygen documentation
geodseries30.html -- geodesic series to 30th order
tmseries30.html -- transverse Mercator series to 30th order
html/* -- directory with built documentation
scripts/*.html -- demonstrations of the JavaScript interface
scripts/GeographicLib/*.js -- JavaScript implementation of geodesics
man/
*.pod -- plain old documentation
*.1 -- man pages in nroff format
*.1.html -- man pages in html format
*.usage -- documentation for incorporation into executables
python/GeographicLib/*.py -- Python implementation of geodesic routines
java/.../*.java -- Java implementation of geodesic routines
dotnet/NETGeographicLib/*.{cpp,h} -- .NET wrapper for GeographicLib
dotnet/examples/CS/*.cs -- simple C# examples for each class
dotnet/examples/ManagedCPP/*.cpp -- Managed C++ examples for each class
dotnet/examples/VB/*.vb -- simple Visual Basic examples for each class
dotnet/Projection/* -- a more complex C# application
legacy/C/* -- C implementation of geodesic routines
legacy/Fortran/* -- Fortran implementation of geodesic routines
Makefile.mk -- Unix/Linux makefiles
configure -- autoconf configuration script
CMakeLists.txt -- cmake configuration files
cmake/
FindGeographicLib.cmake -- cmake find script
*.cmake.in -- cmake config templates

6
gtsam/3rdparty/GeographicLib/AUTHORS vendored Normal file
View File

@ -0,0 +1,6 @@
Charles Karney <charles@karney.com>
Francesco Paolo Lovergine <frankie@debian.org> (autoconfiscation)
Mathieu Peyréga <mathieu.peyrega@gmail.com> (help with gravity models)
Andrew MacIntyre <Andrew.MacIntyre@acma.gov.au> (python/setup.py)
Skip Breidbach <skip.breidbach@sri.com> (maven support for Java)
Scott Heiman <mrmtdew2@outlook.com> (.NET wrappers + C# examples)

View File

@ -0,0 +1,489 @@
project (GeographicLib)
# Version information
set (PROJECT_VERSION_MAJOR 1)
set (PROJECT_VERSION_MINOR 34)
set (PROJECT_VERSION_PATCH 0)
set (PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
if (PROJECT_VERSION_PATCH GREATER 0)
set (PROJECT_VERSION "${PROJECT_VERSION}.${PROJECT_VERSION_PATCH}")
endif ()
set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
# The library version tracks the numbering given by libtool in the
# autoconf set up.
set (LIBVERSION 10)
set (LIBVERSIONFULL 10.1.1)
string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)
cmake_minimum_required (VERSION 2.8.4) # This version was released 2011-02-16
# User-settable variables
# (1) COMMON_INSTALL_PATH governs the installation convention. If it
# is on ON (the Linux default), the installation is to a common
# directory, e.g., /usr/local. If it is OFF (the Windows default),
# the installation directory contains the package name, e.g.,
# c:/pkg/GeographicLib-1.22. The installation directories for the
# documentation, cmake configuration, python and matlab interfaces all
# depend on the variable with deeper paths relative to
# CMAKE_INSTALL_PREFIX being used when it's ON.
if (WIN32)
option (COMMON_INSTALL_PATH "Use a common installation path for packages" OFF)
else ()
option (COMMON_INSTALL_PATH "Use a common installation path for packages" ON)
endif ()
# The use of PACKAGE_PATH and INSTALL_PATH is now DEPRECATED.
# (2) PACKAGE_PATH and INSTALL_PATH govern the find_package search
# path and the installation directory. (find_package is not used by
# GeographicLib since it doesn't depend on other packages. However
# PACKAGE_PATH is used here for uniformity with other packages which
# adopt the same conventions.)
#
# If PACKAGE_PATH is defined, it is prepended to CMAKE_PREFIX_PATH.
#
# If INSTALL_PATH is not specified but PACKAGE_PATH is, then
# INSTALL_PATH is set to
# ${PACKAGE_PATH}, if COMMON_INSTALL_PATH is ON;
# ${PACKAGE_PATH}/${PROJECT_NAME}-${PROJECT_VERSION}, otherwise.
#
# If INSTALL_PATH is now defined, then set CMAKE_INSTALL_PREFIX to
# INSTALL_PATH.
#
# Typically, only PACKAGE_PATH needs to be specified, e.g.,
# cmake -D PACKAGE_PATH=/opt .. (on Linux)
# => CMAKE_PREFIX_PATH=/opt CMAKE_INSTALL_PREFIX=/opt
# cmake -D PACKAGE_PATH=C:/pkg .. (on Windows)
# => CMAKE_PREFIX_PATH=C:/pkg CMAKE_INSTALL_PREFIX=C:/pkg/GeographicLib-1.22
if (PACKAGE_PATH)
set (CMAKE_PREFIX_PATH ${PACKAGE_PATH} ${CMAKE_PREFIX_PATH})
message (STATUS "CMAKE_PREFIX_PATH set to ${CMAKE_PREFIX_PATH}")
endif ()
if (NOT INSTALL_PATH AND PACKAGE_PATH)
if (COMMON_INSTALL_PATH)
set (INSTALL_PATH ${PACKAGE_PATH} CACHE PATH "Installation directory" FORCE)
else ()
set (INSTALL_PATH ${PACKAGE_PATH}/${PROJECT_NAME}-${PROJECT_VERSION}
CACHE PATH "Installation directory" FORCE)
endif ()
endif ()
if (INSTALL_PATH)
file (TO_CMAKE_PATH ${INSTALL_PATH} CMAKE_INSTALL_PREFIX)
message (STATUS "CMAKE_INSTALL_PREFIX set to ${CMAKE_INSTALL_PREFIX}")
endif ()
# (3) Where to look for data files. Various classes look in the geoids,
# gravity, magnetic, subdirectories of ${GEOGRAPHICLIB_DATA}.
if (WIN32)
# The binary installers for the data files for Windows are created
# with Inno Setup which uses {commonappdata}. On most Windows
# systems this is
# "C:/Documents and Settings/All Users/Application Data", while on
# newer systems (Windows 7), it is C:/ProgramData. However the
# longer name "works" on all Windows systems.
set (GEOGRAPHICLIB_DATA
"C:/Documents and Settings/All Users/Application Data/GeographicLib"
CACHE PATH "Location for data for GeographicLib")
else ()
set (GEOGRAPHICLIB_DATA
"/usr/local/share/GeographicLib"
CACHE PATH "Location for data for GeographicLib")
endif ()
# (4) Build which libraries? Possible values are SHARED, STATIC, BOTH.
if (MSVC)
set (GEOGRAPHICLIB_LIB_TYPE STATIC CACHE STRING
"Types of library generated: SHARED, STATIC (default), or BOTH")
else ()
set (GEOGRAPHICLIB_LIB_TYPE SHARED CACHE STRING
"Types of library generated: SHARED (default), STATIC, or BOTH")
endif ()
set_property (CACHE GEOGRAPHICLIB_LIB_TYPE
PROPERTY STRINGS "SHARED" "STATIC" "BOTH")
if (GEOGRAPHICLIB_LIB_TYPE STREQUAL "BOTH")
set (GEOGRAPHICLIB_SHARED_LIB ON)
set (GEOGRAPHICLIB_STATIC_LIB ON)
set (GEOGRAPHICLIB_LIB_TYPE_VAL 2)
elseif (GEOGRAPHICLIB_LIB_TYPE STREQUAL "SHARED")
set (GEOGRAPHICLIB_SHARED_LIB ON)
set (GEOGRAPHICLIB_STATIC_LIB OFF)
set (GEOGRAPHICLIB_LIB_TYPE_VAL 1)
elseif (GEOGRAPHICLIB_LIB_TYPE STREQUAL "STATIC")
set (GEOGRAPHICLIB_SHARED_LIB OFF)
set (GEOGRAPHICLIB_STATIC_LIB ON)
set (GEOGRAPHICLIB_LIB_TYPE_VAL 0)
else ()
message (FATAL_ERROR
"Bad value of GEOGRAPHICLIB_LIB_TYPE, \"${GEOGRAPHICLIB_LIB_TYPE}\" "
"(should be SHARED, STATIC or BOTH)")
endif ()
if (GEOGRAPHICLIB_STATIC_LIB)
set (PROJECT_STATIC_LIBRARIES GeographicLib_STATIC)
set (PROJECT_STATIC_DEFINITIONS -DGEOGRAPHICLIB_SHARED_LIB=0)
else ()
set (PROJECT_STATIC_LIBRARIES)
set (PROJECT_STATIC_DEFINITIONS)
endif ()
if (GEOGRAPHICLIB_SHARED_LIB)
set (PROJECT_SHARED_LIBRARIES GeographicLib)
set (PROJECT_LIBRARIES ${PROJECT_SHARED_LIBRARIES})
set (PROJECT_SHARED_DEFINITIONS -DGEOGRAPHICLIB_SHARED_LIB=1)
set (PROJECT_DEFINITIONS ${PROJECT_SHARED_DEFINITIONS})
else ()
set (PROJECT_SHARED_LIBRARIES)
set (PROJECT_LIBRARIES ${PROJECT_STATIC_LIBRARIES})
set (PROJECT_SHARED_DEFINITIONS)
set (PROJECT_DEFINITIONS ${PROJECT_STATIC_DEFINITIONS})
endif ()
# (5) Compile the Matlab interfaces? Skip Matlab compilation if OFF
set (MATLAB_COMPILER OFF CACHE STRING
"Compiler for matlab/octave interface: mex or mkoctfile or OFF")
set_property (CACHE MATLAB_COMPILER PROPERTY STRINGS "mex" "mkoctfile" OFF)
# (6) Create the documentation? This depends on whether doxygen can be
# found. If this is OFF, then links will be provided to the online
# documentation on Sourceforge.
option (GEOGRAPHICLIB_DOCUMENTATION
"Use doxygen to create the documentation" OFF)
# (7) Build .NET wrapper library NETGeographicLib. This only applies to
# Windows. Default is OFF, because, currently, most people don't use
# this interface.
option (BUILD_NETGEOGRAPHICLIB "Build NETGeographicLib library" OFF)
# (8) Set the default "real" precision. This should probably be left
# at 2 (double).
set (GEOGRAPHICLIB_PRECISION 2 CACHE STRING
"Default real precision: 1 = float, 2 = double, 3 = long double")
set_property (CACHE GEOGRAPHICLIB_PRECISION PROPERTY STRINGS 1 2 3)
# (9) When making a binary package, should we include the debug version
# of the library? This applies to MSVC only, because that's the
# platform where debug and release compilations do not inter-operate.
# It requires building as follows:
# cmake --build . --config Debug --target ALL_BUILD
# cmake --build . --config Release --target ALL_BUILD
# cmake --build . --config Release --target PACKAGE
option (PACKAGE_DEBUG_LIBS
"Include debug versions of library in binary package" OFF)
set (LIBNAME Geographic)
if (MSVC OR CMAKE_CONFIGURATION_TYPES)
# For multi-config systems and for Visual Studio, the debug version of
# the library is called Geographic_d.
set (CMAKE_DEBUG_POSTFIX _d)
endif ()
if (NOT MSVC)
# Set the run time path for shared libraries for non-Windows machines.
# (1) include link path for external packages (not needed with
# GeographicLib because there are no external packages).
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# (2) include installed path for GeographicLib.
if (NOT APPLE)
# Use relative path so that package is relocatable
set (CMAKE_INSTALL_RPATH "\$ORIGIN/../lib${LIB_SUFFIX}")
else ()
# Need absolute path with MacOSx
set (CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
endif ()
endif ()
if (NOT CYGWIN)
# cygwin has a long double but the support for ::cbrtl etc is missing
include (CheckTypeSize)
check_type_size ("long double" LONG_DOUBLE BUILTIN_TYPES_ONLY)
endif ()
include (TestBigEndian)
test_big_endian (WORDS_BIGENDIAN)
# Create a Config.h to expose system information to the compiler
configure_file (
include/GeographicLib/Config.h.in
include/GeographicLib/Config.h )
# The documentation depends on doxygen. Need version 1.8.1.2 or later
# for support of greek letters and math symbols.
if (GEOGRAPHICLIB_DOCUMENTATION)
set (DOXYGEN_SKIP_DOT ON)
find_package (Doxygen 1.8.1.2)
if (DOXYGEN_FOUND)
execute_process (COMMAND ${DOXYGEN_EXECUTABLE} --version
OUTPUT_VARIABLE DOXYGEN_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
if (DOXYGEN_VERSION VERSION_LESS 1.4.0)
set (DOXYGEN_FOUND FALSE)
message (STATUS "Doxygen version found, ${DOXYGEN_VERSION}, is too old")
endif ()
endif ()
endif ()
# The man pages are written as pod files and converted to nroff format,
# C++ code, and html. Because this require tools that may not be
# available on an end-user's system, the creation of the final
# documentation is therefore only done in "MAINTAINER" mode. The
# maintainer runs "make distrib-all" which installs the transformed
# documentation files into the source tree.
if (NOT WIN32 AND NOT APPLE)
find_program (HAVE_POD2MAN pod2man)
find_program (HAVE_POD2HTML pod2html)
find_program (HAVE_COL col)
endif ()
if (HAVE_POD2MAN AND HAVE_POD2HTML AND HAVE_COL)
set (MAINTAINER ON)
else ()
set (MAINTAINER OFF)
endif ()
if (MAINTAINER)
add_custom_target (distrib-all)
add_dependencies (distrib-all distrib-man)
endif ()
# Look for the tool to compile the Matlab interfaces.
if (MATLAB_COMPILER)
if (WIN32)
set (MATLAB_COMPILER_EXT ".bat")
else ()
set (MATLAB_COMPILER_EXT "")
endif ()
find_program (MEX "${MATLAB_COMPILER}${MATLAB_COMPILER_EXT}")
if (MATLAB_COMPILER MATCHES "mex")
get_filename_component (MATLABDIR "${MEX}" REALPATH)
get_filename_component (MATLABDIR "${MATLABDIR}" PATH)
find_program (MEXEXTPROG "mexext${MATLAB_COMPILER_EXT}"
PATHS "${MATLABDIR}")
execute_process (COMMAND "${MEXEXTPROG}"
OUTPUT_VARIABLE MEXEXT OUTPUT_STRIP_TRAILING_WHITESPACE)
set (MEXOPTIONS "-largeArrayDims")
else ()
set (MEXEXT "mex")
set (MEXOPTIONS "--mex")
endif ()
if (NOT MSVC)
# mex files are shared objects => require static lib to be built with
# position independent code
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
endif ()
if (NOT MEX)
message (WARNING
"Cannot find Matlab compiler ${MATLAB_COMPILER}${MATLAB_COMPILER_EXT}")
elseif (NOT MEXEXT)
set (MEX OFF)
message (WARNING "Cannot determine extension for Matlab compiled code")
endif ()
endif ()
# Set a default build type for single-configuration cmake generators if
# no build type is set.
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release)
endif ()
# Make the compiler more picky.
if (MSVC)
string (REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
else ()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
# check for C++11 support
include (CheckCXXCompilerFlag)
set (CXX11FLAG "-std=c++11")
check_cxx_compiler_flag (${CXX11FLAG} CXX11TEST1)
if (NOT CXX11TEST1)
set (CXX11FLAG "-std=c++0x")
check_cxx_compiler_flag (${CXX11FLAG} CXX11TEST2)
if (NOT CXX11TEST2)
unset (CXX11FLAG)
endif ()
endif ()
if (CXX11FLAG)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11FLAG}")
endif ()
endif ()
if (APPLE)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "i.86" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "amd64" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
set (CMAKE_OSX_ARCHITECTURES "i386 -arch x86_64")
endif ()
endif ()
# The list of tools (to be installed into, e.g., /usr/local/bin)
set (TOOLS CartConvert ConicProj GeodesicProj GeoConvert GeodSolve
GeoidEval Gravity MagneticField Planimeter TransverseMercatorProj)
# The list of scripts (to be installed into, e.g., /usr/local/sbin)
set (SCRIPTS
geographiclib-get-geoids geographiclib-get-gravity geographiclib-get-magnetic)
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
# Set the include directories. Look in ${PROJECT_BINARY_DIR}/include
# first because that's where Config.h will be
include_directories ("${PROJECT_BINARY_DIR}/include" include)
# The list of subdirectories to process
add_subdirectory (src)
add_subdirectory (include/GeographicLib)
add_subdirectory (tools)
add_subdirectory (man)
add_subdirectory (doc)
add_subdirectory (matlab)
add_subdirectory (python/geographiclib)
# if (GEOGRAPHICLIB_PRECISION EQUAL 2)
# # The examples assume double precision
# add_subdirectory (examples)
# endif ()
if (BUILD_NETGEOGRAPHICLIB)
set (NETGEOGRAPHICLIB_LIBRARIES NETGeographicLib)
set (NETLIBNAME NETGeographic)
add_subdirectory (dotnet/NETGeographicLib)
if (GEOGRAPHICLIB_PRECISION EQUAL 2)
add_subdirectory (dotnet/examples/ManagedCPP)
endif ()
endif ()
add_subdirectory (cmake)
if (EXISTS ${PROJECT_SOURCE_DIR}/tests/CMakeLists.txt)
add_subdirectory (tests)
endif ()
# Packaging support; we deal with
# (1) a source distribution: cmake make a tar.gz file and the zip file
# is created from this. Only the maintainer can do this, because of
# the need to generate additional documentation files.
# (2) a binary distribution: code is included for Linux, Apple, and
# Windows, but only the Windows distribution has been exercised.
# Need to ensure that system dlls get included in a binary distribution
if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
# Visual Studio Express does include redistributable components so
# squelch the warning.
set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
endif ()
set (CMAKE_INSTALL_DEBUG_LIBRARIES ON)
include (InstallRequiredSystemLibraries)
# The configuration of CPack is via variable that need to be set before
# the include (CPack).
set (CPACK_PACKAGE_CONTACT charles@karney.com)
set (CPACK_PACKAGE_VENDOR "GeographicLib")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY
"GeographicLib library, utilities, and documentation")
# The list of files to be excluded from the source distribution.
set (CPACK_SOURCE_IGNORE_FILES
"#"
"~\$"
"/\\\\.git"
"${PROJECT_SOURCE_DIR}/BUILD"
"${PROJECT_SOURCE_DIR}/(tests|testdata|cgi-bin|.*\\\\.cache)/"
"${PROJECT_SOURCE_DIR}/(distrib|.*-distrib|.*-installer|geodesic-papers)/"
"${PROJECT_SOURCE_DIR}/[^/]*\\\\.(html|kmz|pdf|xml)\$"
"${PROJECT_SOURCE_DIR}/(autogen|biblio|js-compress)\\\\.sh\$"
"${PROJECT_SOURCE_DIR}/(geodesic-biblio.txt|makefile-admin|[^/]*\\\\.png)\$"
"${PROJECT_SOURCE_DIR}/matlab/matlab-.*blurb.txt\$" )
set (CPACK_SOURCE_GENERATOR TGZ)
set (CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE.txt)
set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${PROJECT_VERSION}")
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
if (WIN32)
# The Windows binary packager is NSIS. Set the necessary variables
# for this.
set (CPACK_NSIS_CONTACT "charles@karney.com")
set (CPACK_NSIS_URL_INFO_ABOUT "http://geographiclib.sf.net")
set (CPACK_NSIS_HELP_LINK "mailto:charles@karney.com")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
# Hardcode the prefix for Visual Studio 10
set (CPACK_NSIS_INSTALL_ROOT "C:\\\\pkg-vc10-x64")
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}-win64")
set (CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME} x64 ${PROJECT_VERSION}")
set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY
"${PROJECT_NAME}-x64-${PROJECT_VERSION}")
else ()
# Hardcode the prefix for Visual Studio 10
set (CPACK_NSIS_INSTALL_ROOT "C:\\\\pkg-vc10")
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}-win32")
set (CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME} ${PROJECT_VERSION}")
set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY
"${PROJECT_NAME}-${PROJECT_VERSION}")
endif ()
set (CPACK_NSIS_DISPLAY_NAME ${CPACK_NSIS_PACKAGE_NAME})
set (CPACK_NSIS_MENU_LINKS
"http://geographiclib.sf.net/${PROJECT_VERSION}/index.html"
"Library documentation"
"http://geographiclib.sf.net/${PROJECT_VERSION}/utilities.html"
"Utilities documentation"
"http://geographiclib.sf.net" "GeographicLib home page"
"http://sf.net/projects/geographiclib/" "Main project page")
set (CPACK_NSIS_MODIFY_PATH ON)
elseif (APPLE)
# Not tested
set (CPACK_GENERATOR Bundle)
set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}-darwin")
else ()
# Not tested
set (CPACK_GENERATOR TGZ)
endif ()
include (CPack)
# Another maintainer-specific target is building the source distribution
# via the target dist. This calls package_source to make a tar.gz file.
# However this needs to be touched up to support the vanilla Makefiles
# provided with GeographicLib. This entails
# (1) creating Makefile (which includes Makefile.mk);
# (2) creating a bare-bones Config.h (with just the version information);
# (3) making sure that make thinks the generated documentation files are
# up-to-date.
# Then a new tar.gz file and zip file are created. To avoid potential
# problems with directory permissions, tar and zip are told only to
# archive the files.
if (MAINTAINER)
add_custom_target (dist
COMMAND ${CMAKE_MAKE_PROGRAM} package_source
COMMAND
cd _CPack_Packages/Linux-Source/TGZ/${CPACK_SOURCE_PACKAGE_FILE_NAME} &&
echo include Makefile.mk > Makefile &&
sed -e "s/Unconfigured/${PROJECT_VERSION}/"
-e "s/MAJOR .*/MAJOR ${CPACK_PACKAGE_VERSION_MAJOR}/"
-e "s/MINOR .*/MINOR ${CPACK_PACKAGE_VERSION_MINOR}/"
-e "s/PATCH .*/PATCH ${CPACK_PACKAGE_VERSION_PATCH}/"
include/GeographicLib/Config.h > include/GeographicLib/Config.h.new &&
mv include/GeographicLib/Config.h.new include/GeographicLib/Config.h
COMMAND
cd _CPack_Packages/Linux-Source/TGZ/${CPACK_SOURCE_PACKAGE_FILE_NAME} &&
touch man/[A-Za-z]*.usage man/[A-Za-z]*.1 man/[A-Za-z]*.1.html &&
chmod -R g-w .
COMMAND
cd _CPack_Packages/Linux-Source/TGZ &&
find ${CPACK_SOURCE_PACKAGE_FILE_NAME} -type f |
tar cfzT ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz -
COMMAND
rm -f ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.zip &&
rsync -a --delete
_CPack_Packages/Linux-Source/TGZ/${CPACK_SOURCE_PACKAGE_FILE_NAME}
_CPack_Packages/Linux-Source/TGZ.DOS/ &&
cd _CPack_Packages/Linux-Source/TGZ.DOS &&
find . -type f |
egrep '/\(doxyfile.*\\.in|MANIFEST.in|NEWS|AUTHORS|INSTALL|pom\\.xml|dummy.*\\.in|.*\\.\(cpp|hpp|h\\.in|txt|pro|usage|pod|py|m|mac|cmake\\.in|cmake|h|js|c|for|dox|cs|vb|inc|java|html\\.in\)\)$$' |
xargs unix2dos -q -k &&
find ${CPACK_SOURCE_PACKAGE_FILE_NAME} -type f |
zip -q ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.zip -@
)
add_dependencies (dist distrib-all)
endif ()
# Add a test target; the tests are in tools.
enable_testing ()

3
gtsam/3rdparty/GeographicLib/INSTALL vendored Normal file
View File

@ -0,0 +1,3 @@
For installation instructions, open
http://geographiclib.sourceforge.net/html/install.html

View File

@ -0,0 +1,23 @@
This license applies to GeographicLib, versions 1.12 and later.
Copyright (c) 2008-2013, Charles Karney
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

1
gtsam/3rdparty/GeographicLib/Makefile vendored Normal file
View File

@ -0,0 +1 @@
include Makefile.mk

View File

@ -0,0 +1,51 @@
#
# Makefile.am
#
# Copyright (C) 2009, Francesco P. Lovergine <frankie@debian.org>
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src man tools doc include matlab python cmake examples
EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL \
Makefile.mk CMakeLists.txt windows maxima doc legacy java dotnet
dist-hook:
rm -rf $(distdir)/doc/html $(distdir)/doc/manpages ; \
find $(distdir)/maxima -type f -name '*.lsp' | xargs rm -rf ; \
rm -rf $(distdir)/java/targets ; \
find $(distdir)/java -type f -name '*.class' | xargs rm -rf ; \
find $(distdir)/windows -mindepth 1 -type d | xargs rm -rf ; \
find $(distdir)/windows -type f \
! \( -name '*.sln' -o -name '*.vc*proj' -o -name '*.mk' \)| \
xargs rm -f ; \
find $(distdir) \
\( -name .svn -o -name '.git*' -o -name CVS -o -name Makefile -o -name '*~' -o -name '*#*' -o -name 'CMakeFiles' -o -name '*.log' -o -name '*.tmp' -o -name '*.pyc' -o -name '*.bak' -o -name '*.BAK' -o -name geographiclib.js \)| \
xargs rm -rf ; \
echo include Makefile.mk > $(distdir)/Makefile ; \
sed -e "s/Unconfigured/$(PACKAGE_VERSION)/" \
-e "s/MAJOR .*/MAJOR ${GEOGRAPHICLIB_VERSION_MAJOR}/" \
-e "s/MINOR .*/MINOR ${GEOGRAPHICLIB_VERSION_MINOR}/" \
-e "s/PATCH .*/PATCH ${GEOGRAPHICLIB_VERSION_PATCH}/" \
$(top_srcdir)/include/GeographicLib/Config.h > \
$(distdir)/include/GeographicLib/Config.h
# Custom rules
all-local: man doc
install-data-local: install-doc # install-matlab
doc: man
$(MAKE) -C doc doc
install-doc:
$(MAKE) -C doc install-doc
man:
$(MAKE) -C man man
# install-matlab:
# $(MAKE) -C matlab install-matlab
.PHONY: doc install-doc man install-matlab install-python

832
gtsam/3rdparty/GeographicLib/Makefile.in vendored Normal file
View File

@ -0,0 +1,832 @@
# Makefile.in generated by automake 1.12.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am
#
# Copyright (C) 2009, Francesco P. Lovergine <frankie@debian.org>
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = .
DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/configure \
$(top_srcdir)/include/GeographicLib/Config-ac.h.in AUTHORS \
INSTALL NEWS config.guess config.sub depcomp install-sh \
ltmain.sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/include/GeographicLib/Config-ac.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
cscope distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COL = @COL@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOXYGEN = @DOXYGEN@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GEOGRAPHICLIB_VERSION_MAJOR = @GEOGRAPHICLIB_VERSION_MAJOR@
GEOGRAPHICLIB_VERSION_MINOR = @GEOGRAPHICLIB_VERSION_MINOR@
GEOGRAPHICLIB_VERSION_PATCH = @GEOGRAPHICLIB_VERSION_PATCH@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POD2HTML = @POD2HTML@
POD2MAN = @POD2MAN@
POW_LIB = @POW_LIB@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src man tools doc include matlab python cmake examples
EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL \
Makefile.mk CMakeLists.txt windows maxima doc legacy java dotnet
all: all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
include/GeographicLib/Config-ac.h: include/GeographicLib/stamp-h1
@if test ! -f $@; then rm -f include/GeographicLib/stamp-h1; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) include/GeographicLib/stamp-h1; else :; fi
include/GeographicLib/stamp-h1: $(top_srcdir)/include/GeographicLib/Config-ac.h.in $(top_builddir)/config.status
@rm -f include/GeographicLib/stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status include/GeographicLib/Config-ac.h
$(top_srcdir)/include/GeographicLib/Config-ac.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f include/GeographicLib/stamp-h1
touch $@
distclean-hdr:
-rm -f include/GeographicLib/Config-ac.h include/GeographicLib/stamp-h1
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
cscopelist-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist-recursive cscopelist
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod u+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile all-local
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-data-local
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
cscopelist-recursive ctags-recursive install-am install-strip \
tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am all-local am--refresh check check-am clean \
clean-cscope clean-generic clean-libtool cscope cscopelist \
cscopelist-recursive ctags ctags-recursive dist dist-all \
dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar dist-tarZ \
dist-xz dist-zip distcheck distclean distclean-generic \
distclean-hdr distclean-libtool distclean-tags distcleancheck \
distdir distuninstallcheck dvi dvi-am html html-am info \
info-am install install-am install-data install-data-am \
install-data-local install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am
dist-hook:
rm -rf $(distdir)/doc/html $(distdir)/doc/manpages ; \
find $(distdir)/maxima -type f -name '*.lsp' | xargs rm -rf ; \
rm -rf $(distdir)/java/targets ; \
find $(distdir)/java -type f -name '*.class' | xargs rm -rf ; \
find $(distdir)/windows -mindepth 1 -type d | xargs rm -rf ; \
find $(distdir)/windows -type f \
! \( -name '*.sln' -o -name '*.vc*proj' -o -name '*.mk' \)| \
xargs rm -f ; \
find $(distdir) \
\( -name .svn -o -name '.git*' -o -name CVS -o -name Makefile -o -name '*~' -o -name '*#*' -o -name 'CMakeFiles' -o -name '*.log' -o -name '*.tmp' -o -name '*.pyc' -o -name '*.bak' -o -name '*.BAK' -o -name geographiclib.js \)| \
xargs rm -rf ; \
echo include Makefile.mk > $(distdir)/Makefile ; \
sed -e "s/Unconfigured/$(PACKAGE_VERSION)/" \
-e "s/MAJOR .*/MAJOR ${GEOGRAPHICLIB_VERSION_MAJOR}/" \
-e "s/MINOR .*/MINOR ${GEOGRAPHICLIB_VERSION_MINOR}/" \
-e "s/PATCH .*/PATCH ${GEOGRAPHICLIB_VERSION_PATCH}/" \
$(top_srcdir)/include/GeographicLib/Config.h > \
$(distdir)/include/GeographicLib/Config.h
# Custom rules
all-local: man doc
install-data-local: install-doc # install-matlab
doc: man
$(MAKE) -C doc doc
install-doc:
$(MAKE) -C doc install-doc
man:
$(MAKE) -C man man
# install-matlab:
# $(MAKE) -C matlab install-matlab
.PHONY: doc install-doc man install-matlab install-python
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,51 @@
MAKEFILE := $(lastword $(MAKEFILE_LIST))
MAKE := $(MAKE) -f $(MAKEFILE)
SUBDIRS = src man tools doc
ALLDIRS = include $(SUBDIRS) maxima matlab python cmake
all: src man tools
$(SUBDIRS):
$(MAKE) -C $@
tools: src
install: install-headers install-lib install-tools install-man install-cmake \
install-doc install-matlab install-python
clean: clean-src clean-tools clean-doc clean-man clean-matlab clean-python
install-headers:
$(MAKE) -C include install
install-lib:
$(MAKE) -C src install
install-tools: src
$(MAKE) -C tools install
install-cmake:
$(MAKE) -C cmake install
install-doc: doc
$(MAKE) -C doc install
install-man: man
$(MAKE) -C man install
install-matlab: matlab
$(MAKE) -C matlab install
install-python: python
$(MAKE) -C python install
clean-src:
$(MAKE) -C src clean
clean-tools:
$(MAKE) -C tools clean
clean-doc:
$(MAKE) -C doc clean
clean-man:
$(MAKE) -C man clean
clean-matlab: matlab
$(MAKE) -C matlab clean
clean-python: python
$(MAKE) -C python clean
VERSION:=$(shell grep '\bVERSION=' configure | cut -f2 -d\' | head -1)
.PHONY: all $(SUBDIRS) install \
install-headers install-lib install-tools install-cmake install-man \
install-matlab install-python \
clean clean-src clean-tools clean-doc clean-man clean-matlab \
clean-python

886
gtsam/3rdparty/GeographicLib/NEWS vendored Normal file
View File

@ -0,0 +1,886 @@
A reverse chronological list of changes to GeographicLib
For more information, see
http://geographiclib.sourceforge.net/
The current version of the library is 1.34.
Changes between 1.34 (released 2013-12-11) and 1.33 versions:
* Many changes in cmake support:
+ minimum version of cmake needed increased to 2.8.4 (which was
released in 2011-02);
+ allow building both shared and static librarys with
-D GEOGRAPHICLIB_LIB_TYPE=BOTH;
+ both shared and static libraries (Release plus Debug) included in
binary installer;
+ find_package uses COMPONENTS and GeographicLib_USE_STATIC_LIBS to
select the library to use;
+ find_package version checking allows nmake and Visual Studio
generators to interoperate on Windows;
+ find_package (GeographicLib ...) requires that GeographicLib be
capitalized correctly;
+ on Unix/Linux, don't include the version number in directory for
the cmake configuration files;
+ defaults for GEOGRAPHICLIB_DOCUMENTATION and
BUILD_NETGEOGRAPHICLIB are now OFF;
+ the GEOGRAPHICLIB_EXAMPLES configuration parameter is no longer
used; cmake always configures to build the examples, but they are
not built by default (instead build targets: exampleprograms and
netexamples);
+ matlab-all target renamed to matlabinterface;
+ the configuration parameters PACKAGE_PATH and INSTALL_PATH are
now deprecated (use CMAKE_INSTALL_PREFIX instead);
+ on Linux, the installed package is relocatable;
+ on MacOSX, the installed utilities can find the shared library.
* Use a more precise value for OSGB::CentralScale().
* Add Arc routines to python interface.
* The Geod utility has been removed; the same functionality lives on
with GeodSolve (introduced in version 1.30).
Changes between 1.33 (released 2013-10-08) and 1.32 versions:
* Add NETGeographic .NET wrapper library (courtesy of Scott Heiman).
* Make inspector functions in GeographicLib::Ellipsoid const.
* Add Accumulator.cpp to instantiate GeographicLib::Accumulator.
* Defer some of the initialization of GeographicLib::OSGB to when it
is first called.
* Fix bug in autoconf builds under MacOS.
Changes between 1.32 (released 2013-07-12) and 1.31 versions:
* Generalize C interface for polygon areas to allow vertices to be
specified incrementally.
* Fix way flags for C++11 support are determined.
Changes between 1.31 (released 2013-07-01) and 1.30 versions:
* Changes breaking binary compatibility (source compatibility is
maintained):
+ overloaded versions of DMS::Encode,
EllipticFunction::EllipticFunction, and
GeoCoords::DMSRepresentation, have been eliminated by the use of
optional arguments;
+ correct the declaration of first arg to UTMUPS::DecodeEPSG.
* FIX BUG in GeographicLib::GravityCircle constructor (found by
Mathieu Peyréga) which caused bogus results for the gravity
disturbance and gravity anomaly vectors. (This only affected
calculations using GravityCircle. GravityModel calculations did not
suffer from this bug.)
* Improvements to the build:
+ add macros GEOGRAPHICLIB_VERSION_{MAJOR,MINOR,PATCH} to Config.h;
+ fix documentation for new version of perlpod;
+ improving setting of runtime path for Unix-like systems with
cmake;
+ install PDB files when compiling with Visual Studio to aid
debugging;
+ Windows binary release now uses Matlab R2013a (64-bit) and uses
the -largeArrayDims option.
* Changes to the geodesic routines:
+ add Java implementation of the geodesic routines (thanks to Skip
Breidbach for the maven support);
+ FIX BUG: avoid altering input args in Fortran implementation;
+ more systematic treatment of very short geodesic;
+ fixes to python port so that they work with version 3.x, in
addition to 2.x (courtesy of Amato);
+ accumulate the perimeter and area of polygons via a double-wide
accumulator in Fortran, C, and Matlab implementations (this is
already included in the other implementations);
+ port PolygonArea::AddEdge and PolygonArea::TestEdge to JavaScript
and python interfaces;
+ include documentation on short geodesics.
* Unix scripts for downloading datasets,
geographiclib-get-{geoids,gravity,magnetic}, skip already download
models by default, unless the -f flag is given.
* FIX BUGS: meridian convergence and scale returned by
TransverseMercatorExact was wrong at a pole.
* Improve efficiency of MGRS::Forward by avoiding the calculation of
the latitude if possible (adapting an idea of Craig Rollins).
* Fixes to the way the Matlab interface routines are built (thanks to
Phil Miller and Chris F.).
Changes between 1.30 (released 2013-02-27) and 1.29 versions:
* Changes to geodesic routines:
+ fix BUG in fail-safe mechanisms in Geodesic::Inverse;
+ the command line utility Geod is now called GeodSolve;
+ allow addition of polygon edges in PolygonArea;
+ add full Maxima implementation of geodesic algorithms.
Changes between 1.29 (released 2013-01-16) and 1.28 versions:
* Changes to allow compilation with libc++ (courtesy of Kal Conley).
* Add description of geodesics on triaxial ellipsoid to
documentation.
* Update journal reference for "Algorithms for geodesics".
Changes between 1.28 (released 2012-12-11) and 1.27 versions:
* Changes to geodesic routines:
+ compute longitude difference exactly;
+ hence fix BUG in area calculations for polygons with vertices very
close to the prime meridian;
+ fix BUG is geoddistance.m where the value of m12 was wrong for
meridional geodesics;
+ add Matlab implementations of the geodesic projections;
+ remove unneeded special code for geodesics which start at a pole;
+ include polygon area routine in C and Fortran implementations;
+ add doxygen documentation for C and Fortran libraries.
Changes between 1.27 (released 2012-11-29) and 1.26 versions:
* Changes to geodesic routines:
+ add native Matlab implementations: geoddistance.m, geodreckon.m,
geodarea.m;
+ add C and Fortran implementations;
+ improve the solution of the direct problem so that the series
solution is accurate to round off for |f| < 1/50;
+ tighten up the convergence criteria for solution of the inverse
problem;
+ no longer signal failures of convergence with NaNs (a slightly
less accurate answer is returned instead).
* Fix DMS::Decode double rounding BUG.
* On MacOSX platforms with the cmake configuration, universal
binaries are built.
Changes between 1.26 (released 2012-10-22) and 1.25 versions:
* Replace the series used for geodesic areas by one with better
convergence (this only makes an appreciable difference if |f| >
1/150).
Changes between 1.25 (released 2012-10-16) and 1.24 versions:
* Changes to geodesic calculations:
+ restart Newton's method in Geodesic::Inverse when it goes awry;
+ back up Newton's method with the bisection method;
+ Geodesic::Inverse now converges for any value of f;
+ add GeodesicExact and GeodesicLineExact which are formulated in
terms of elliptic integrals and thus yield accurate results
even for very eccentric ellipsoids.
+ the -E option to Geod invokes these exact classes.
* Add functionality to EllipticFunction:
+ add all the traditional elliptic integrals;
+ remove restrictions on argument range for incomplete elliptic
integrals;
+ allow imaginary modulus for elliptic integrals and elliptic
functions;
+ make interface to the symmetric elliptic integrals public.
* Allow GeographicLib::Ellipsoid to be copied.
* Changes to the build tools:
+ cmake uses folders in Visual Studio to reduce clutter;
+ allow precision of reals to be set in cmake;
+ fail gracefully in the absence of pod documentation tools;
+ remove support for maintainer tasks in Makefile.mk.
Changes between 1.24 (released 2012-09-22) and 1.23 versions:
* Allow the specification of the hemisphere in UTM coordinates in
order to provide continuity across the equator:
+ add UTMUPS::Transfer;
+ add GeoCoords::UTMUPSRepresentation(bool, int) and
GeoCoords::AltUTMUPSRepresentation(bool, int);
+ use the hemisphere letter in, e.g., GeoConvert -u -z 31N.
* Add UTMUPS::DecodeEPSG and UTMUPS::EncodeEPSG.
* cmake changes:
+ restore support for cmake 2.4.x;
+ explicitly check version of doxygen.
* Fix building under cygwin.
* Document restrictions on f in the Introduction.
* Fix python interface to work with version 2.6.x.
Changes between 1.23 (released 2012-07-17) and 1.22 versions:
* Documentation changes:
+ remove html documentation from distribution and use web links if
doxygen is not available;
+ use doxygen tags to document exceptions;
+ begin migrating the documentation to using Greek letters where
appropriate (requires doxygen 1.8.1.2 or later).
* Add Math::AngNormalize and Math::AngNormalize2; the allowed range
for longitudes and azimuths widened to [-540d, 540d).
* DMS::Decode understands more unicode symbols.
* Geohash uses geohash code "nan" to stand for not a number.
* Add Ellipsoid::NormalCurvatureRadius.
* Various fixes in LambertConformalConic, TransverseMercator,
PolarStereographic, and Ellipsoid to handle reverse projections of
points near infinity.
* Fix programming blunder in LambertConformalConic::Forward (incorrect
results were returned if the tangent latitude was negative).
Changes between 1.22 (released 2012-05-27) and 1.21 versions:
* Add Geohash and Ellipsoid classes.
* Fix bug in AlbersEqualArea of very prolate ellipsoids (b^2 > 2
a^2).
* cmake changes:
+ optionally use PACKAGE_PATH and INSTALL_PATH to determine
CMAKE_INSTALL_PREFIX;
+ use COMMON_INSTALL_PATH to determine layout of installation
directories;
+ as a consequence, the installation paths for the documentation,
and python and matlab interfaces are shortened for Windows;
+ zip source distribution now uses DOS line endings;
+ the tests work in debug mode for Windows;
+ default setting of GEOGRAPHICLIB_DATA does not depend on
CMAKE_INSTALL_PREFIX;
+ add a cmake configuration for build tree.
Changes between 1.21 (released 2012-04-25) and 1.20 versions:
* Support colon-separated DMS output:
+ DMS::Encode and GeoCoords::DMSRepresentation generalized;
+ GeoConvert and Geod now accept a -: option.
* GeoidEval does not print the gradient of the geoid height by default
(because it's subject to large errors); give the -g option to get
the gradient printed.
* Work around optimization BUG in GeographicLib::Geodesic::Inverse
with tdm mingw g++ version 4.6.1.
* autoconf fixed to ensure that that out-of-sources builds work;
document this as the preferred method of using autoconf.
* cmake tweaks:
+ simplify the configuration of doxygen;
+ allow the Matlab compiler to be specified with the MATLAB_COMPILER option.
Changes between 1.20 (released 2012-03-23) and 1.19 versions:
* cmake tweaks:
+ improve find_package's matching of compiler versions;
+ CMAKE_INSTALL_PREFIX set from CMAKE_PREFIX_PATH if available;
+ add "x64" to the package name for the 64-bit binary installer;
+ fix cmake warning with Visual Studio Express.
* Fix SphericalEngine to deal with aggessive iterator checking by
Visual Studio.
* Fix transcription BUG is Geodesic.js.
Changes between 1.19 (released 2012-03-13) and 1.18 versions:
* Slight improvement in Geodesic::Inverse for very short lines.
* Fix argument checking tests in MGRS::Forward.
* Add --comment-delimiter and --line-separator options to the utility
programs.
* Add installer for 64-bit Windows; the compiled Matlab interface is
supplied with the Windows 64-bit installer only.
Changes between 1.18 (released 2012-02-18) and 1.17 versions:
* Improve documentation on configuration with cmake.
* cmake's find_package ensures that the compiler versions match on Windows.
* Improve documentation on compiling Matlab interface.
* Binary installer for Windows installs under C:/pkg-vc10 by default.
Changes between 1.17 (released 2012-01-21) and 1.16 versions:
* Work around optimization BUG in Geodesic::Inverse with g++ version
4.4.0 (mingw).
* Fix BUG in argument checking with OSGB::GridReference.
* Fix missing include file in SphericalHarmonic2.
* Add simple examples of usage for each class.
* Add internal documenation to the cmake configuration files.
Changes between 1.16 (released 2011-12-07) and 1.15 versions:
* Add calculation of the earth's gravitational field:
+ add NormalGravity GravityModel and GravityCircle classes;
+ add command line utility Gravity;
+ add Gravity models;
+ add Constants::WGS84_GM(), Constants::WGS84_omega(), and similarly
for GRS80.
* Build uses GEOGRAPHICLIB_DATA to specify a common parent directory
for geoid, gravity, and magnetic data (instead of
GEOGRAPHICLIB_GEOID_PATH, etc.); similarly, GeoidEval, Gravity, and
MagneticField, look at the environment variable GEOGRAPHICLIB_DATA
to locate the data.
* Spherical harmonic software changes:
+ capitalize enums SphericalHarmonic::FULL and
SphericalHarmonic::SCHMIDT (the lower case names are retained but
deprecated);
+ optimize the sum by using a static table of square roots which is
updated by SphericalEngine::RootTable;
+ avoid overflow for high degree models.
* Magnetic software fixes:
+ fix documentation BUG in MagneticModel::Circle;
+ make MagneticModel constructor explicit;
+ provide default MagneticCircle constructor;
+ add additional inspector functions to MagneticCircle;
+ add -c option to MagneticField;
+ default height to zero in MagneticField.
Changes between 1.15 (released 2011-11-08) and 1.14 versions:
* Add calculation of the earth's magnetic field:
+ add MagneticModel and MagneticCircle classes;
+ add command line utility MagneticField;
+ add Magnetic models;
+ add Installing the magnetic field models;
+ add The format of the magnetic model files;
+ add classes SphericalEngine, CircularEngine, SphericalHarmonic,
SphericalHarmonic1, and SphericalHarmonic2. which sum spherical
harmonic series.
* Add Utility class to support I/O and date manipulation.
* Cmake configuration includes a _d suffix on the library built in
debug mode.
* For the Python package, include manifest and readme files; don't
install setup.py for non-Windows systems.
* Include Doxygen tag file in distribution as doc/html/Geographic.tag.
Changes between 1.14 (released 2011-09-30) and 1.13 versions:
* Ensure that geographiclib-config.cmake is relocatable.
* Allow more unicode symbols to be used in DMS::Decode.
* Modify GeoidEval so that it can be used to convert the height datum
for LIDAR data.
* Modest speed-up of Geodesic::Inverse.
* Changes in python interface:
+ FIX BUG in transcription of Geodesic::Inverse;
+ include setup.py for easy installation;
+ python only distribution is available at
http://pypi.python.org/pypi/geographiclib
* Supply a minimal Qt qmake project file for library
src/Geographic.pro.
Changes between 1.13 (released 2011-08-13) and 1.12 versions:
* Changes to I/O:
+ allow : (colon) to be used as a DMS separator in DMS::Decode;
+ also accept Unicode symbols for degrees, minutes, and seconds
(coded as UTF-8);
+ provide optional swaplatlong argument to various DMS and GeoCoords
functions to make longitude precede latitude;
+ GeoConvert now has a -w option to make longitude precede latitude
on input and output;
+ include a JavaScript version of DMS.
* Slight improvement in starting guess for solution of geographic
latitude in terms of conformal latitude in TransverseMercator,
TransverseMercatorExact, and LambertConformalConic.
* For most classes, get rid of const member variables so that the
default copy assignment works.
* Put Math and Accumulator in their own header files.
* Remove unused "fast" GeographicLib::Accumulator method.
* Reorganize the Python interface.
* Withdraw some deprecated routines.
* cmake changes:
+ include FindGeographic.cmake in distribution;
+ building with cmake creates and installs
geographiclib-config.cmake;
+ better support for building a shared library under Windows.
Changes between 1.12 (released 2011-07-21) and 1.11 versions:
* Change license to MIT/X11.
* Add GeographicLib::PolygonArea class and equivalent Matlab function.
* Provide JavaScript and Python implementations of geodesic routines.
* Fix Windows installer to include runtime dlls for Matlab.
* Fix (innocuous) unassigned variable in Geodesic::GenInverse.
* Geodesic routines in Matlab return a12 as first column of aux return
value (incompatible change).
* A couple of code changes to enable compilation with Visual Studio
2003.
Changes between 1.11 (released 2011-06-27) and 1.10 versions:
* Changes to Planimeter:
+ add -l flag to Planimeter for polyline calculations;
+ trim precision of area to 3 decimal places;
+ FIX BUG with pole crossing edges (due to compiler optimization).
* Geod no longer reports the reduced length by default; however the -f
flag still reports this and in addition gives the geodesic scales
and the geodesic area.
* FIX BUGS (compiler-specific) in inverse geodesic calculations.
* FIX BUG: accommodate tellg() returning -1 at end of string.
* Change way flattening of the ellipsoid is specified:
+ constructors take f argument which is taken to be the flattening
if f < 1 and the inverse flattening otherwise (this is a
compatible change for spheres and oblate ellipsoids, but it is an
INCOMPATIBLE change for prolate ellipsoids);
+ the -e arguments to the Utility Programs are handled similarly; in
addition, simple fractions, e.g., 1/297, can be used for the
flattening;
+ introduce Constants::WGS84_f() for the WGS84 flattening (and
deprecate Constants::WGS84_r() for the inverse flattening);
+ most classes have a Flattening() member function;
+ InverseFlattening() has been deprecated (and now returns inf for a
sphere, instead of 0).
Changes between 1.10 (released 2011-06-11) and 1.9 versions:
* Improvements to Matlab/Octave interface:
+ add {geocentric,localcartesian}{forward,reverse};
+ make geographiclibinterface more general;
+ install the source for the interface;
+ cmake compiles the interface if ENABLE_MATLAB=ON;
+ include compiled interface with Windows binary installer.
* Fix various configuration issues
+ autoconf did not install Config.h;
+ cmake installed in man/man1 instead of share/man/man1;
+ cmake did not set the rpath on the tools.
Changes between 1.9 (released 2011-05-28) and 1.8 versions:
* FIX BUG in area returned by Planimeter for pole encircling polygons.
* FIX BUG in error message reported when DMS::Decode reads the string
"5d.".
* FIX BUG in AlbersEqualArea::Reverse (lon0 not being used).
* Ensure that all exceptions thrown in the Utility Programs are
caught.
* Avoid using catch within GeographicLib::DMS.
* Move Accumulator class from Planimeter.cpp to Constants.hpp.
* Add Math::sq<T>.
* Simplify Installing the geoid datasets
+ add geographiclib-get-geoids for Unix-like systems;
+ add installers for Windows.
* Provide cmake support:
+ build binary installer for Windows;
+ include regression tests;
+ add --input-string, --input-file, --output-file options to the
Utility Programs to support tests.
* Rename utility EquidistantTest as GeodesicProj and
TransverseMercatorTest as TransverseMercatorProj.
* Add ConicProj.
* Reverse the initial sense of the -s option for Planimeter.
* Migrate source from subversion to git.
Changes between 1.8 (released 2011-02-22) and 1.7 versions:
* Optionally return rotation matrix from GeographicLib::Geocentric and
GeographicLib::LocalCartesian.
* For the Utility Programs, supply man pages, -h prints the synopsis,
--help prints the man page, --version prints the version.
* Use accurate summation in Planimeter.
* Add 64-bit targets for Visual Studio 2010.
* Use templates for defining math functions and some constants.
* GeographicLib::Geoid updates
+ Add GeographicLib::Geoid::DefaultGeoidPath and
GeographicLib::Geoid::DefaultGeoidName;
+ GeoidEval uses environment variable GEOID_NAME as the default
geoid;
+ Add --msltohae and --haetomsl as GeoidEval options (and don't
document the single hyphen versions).
* Remove documentation that duplicates papers on transverse Mercator
and geodesics.
Changes between 1.7 (released 2010-12-21) and 1.6 versions:
* FIX BUG in scale returned by GeographicLib::LambertConformalConic::Reverse.
* Add GeographicLib::AlbersEqualArea projection.
* Library created by Visual Studio is Geographic.lib instead of
GeographicLib.lib (compatible with makefiles).
* Make classes NaN aware.
* Use cell arrays for MGRS strings in Matlab.
* Add solution/project files for Visual Studio 2010 (32-bit only).
* Use C++11 static_assert and math functions, if available.
Change between 1.6 (released 2010-11-23) and 1.5 versions:
* FIX BUG introduced in GeographicLib::Geoid in version 1.5 (found by
Dave Edwards).
Changes between 1.5 (released 2010-11-19) and 1.4 versions:
* Improve area calculations for small polygons.
* Add -s and -r flags to Planimeter utility.
* Improve the accuracy of GeographicLib::LambertConformalConic using
divided differences.
* FIX BUG in meridian convergence returned by
LambertConformalConic::Forward.
* Add optional threadsafe parameter to GeographicLib::Geoid
constructor. WARNING: This changes may break binary compatibility
with previous versions of GeographicLib. However, the library is
source compatible.
* Add GeographicLib::OSGB.
* Matlab and Octave interfaces to GeographicLib::UTMUPS,
GeographicLib::MGRS, GeographicLib::Geoid, GeographicLib::Geodesic
provided.
* Minor changes
+ explicitly turn on optimization in Visual Studio 2008 projects;
+ add missing dependencies in some Makefiles;
+ move pi() and degree() from GeographicLib::Constants to
GeographicLib::Math;
+ introduce GeographicLib::Math::extended type to aid testing;
+ add GeographicLib::Math::epi() and GeographicLib::Math::edegree().
+ fixes to compile under cygwin;
+ tweak expression used to find latitude from conformal latitude.
Changes between 1.4 (released 2010-09-12) and 1.3 versions:
* Changes to GeographicLib::Geodesic and GeographicLib::GeodesicLine:
+ FIX BUG in Geodesic::Inverse with prolate ellipsoids;
+ add area computations to Geodesic::Direct and Geodesic::Inverse;
+ add geodesic areas to geodesic test set;
+ make GeodesicLine constructor public;
+ change longitude series in Geodesic into Helmert-like form;
+ ensure that equatorial geodesics have cos(alpha0) = 0 identically;
+ generalize interface for Geodesic and GeodesicLine;
+ split GeodesicLine and Geodesic into different files;
+ signal convergence failure in Geodesic::Inverse with NaNs;
+ deprecate one function in Geodesic and two functions in
GeodesicLine;
+ deprecate -n option for Geod.
WARNING: These changes may break binary compatibility with previous
versions of GeographicLib. However, the library is source
compatible (with the proviso that GeographicLib/GeodesicLine.hpp may
now need to be included).
* Add the Planimeter utility for computing the areas of
geodesic polygons.
* Improve iterative solution of GeographicLib::Gnomonic::Reverse.
* Add GeographicLib::Geoid::ConvertHeight.
* Add -msltohae, -haetomsl, and -z options to \ref geoideval.
* Constructors check that minor radius is positive.
* Add overloaded Forward and Reverse functions to the projection
classes which don't return the convergence (or azimuth) and scale.
* Document function parameters and return values consistently.
Changes between 1.3 (released 2010-07-21) and 1.2 versions:
* Add GeographicLib::Gnomonic, the ellipsoid generalization of the
gnomonic projection.
* Add -g and -e options to Equidistanttest.
* Use fixed-point notation for output from Cartconvert,
Equidistanttest, Transversemercatortest.
* PolarStereographic:
+ Improved conversion to conformal coordinates;
+ Fix bug with scale at opposite pole;
+ Complain if latitude out of range in SetScale.
* Add GeographicLib::Math::NaN().
* Add long double version of hypot for Windows.
* Add EllipticFunction::E(real).
* Update references to Geotrans in MGRS documentation.
* Speed up tmseries.mac.
Changes between 1.2 (released 2010-05-21) and 1.1 versions:
* FIX BUGS in GeographicLib::Geodesic,
+ wrong azimuth returned by Direct if point 2 is on a pole;
+ Inverse sometimes fails with very close points.
* Improve calculation of scale in GeographicLib::CassiniSoldner,
+ add GeodesicLine::Scale, GeodesicLine::EquatorialAzimuth, and
GeodesicLine::EquatorialArc;
+ break friend connection between CassiniSoldner and Geodesic.
* Add DMS::DecodeAngle and DMS::DecodeAzimuth. Extend DMS::Decode and
DMS::Encode to deal with distances.
* Code and documentation changes in Geodesic and Geocentric for
consistency with the forthcoming paper on geodesics.
* Increase order of series using in Geodesic to 6 (full accuracy
maintained for ellipsoid flattening < 0.01).
* Macro __NO_LONG_DOUBLE_MATH to disable use of long double.
* Correct declaration of Math::isfinite to return a bool.
* Changes in the Utility Programs,
+ improve error reporting when parsing command line arguments;
+ accept latitudes and longitudes in decimal degrees or degrees,
minutes, and seconds, with optional hemisphere designators;
+ GeoConvert -z accepts zone or zone+hemisphere;
+ GeoidEval accepts any of the input formats used by GeoConvert;
+ CartConvert allows the ellipsoid to be specified with -e.
Changes between 1.1 (released 2010-02-09) and 1.0 versions:
* FIX BUG (introduced in 2009-03) in EllipticFunction::E(sn,cn,dn).
* Increase accuracy of scale calculation in TransverseMercator and
TransverseMercatorExact.
* Code and documentation changes for consistency with arXiv:1002.1417
Changes between 1.0 (released 2010-01-07) and 2009-11 versions:
* Add autoconf configuration files.
* BUG FIX: Improve initial guess for Newton's method in
PolarStereographic::Reverse. (Previously this failed to converge
when the co-latitude exceeded about 130 deg.)
* Constructors for TransverseMercator, TransverseMercatorExact,
PolarStereographic, Geocentric, and Geodesic now check for obvious
problems with their arguments and throw an exception if necessary.
* Most classes now include inspector functions such as MajorRadius()
so that you can determine how instances were constructed.
* Add GeographicLib::LambertConformalConic class.
* Add GeographicLib::PolarStereographic::SetScale to allow the
latitude of true scale to be specified.
* Add solution and project files for Visual Studio 2008.
* Add GeographicLib::GeographicErr for exceptions.
* GeographicLib::Geoid changes:
+ BUG FIX: fix typo in GeographicLib::Geoid::Cache which could cause
a segmentation fault in some cases when the cached area spanned
the prime meridian.
+ Include sufficient edge data to allow heights to be returned for
cached area without disk reads;
+ Add inspector functions to query the extent of the cache.
Changes between 2009-11 and 2009-10 versions:
* Allow specification of "closest UTM zone" in GeographicLib::UTMUPS
and GeoConvert (via -t option).
* Utilities now complain is there are too many tokens on input lines.
* Include real-to-real versions of GeographicLib::DMS::Decode and
GeographicLib::DMS::Encode.
* More house-cleaning changes:
+ Ensure that functions which return results through reference
arguments do not alter the arguments when an exception is thrown.
+ Improve accuracy of GeographicLib::MGRS::Forward.
+ Include more information in some error messages.
+ Improve accuracy of inverse hyperbolic functions.
+ Fix the way GeographicLib::Math functions handle different
precisions.
Changes between 2009-10 and 2009-09 versions:
* Change web site to http://geographiclib.sourceforge.net
* Several house-cleaning changes:
+ Change from the a flat directory structure to a more easily
maintained one.
+ Introduce Math class for common mathematical functions (in
Constants.hpp).
+ Use Math::real as the type for all real quantities. By default this
is typedef'ed to double; and the library should be installed this
way.
+ Eliminate const reference members of AzimuthalEquidistant,
CassiniSoldner and LocalCartesian so that they may be copied.
+ Make several constructors explicit. Disallow some constructors.
Disallow copy constructor/assignment for Geoid.
+ Document least square formulas in Geoid.cpp.
+ Use unsigned long long for files positions of geoid files in Geoid.
+ Introduce optional mgrslimits argument in UTMUPS::Forward and
UTMUPS::Reverse to enforce stricter MGRS limits on eastings and
northings.in
+ Add 64-bit targets in Visual Studio project files.
Changes between 2009-09 and 2009-08 versions:
* Add GeographicLib::Geoid and GeoidEval utility.
Changes between 2009-08 and 2009-07 versions:
* Add GeographicLib::CassiniSoldner class and EquidistantTest utility.
* Fix bug in GeographicLib::Geodesic::Inverse where NaNs were
sometimes returned.
* INCOMPATIBLE CHANGE: AzimuthalEquidistant now returns the reciprocal
of the azimuthal scale instead of the reduced length.
* Add -n option to GeoConvert.
Changes between 2009-07 and 2009-06 versions:
* Speed up the series inversion code in tmseries.mac and geod.mac.
* Reference Borkowski in section on Geocentric coordinates.
Changes between 2009-06 and 2009-05 versions:
* Add routines to decode and encode zone+hemisphere to GeographicLib::UTMUPS.
* Clean up code in GeographicLib::Geodesic.
Changes between 2009-05 and 2009-04 versions:
* Improvements to GeographicLib::Geodesic:
+ more economical series expansions,
+ return reduced length (as does the Geod utility),
+ improved calculation of starting point for inverse method,
+ use reduced length to give derivative for Newton's method.
* Add AzimuthalEquidistant class.
+ Make GeographicLib::Geocentric, GeographicLib::TransverseMercator,
and GeographicLib::PolarStereographic classes work with prolate
ellipsoids.
* CartConvert checks its inputs more carefully.
* Remove reference to defunct Constants.cpp from GeographicLib.vcproj.
Changes between 2009-04 and 2009-03 versions:
* Use compile-time constants to select the order of series in
GeographicLib::TransverseMercator.
* 2x unroll of Clenshaw summation to avoid data shuffling.
* Simplification of GeographicLib::EllipticFunction::E.
* Use STATIC_ASSERT for compile-time checking of constants.
* Improvements to GeographicLib::Geodesic:
+ compile-time option to change order of series used,
+ post maxima code for generating the series,
+ tune the order of series for double,
+ improvements in the selection of starting points for Newton's
method,
+ accept and return spherical arc lengths,
+ works with both oblate and prolate spheroids,
+ add -a, -e, -b options to the Geod utility.
Changes between 2009-03 and 2009-02 versions:
* Add GeographicLib::Geodesic and the Geod utility.
* Declare when no exceptions are thrown by functions.
* Minor changes to GeographicLib::DMS class.
* Use invf = 0 to mean a sphere in constructors to some classes.
* The makefile creates a library and includes an install target.
* Rename GeographicLib::ECEF to GeographicLib::Geocentric, ECEFConvert
to CartConvert.
* Use inline functions to define constant doubles in Constants.hpp.
Changes between 2009-02 and 2009-01 versions:
* Fix documentation of constructors (flattening -> inverse
flattening).
* Use std versions of math functions.
* Add ECEF and LocalCartesian classes and ECEFConvert utility.
* Gather the documentation on the utility programs onto one page.

1018
gtsam/3rdparty/GeographicLib/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,52 @@
# config file support for find_package (GeographicLib). This needs to
# deal with two environments: (1) finding the build tree and (2)
# finding the install tree. geographiclib-config.cmake detects which
# situation it is handing by looking at @PROJECT_ROOT_DIR@. If
# this is an absolute path, it's in the build tree; otherwise, it's in the
# install tree. (Note that the whole install tree can be relocated.)
# geographiclib-config.cmake for the build tree
set (PROJECT_ROOT_DIR "${PROJECT_BINARY_DIR}")
set (PROJECT_INCLUDE_DIRS
"${PROJECT_BINARY_DIR}/include" "${PROJECT_SOURCE_DIR}/include" )
configure_file (project-config.cmake.in
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake" @ONLY)
configure_file (project-config-version.cmake.in
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake" @ONLY)
export (TARGETS ${PROJECT_SHARED_LIBRARIES} ${PROJECT_STATIC_LIBRARIES} ${TOOLS}
FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-depends.cmake")
# geographiclib-config.cmake for the install tree. It's installed in
# ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative
# path to the root from there. (Note that the whole install tree can
# be relocated.)
if (COMMON_INSTALL_PATH)
set (INSTALL_CMAKE_DIR "share/cmake/${PROJECT_NAME}")
set (PROJECT_ROOT_DIR "../../..")
else ()
set (INSTALL_CMAKE_DIR "cmake")
set (PROJECT_ROOT_DIR "..")
endif ()
# @PROJECT_INCLUDE_DIRS@ is not used in the install tree; reset
# it to prevent the source and build paths appearing in the installed
# config files
set (PROJECT_INCLUDE_DIRS)
configure_file (project-config.cmake.in
${PROJECT_NAME_LOWER}-config.cmake @ONLY)
configure_file (project-config-version.cmake.in
${PROJECT_NAME_LOWER}-config-version.cmake @ONLY)
install (FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
DESTINATION "${INSTALL_CMAKE_DIR}")
# Make information about the cmake targets (the library and the tools)
# available.
install (EXPORT depends
FILE ${PROJECT_NAME_LOWER}-depends.cmake
DESTINATION "${INSTALL_CMAKE_DIR}")
if (MSVC AND PACKAGE_DEBUG_LIBS)
install (FILES
"${PROJECT_BINARY_DIR}/cmake/CMakeFiles/Export/cmake/${PROJECT_NAME_LOWER}-depends-debug.cmake"
DESTINATION "${INSTALL_CMAKE_DIR}" CONFIGURATIONS Release)
endif ()

View File

@ -0,0 +1,31 @@
# Look for GeographicLib
#
# Set
# GEOGRAPHICLIB_FOUND = TRUE
# GeographicLib_INCLUDE_DIRS = /usr/local/include
# GeographicLib_LIBRARIES = /usr/local/lib/libGeographic.so
# GeographicLib_LIBRARY_DIRS = /usr/local/lib
find_library (GeographicLib_LIBRARIES Geographic
PATHS "${CMAKE_INSTALL_PREFIX}/../GeographicLib/lib")
if (GeographicLib_LIBRARIES)
get_filename_component (GeographicLib_LIBRARY_DIRS
"${GeographicLib_LIBRARIES}" PATH)
get_filename_component (_ROOT_DIR "${GeographicLib_LIBRARY_DIRS}" PATH)
set (GeographicLib_INCLUDE_DIRS "${_ROOT_DIR}/include")
set (GeographicLib_BINARY_DIRS "${_ROOT_DIR}/bin")
unset (_ROOT_DIR)
if (NOT EXISTS "${GeographicLib_INCLUDE_DIRS}/GeographicLib/Config.h")
unset (GeographicLib_INCLUDE_DIRS)
unset (GeographicLib_LIBRARIES)
unset (GeographicLib_LIBRARY_DIRS)
unset (GeographicLib_BINARY_DIRS)
endif ()
endif ()
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (GeographicLib DEFAULT_MSG
GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES GeographicLib_INCLUDE_DIRS)
mark_as_advanced (GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES
GeographicLib_INCLUDE_DIRS)

View File

@ -0,0 +1,14 @@
#
# Makefile.am
#
# Copyright (C) 2011, Charles Karney <charles@karney.com>
cmakedir=$(datadir)/cmake/GeographicLib
install:
$(INSTALL) -d $(DESTDIR)$(cmakedir)
$(INSTALL) -m 644 $(srcdir)/FindGeographicLib.cmake \
$(DESTDIR)$(cmakedir)
EXTRA_DIST = Makefile.mk CMakeLists.txt FindGeographicLib.cmake \
project-config-version.cmake.in project-config.cmake.in

View File

@ -0,0 +1,415 @@
# Makefile.in generated by automake 1.12.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am
#
# Copyright (C) 2011, Charles Karney <charles@karney.com>
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = cmake
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/include/GeographicLib/Config-ac.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COL = @COL@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOXYGEN = @DOXYGEN@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GEOGRAPHICLIB_VERSION_MAJOR = @GEOGRAPHICLIB_VERSION_MAJOR@
GEOGRAPHICLIB_VERSION_MINOR = @GEOGRAPHICLIB_VERSION_MINOR@
GEOGRAPHICLIB_VERSION_PATCH = @GEOGRAPHICLIB_VERSION_PATCH@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POD2HTML = @POD2HTML@
POD2MAN = @POD2MAN@
POW_LIB = @POW_LIB@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
cmakedir = $(datadir)/cmake/GeographicLib
EXTRA_DIST = Makefile.mk CMakeLists.txt FindGeographicLib.cmake \
project-config-version.cmake.in project-config.cmake.in
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu cmake/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu cmake/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
install:
$(INSTALL) -d $(DESTDIR)$(cmakedir)
$(INSTALL) -m 644 $(srcdir)/FindGeographicLib.cmake \
$(DESTDIR)$(cmakedir)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,13 @@
DEST = $(PREFIX)/share/cmake/GeographicLib
INSTALL=install -b
all:
@:
install:
test -d $(DEST) || mkdir -p $(DEST)
$(INSTALL) -m 644 FindGeographicLib.cmake $(DEST)
clean:
@:
.PHONY: all install clean

View File

@ -0,0 +1,54 @@
# Version checking for @PROJECT_NAME@
set (PACKAGE_VERSION "@PROJECT_VERSION@")
set (PACKAGE_VERSION_MAJOR "@PROJECT_VERSION_MAJOR@")
set (PACKAGE_VERSION_MINOR "@PROJECT_VERSION_MINOR@")
set (PACKAGE_VERSION_PATCH "@PROJECT_VERSION_PATCH@")
if (NOT PACKAGE_FIND_NAME STREQUAL "@PROJECT_NAME@")
# Check package name (in particular, because of the way cmake finds
# package config files, the capitalization could easily be "wrong").
# This is necessary to ensure that the automatically generated
# variables, e.g., <package>_FOUND, are consistently spelled. Make
# this a WARNING, because this is a user error that needs to be fixed.
message (WARNING
"Mismatched package names: use find_package(@PROJECT_NAME@ ...) instead"
" of find_package(${PACKAGE_FIND_NAME} ...)")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (NOT (APPLE OR CMAKE_SIZEOF_VOID_P EQUAL @CMAKE_SIZEOF_VOID_P@))
# Reject if there's a 32-bit/64-bit mismatch (not necessary with Apple
# since a multi-architecture library is built for that platform).
message (STATUS
"${CMAKE_CURRENT_LIST_FILE} unsuitable because package built with "
"sizeof(*void) = @CMAKE_SIZEOF_VOID_P@")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (MSVC AND NOT MSVC_VERSION STREQUAL "@MSVC_VERSION@")
# Reject if there's a mismatch in MSVC compiler versions
message (STATUS
"${CMAKE_CURRENT_LIST_FILE} unsuitable because package built with "
"_MSC_VER = @MSVC_VERSION@")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (PACKAGE_FIND_VERSION)
if (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
set (PACKAGE_VERSION_EXACT TRUE)
elseif (PACKAGE_FIND_VERSION VERSION_LESS PACKAGE_VERSION
AND PACKAGE_FIND_VERSION_MAJOR EQUAL PACKAGE_VERSION_MAJOR)
set (PACKAGE_VERSION_COMPATIBLE TRUE)
endif ()
endif ()
set (@PROJECT_NAME@_SHARED_FOUND @GEOGRAPHICLIB_SHARED_LIB@)
set (@PROJECT_NAME@_STATIC_FOUND @GEOGRAPHICLIB_STATIC_LIB@)
set (@PROJECT_NAME@_NETGeographicLib_FOUND @BUILD_NETGEOGRAPHICLIB@)
# Check for the components requested. The convention is that
# GeographicLib_${comp}_FOUND should be true for all the required
# components.
if (@PROJECT_NAME@_FIND_COMPONENTS)
foreach (comp ${@PROJECT_NAME@_FIND_COMPONENTS})
if (@PROJECT_NAME@_FIND_REQUIRED_${comp} AND
NOT @PROJECT_NAME@_${comp}_FOUND)
set (PACKAGE_VERSION_UNSUITABLE TRUE)
endif ()
endforeach ()
endif ()

View File

@ -0,0 +1,82 @@
# Configure @PROJECT_NAME@
#
# Set
# @PROJECT_NAME@_FOUND = @PROJECT_NAME_UPPER@_FOUND = 1
# @PROJECT_NAME@_INCLUDE_DIRS = /usr/local/include
# @PROJECT_NAME@_SHARED_LIBRARIES = GeographicLib (or empty)
# @PROJECT_NAME@_STATIC_LIBRARIES = GeographicLib_STATIC (or empty)
# @PROJECT_NAME@_SHARED_DEFINITIONS = GEOGRAPHICLIB_SHARED_LIB=1
# @PROJECT_NAME@_STATIC_DEFINITIONS = GEOGRAPHICLIB_SHARED_LIB=0
# @PROJECT_NAME@_LIBRARY_DIRS = /usr/local/lib
# @PROJECT_NAME@_BINARY_DIRS = /usr/local/bin
# @PROJECT_NAME@_VERSION = 1.9 (for example)
# Depending on @PROJECT_NAME@_USE_STATIC_LIBS
# @PROJECT_NAME@_LIBRARIES = ${@PROJECT_NAME@_SHARED_LIBRARIES}, if OFF
# @PROJECT_NAME@_LIBRARIES = ${@PROJECT_NAME@_STATIC_LIBRARIES}, if ON
# @PROJECT_NAME@_DEFINITIONS = ${@PROJECT_NAME@_SHARED_DEFINITIONS}, if OFF
# @PROJECT_NAME@_DEFINITIONS = ${@PROJECT_NAME@_STATIC_DEFINITIONS}, if ON
# If only one of the libraries is provided, then
# @PROJECT_NAME@_USE_STATIC_LIBS is ignored.
message (STATUS "Reading ${CMAKE_CURRENT_LIST_FILE}")
set (@PROJECT_NAME@_VERSION "@PROJECT_VERSION@")
message (STATUS
"@PROJECT_NAME@ configuration, version ${@PROJECT_NAME@_VERSION}")
# Tell the user project where to find our headers and libraries
get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
if (IS_ABSOLUTE "@PROJECT_ROOT_DIR@")
# This is an uninstalled package (still in the build tree)
set (_ROOT "@PROJECT_ROOT_DIR@")
set (@PROJECT_NAME@_INCLUDE_DIRS "@PROJECT_INCLUDE_DIRS@")
set (@PROJECT_NAME@_LIBRARY_DIRS "${_ROOT}/src")
set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/src")
else ()
# This is an installed package; figure out the paths relative to the
# current directory.
get_filename_component (_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE)
set (@PROJECT_NAME@_INCLUDE_DIRS "${_ROOT}/include")
set (@PROJECT_NAME@_LIBRARY_DIRS "${_ROOT}/lib")
set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/bin")
endif ()
message (STATUS " include directory: \${@PROJECT_NAME@_INCLUDE_DIRS}")
set (@PROJECT_NAME@_SHARED_LIBRARIES @PROJECT_SHARED_LIBRARIES@)
set (@PROJECT_NAME@_STATIC_LIBRARIES @PROJECT_STATIC_LIBRARIES@)
set (@PROJECT_NAME@_SHARED_DEFINITIONS @PROJECT_SHARED_DEFINITIONS@)
set (@PROJECT_NAME@_STATIC_DEFINITIONS @PROJECT_STATIC_DEFINITIONS@)
# Read in the exported definition of the library
include ("${_DIR}/@PROJECT_NAME_LOWER@-depends.cmake")
if ((NOT @PROJECT_NAME@_SHARED_LIBRARIES) OR
(@PROJECT_NAME@_USE_STATIC_LIBS AND @PROJECT_NAME@_STATIC_LIBRARIES))
set (@PROJECT_NAME@_LIBRARIES ${@PROJECT_NAME@_STATIC_LIBRARIES})
set (@PROJECT_NAME@_DEFINITIONS ${@PROJECT_NAME@_STATIC_DEFINITIONS})
message (STATUS " \${@PROJECT_NAME@_LIBRARIES} set to static library")
else ()
set (@PROJECT_NAME@_LIBRARIES ${@PROJECT_NAME@_SHARED_LIBRARIES})
set (@PROJECT_NAME@_DEFINITIONS ${@PROJECT_NAME@_SHARED_DEFINITIONS})
message (STATUS " \${@PROJECT_NAME@_LIBRARIES} set to shared library")
endif ()
set (@PROJECT_NAME@_NETGeographicLib_LIBRARIES @NETGEOGRAPHICLIB_LIBRARIES@)
# Check for the components requested. This only supports components
# STATIC, SHARED, and NETGeographicLib by checking the value of
# @PROJECT_NAME@_${comp}_LIBRARIES. No need to check if the component
# is required or not--the version file took care of that.
# @PROJECT_NAME@_${comp}_FOUND is set appropriately for each component.
if (@PROJECT_NAME@_FIND_COMPONENTS)
foreach (comp ${@PROJECT_NAME@_FIND_COMPONENTS})
if (@PROJECT_NAME@_${comp}_LIBRARIES)
set (@PROJECT_NAME@_${comp}_FOUND 1)
message (STATUS "@PROJECT_NAME@ component ${comp} found")
else ()
set (@PROJECT_NAME@_${comp}_FOUND 0)
message (WARNING "@PROJECT_NAME@ component ${comp} not found")
endif ()
endforeach ()
endif ()
# @PROJECT_NAME@_FOUND is set to 1 automatically
set (@PROJECT_NAME_UPPER@_FOUND 1) # for backwards compatibility

1530
gtsam/3rdparty/GeographicLib/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

1782
gtsam/3rdparty/GeographicLib/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

18780
gtsam/3rdparty/GeographicLib/configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,96 @@
dnl
dnl Copyright (C) 2009, Francesco P. Lovergine <frankie@debian.org>
AC_INIT([GeographicLib],[1.34],[charles@karney.com])
AC_CANONICAL_SYSTEM
AC_PREREQ(2.61)
AC_CONFIG_SRCDIR(src/Geodesic.cpp)
AC_CONFIG_MACRO_DIR(m4)
AM_INIT_AUTOMAKE
GEOGRAPHICLIB_VERSION_MAJOR=1
GEOGRAPHICLIB_VERSION_MINOR=34
GEOGRAPHICLIB_VERSION_PATCH=0
AC_DEFINE_UNQUOTED([GEOGRAPHICLIB_VERSION_MAJOR],
[$GEOGRAPHICLIB_VERSION_MAJOR],[major version number])
AC_DEFINE_UNQUOTED([GEOGRAPHICLIB_VERSION_MINOR],
[$GEOGRAPHICLIB_VERSION_MINOR],[minor version number])
AC_DEFINE_UNQUOTED([GEOGRAPHICLIB_VERSION_PATCH],
[$GEOGRAPHICLIB_VERSION_PATCH],[patch number])
AC_SUBST(GEOGRAPHICLIB_VERSION_MAJOR)
AC_SUBST(GEOGRAPHICLIB_VERSION_MINOR)
AC_SUBST(GEOGRAPHICLIB_VERSION_PATCH)
dnl
dnl This directive is deprecated by someone, but I prefer to avoid
dnl running autotools if not required explicitly. The reason is
dnl the need to be in sync with autoconf/automake.
dnl
AM_MAINTAINER_MODE
AC_CONFIG_HEADERS(include/GeographicLib/Config-ac.h)
dnl Library code modified: REVISION++
dnl Interfaces changed/added/removed: CURRENT++ REVISION=0
dnl Interfaces added: AGE++
dnl Interfaces removed: AGE=0
LT_CURRENT=11
LT_REVISION=1
LT_AGE=1
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_ARG_PROGRAM
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_CXX
AC_PROG_LIBTOOL
# Checks for header files.
AC_CHECK_HEADERS([float.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_LONG_DOUBLE
# Checks for library functions.
AC_FUNC_STRTOD
AC_CHECK_FUNCS([strtol])
AC_SEARCH_LIBS([floor],[m])
AC_SEARCH_LIBS([pow],[m])
AC_SEARCH_LIBS([sqrt],[m])
# Check endianness
AC_C_BIGENDIAN
# Check for doxygen.
# Need version 1.8.1.2 or later for greek and math symbols.
AC_CHECK_PROGS([DOXYGEN], [doxygen])
AM_CONDITIONAL([HAVE_DOXYGEN],
[test "$DOXYGEN" && test `"$DOXYGEN" --version |
sed 's/^\([[0-9]]\)\.\([[0-9]]\)\./\1.0\2./'` '>' 1.08.1.1])
AC_CHECK_PROGS([POD2MAN], [pod2man])
AC_CHECK_PROGS([POD2HTML], [pod2html])
AC_CHECK_PROGS([COL], [col])
AM_CONDITIONAL([HAVE_PODPROGS], [test "$POD2MAN" -a "$POD2HTML" -a "$COL"])
dnl
dnl Add here new file to be generated
dnl
AC_CONFIG_FILES([
Makefile
src/Makefile
include/Makefile
tools/Makefile
doc/Makefile
man/Makefile
matlab/Makefile
python/Makefile
cmake/Makefile
examples/Makefile
])
AC_OUTPUT

707
gtsam/3rdparty/GeographicLib/depcomp vendored Executable file
View File

@ -0,0 +1,707 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2012-03-27.16; # UTC
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# A tabulation character.
tab=' '
# A newline character.
nl='
'
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' "$nl" < "$tmpdepfile" |
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependent.h'.
# Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
# However on
# $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\':
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
# tcc 0.9.26 (FIXME still under development at the moment of writing)
# will emit a similar output, but also prepend the continuation lines
# with horizontal tabulation characters.
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form 'foo.o: dependent.h',
# or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
# Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
< "$tmpdepfile" > "$depfile"
sed '
s/[ '"$tab"'][ '"$tab"']*/ /g
s/^ *//
s/ *\\*$//
s/^[^:]*: *//
/^$/d
/:$/d
s/$/ :/
' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test "$stat" = 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' "$nl" < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -0,0 +1,83 @@
# Where the html versions of the man pages (extension .1.html) are
# found.
set (MANDIR ${PROJECT_BINARY_DIR}/man)
# Build up a list of the .1.html files.
set (HTMLMAN)
foreach (TOOL ${TOOLS})
set (HTMLMAN ${HTMLMAN} ${MANDIR}/${TOOL}.1.html)
endforeach ()
if (COMMON_INSTALL_PATH)
set (INSTALL_DOC_DIR "share/doc/GeographicLib")
else ()
set (INSTALL_DOC_DIR "doc")
endif ()
# Run doxygen, if available
# First assemble a list of all the files the documentation uses. Add a
# dependency on htmlman (from man/CMakeLists.txt). Use html/index.html
# as the make target. To make this target, copy the non-doxygen
# generated files into html/. Run doxfile.in thru cmake's config
# process so that absolute path names are used and so that the pathnames
# are properly stripped by doxygen (via STRIP_FROM_PATH). The
# distrib-doc target copies the html directory into the source tree.
# If doxygen is not available, only the install step (from the source
# tree) is done.
file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html-stage)
if (DOXYGEN_FOUND)
configure_file (doxyfile.in doxyfile)
configure_file (doxyfile-c.in doxyfile-c)
configure_file (doxyfile-for.in doxyfile-for)
configure_file (doxyfile-net.in doxyfile-net)
file (GLOB SOURCES
../src/[A-Za-z]*.cpp ../include/GeographicLib/[A-Za-z]*.hpp
../tools/[A-Za-z]*.cpp ../examples/[A-Za-z]*.cpp
../legacy/C/*.[ch] ../legacy/Fortran/*.for ../legacy/Fortran/*.inc
../dotnet/NETGeographicLib/*.cpp ../dotnet/NETGeographicLib/*.h
../dotnet/examples/CS/*.cs ../dotnet/examples/ManagedCPP/*.cpp
../dotnet/examples/VB/*.vb)
file (GLOB EXTRA_FILES ../maxima/[A-Za-z]*.mac
tmseries30.html geodseries30.html ../LICENSE.txt)
file (GLOB FIGURES *.png)
file (COPY ${EXTRA_FILES} DESTINATION html-stage)
add_custom_target (doc ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
add_dependencies (doc htmlman)
add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/index.html
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doxyfile
${CMAKE_CURRENT_BINARY_DIR}/doxyfile-c
${CMAKE_CURRENT_BINARY_DIR}/doxyfile-for
${CMAKE_CURRENT_BINARY_DIR}/doxyfile-net
GeographicLib.dox geodesic-c.dox geodesic-for.dox NETGeographicLib.dox
${SOURCES} ${EXTRA_FILES} ${FIGURES} ${HTMLMAN}
COMMAND ${CMAKE_COMMAND} -E remove_directory html
COMMAND ${CMAKE_COMMAND} -E copy_directory html-stage html
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile > doxygen.log
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile-c > doxygen-c.log
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile-for > doxygen-for.log
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile-net > doxygen-net.log
COMMENT "Generating html documentation tree")
install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
DESTINATION ${INSTALL_DOC_DIR})
else ()
file (COPY ../LICENSE.txt DESTINATION html)
# Need to absolute path on destination to support old versions of cmake
configure_file (index.html.in html/index.html)
configure_file (utilities.html.in html/utilities.html)
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/html/LICENSE.txt
${CMAKE_CURRENT_BINARY_DIR}/html/index.html
${CMAKE_CURRENT_BINARY_DIR}/html/utilities.html
DESTINATION ${INSTALL_DOC_DIR}/html)
endif ()
# Finally install the JavaScript files
file (GLOB SCRIPTDRIVERS scripts/[A-Za-z]*.html)
file (GLOB JSSCRIPTS scripts/GeographicLib/[A-Za-z]*.js)
install (FILES ${SCRIPTDRIVERS} DESTINATION ${INSTALL_DOC_DIR}/scripts)
install (FILES ${JSSCRIPTS}
DESTINATION ${INSTALL_DOC_DIR}/scripts/GeographicLib)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,160 @@
EXTRAFILES = $(srcdir)/tmseries30.html $(srcdir)/geodseries30.html
FIGURES = $(srcdir)/gauss-krueger-graticule.png \
$(srcdir)/thompson-tm-graticule.png \
$(srcdir)/gauss-krueger-convergence-scale.png \
$(srcdir)/gauss-schreiber-graticule-a.png \
$(srcdir)/gauss-krueger-graticule-a.png \
$(srcdir)/thompson-tm-graticule-a.png \
$(srcdir)/gauss-krueger-error.png \
$(srcdir)/meridian-measures.png
SCRIPTDRIVERS = \
$(srcdir)/scripts/geod-calc.html \
$(srcdir)/scripts/geod-google.html \
$(srcdir)/scripts/geod-google-instructions.html
JSSCRIPTS = \
$(srcdir)/scripts/GeographicLib/Math.js \
$(srcdir)/scripts/GeographicLib/Geodesic.js \
$(srcdir)/scripts/GeographicLib/GeodesicLine.js \
$(srcdir)/scripts/GeographicLib/PolygonArea.js \
$(srcdir)/scripts/GeographicLib/DMS.js \
$(srcdir)/scripts/GeographicLib/Interface.js
HPPFILES = \
$(top_srcdir)/include/GeographicLib/Accumulator.hpp \
$(top_srcdir)/include/GeographicLib/AlbersEqualArea.hpp \
$(top_srcdir)/include/GeographicLib/AzimuthalEquidistant.hpp \
$(top_srcdir)/include/GeographicLib/CassiniSoldner.hpp \
$(top_srcdir)/include/GeographicLib/Constants.hpp \
$(top_srcdir)/include/GeographicLib/DMS.hpp \
$(top_srcdir)/include/GeographicLib/Ellipsoid.hpp \
$(top_srcdir)/include/GeographicLib/EllipticFunction.hpp \
$(top_srcdir)/include/GeographicLib/Geocentric.hpp \
$(top_srcdir)/include/GeographicLib/GeoCoords.hpp \
$(top_srcdir)/include/GeographicLib/Geodesic.hpp \
$(top_srcdir)/include/GeographicLib/GeodesicExact.hpp \
$(top_srcdir)/include/GeographicLib/GeodesicLine.hpp \
$(top_srcdir)/include/GeographicLib/GeodesicLineExact.hpp \
$(top_srcdir)/include/GeographicLib/Geohash.hpp \
$(top_srcdir)/include/GeographicLib/Geoid.hpp \
$(top_srcdir)/include/GeographicLib/Gnomonic.hpp \
$(top_srcdir)/include/GeographicLib/LambertConformalConic.hpp \
$(top_srcdir)/include/GeographicLib/LocalCartesian.hpp \
$(top_srcdir)/include/GeographicLib/Math.hpp \
$(top_srcdir)/include/GeographicLib/MGRS.hpp \
$(top_srcdir)/include/GeographicLib/OSGB.hpp \
$(top_srcdir)/include/GeographicLib/PolarStereographic.hpp \
$(top_srcdir)/include/GeographicLib/PolygonArea.hpp \
$(top_srcdir)/include/GeographicLib/TransverseMercatorExact.hpp \
$(top_srcdir)/include/GeographicLib/TransverseMercator.hpp \
$(top_srcdir)/include/GeographicLib/UTMUPS.hpp
ALLSOURCES = \
$(top_srcdir)/src/AlbersEqualArea.cpp \
$(top_srcdir)/src/AzimuthalEquidistant.cpp \
$(top_srcdir)/src/CassiniSoldner.cpp \
$(top_srcdir)/src/DMS.cpp \
$(top_srcdir)/src/Ellipsoid.cpp \
$(top_srcdir)/src/EllipticFunction.cpp \
$(top_srcdir)/src/Geocentric.cpp \
$(top_srcdir)/src/GeoCoords.cpp \
$(top_srcdir)/src/Geodesic.cpp \
$(top_srcdir)/src/GeodesicLine.cpp \
$(top_srcdir)/src/Geohash.cpp \
$(top_srcdir)/src/Geoid.cpp \
$(top_srcdir)/src/Gnomonic.cpp \
$(top_srcdir)/src/LambertConformalConic.cpp \
$(top_srcdir)/src/LocalCartesian.cpp \
$(top_srcdir)/src/MGRS.cpp \
$(top_srcdir)/src/OSGB.cpp \
$(top_srcdir)/src/PolarStereographic.cpp \
$(top_srcdir)/src/PolygonArea.cpp \
$(top_srcdir)/src/TransverseMercator.cpp \
$(top_srcdir)/src/TransverseMercatorExact.cpp \
$(top_srcdir)/src/UTMUPS.cpp \
$(top_srcdir)/tools/CartConvert.cpp \
$(top_srcdir)/tools/ConicProj.cpp \
$(top_srcdir)/tools/GeodesicProj.cpp \
$(top_srcdir)/tools/GeoConvert.cpp \
$(top_srcdir)/tools/GeodSolve.cpp \
$(top_srcdir)/tools/GeoidEval.cpp \
$(top_srcdir)/tools/Gravity.cpp \
$(top_srcdir)/tools/Planimeter.cpp \
$(top_srcdir)/tools/TransverseMercatorProj.cpp
MANPAGES = \
../man/CartConvert.1.html \
../man/ConicProj.1.html \
../man/GeodesicProj.1.html \
../man/GeoConvert.1.html \
../man/GeodSolve.1.html \
../man/GeoidEval.1.html \
../man/Gravity.1.html \
../man/MagneticField.1.html \
../man/Planimeter.1.html \
../man/TransverseMercatorProj.1.html
LEGACYFILES = \
$(top_srcdir)/legacy/C/geodesic.c \
$(top_srcdir)/legacy/C/geodesic.h \
$(top_srcdir)/legacy/C/direct.c \
$(top_srcdir)/legacy/C/inverse.c \
$(top_srcdir)/legacy/C/planimeter.c \
$(top_srcdir)/legacy/Fortran/geodesic.for \
$(top_srcdir)/legacy/Fortran/geodesic.inc \
$(top_srcdir)/legacy/Fortran/geoddirect.for \
$(top_srcdir)/legacy/Fortran/geodinverse.for \
$(top_srcdir)/legacy/Fortran/planimeter.for
doc: html/index.html
if HAVE_DOXYGEN
manpages: $(MANPAGES)
if test -d html; then rm -rf html/*; else mkdir html; fi
cp $^ html/
touch $@
html/index.html: manpages doxyfile.in GeographicLib.dox \
$(HPPFILES) $(ALLSOURCES) $(EXTRAFILES) $(FIGURES) \
doxyfile-c.in geodesic-c.dox doxyfile-for.in geodesic-for.dox \
$(LEGACYFILES)
cp -p $(EXTRAFILES) $(top_srcdir)/maxima/*.mac \
$(top_srcdir)/LICENSE.txt html/
sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \
-e "s%@PROJECT_VERSION@%$(VERSION)%g" \
$(srcdir)/doxyfile.in | $(DOXYGEN) -
sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \
-e "s%@PROJECT_VERSION@%$(VERSION)%g" \
$(srcdir)/doxyfile-c.in | $(DOXYGEN) -
sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \
-e "s%@PROJECT_VERSION@%$(VERSION)%g" \
$(srcdir)/doxyfile-for.in | $(DOXYGEN) -
else
html/index.html: index.html.in utilities.html.in
if test -d html; then rm -rf html/*; else mkdir html; fi
cp $(top_srcdir)/LICENSE.txt html/
sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \
$(srcdir)/utilities.html.in > html/utilities.html
sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \
$(srcdir)/index.html.in > html/index.html
endif
maintainer-clean-local:
rm -rf html manpages
install-doc: html/index.html
$(INSTALL) -d $(DESTDIR)$(docdir)/html
$(INSTALL) -m 644 `dirname $<`/*.* $(DESTDIR)$(docdir)/html
-test -f `dirname $<`/C/index.html && \
$(INSTALL) -d $(DESTDIR)$(docdir)/html/C && \
$(INSTALL) -m 644 `dirname $<`/C/*.* $(DESTDIR)$(docdir)/html/C
-test -f `dirname $<`/Fortran/index.html && \
$(INSTALL) -d $(DESTDIR)$(docdir)/html/Fortran && \
$(INSTALL) -m 644 `dirname $<`/Fortran/*.* \
$(DESTDIR)$(docdir)/html/Fortran
$(INSTALL) -d $(DESTDIR)$(docdir)/scripts
$(INSTALL) -m 644 $(SCRIPTDRIVERS) $(DESTDIR)$(docdir)/scripts
$(INSTALL) -d $(DESTDIR)$(docdir)/scripts/GeographicLib
$(INSTALL) -m 644 $(JSSCRIPTS) $(DESTDIR)$(docdir)/scripts/GeographicLib

View File

@ -0,0 +1,561 @@
# Makefile.in generated by automake 1.12.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/include/GeographicLib/Config-ac.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COL = @COL@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOXYGEN = @DOXYGEN@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GEOGRAPHICLIB_VERSION_MAJOR = @GEOGRAPHICLIB_VERSION_MAJOR@
GEOGRAPHICLIB_VERSION_MINOR = @GEOGRAPHICLIB_VERSION_MINOR@
GEOGRAPHICLIB_VERSION_PATCH = @GEOGRAPHICLIB_VERSION_PATCH@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POD2HTML = @POD2HTML@
POD2MAN = @POD2MAN@
POW_LIB = @POW_LIB@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRAFILES = $(srcdir)/tmseries30.html $(srcdir)/geodseries30.html
FIGURES = $(srcdir)/gauss-krueger-graticule.png \
$(srcdir)/thompson-tm-graticule.png \
$(srcdir)/gauss-krueger-convergence-scale.png \
$(srcdir)/gauss-schreiber-graticule-a.png \
$(srcdir)/gauss-krueger-graticule-a.png \
$(srcdir)/thompson-tm-graticule-a.png \
$(srcdir)/gauss-krueger-error.png \
$(srcdir)/meridian-measures.png
SCRIPTDRIVERS = \
$(srcdir)/scripts/geod-calc.html \
$(srcdir)/scripts/geod-google.html \
$(srcdir)/scripts/geod-google-instructions.html
JSSCRIPTS = \
$(srcdir)/scripts/GeographicLib/Math.js \
$(srcdir)/scripts/GeographicLib/Geodesic.js \
$(srcdir)/scripts/GeographicLib/GeodesicLine.js \
$(srcdir)/scripts/GeographicLib/PolygonArea.js \
$(srcdir)/scripts/GeographicLib/DMS.js \
$(srcdir)/scripts/GeographicLib/Interface.js
HPPFILES = \
$(top_srcdir)/include/GeographicLib/Accumulator.hpp \
$(top_srcdir)/include/GeographicLib/AlbersEqualArea.hpp \
$(top_srcdir)/include/GeographicLib/AzimuthalEquidistant.hpp \
$(top_srcdir)/include/GeographicLib/CassiniSoldner.hpp \
$(top_srcdir)/include/GeographicLib/Constants.hpp \
$(top_srcdir)/include/GeographicLib/DMS.hpp \
$(top_srcdir)/include/GeographicLib/Ellipsoid.hpp \
$(top_srcdir)/include/GeographicLib/EllipticFunction.hpp \
$(top_srcdir)/include/GeographicLib/Geocentric.hpp \
$(top_srcdir)/include/GeographicLib/GeoCoords.hpp \
$(top_srcdir)/include/GeographicLib/Geodesic.hpp \
$(top_srcdir)/include/GeographicLib/GeodesicExact.hpp \
$(top_srcdir)/include/GeographicLib/GeodesicLine.hpp \
$(top_srcdir)/include/GeographicLib/GeodesicLineExact.hpp \
$(top_srcdir)/include/GeographicLib/Geohash.hpp \
$(top_srcdir)/include/GeographicLib/Geoid.hpp \
$(top_srcdir)/include/GeographicLib/Gnomonic.hpp \
$(top_srcdir)/include/GeographicLib/LambertConformalConic.hpp \
$(top_srcdir)/include/GeographicLib/LocalCartesian.hpp \
$(top_srcdir)/include/GeographicLib/Math.hpp \
$(top_srcdir)/include/GeographicLib/MGRS.hpp \
$(top_srcdir)/include/GeographicLib/OSGB.hpp \
$(top_srcdir)/include/GeographicLib/PolarStereographic.hpp \
$(top_srcdir)/include/GeographicLib/PolygonArea.hpp \
$(top_srcdir)/include/GeographicLib/TransverseMercatorExact.hpp \
$(top_srcdir)/include/GeographicLib/TransverseMercator.hpp \
$(top_srcdir)/include/GeographicLib/UTMUPS.hpp
ALLSOURCES = \
$(top_srcdir)/src/AlbersEqualArea.cpp \
$(top_srcdir)/src/AzimuthalEquidistant.cpp \
$(top_srcdir)/src/CassiniSoldner.cpp \
$(top_srcdir)/src/DMS.cpp \
$(top_srcdir)/src/Ellipsoid.cpp \
$(top_srcdir)/src/EllipticFunction.cpp \
$(top_srcdir)/src/Geocentric.cpp \
$(top_srcdir)/src/GeoCoords.cpp \
$(top_srcdir)/src/Geodesic.cpp \
$(top_srcdir)/src/GeodesicLine.cpp \
$(top_srcdir)/src/Geohash.cpp \
$(top_srcdir)/src/Geoid.cpp \
$(top_srcdir)/src/Gnomonic.cpp \
$(top_srcdir)/src/LambertConformalConic.cpp \
$(top_srcdir)/src/LocalCartesian.cpp \
$(top_srcdir)/src/MGRS.cpp \
$(top_srcdir)/src/OSGB.cpp \
$(top_srcdir)/src/PolarStereographic.cpp \
$(top_srcdir)/src/PolygonArea.cpp \
$(top_srcdir)/src/TransverseMercator.cpp \
$(top_srcdir)/src/TransverseMercatorExact.cpp \
$(top_srcdir)/src/UTMUPS.cpp \
$(top_srcdir)/tools/CartConvert.cpp \
$(top_srcdir)/tools/ConicProj.cpp \
$(top_srcdir)/tools/GeodesicProj.cpp \
$(top_srcdir)/tools/GeoConvert.cpp \
$(top_srcdir)/tools/GeodSolve.cpp \
$(top_srcdir)/tools/GeoidEval.cpp \
$(top_srcdir)/tools/Gravity.cpp \
$(top_srcdir)/tools/Planimeter.cpp \
$(top_srcdir)/tools/TransverseMercatorProj.cpp
MANPAGES = \
../man/CartConvert.1.html \
../man/ConicProj.1.html \
../man/GeodesicProj.1.html \
../man/GeoConvert.1.html \
../man/GeodSolve.1.html \
../man/GeoidEval.1.html \
../man/Gravity.1.html \
../man/MagneticField.1.html \
../man/Planimeter.1.html \
../man/TransverseMercatorProj.1.html
LEGACYFILES = \
$(top_srcdir)/legacy/C/geodesic.c \
$(top_srcdir)/legacy/C/geodesic.h \
$(top_srcdir)/legacy/C/direct.c \
$(top_srcdir)/legacy/C/inverse.c \
$(top_srcdir)/legacy/C/planimeter.c \
$(top_srcdir)/legacy/Fortran/geodesic.for \
$(top_srcdir)/legacy/Fortran/geodesic.inc \
$(top_srcdir)/legacy/Fortran/geoddirect.for \
$(top_srcdir)/legacy/Fortran/geodinverse.for \
$(top_srcdir)/legacy/Fortran/planimeter.for
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic \
maintainer-clean-local
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic maintainer-clean-local mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
uninstall uninstall-am
doc: html/index.html
@HAVE_DOXYGEN_TRUE@manpages: $(MANPAGES)
@HAVE_DOXYGEN_TRUE@ if test -d html; then rm -rf html/*; else mkdir html; fi
@HAVE_DOXYGEN_TRUE@ cp $^ html/
@HAVE_DOXYGEN_TRUE@ touch $@
@HAVE_DOXYGEN_TRUE@html/index.html: manpages doxyfile.in GeographicLib.dox \
@HAVE_DOXYGEN_TRUE@ $(HPPFILES) $(ALLSOURCES) $(EXTRAFILES) $(FIGURES) \
@HAVE_DOXYGEN_TRUE@ doxyfile-c.in geodesic-c.dox doxyfile-for.in geodesic-for.dox \
@HAVE_DOXYGEN_TRUE@ $(LEGACYFILES)
@HAVE_DOXYGEN_TRUE@ cp -p $(EXTRAFILES) $(top_srcdir)/maxima/*.mac \
@HAVE_DOXYGEN_TRUE@ $(top_srcdir)/LICENSE.txt html/
@HAVE_DOXYGEN_TRUE@ sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \
@HAVE_DOXYGEN_TRUE@ -e "s%@PROJECT_VERSION@%$(VERSION)%g" \
@HAVE_DOXYGEN_TRUE@ $(srcdir)/doxyfile.in | $(DOXYGEN) -
@HAVE_DOXYGEN_TRUE@ sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \
@HAVE_DOXYGEN_TRUE@ -e "s%@PROJECT_VERSION@%$(VERSION)%g" \
@HAVE_DOXYGEN_TRUE@ $(srcdir)/doxyfile-c.in | $(DOXYGEN) -
@HAVE_DOXYGEN_TRUE@ sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \
@HAVE_DOXYGEN_TRUE@ -e "s%@PROJECT_VERSION@%$(VERSION)%g" \
@HAVE_DOXYGEN_TRUE@ $(srcdir)/doxyfile-for.in | $(DOXYGEN) -
@HAVE_DOXYGEN_FALSE@html/index.html: index.html.in utilities.html.in
@HAVE_DOXYGEN_FALSE@ if test -d html; then rm -rf html/*; else mkdir html; fi
@HAVE_DOXYGEN_FALSE@ cp $(top_srcdir)/LICENSE.txt html/
@HAVE_DOXYGEN_FALSE@ sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \
@HAVE_DOXYGEN_FALSE@ $(srcdir)/utilities.html.in > html/utilities.html
@HAVE_DOXYGEN_FALSE@ sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \
@HAVE_DOXYGEN_FALSE@ $(srcdir)/index.html.in > html/index.html
maintainer-clean-local:
rm -rf html manpages
install-doc: html/index.html
$(INSTALL) -d $(DESTDIR)$(docdir)/html
$(INSTALL) -m 644 `dirname $<`/*.* $(DESTDIR)$(docdir)/html
-test -f `dirname $<`/C/index.html && \
$(INSTALL) -d $(DESTDIR)$(docdir)/html/C && \
$(INSTALL) -m 644 `dirname $<`/C/*.* $(DESTDIR)$(docdir)/html/C
-test -f `dirname $<`/Fortran/index.html && \
$(INSTALL) -d $(DESTDIR)$(docdir)/html/Fortran && \
$(INSTALL) -m 644 `dirname $<`/Fortran/*.* \
$(DESTDIR)$(docdir)/html/Fortran
$(INSTALL) -d $(DESTDIR)$(docdir)/scripts
$(INSTALL) -m 644 $(SCRIPTDRIVERS) $(DESTDIR)$(docdir)/scripts
$(INSTALL) -d $(DESTDIR)$(docdir)/scripts/GeographicLib
$(INSTALL) -m 644 $(JSSCRIPTS) $(DESTDIR)$(docdir)/scripts/GeographicLib
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,30 @@
SCRIPTDRIVERS = $(wildcard scripts/[A-Za-z]*.html)
JSSCRIPTS = $(wildcard scripts/GeographicLib/[A-Za-z]*.js)
VERSION:=$(shell grep '\bVERSION=' ../configure | cut -f2 -d\' | head -1)
doc: html/index.html
html/index.html: index.html.in utilities.html.in
if test -d html; then rm -rf html/*; else mkdir html; fi
cp ../LICENSE.txt html/
sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \
utilities.html.in > html/utilities.html
sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \
index.html.in > html/index.html
PREFIX = /usr/local
DEST = $(PREFIX)/share/doc/GeographicLib
DOCDEST = $(DEST)/html
SCRIPTDEST = $(DEST)/scripts
INSTALL = install -b
install: html/index.html
test -d $(DOCDEST) || mkdir -p $(DOCDEST)
$(INSTALL) -m 644 html/* $(DOCDEST)/
test -d $(SCRIPTDEST)/GeographicLib || \
mkdir -p $(SCRIPTDEST)/GeographicLib
$(INSTALL) -m 644 $(SCRIPTDRIVERS) $(SCRIPTDEST)/
$(INSTALL) -m 644 $(JSSCRIPTS) $(SCRIPTDEST)/GeographicLib/
.PHONY: doc install clean

View File

@ -0,0 +1,241 @@
// -*- text -*-
/**
* \file NETGeographicLib.dox
* \brief Documentation for NETGeographicLib
*
* Written by Scott Heiman <mrmtdew2@outlook.com> and licensed under the
* MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/
**********************************************************************/
/**
\mainpage NETGeographicLib library
\author Scott Heiman (mrmtdew2@outlook.com)
\version 1.34
\date 2013-12-11
\section abstract Abstract
%NETGeographicLib is a .NET wrapper for GeographicLib. It allows
.NET developers to access GeographicLib classes within C#, Visual
Basic, Managed C++, and other Microsoft .NET languages.
NETGeographicLib is written in Managed C++. It IS NOT a reimplementation
of the GeographicLib software. It is a container that provides interfaces
to the GeographicLib classes. GeographicLib and NETGeographicLib is an
integrated product.
The NETGeographic project in the GeographicLib-vc10.sln file located in
\<install folder\>/GeographicLib-1.34/windows will create the NETGeographicLib
DLL. The source code for NETGeographicLib is located in
\<install folder\>/GeographicLib-1.34/dotnet/NETGeographicLib. NETGeographicLib
is not available for older versions of Microsoft Visual Studio.
NETGeographicLib has been tested with C#, Managed C++, and Visual Basic.
Sample code snippets can be found in
\<install folder\>/GeographicLib-1.34/dotnet/examples.
\section differences Differences between NETGeographicLib and GeographicLib
The NETGeographicLib class names are identical to the GeographicLib class names.
All NETGeographicLib classes are in the NETGeographicLib namespace.
NETGeographicLib exposes most of the GeographicLib classes. The exceptions
are SphericalEngine, GeographicLib::Math, and GeographicLib::Utility. The
SphericalEngine class is a template class which (according to the comments in
the SphericalEngine.h file) is not usually accessible to developers. The
GeographicLib::Math class contains several specialized functions required by
GeographicLib classes. They have limited use outside GeographicLib. This class
may be exposed in a future release if there is demand for it. The functions
provided by GeographicLib::Utility duplicate functions provided by existing .NET
controls (DateTime).
The SphericalCoefficients class replaces the SphericalEngine::coeff class.
The NETGeographicLib class function interfaces are similar, and in many cases,
identical to the GeographicLib interfaces. There are differences because of
limitations in .NET and other differences that are discretionary. The comments
in the header files contain a section labeled "INTERFACE DIFFERENCES" that detail
the differences between the NETGeographicLib interfaces and the GeographicLib
interfaces. The differences are summarized in the text that follows.
Default values for function parameters are not supported in .NET.
Several GeographicLib class functions accept or return a "capabilities mask" as
an unsigned integer. The NETGeographicLib classes accept and return the capabilities
mask as an enumeration.
The Geocentric and LocalCartesian classes have functions that return a rotation matrix.
The NETGeographicLib versions return a two-dimensional, 3 &times; 3 array rather than a vector.
A lot of GeographicLib classes have inspector functions (MajorRadius,
Flattening, etc.). These inspector functions are implemented as
properties in NETGeographicLib.
NETGeographicLib classes do not implement constructors that create "uninitialized" objects.
Many NETGeographicLib classes implement a default constructor that assumes WGS84 parameters.
Several GeographicLib classes implement the () operator. NETGeographicLib classes
replace the () operator with a specific function. Managed C++ allows developers to
overload the () operator; however, the () operator is not 'elegantly' supported in
other .NET languages. For example, if the () operator was implemented in the
NETGeographicLib::Geoid class, then C# code would look like
\code
Geoid geoid = new Geoid();
double h = geoid.op_FuncCall(latitude,longitude); // if () operator was implemented.
h = geoid.Height(latitude,longitude); // with () operator replaced with Height
\endcode
The author felt that the op_FuncCall syntax did not appropriately define the purpose
of the function call.
.NET does not allow developers to overload the assignment operators (=,+=,-=,*=).
These operators have been replaced with functions in the NETGeographicLib::Accumulator class.
\section library Using NETGeographicLib in a .NET Application
If you have access to the NETGeographicLib and GeographicLib projects then
-# Create a new solution.
-# Create a new project using any .NET language. For this example, call it MyApp.
-# Add the NETGeographic and Geographic projects to the solution. Verify that NETGeographicLib depends upon GeographicLib.
-# Right-Click MyApp in the Solution View and select "Add Reference..." (C#/VB) or "References..." (Managed C++) in the pop-up menu.
-# (Managed C++) Click the "Add New Reference..." button in the Properties dialog.
\image html NETGeographicLib3.png
-# Click the Projects Tab and select NETGeographic.
\image html NETGeographicLib1.png
-# Click OK.
If you only have access to the NETGeographic.dll then
-# Create a new solution.
-# Create a new project using any .NET language. For this example, call it MyApp.
-# Right-Click MyApp in the Solution View and select "Add Reference..." in the popup menu.
-# Right-Click MyApp in the Solution View and select "Add Reference..." (C#/VB) or "References..." (Managed C++) in the pop-up menu.
-# (Managed C++) Click the "Add New Reference..." button in the Properties dialog.
\image html NETGeographicLib3.png
-# Click the Browse Tab and navigate to the folder containing NETGeographic.dll.
\image html NETGeographicLib2.png
-# Select NETGeographic.dll and click OK.
The MyApp project will have access to all public NETGeographicLib classes after the
NETGeographic reference is added to MyApp.
C# developers should add
\code using NETGeographicLib; \endcode
to any C# source file that uses NETGeographicLib.
Managed C++ developers should add
\code using namespace NETGeographicLib; \endcode
to any C++ source that uses NETGeographicLib classes.
Visual Basic developers should add
\code Imports NETGeographicLib \endcode
to any Visual Basic source that uses NETGeographicLib classes.
\section sample C# Sample Application
A C# sample application is provided that demonstrates NETGeographicLib classes.
The source code for the sample application is located in
\<install folder\>/GeographicLib-1.34/dotnet/Projections. The sample
application creates a tabbed dialog. Each tab provides data entry fields that
allow the user to exercise one or more NETGeographicLib classes.
The following table lists the source code that demonstrates specific classes.
<center>
<TABLE>
<TR><TH>Source File</TH><TH>Classes</TH></TR>
<TR><TD>AccumPanel.cs</TD><TD>Accumulator</TD></TR>
<TR><TD>AlbersPanel.cs</TD><TD>AlbersEqualArea, LambertConformalConic, TransverseMercator, TransverseMercatorExact</TD></TR>
<TR><TD>EllipsoidPanel.cs</TD><TD>Ellipsoid</TD></TR>
<TR><TD>EllipticPanel.cs</TD><TD>EllipticFunction</TD></TR>
<TR><TD>GeocentricPanel.cs</TD><TD>Geocentric</TD></TR>
<TR><TD>GeodesicPanel.cs</TD><TD>Geodesic, GeodesicLine, GeodesicExact, GeodesicLineExact</TD></TR>
<TR><TD>GeoidPanel.cs</TD><TD>Geoid</TD></TR>
<TR><TD>GravityPanel.cs</TD><TD>NormalGravity, GravityModel, GravityCircle</TD></TR>
<TR><TD>LocalCartesianPanel.cs</TD><TD>LocalCartesian</TD></TR>
<TR><TD>MagneticPanel.cs</TD><TD>MagneticModel, MagneticCircle</TD></TR>
<TR><TD>MiscPanel.cs</TD><TD>DMS, Geohash</TD></TR>
<TR><TD>PolarStereoPanel.cs</TD><TD>PolarStereographic</TD></TR>
<TR><TD>PolyPanel.cs</TD><TD>PolygonArea</TD></TR>
<TR><TD>ProjectionsPanel.cs</TD><TD>AzimuthalEquidistant, CassiniSoldner, Gnomonic</TD></TR>
<TR><TD>SphericalHarmonicsPanel.cs</TD><TD>SphericalHarmonic, SphericalHarmonic1, SphericalHarmonic2, CircularEngine, SphericalCoefficients</TD></TR>
<TR><TD>TypeIIIProjPanel.cs</TD><TD>UTMUPS, MGRS, OSGB</TD></TR>
</TABLE>
</center>
\section netcmake Using cmake to build a Managed C++ Application
The following assumes that you have installed %GeographicLib in one of
two ways:
- you have built and installed %GeographicLib using cmake with
<code>-D BUILD_NETGEOGRAPHICLIB=ON</code> (see
\ref cmake "Installation with cmake" in the %GeographicLib
documentation). You can use any version of Visual Studio to build
%GeographicLib and should use the same version to build your
application. You can build %GeographicLib as a shared library using
<code>-D GEOGRAPHICLIB_LIB_TYPE=SHARED</code> or <code>BOTH</code>.
- you have installed %GeographicLib using one of the binary installers (see
\ref windowsbin "Using a binary installer for Windows" in the
%GeographicLib documentation). In this case, you are restricted to using
Visual Studio 10.
The minimum recommended version of cmake for use with NETGeographicLib
is 2.8.7. In order to build an application that uses NETGeographicLib
with cmake, ask for the NETGeographicLib "component" of %GeographicLib
using \verbatim
find_package(GeographicLib COMPONENTS NETGeographicLib) \endverbatim
If NETGeographicLib is found, then
<code>GeographicLib_NETGeographicLib_FOUND</code> will be set to true and
<code>GeographicLib_NETGeographicLib_LIBRARIES</code> will be set to the
NETGeographic shared library. This is the name of the cmake target from
which the pathname of the dll can be obtained.
Here is a very simple test code, which uses the
NETGeographicLib::Geodesic class:
\include example-Geodesic-small.cpp
This example is
<code>dotnet/examples/ManagedCPP/example-Geodesic-small.cpp</code>.
Here is a complete CMakeList.txt files you can use to build this test
code using the installed library: \verbatim
project (geodesictest)
cmake_minimum_required (VERSION 2.8.7) # required for VS_DOTNET_REFERENCES
find_package (GeographicLib 1.34 REQUIRED COMPONENTS NETGeographicLib)
add_executable (${PROJECT_NAME} example-Geodesic-small.cpp)
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/clr")
string (REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string (REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# This is set up for Release builds only. Change RELEASE to DEBUG for
# Debug builds.
get_target_property (_LOC "${GeographicLib_NETGeographicLib_LIBRARIES}"
IMPORTED_LOCATION_RELEASE)
set_target_properties (${PROJECT_NAME} PROPERTIES VS_DOTNET_REFERENCES ${_LOC})
get_target_property (_LIB "${GeographicLib_NETGeographicLib_LIBRARIES}"
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE)
get_target_property (_LIBTYPE ${_LIB} TYPE)
if (_LIBTYPE STREQUAL "SHARED_LIBRARY")
# On Windows systems, copy the shared library to build directory
add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy $<TARGET_FILE:${_LIB}> ${CMAKE_CFG_INTDIR}
COMMENT "Copying shared library for GeographicLib")
endif () \endverbatim
The typical invocation of cmake is \verbatim
mkdir BUILD
cd BUILD
cmake -G "Visual Studio 10" -D CMAKE_PREFIX_PATH=C:/pkg-vc10 ..
cmake --build . --config Release \endverbatim
The version of Visual Studio should match that used to build
NETGeographicLib. <b>NOTE:</b> With Visual Studio 10, this results in
warnings such as \verbatim
warning C4945: 'ExtensionAttribute' : cannot import symbol from ... \endverbatim
which can be safely(?) ignored.
Running the example with \verbatim
Release\geodesictest.exe \endverbatim
should give \verbatim
5551.75940031868 km \endverbatim
**********************************************************************/

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -0,0 +1,118 @@
// -*- text -*-
/**
* \file geodesic-c.dox
* \brief Documentation for geodesic routines implemented in C
*
* Written by Charles Karney <charles@karney.com> and licensed under the
* MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/
**********************************************************************/
/**
\mainpage Geodesic routines implemented in C
\author Charles F. F. Karney (charles@karney.com)
\version 1.32
\section abstract Abstract
This is a C implementation of the geodesic algorithms from <a
href="http://geographiclib.sf.net">GeographicLib</a>. This is a
self-contained library (requiring only the standard C math library)
which makes it easy to do geodesic computations for an ellipsoid of
revolution in a C program. It uses ANSI C as described in
B. W. Kernigan and D. M. Ritchie, The C Programming Language, 2nd
Ed. (Prentice Hall, 1988), and so should compile correctly with just
about any C compiler.
\section download Downloading the source
The C library is part of %GeographicLib which available for download at
- <a href="http://sf.net/projects/geographiclib/files/distrib/GeographicLib-1.32.tar.gz">
GeographicLib-1.32.tar.gz</a>
- <a href="http://sf.net/projects/geographiclib/files/distrib/GeographicLib-1.32.zip">
GeographicLib-1.32.zip</a>
.
as either a compressed tar file (tar.gz) or a zip file. After unpacking
the source, the C library can be found in GeographicLib-1.32/legacy/C.
The library consists of two files geodesic.c and geodesic.h.
The library is also included as part of
<a href="http://trac.osgeo.org/proj/">proj.4</a> starting with version
4.9.0, where is used as the computational backend for
<a href="http://trac.osgeo.org/proj/wiki/man_geod">geod(1)</a>.
Instructions for how to use the library via proj.4 are given below.
\section doc Library documentation
The interface to the library is documented via doxygen in the header
file. To access this, see geodesic.h.
\section samples Sample programs
Also included are 3 small test programs:
- direct.c is a simple command line utility for solving the
direct geodesic problem;
- inverse.c is a simple command line utility for solving the
inverse geodesic problem;
- planimeter.c is a simple command line utility for computing the
area of a geodesic polygon given its vertices.
.
Here, for example, is inverse.c
\include inverse.c
To compile, link, and run this, you would typically use \verbatim
cc -o inverse inverse.c geodesic.c -lm
echo 30 0 29.5 179.5 | ./inverse \endverbatim
These sample programs can also be built with the supplied cmake file,
CMakeLists.txt, as follows \verbatim
mkdir BUILD
cd BUILD
cmake ..
make
echo 30 0 29.5 179.5 | ./inverse \endverbatim
Alternatively, if you have proj.4 installed, you can compile and link
with \verbatim
cc -c inverse.c
cc -o inverse inverse.o -lproj
echo 30 0 29.5 179.5 | ./inverse \endverbatim
If proj.4 is installed, e.g., in /usr/local, you might have to use
\verbatim
cc -c -I/usr/local/include inverse.c
cc -o inverse inverse.o -lproj -L/usr/local/lib -Wl,-rpath=/usr/local/lib
echo 30 0 29.5 179.5 | ./inverse \endverbatim
\section library Using the library
- Put @verbatim
#include "geodesic.h" @endverbatim
in your source code. If you are using the library via proj.4, change
this to @verbatim
#include <geodesic.h> @endverbatim
- make calls to the geodesic routines from your code. The interface to
the library is documented in geodesic.h.
- Compile and link as described above.
\section external External links
- These algorithms are derived in C. F. F. Karney,
<a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
Algorithms for geodesics</a>,
J. Geodesy <b>87</b>, 43--55 (2013)
(<a href="http://geographiclib.sf.net/geod-addenda.html"> addenda</a>).
- A longer paper on geodesics: C. F. F. Karney,
<a href="http://arxiv.org/abs/1102.1215v1">Geodesics
on an ellipsoid of revolution</a>,
Feb. 2011
(<a href="http://geographiclib.sf.net/geod-addenda.html#geod-errata">
errata</a>).
- <a href="http://geographiclib.sf.net">The GeographicLib web site</a>.
- <a href="../index.html">The C++ library</a>.
- <a href="../java/index.html">The Java library</a>.
- <a href="../Fortran/index.html">The Fortran library</a>.
- Documentation on the C++ classes: GeographicLib::Geodesic,
GeographicLib::GeodesicLine, GeographicLib::PolygonArea.
- The section in the %GeographicLib documentation on geodesics: \ref
geodesic.
- <a href="http://geographiclib.sf.net/geodesic-papers/biblio.html">
An online geodesic bibliography</a>.
**********************************************************************/

View File

@ -0,0 +1,100 @@
// -*- text -*-
/**
* \file geodesic-for.dox
* \brief Documentation for geodesic routines implemented in Fortran
*
* Written by Charles Karney <charles@karney.com> and licensed under the
* MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/
**********************************************************************/
/**
\mainpage Geodesic routines implemented in Fortran
\author Charles F. F. Karney (charles@karney.com)
\version 1.31
\section abstract Abstract
This is a Fortran implementation of the geodesic algorithms from <a
href="http://geographiclib.sf.net">GeographicLib</a>. This is a
self-contained library which makes it easy to do geodesic computations
for an ellipsoid of revolution in a Fortran program. It is written in
Fortran 77 (avoiding features which are now deprecated) and should
compile correctly with just about any Fortran compiler.
\section download Downloading the source
The Fortran library is part of %GeographicLib which available for download at
- <a href="http://sf.net/projects/geographiclib/files/distrib/GeographicLib-1.31.tar.gz">
GeographicLib-1.31.tar.gz</a>
- <a href="http://sf.net/projects/geographiclib/files/distrib/GeographicLib-1.31.zip">
GeographicLib-1.31.zip</a>
.
as either a compressed tar file (tar.gz) or a zip file. After unpacking
the source, the Fortran library can be found in
GeographicLib-1.31/legacy/Fortran. The library consists of the file
geodesic.for.
\section doc Library documentation
The interface to the library is documented via doxygen in the source
file. To access this, see geodesic.for.
\section samples Sample programs
Also included are 3 small test programs:
- geoddirect.for is a simple command line utility for solving the
direct geodesic problem;
- geodinverse.for is a simple command line utility for solving the
inverse geodesic problem;
- planimeter.for is a simple command line utility for computing the
area of a geodesic polygon given its vertices.
.
Here, for example, is geodinverse.for
\include geodinverse.for
To compile, link, and run this, you would typically use \verbatim
f95 -o geodinverse geodinverse.for geodesic.for
echo 30 0 29.5 179.5 | ./geodinverse \endverbatim
These sample programs can also be built with the supplied cmake file,
CMakeLists.txt, as follows \verbatim
mkdir BUILD
cd BUILD
cmake ..
make
echo 30 0 29.5 179.5 | ./geodinverse \endverbatim
\section library Using the library
- Optionall put @verbatim
include "geodesic.inc" @endverbatim
in declaration section of your subroutines.
- make calls to the geodesic routines from your code. The interface to
the library is documented in geodesic.for.
- Compile and link as described above.
\section external External links
- These algorithms are derived in C. F. F. Karney,
<a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
Algorithms for geodesics</a>,
J. Geodesy <b>87</b>, 43--55 (2013)
(<a href="http://geographiclib.sf.net/geod-addenda.html"> addenda</a>).
- A longer paper on geodesics: C. F. F. Karney,
<a href="http://arxiv.org/abs/1102.1215v1">Geodesics
on an ellipsoid of revolution</a>,
Feb. 2011
(<a href="http://geographiclib.sf.net/geod-addenda.html#geod-errata">
errata</a>).
- <a href="http://geographiclib.sf.net">The GeographicLib web site</a>.
- <a href="../index.html">The C++ library</a>.
- <a href="../C/index.html">The C library</a>.
- <a href="../java/index.html">The Java library</a>.
- Documentation on the C++ classes: GeographicLib::Geodesic,
GeographicLib::GeodesicLine, GeographicLib::PolygonArea.
- The section in the %GeographicLib documentation on geodesics: \ref
geodesic.
- <a href="http://geographiclib.sf.net/geodesic-papers/biblio.html">
An online geodesic bibliography</a>.
**********************************************************************/
**********************************************************************/

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
<html>
<head>
<title>GeographicLib-@PROJECT_VERSION@ documentation</title>
<meta HTTP-EQUIV="Refresh"
CONTENT="0; URL=http://geographiclib.sourceforge.net/@PROJECT_VERSION@/index.html">
</head>
<body topmargin=10 leftmargin=10>
<h3>
<blockquote>
<em>
Online documentation for GeographicLib version
@PROJECT_VERSION@ is available at
<center>
<a href="http://geographiclib.sourceforge.net/@PROJECT_VERSION@/index.html">
http://geographiclib.sourceforge.net/@PROJECT_VERSION@/index.html</a>.
</center>
<br>
You will be redirected there. Click on the link to go there
directly.
</em>
</blockquote>
</h3>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@ -0,0 +1,364 @@
/**
* DMS.js
* Transcription of DMS.[ch]pp into JavaScript.
*
* See the documentation for the C++ class. The conversion is a literal
* conversion from C++.
*
* Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed
* under the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/
**********************************************************************/
GeographicLib.DMS = {};
(function() {
var d = GeographicLib.DMS;
var m = GeographicLib.Math;
d.lookup = function(s, c) {
return s.indexOf(c.toUpperCase());
}
d.zerofill = function(s, n) {
return String("0000").substr(0, Math.max(0, Math.min(4, n-s.length))) +
s;
}
d.hemispheres_ = "SNWE";
d.signs_ = "-+";
d.digits_ = "0123456789";
d.dmsindicators_ = "D'\":";
// d.dmsindicatorsu_ = "\u00b0\u2032\u2033"; // Unicode variants
d.dmsindicatorsu_ = "\u00b0'\""; // Use degree symbol
d.components_ = ["degrees", "minutes", "seconds"];
d.NONE = 0;
d.LATITUDE = 1;
d.LONGITUDE = 2;
d.AZIMUTH = 3;
d.NUMBER = 4;
d.DEGREE = 0;
d.MINUTE = 1;
d.SECOND = 2;
// return val, ind
d.Decode = function(dms) {
var vals = {};
var errormsg = new String("");
var dmsa = dms;
dmsa = dmsa.replace(/\u00b0/g, 'd');
dmsa = dmsa.replace(/\u00ba/g, 'd');
dmsa = dmsa.replace(/\u2070/g, 'd');
dmsa = dmsa.replace(/\u02da/g, 'd');
dmsa = dmsa.replace(/\u2032/g, '\'');
dmsa = dmsa.replace(/\u00b4/g, '\'');
dmsa = dmsa.replace(/\u2019/g, '\'');
dmsa = dmsa.replace(/\u2033/g, '"');
dmsa = dmsa.replace(/\u201d/g, '"');
dmsa = dmsa.replace(/''/g, '"');
dmsa = dmsa.replace(/^\s+/, "");
dmsa = dmsa.replace(/\s+$/, "");
do { // Executed once (provides the ability to break)
var sign = 1;
var beg = 0, end = dmsa.length;
var ind1 = d.NONE;
var k = -1;
if (end > beg && (k = d.lookup(d.hemispheres_, dmsa.charAt(beg))) >= 0) {
ind1 = (k & 2) ? d.LONGITUDE : d.LATITUDE;
sign = (k & 1) ? 1 : -1;
++beg;
}
if (end > beg &&
(k = d.lookup(d.hemispheres_, dmsa.charAt(end-1))) >= 0) {
if (k >= 0) {
if (ind1 != d.NONE) {
if (dmsa.charAt(beg - 1).toUpperCase() ==
dmsa.charAt(end - 1).toUpperCase())
errormsg = "Repeated hemisphere indicators " +
dmsa.charAt(beg - 1) + " in " +
dmsa.substr(beg - 1, end - beg + 1);
else
errormsg = "Contradictory hemisphere indicators " +
dmsa.charAt(beg - 1) + " and " + dmsa.charAt(end - 1) + " in " +
dmsa.substr(beg - 1, end - beg + 1);
break;
}
ind1 = (k & 2) ? d.LONGITUDE : d.LATITUDE;
sign = (k & 1) ? 1 : -1;
--end;
}
}
if (end > beg && (k = d.lookup(d.signs_, dmsa.charAt(beg))) >= 0) {
if (k >= 0) {
sign *= k ? 1 : -1;
++beg;
}
}
if (end == beg) {
errormsg = "Empty or incomplete DMS string " + dmsa;
break;
}
var ipieces = [0, 0, 0];
var fpieces = [0, 0, 0];
var npiece = 0;
var icurrent = 0;
var fcurrent = 0;
var ncurrent = 0, p = beg;
var pointseen = false;
var digcount = 0;
var intcount = 0;
while (p < end) {
var x = dmsa.charAt(p++);
if ((k = d.lookup(d.digits_, x)) >= 0) {
++ncurrent;
if (digcount > 0)
++digcount; // Count of decimal digits
else {
icurrent = 10 * icurrent + k;
++intcount;
}
} else if (x == '.') {
if (pointseen) {
errormsg = "Multiple decimal points in "
+ dmsa.substr(beg, end - beg);
break;
}
pointseen = true;
digcount = 1;
} else if ((k = d.lookup(d.dmsindicators_, x)) >= 0) {
if (k >= 3) {
if (p == end) {
errormsg = "Illegal for : to appear at the end of " +
dmsa.substr(beg, end - beg);
break;
}
k = npiece;
}
if (k == npiece - 1) {
errormsg = "Repeated " + d.components_[k] +
" component in " + dmsa.substr(beg, end - beg);
break;
} else if (k < npiece) {
errormsg = d.components_[k] + " component follows "
+ d.components_[npiece - 1] + " component in "
+ dmsa.substr(beg, end - beg);
break;
}
if (ncurrent == 0) {
errormsg = "Missing numbers in " + d.components_[k] +
" component of " + dmsa.substr(beg, end - beg);
break;
}
if (digcount > 1) {
fcurrent = parseFloat(dmsa.substr(p - intcount - digcount - 1,
intcount + digcount));
icurrent = 0;
}
ipieces[k] = icurrent;
fpieces[k] = icurrent + fcurrent;
if (p < end) {
npiece = k + 1;
icurrent = fcurrent = 0;
ncurrent = digcount = intcount = 0;
}
} else if (d.lookup(d.signs_, x) >= 0) {
errormsg = "Internal sign in DMS string "
+ dmsa.substr(beg, end - beg);
break;
} else {
errormsg = "Illegal character " + x + " in DMS string "
+ dmsa.substr(beg, end - beg);
break;
}
}
if (errormsg.length)
break;
if (d.lookup(d.dmsindicators_, dmsa.charAt(p - 1)) < 0) {
if (npiece >= 3) {
errormsg = "Extra text following seconds in DMS string "
+ dmsa.substr(beg, end - beg);
break;
}
if (ncurrent == 0) {
errormsg = "Missing numbers in trailing component of "
+ dmsa.substr(beg, end - beg);
break;
}
if (digcount > 1) {
fcurrent = parseFloat(dmsa.substr(p - intcount - digcount,
intcount + digcount));
icurrent = 0;
}
ipieces[npiece] = icurrent;
fpieces[npiece] = icurrent + fcurrent;
}
if (pointseen && digcount == 0) {
errormsg = "Decimal point in non-terminal component of "
+ dmsa.substr(beg, end - beg);
break;
}
// Note that we accept 59.999999... even though it rounds to 60.
if (ipieces[1] >= 60) {
errormsg = "Minutes " + fpieces[1] + " not in range [0, 60)";
break;
}
if (ipieces[2] >= 60) {
errormsg = "Seconds " + fpieces[2] + " not in range [0, 60)";
break;
}
vals.ind = ind1;
// Assume check on range of result is made by calling routine (which
// might be able to offer a better diagnostic).
vals.val = sign * (fpieces[0] + (fpieces[1] + fpieces[2] / 60) / 60);
return vals;
} while (false);
vals.val = d.NumMatch(dmsa);
if (vals.val == 0)
throw new Error(errormsg);
else
vals.ind = d.NONE;
return vals;
}
d.NumMatch = function(s) {
if (s.length < 3)
return 0;
var t = s.toUpperCase().replace(/0+$/,"");
var sign = t.charAt(0) == '-' ? -1 : 1;
var p0 = t.charAt(0) == '-' || t.charAt(0) == '+' ? 1 : 0;
var p1 = t.length - 1;
if (p1 + 1 < p0 + 3)
return 0;
// Strip off sign and trailing 0s
t = t.substr(p0, p1 + 1 - p0); // Length at least 3
if (t == "NAN" || t == "1.#QNAN" || t == "1.#SNAN" || t == "1.#IND" ||
t == "1.#R")
return sign * Number.NaN;
else if (t == "INF" || t == "1.#INF")
return sign * Number.POSITIVE_INFINITY;
return 0;
}
// return lat, lon
d.DecodeLatLon = function(stra, strb, swaplatlong) {
var vals = {};
if (!swaplatlong) swaplatlong = false;
var valsa = d.Decode(stra);
var valsb = d.Decode(strb);
var a = valsa.val, ia = valsa.ind;
var b = valsb.val, ib = valsb.ind;
if (ia == d.NONE && ib == d.NONE) {
// Default to lat, long unless swaplatlong
ia = swaplatlong ? d.LONGITUDE : d.LATITUDE;
ib = swaplatlong ? d.LATITUDE : d.LONGITUDE;
} else if (ia == d.NONE)
ia = d.LATITUDE + d.LONGITUDE - ib;
else if (ib == d.NONE)
ib = d.LATITUDE + d.LONGITUDE - ia;
if (ia == ib)
throw new Error("Both " + stra + " and "
+ strb + " interpreted as "
+ (ia == d.LATITUDE ? "latitudes" : "longitudes"));
var lat = ia == d.LATITUDE ? a : b, lon = ia == d.LATITUDE ? b : a;
if (Math.abs(lat) > 90)
throw new Error("Latitude " + lat + "d not in [-90d, 90d]");
if (lon < -540 || lon >= 540)
throw new Error("Latitude " + lon + "d not in [-540d, 540d)");
lon = m.AngNormalize(lon);
vals.lat = lat;
vals.lon = lon;
return vals;
}
d.DecodeAngle = function(angstr) {
var vals = d.Decode(angstr);
var ang = vals.val, ind = vals.ind;
if (ind != d.NONE)
throw new Error("Arc angle " + angstr
+ " includes a hemisphere, N/E/W/S");
return ang;
}
d.DecodeAzimuth = function(azistr) {
var vals = d.Decode(azistr);
var azi = vals.val, ind = vals.ind;
if (ind == d.LATITUDE)
throw new Error("Azimuth " + azistr
+ " has a latitude hemisphere, N/S");
if (azi < -540 || azi >= 540)
throw new Error("Azimuth " + azistr + " not in range [-540d, 540d)");
azi = m.AngNormalize(azi);
return azi;
}
d.Encode = function(angle, trailing, prec, ind) {
// Assume check on range of input angle has been made by calling
// routine (which might be able to offer a better diagnostic).
if (!ind) ind = d.NONE;
if (!isFinite(angle))
return angle < 0 ? String("-inf") :
(angle > 0 ? String("inf") : String("nan"));
// 15 - 2 * trailing = ceiling(log10(2^53/90/60^trailing)).
// This suffices to give full real precision for numbers in [-90,90]
prec = Math.min(15 - 2 * trailing, prec);
var scale = 1, i;
for (i = 0; i < trailing; ++i)
scale *= 60;
for (i = 0; i < prec; ++i)
scale *= 10;
if (ind == d.AZIMUTH)
angle -= Math.floor(angle/360) * 360;
var sign = angle < 0 ? -1 : 1;
angle *= sign;
// Break off integer part to preserve precision in manipulation of
// fractional part.
var
idegree = Math.floor(angle),
fdegree = Math.floor((angle - idegree) * scale + 0.5) / scale;
if (fdegree >= 1) {
idegree += 1;
fdegree -= 1;
}
var pieces = [fdegree, 0, 0];
for (i = 1; i <= trailing; ++i) {
var
ip = Math.floor(pieces[i - 1]),
fp = pieces[i - 1] - ip;
pieces[i] = fp * 60;
pieces[i - 1] = ip;
}
pieces[0] += idegree;
var s = new String("");
if (ind == d.NONE && sign < 0)
s += '-';
switch (trailing) {
case d.DEGREE:
s += d.zerofill(pieces[0].toFixed(prec),
ind == d.NONE ? 0 :
1 + Math.min(ind, 2) + prec + (prec ? 1 : 0)) +
d.dmsindicatorsu_.charAt(0);
break;
default:
s += d.zerofill(pieces[0].toFixed(0),
ind == d.NONE ? 0 : 1 + Math.min(ind, 2)) +
d.dmsindicatorsu_.charAt(0);
switch (trailing) {
case d.MINUTE:
s += d.zerofill(pieces[1].toFixed(prec), 2 + prec + (prec ? 1 : 0)) +
d.dmsindicatorsu_.charAt(1);
break;
case d.SECOND:
s += d.zerofill(pieces[1].toFixed(0), 2) + d.dmsindicatorsu_.charAt(1);
s += d.zerofill(pieces[2].toFixed(prec), 2 + prec + (prec ? 1 : 0)) +
d.dmsindicatorsu_.charAt(2);
break;
default:
break;
}
}
if (ind != d.NONE && ind != d.AZIMUTH)
s += d.hemispheres_.charAt((ind == d.LATITUDE ? 0 : 2) +
(sign < 0 ? 0 : 1));
return s;
}
})();

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More