finishing up FRCSim installer

adds build of gz_msgs on end-user computer
This means we don't need to provide different zips for different
versions of ubuntu.
The problem was that gazebo on 14.04 comes with protobuf 2.5 but gazebo on 15.10 comes with 2.6
added a few other fixes to the install script as well

also fix dependency between simluation publishing and libwpilibcsim
building

Change-Id: I57d5a26ed7795bc61a25402e2986c6023d1d78ac
This commit is contained in:
Peter_Mitrano
2015-12-28 01:50:35 -05:00
parent 17b363f3b4
commit acc7fbbf01
6 changed files with 50 additions and 33 deletions

View File

@@ -5,27 +5,9 @@ include(CheckCXXCompilerFlag)
include (FindPkgConfig) include (FindPkgConfig)
include(GNUInstallDirs) include(GNUInstallDirs)
#copied from GazeboUtils.cmake
macro (APPEND_TO_CACHED_STRING _string _cacheDesc)
FOREACH (newItem ${ARGN})
SET (${_string} "${${_string}} ${newItem}" CACHE INTERNAL ${_cacheDesc} FORCE)
ENDFOREACH (newItem ${ARGN})
endmacro (APPEND_TO_CACHED_STRING)
#check for depenedencies #check for depenedencies
find_package(gazebo REQUIRED) find_package(gazebo REQUIRED)
find_package(Boost COMPONENTS system filesystem REQUIRED) find_package(Boost COMPONENTS system filesystem REQUIRED)
find_package(Protobuf REQUIRED)
if (NOT PROTOBUF_FOUND)
MESSAGE ("Missing: Google Protobuf (libprotobuf-dev)")
endif()
if (NOT PROTOBUF_PROTOC_EXECUTABLE)
MESSAGE ( "Missing: Google Protobuf Compiler (protobuf-compiler)")
endif()
if (NOT PROTOBUF_PROTOC_LIBRARY)
MESSAGE ("Missing: Google Protobuf Compiler Library (libprotoc-dev)")
endif()
#on windows we produce .dlls with no prefix #on windows we produce .dlls with no prefix
if(WIN32) if(WIN32)

View File

