Skip to content

Commit 461ff96

Browse files
committed
Merge branch 'develop' of github.com:borglab/gtsam into amg/sim3
2 parents 8f17b5c + 952ce5e commit 461ff96

File tree

143 files changed

+18285
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+18285
-149
lines changed

.github/scripts/python.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,21 @@ function build()
6565
# Set to 2 cores so that Actions does not error out during resource provisioning.
6666
cmake --build build -j2
6767

68-
$PYTHON -m pip install --user build/python
68+
cmake --build build --target python-install
6969
}
7070

7171
function test()
7272
{
7373
cd $GITHUB_WORKSPACE/python/gtsam/tests
7474
$PYTHON -m unittest discover -v
7575
cd $GITHUB_WORKSPACE
76+
77+
cd $GITHUB_WORKSPACE/python/gtsam_unstable/tests
78+
$PYTHON -m unittest discover -v
79+
cd $GITHUB_WORKSPACE
80+
81+
# cmake --build build --target python-test
82+
# cmake --build build --target python-test-unstable
7683
}
7784

7885
# select between build or test

.github/workflows/build-python.yml

+48-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
CTEST_PARALLEL_LEVEL: 2
1919
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
2020
PYTHON_VERSION: ${{ matrix.python_version }}
21+
BOOST_VERSION: 1.72.0
22+
BOOST_EXE: boost_1_72_0-msvc-14.2
2123

2224
strategy:
2325
fail-fast: true
@@ -30,6 +32,7 @@ jobs:
3032
ubuntu-20.04-gcc-9-tbb,
3133
ubuntu-20.04-clang-9,
3234
macOS-11-xcode-13.4.1,
35+
windows-2019-msbuild,
3336
]
3437

3538
build_type: [Release]
@@ -56,6 +59,10 @@ jobs:
5659
compiler: xcode
5760
version: "13.4.1"
5861

62+
- name: windows-2019-msbuild
63+
os: windows-2019
64+
platform: 64
65+
5966
steps:
6067
- name: Checkout
6168
uses: actions/checkout@v3
@@ -97,29 +104,68 @@ jobs:
97104
echo "CC=clang" >> $GITHUB_ENV
98105
echo "CXX=clang++" >> $GITHUB_ENV
99106
107+
- name: Setup msbuild (Windows)
108+
if: runner.os == 'Windows'
109+
uses: ilammy/msvc-dev-cmd@v1
110+
with:
111+
arch: x${{matrix.platform}}
112+
113+
- name: Setup python (Windows)
114+
uses: actions/setup-python@v4
115+
if: runner.os == 'Windows'
116+
with:
117+
python-version: ${{ matrix.python_version }}
118+
119+
- name: Install ninja (Windows)
120+
if: runner.os == 'Windows'
121+
shell: bash
122+
run: |
123+
choco install ninja
124+
ninja --version
125+
where ninja
126+
127+
- name: Install Boost (Windows)
128+
if: runner.os == 'Windows'
129+
shell: powershell
130+
run: |
131+
# Snippet from: https://github.com/actions/virtual-environments/issues/2667
132+
$BOOST_PATH = "C:\hostedtoolcache\windows\Boost\$env:BOOST_VERSION\x86_64"
133+
134+
# Use the prebuilt binary for Windows
135+
$Url = "https://sourceforge.net/projects/boost/files/boost-binaries/$env:BOOST_VERSION/$env:BOOST_EXE-${{matrix.platform}}.exe"
136+
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost.exe")
137+
Start-Process -Wait -FilePath "$env:TEMP\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=$BOOST_PATH"
138+
139+
# Set the BOOST_ROOT variable
140+
echo "BOOST_ROOT=$BOOST_PATH" >> $env:GITHUB_ENV
141+
100142
- name: Set GTSAM_WITH_TBB Flag
101143
if: matrix.flag == 'tbb'
102144
run: |
103145
echo "GTSAM_WITH_TBB=ON" >> $GITHUB_ENV
104146
echo "GTSAM Uses TBB"
105147
106-
- name: Set Swap Space
148+
- name: Set Swap Space (Linux)
107149
if: runner.os == 'Linux'
108150
uses: pierotofy/set-swap-space@master
109151
with:
110152
swap-size-gb: 6
111153

112-
- name: Install System Dependencies
154+
- name: Install System Dependencies (Linux, macOS)
155+
if: runner.os != 'Windows'
113156
run: |
114157
bash .github/scripts/python.sh -d
115158
116159
- name: Install Python Dependencies
160+
shell: bash
117161
run: python$PYTHON_VERSION -m pip install -r python/dev_requirements.txt
118162

119163
- name: Build
164+
shell: bash
120165
run: |
121166
bash .github/scripts/python.sh -b
122167
123168
- name: Test
169+
shell: bash
124170
run: |
125171
bash .github/scripts/python.sh -t

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ include(cmake/HandleCCache.cmake) # ccache
7272
include(cmake/HandleCPack.cmake) # CPack
7373
include(cmake/HandleEigen.cmake) # Eigen3
7474
include(cmake/HandleMetis.cmake) # metis
75+
include(cmake/HandleCephes.cmake) # cephes
7576
include(cmake/HandleMKL.cmake) # MKL
7677
include(cmake/HandleOpenMP.cmake) # OpenMP
7778
include(cmake/HandlePerfTools.cmake) # Google perftools

