|
| 1 | +<# |
| 2 | +Originally based on script written by Pebaz (https://github.com/Pebaz/python-fcl/blob/master/requirements/build_win32.ps1) |
| 3 | +but with many modification in order to use fcl 0.6.1 and install dependencies without admin rights. |
| 4 | +
|
| 5 | +This script builds fcl and it's dependencies for python-fcl on Windows. |
| 6 | +
|
| 7 | +It downloads, builds, installs: |
| 8 | + * fcl |
| 9 | + * libccd |
| 10 | + * eigen |
| 11 | + * octomap |
| 12 | +#> |
| 13 | + |
| 14 | +# Remember starting location for future usage |
| 15 | +$base_dir = Get-Location |
| 16 | + |
| 17 | +# Create a directory that encapsulates all dependencies |
| 18 | +mkdir -p deps; Set-Location deps |
| 19 | + |
| 20 | +# Build options |
| 21 | +$generator = "Visual Studio 16 2019" |
| 22 | + |
| 23 | +# All compiled depencies will be install in following folder |
| 24 | +$install_dir = "$base_dir\deps\install" |
| 25 | + |
| 26 | + |
| 27 | +#------------------------------------------------------------------------------ |
| 28 | +# Eigen |
| 29 | +Write-Host "Building Eigen" |
| 30 | +$eigen_ver = "3.3.9" |
| 31 | +Invoke-WebRequest -Uri https://gitlab.com/libeigen/eigen/-/archive/$eigen_ver/eigen-$eigen_ver.tar.gz -Outfile eigen-$eigen_ver.tar.gz |
| 32 | +tar -zxf "eigen-$eigen_ver.tar.gz" |
| 33 | +Set-Location "eigen-$eigen_ver" |
| 34 | + |
| 35 | +cmake -B build ` |
| 36 | + -D CMAKE_BUILD_TYPE=Release ` |
| 37 | + -G $generator ` |
| 38 | + -D BUILD_SHARED_LIBS=ON ` |
| 39 | + -D CMAKE_INSTALL_PREFIX=$install_dir |
| 40 | +cmake --install build |
| 41 | + |
| 42 | +Set-Location .. |
| 43 | + |
| 44 | + |
| 45 | +# ------------------------------------------------------------------------------ |
| 46 | +# LibCCD |
| 47 | +Write-Host "Building LibCCD" |
| 48 | +git clone --depth 1 --branch v2.1 https://github.com/danfis/libccd |
| 49 | +Set-Location libccd |
| 50 | + |
| 51 | +cmake -B build ` |
| 52 | + -D CMAKE_BUILD_TYPE=Release ` |
| 53 | + -G $generator ` |
| 54 | + -D BUILD_SHARED_LIBS=ON ` |
| 55 | + -D CMAKE_INSTALL_PREFIX=$install_dir |
| 56 | +cmake --build build --config Release --target install |
| 57 | + |
| 58 | +Set-Location .. |
| 59 | + |
| 60 | + |
| 61 | +# ------------------------------------------------------------------------------ |
| 62 | +# Octomap |
| 63 | +Write-Host "Building Octomap" |
| 64 | +git clone --depth 1 --branch v1.8.0 https://github.com/OctoMap/octomap |
| 65 | +Set-Location octomap |
| 66 | + |
| 67 | +cmake -B build ` |
| 68 | + -D CMAKE_PREFIX_PATH=$install_dir ` |
| 69 | + -D CMAKE_BUILD_TYPE=Release ` |
| 70 | + -G $generator ` |
| 71 | + -D BUILD_SHARED_LIBS=ON ` |
| 72 | + -D CMAKE_INSTALL_PREFIX=$install_dir ` |
| 73 | + -D BUILD_OCTOVIS_SUBPROJECT=OFF ` |
| 74 | + -D BUILD_DYNAMICETD3D_SUBPROJECT=OFF |
| 75 | +cmake --build build --config Release |
| 76 | +cmake --build build --config Release --target install |
| 77 | + |
| 78 | +Set-Location .. |
| 79 | + |
| 80 | +# ------------------------------------------------------------------------------ |
| 81 | +# FCL |
| 82 | +Write-Host "Building FCL" |
| 83 | +git clone --depth 1 --branch v0.6.1 https://github.com/flexible-collision-library/fcl |
| 84 | +Set-Location fcl |
| 85 | + |
| 86 | +cmake -B build ` |
| 87 | + -D CMAKE_PREFIX_PATH=$install_dir ` |
| 88 | + -D CMAKE_BUILD_TYPE=Release ` |
| 89 | + -G $generator ` |
| 90 | + -D CMAKE_INSTALL_PREFIX=$install_dir |
| 91 | + |
| 92 | +cmake --build build --config Release --target install |
| 93 | +Set-Location .. |
| 94 | + |
| 95 | +# ------------------------------------------------------------------------------ |
| 96 | +# Python-FCL |
| 97 | + |
| 98 | +Write-Host "Copying dependent DLLs" |
| 99 | +Copy-Item $install_dir\bin\octomap.dll $base_dir\src\fcl |
| 100 | +Copy-Item $install_dir\bin\octomath.dll $base_dir\src\fcl |
| 101 | +Copy-Item $install_dir\bin\ccd.dll $base_dir\src\fcl |
| 102 | + |
| 103 | +Set-Location $base_dir |
| 104 | +Write-Host "All done!" |
0 commit comments