@@ -5,7 +5,7 @@ publishing {
publications { publications {
simulation(MavenPublication) { simulation(MavenPublication) {
artifact zip artifact zip
groupId 'simulation' groupId 'edu.wpi.first.wpilib.simulation'
artifactId 'simulation' artifactId 'simulation'
version '1.0.0' version '1.0.0'
} }

View File

@@ -121,7 +121,7 @@ function install-eclipse {
fi fi
tar -xf /tmp/eclipse.tar.gz -C /opt tar -xf /tmp/eclipse.tar.gz -C /opt
ln -s /opt/eclipse/eclipse /usr/bin/eclipse ln -fs /opt/eclipse/eclipse /usr/bin/eclipse
} }
function install-desktops { function install-desktops {
@@ -143,7 +143,7 @@ function install-toolchain {
add-apt-repository ppa:openjdk-r/ppa -y add-apt-repository ppa:openjdk-r/ppa -y
add-apt-repository ppa:ubuntu-toolchain-r/test -y add-apt-repository ppa:ubuntu-toolchain-r/test -y
apt-get update apt-get update
apt-get install libprotoc-dev libprotobuf-dev protobuf-compiler g++-4.9 openjdk-8-jdk -y apt-get install cmake libprotoc-dev libprotobuf-dev protobuf-compiler g++-4.9 openjdk-8-jdk -y
ln -fs /usr/bin/g++-4.9 /usr/bin/g++ ln -fs /usr/bin/g++-4.9 /usr/bin/g++
} }
@@ -154,7 +154,9 @@ function install-models {
install-fail install-fail
fi fi
unzip /tmp/models.zip -d ~/wpilib/simulation unzip /tmp/models.zip -d /tmp
mv /tmp/frcsim-gazebo-models/models ~/wpilib/simulation/models
mv /tmp/frcsim-gazebo-models/worlds ~/wpilib/simulation/worlds
} }
function install-frcsim { function install-frcsim {
@@ -196,6 +198,8 @@ function install-frcsim {
install-desktops install-desktops
install-models install-models
sudo chown -R $USER:$USER ~/wpilib
# Done # Done
echo "Installation Finished!!" echo "Installation Finished!!"
} }

View File

@@ -1,6 +1,25 @@
cmake_minimum_required(VERSION 2.8) Cmake_minimum_required(VERSION 2.8)
project(gz_msgs) project(gz_msgs)
#copied from GazeboUtils.cmake
macro (APPEND_TO_CACHED_STRING _string _cacheDesc)
FOREACH (newItem ${ARGN})
SET (${_string} "${${_string}} ${newItem}" CACHE INTERNAL ${_cacheDesc} FORCE)
ENDFOREACH (newItem ${ARGN})
endmacro (APPEND_TO_CACHED_STRING)
find_package(Protobuf REQUIRED)
if (NOT PROTOBUF_FOUND)
MESSAGE ("Missing: Google Protobuf (libprotobuf-dev)")
endif()
if (NOT PROTOBUF_PROTOC_EXECUTABLE)
MESSAGE ( "Missing: Google Protobuf Compiler (protobuf-compiler)")
endif()
if (NOT PROTOBUF_PROTOC_LIBRARY)
MESSAGE ("Missing: Google Protobuf Compiler Library (libprotoc-dev)")
endif()
#list all proto files used #list all proto files used
get_filename_component(PROTO_DIR src/main/proto ABSOLUTE) get_filename_component(PROTO_DIR src/main/proto ABSOLUTE)
set(msgs set(msgs
@@ -62,10 +81,9 @@ else()
endif() endif()
target_link_libraries(${PROJECT_NAME} ${PROTOBUF_LIBRARIES}) target_link_libraries(${PROJECT_NAME} ${PROTOBUF_LIBRARIES})
set_target_properties(${PROJECT_NAME} set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ENV{HOME}/wpilib/simulation/lib")
PROPERTIES
INSTALL_RPATH "${ENV_HOME}/wpilib/simulation/lib"
LIBRARY_OUTPUT_DIRECTORY ${SIMULATION_INSTALL_DIR}/lib)
file(COPY "${GZ_MSGS_INCLUDE_DIR}/simulation" install(TARGETS ${PROJECT_NAME}
DESTINATION "${CMAKE_BINARY_DIR}/install/simulation/include") DESTINATION "$ENV{HOME}/wpilib/simulation/lib")
install(DIRECTORY "${GZ_MSGS_INCLUDE_DIR}/simulation"
DESTINATION "$ENV{HOME}/wpilib/simulation/include")

View File

@@ -1,6 +1,19 @@
Building gz_msgs Building gz_msgs
================ ================
Currently uses cmake. gz_msgs currently uses cmake, is built on the end-users computer.
This is build as a part of the whole cmake project. This allows us to support various versions of protobuf (2.5 on Ubuntu 14.04, 2.6 on Ubuntu 15.10)
see top level building.md for detail
To build, run the following commands in the ~/wpilib/simulation/gz_msgs directory.
If that directory doesn't exist, it means you haven't installed correctly.
If you're a developer for wpilib, you will need to unzip the simulation.zip file you published into ~/releases.
If you are a student using FRCSim, you should have downloaded that zip when you installed frcsim.
mkdir build
cd build
cmake ..
make
make install
If you are installing FRCSim with the script, then this *should* have be done for you.

View File

@@ -67,7 +67,7 @@ task allcsim(dependsOn: [wpilibcSim, gz_msgs, frc_gazebo_plugins]){
group = 'WPILib Simulation' group = 'WPILib Simulation'
} }
task wpilibcSimCopy(type: Copy) { task wpilibcSimCopy(type: Copy, dependsOn: allcsim) {
description = 'copy headers and ntcore library to make simulation zip' description = 'copy headers and ntcore library to make simulation zip'
group = 'WPILib Simulation' group = 'WPILib Simulation'
into "$simulationInstallDir" into "$simulationInstallDir"