cmake/HandleCephes.cmake

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ##############################################################################
2+
# Cephes library
3+
4+
# For both system or bundle version, a cmake target "cephes-gtsam-if" is defined
5+
# (interface library)
6+
7+
8+
add_subdirectory(${GTSAM_SOURCE_DIR}/gtsam/3rdparty/cephes)
9+
10+
list(APPEND GTSAM_EXPORTED_TARGETS cephes-gtsam)
11+
12+
add_library(cephes-gtsam-if INTERFACE)
13+
target_link_libraries(cephes-gtsam-if INTERFACE cephes-gtsam)
14+
15+
list(APPEND GTSAM_EXPORTED_TARGETS cephes-gtsam-if)
16+
install(
17+
TARGETS cephes-gtsam-if
18+
EXPORT GTSAM-exports
19+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

gtsam/3rdparty/cephes/CMakeLists.txt

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
enable_testing()
3+
project(
4+
cephes
5+
DESCRIPTION "Cephes Mathematical Function Library"
6+
VERSION 1.0.0
7+
LANGUAGES C)
8+
9+
set(CEPHES_HEADER_FILES
10+
cephes.h
11+
cephes/dd_idefs.h
12+
cephes/dd_real.h
13+
cephes/dd_real_idefs.h
14+
cephes/expn.h
15+
cephes/igam.h
16+
cephes/lanczos.h
17+
cephes/mconf.h
18+
cephes/polevl.h
19+
cephes/sf_error.h)
20+
21+
# Add header files
22+
install(FILES ${CEPHES_HEADER_FILES} DESTINATION include/gtsam/3rdparty/cephes)
23+
24+
set(CEPHES_SOURCES
25+
cephes/airy.c
26+
cephes/bdtr.c
27+
cephes/besselpoly.c
28+
cephes/beta.c
29+
cephes/btdtr.c
30+
cephes/cbrt.c
31+
cephes/chbevl.c
32+
cephes/chdtr.c
33+
cephes/const.c
34+
cephes/dawsn.c
35+
cephes/dd_real.c
36+
cephes/ellie.c
37+
cephes/ellik.c
38+
cephes/ellpe.c
39+
cephes/ellpj.c
40+
cephes/ellpk.c
41+
cephes/erfinv.c
42+
cephes/exp10.c
43+
cephes/exp2.c
44+
cephes/expn.c
45+
cephes/fdtr.c
46+
cephes/fresnl.c
47+
cephes/gamma.c
48+
cephes/gammasgn.c
49+
cephes/gdtr.c
50+
cephes/hyp2f1.c
51+
cephes/hyperg.c
52+
cephes/i0.c
53+
cephes/i1.c
54+
cephes/igam.c
55+
cephes/igami.c
56+
cephes/incbet.c
57+
cephes/incbi.c
58+
cephes/j0.c
59+
cephes/j1.c
60+
cephes/jv.c
61+
cephes/k0.c
62+
cephes/k1.c
63+
cephes/kn.c
64+
cephes/kolmogorov.c
65+
cephes/lanczos.c
66+
cephes/nbdtr.c
67+
cephes/ndtr.c
68+
cephes/ndtri.c
69+
cephes/owens_t.c
70+
cephes/pdtr.c
71+
cephes/poch.c
72+
cephes/psi.c
73+
cephes/rgamma.c
74+
cephes/round.c
75+
cephes/sf_error.c
76+
cephes/shichi.c
77+
cephes/sici.c
78+
cephes/sindg.c
79+
cephes/sinpi.c
80+
cephes/spence.c
81+
cephes/stdtr.c
82+
cephes/tandg.c
83+
cephes/tukey.c
84+
cephes/unity.c
85+
cephes/yn.c
86+
cephes/yv.c
87+
cephes/zeta.c
88+
cephes/zetac.c)
89+
90+
# Add library source files
91+
add_library(cephes-gtsam SHARED ${CEPHES_SOURCES})
92+
93+
# Add include directory (aka headers)
94+
target_include_directories(
95+
cephes-gtsam BEFORE PUBLIC $<INSTALL_INTERFACE:include/gtsam/3rdparty/cephes/>
96+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
97+
98+
set_target_properties(
99+
cephes-gtsam
100+
PROPERTIES VERSION ${PROJECT_VERSION}
101+
SOVERSION ${PROJECT_VERSION_MAJOR}
102+
C_STANDARD 99)
103+
104+
if(WIN32)
105+
set_target_properties(
106+
cephes-gtsam
107+
PROPERTIES PREFIX ""
108+
COMPILE_FLAGS /w
109+
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/../../../bin")
110+
endif()
111+
112+
if(APPLE)
113+
set_target_properties(cephes-gtsam PROPERTIES INSTALL_NAME_DIR
114+
"${CMAKE_INSTALL_PREFIX}/lib")
115+
endif()
116+
117+
install(
118+
TARGETS cephes-gtsam
119+
EXPORT GTSAM-exports
120+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
121+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
122+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

gtsam/3rdparty/cephes/LICENSE.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
MIT License
2+
3+
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:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
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.

gtsam/3rdparty/cephes/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# README
2+
3+
This is a vendored version of the Cephes Mathematical Library. The source code can be found on [netlib.org](https://www.netlib.org/cephes/).
4+
5+
The software is provided with an [MIT License](https://smath.com/en-US/view/CephesMathLibrary/license).
6+
7+
## Original Readme
8+
9+
Some software in this archive may be from the book _Methods and
10+
Programs for Mathematical Functions_ (Prentice-Hall or Simon & Schuster
11+
International, 1989) or from the Cephes Mathematical Library, a
12+
commercial product. In either event, it is copyrighted by the author.
13+
What you see here may be used freely but it comes with no support or
14+
guarantee.
15+
16+
The two known misprints in the book are repaired here in the
17+
source listings for the gamma function and the incomplete beta
18+
integral.
19+
20+
21+
Stephen L. Moshier
22+

0 commit comments

Comments
 (0)