diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml new file mode 100644 index 00000000..56204d7e --- /dev/null +++ b/.github/workflows/conda.yml @@ -0,0 +1,81 @@ +name: Conda + +on: + push: + branches: + - master + - 'dev**' + pull_request: + release: + types: + - released + +jobs: + conda-win: + runs-on: windows-2019 + defaults: + run: + shell: powershell + steps: + - uses: actions/checkout@v3 + with: + path: workspace/src/trajopt + - name: install-depends + shell: cmd + run: | + python -m pip install vcstool -q + - name: vcs import + run: > + vcs import --input "${{ github.workspace }}/workspace/src/trajopt/.github/workflows/windows_dependencies.repos" workspace/src/ + - uses: conda-incubator/setup-miniconda@v3 + with: + channel-priority: strict + environment-file: workspace/src/trajopt/.github/workflows/conda/environment.yml + use-mamba: true + auto-update-conda: true + activate-environment: tesseract-build + - name: build and test + run: | + conda info + conda list + mkdir conda + xcopy /E workspace\src\trajopt\.github\workflows\conda conda + cd conda + New-Item -Name conda-forge.yml -ItemType File + conda smithy regenerate + + conda mambabuild -m .ci_support/win_64_.yaml . + + conda-linux: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -el {0} + steps: + - uses: actions/checkout@v3 + with: + path: workspace/src/trajopt + - name: install-depends + run: | + python -m pip install vcstool -q + - name: vcs import + run: > + vcs import --input "${{ github.workspace }}/workspace/src/trajopt/.github/workflows/windows_dependencies.repos" workspace/src/ + - uses: conda-incubator/setup-miniconda@v3 + with: + channel-priority: strict + environment-file: workspace/src/trajopt/.github/workflows/conda/environment.yml + use-mamba: true + auto-update-conda: true + activate-environment: tesseract-build + - name: build and test + run: | + conda info + conda list + + cp -r workspace/src/trajopt/.github/workflows/conda ./conda + cd conda + touch conda-forge.yml + conda smithy regenerate + + conda mambabuild -m .ci_support/linux_64_.yaml . diff --git a/.github/workflows/conda/environment.yml b/.github/workflows/conda/environment.yml new file mode 100644 index 00000000..909dc29d --- /dev/null +++ b/.github/workflows/conda/environment.yml @@ -0,0 +1,6 @@ +name: tesseract-build +channels: + - conda-forge +dependencies: + - boa + - conda-smithy \ No newline at end of file diff --git a/.github/workflows/conda/recipe/activate.bat b/.github/workflows/conda/recipe/activate.bat new file mode 100644 index 00000000..0e01a3a5 --- /dev/null +++ b/.github/workflows/conda/recipe/activate.bat @@ -0,0 +1,5 @@ +@if not defined CONDA_PREFIX goto:eof + +@call "%CONDA_PREFIX%\opt\tesseract_robotics\setup.bat" + +@set TESSERACT_PYTHON_DLL_PATH=%CONDA_PREFIX%\opt\tesseract_robotics\bin \ No newline at end of file diff --git a/.github/workflows/conda/recipe/activate.sh b/.github/workflows/conda/recipe/activate.sh new file mode 100644 index 00000000..b4f02422 --- /dev/null +++ b/.github/workflows/conda/recipe/activate.sh @@ -0,0 +1 @@ +source "${CONDA_PREFIX}/opt/tesseract_robotics/setup.sh" \ No newline at end of file diff --git a/.github/workflows/conda/recipe/bld.bat b/.github/workflows/conda/recipe/bld.bat new file mode 100644 index 00000000..1ca24598 --- /dev/null +++ b/.github/workflows/conda/recipe/bld.bat @@ -0,0 +1,45 @@ +set CXXFLAGS=%CXXFLAGS% -DEIGEN_DONT_ALIGN=1 -DEIGEN_DONT_VECTORIZE=1 +set CXXFLAGS=%CXXFLAGS% /std:c++17 + +colcon build --merge-install --install-base="%PREFIX%\opt\tesseract_robotics" ^ + --event-handlers console_cohesion+ desktop_notification- status- terminal_title- ^ + --packages-ignore gtest osqp osqp_eigen tesseract_examples trajopt_ifopt trajopt_sqp ^ + --cmake-args -GNinja -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="/MD /O2 /Ob0 /Zi /DNDEBUG" ^ + -DCMAKE_RELWITHDEBINFO_POSTFIX="" ^ + -DBUILD_SHARED_LIBS=ON ^ + -DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON ^ + -DBUILD_IPOPT=OFF ^ + -DBUILD_SNOPT=OFF ^ + -DCMAKE_PREFIX_PATH:PATH="%LIBRARY_PREFIX%" ^ + -DTESSERACT_ENABLE_CLANG_TIDY=OFF ^ + -DTESSERACT_ENABLE_CODE_COVERAGE=OFF ^ + -DPYTHON_EXECUTABLE="%PREFIX%\python.exe" ^ + -DTESSERACT_ENABLE_EXAMPLES=OFF ^ + -DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF ^ + -DTESSERACT_ENABLE_TESTING=OFF ^ + -DTRAJOPT_ENABLE_TESTING=ON + +if %errorlevel% neq 0 exit /b %errorlevel% + +set TESSERACT_RESOURCE_PATH=%PREFIX%\opt\tesseract_robotics\share + +colcon test --event-handlers console_direct+ desktop_notification- status- terminal_title- ^ + --return-code-on-test-failure ^ + --packages-ignore gtest osqp osqp_eigen tesseract_examples trajopt_ifopt trajopt_sqp tesseract_common ^ + tesseract_collision tesseract_environment tesseract_geometry tesseract_kinematics tesseract_scene_graph ^ + tesseract_srdf tesseract_state_solver tesseract_support tesseract_urdf tesseract_visualization ^ + --merge-install --install-base="%PREFIX%\opt\tesseract_robotics" + +if %errorlevel% neq 0 exit /b %errorlevel% + +setlocal EnableDelayedExpansion + +:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d. +:: This will allow them to be run on environment activation. +for %%F in (activate deactivate) DO ( + if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d + copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat +) + +if %errorlevel% neq 0 exit /b %errorlevel% \ No newline at end of file diff --git a/.github/workflows/conda/recipe/build.sh b/.github/workflows/conda/recipe/build.sh new file mode 100644 index 00000000..28dbdc0d --- /dev/null +++ b/.github/workflows/conda/recipe/build.sh @@ -0,0 +1,33 @@ +set -e + +ln -s $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-gcc $BUILD_PREFIX/bin/gcc + +colcon build --merge-install --install-base="$PREFIX/opt/tesseract_robotics" \ + --event-handlers console_cohesion+ \ + --packages-ignore gtest osqp osqp_eigen tesseract_examples trajopt_ifopt trajopt_sqp \ + --cmake-args -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_IPOPT=OFF \ + -DBUILD_SNOPT=OFF \ + -DCMAKE_PREFIX_PATH:PATH="$PREFIX" \ + -DTESSERACT_ENABLE_CLANG_TIDY=OFF \ + -DTESSERACT_ENABLE_CODE_COVERAGE=OFF \ + -DTESSERACT_ENABLE_EXAMPLES=OFF \ + -DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF \ + -DSETUPTOOLS_DEB_LAYOUT=OFF \ + -DTESSERACT_ENABLE_TESTING=ON \ + -DTRAJOPT_ENABLE_TESTING=ON + +export TESSERACT_RESOURCE_PATH="$PREFIX/opt/tesseract_robotics/share" + +colcon test --event-handlers console_direct+ \ + --return-code-on-test-failure \ + --packages-ignore gtest osqp osqp_eigen tesseract_examples trajopt_ifopt trajopt_sqp tesseract_common \ + --merge-install --install-base="$PREFIX/opt/tesseract_robotics" + + +for CHANGE in "activate" "deactivate" +do + mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d" + cp "${RECIPE_DIR}/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh" +done \ No newline at end of file diff --git a/.github/workflows/conda/recipe/deactivate.bat b/.github/workflows/conda/recipe/deactivate.bat new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/conda/recipe/deactivate.sh b/.github/workflows/conda/recipe/deactivate.sh new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/conda/recipe/meta.yaml b/.github/workflows/conda/recipe/meta.yaml new file mode 100644 index 00000000..e357739b --- /dev/null +++ b/.github/workflows/conda/recipe/meta.yaml @@ -0,0 +1,77 @@ +package: + name: trajopt + version: "0.1.0" + +source: + path: ../../workspace + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - gtest + - gmock + - cmake + - ninja # [win] + - make # [linux] + - pkg-config + - colcon-common-extensions + - lcov + - {{ cdt('mesa-libgl-devel') }} # [linux] + - {{ cdt('mesa-dri-drivers') }} # [linux] + - git + host: + - boost-cpp + - eigen + - tinyxml2 + - console_bridge + - assimp + - urdfdom + - fcl + - octomap + - orocos-kdl + - pcl + - gtest + - gmock + - pkg-config + - xz + - flann + - jsoncpp + - yaml-cpp + - bullet-cpp + - xorg-libx11 # [unix] + - xorg-libxext # [unix] + - blas + - osqp + - qpoases + run: + - boost-cpp + - eigen + - tinyxml2 + - console_bridge + - assimp + - urdfdom + - fcl + - octomap + - orocos-kdl + - pcl + - gtest + - gmock + - xz + - jsoncpp + - taskflow + - yaml-cpp + - bullet-cpp + - xorg-libx11 # [unix] + - xorg-libxext # [unix] + - blas + - osqp + - qpoases + +build: + skip: true # [py<37] + number: 0 + +about: + home: https://github.com/ros-industrial-consortium/trajopt + summary: Trajopt motion planner \ No newline at end of file diff --git a/trajopt/test/benchmarks/CMakeLists.txt b/trajopt/test/benchmarks/CMakeLists.txt index cdd50d30..1d2948b8 100644 --- a/trajopt/test/benchmarks/CMakeLists.txt +++ b/trajopt/test/benchmarks/CMakeLists.txt @@ -10,7 +10,7 @@ macro(add_benchmark benchmark_name benchmark_file) target_link_libraries( ${benchmark_name} ${PROJECT_NAME} - osqp::osqpstatic + osqp::osqp benchmark::benchmark) target_include_directories(${benchmark_name} PRIVATE "$") add_dependencies(${benchmark_name} ${PROJECT_NAME}) diff --git a/trajopt_sco/CMakeLists.txt b/trajopt_sco/CMakeLists.txt index 79ccdd19..c8a257cf 100644 --- a/trajopt_sco/CMakeLists.txt +++ b/trajopt_sco/CMakeLists.txt @@ -99,7 +99,7 @@ if(HAVE_BPMPD) HAVE_BPMPD=ON) endif() if(osqp_FOUND) - target_link_libraries(${PROJECT_NAME} PRIVATE osqp::osqpstatic) + target_link_libraries(${PROJECT_NAME} PRIVATE osqp::osqp) target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_OSQP=ON) endif() if(qpOASES_FOUND AND TRAJOPT_BUILD_qpOASES) diff --git a/trajopt_sco/src/bpmpd_interface.cpp b/trajopt_sco/src/bpmpd_interface.cpp index ab48e7f4..c641307c 100644 --- a/trajopt_sco/src/bpmpd_interface.cpp +++ b/trajopt_sco/src/bpmpd_interface.cpp @@ -1,6 +1,8 @@ #include TRAJOPT_IGNORE_WARNINGS_PUSH #include +#include +#include #include #include #include diff --git a/trajopt_sco/src/solver_interface.cpp b/trajopt_sco/src/solver_interface.cpp index 5574b6c5..def65064 100644 --- a/trajopt_sco/src/solver_interface.cpp +++ b/trajopt_sco/src/solver_interface.cpp @@ -288,6 +288,7 @@ std::vector availableSolvers() Model::Ptr createModel(ModelType model_type, const ModelConfig::ConstPtr& model_config) { + UNUSED(model_config); #ifdef HAVE_GUROBI extern Model::Ptr createGurobiModel(); #endif diff --git a/trajopt_sco/test/CMakeLists.txt b/trajopt_sco/test/CMakeLists.txt index 3584393a..8ef01711 100644 --- a/trajopt_sco/test/CMakeLists.txt +++ b/trajopt_sco/test/CMakeLists.txt @@ -46,7 +46,7 @@ target_link_libraries( GTest::Main ${PROJECT_NAME}) if(osqp_FOUND) - target_link_libraries(${PROJECT_NAME}-test osqp::osqpstatic) + target_link_libraries(${PROJECT_NAME}-test osqp::osqp) endif() target_compile_options(${PROJECT_NAME}-test PRIVATE ${TRAJOPT_COMPILE_OPTIONS_PRIVATE} ${TRAJOPT_COMPILE_OPTIONS_PUBLIC})