2019-05-20 06:21:02 -05:00
|
|
|
########## Windows using vcpkg ###################
|
|
|
|
1. Clone VCPKG
|
|
|
|
git clone https://github.com/microsoft/vcpkg.git
|
2019-05-29 03:14:34 -05:00
|
|
|
2. Install VCPKG from within vcpkg folder:
|
2019-05-20 08:11:35 -05:00
|
|
|
.\boostrap-vcpkg.bat
|
2019-05-29 03:14:34 -05:00
|
|
|
3. Install GRPC
|
2019-05-20 06:21:02 -05:00
|
|
|
.\vcpkg install grpc --triplet x64-windows
|
2019-05-29 03:14:34 -05:00
|
|
|
|
|
|
|
4. Python
|
|
|
|
* Install Python 3
|
|
|
|
* Execute the following using Python3
|
|
|
|
python -m pip install grpcio-tools
|
|
|
|
* Make sure the python executable is found by setting -DPYTHON_EXECUTABLE=LOCATION_OF_PYTHON.EXE
|
|
|
|
|
|
|
|
4. Run cmake with the following statements
|
|
|
|
-DRESINSIGHT_ENABLE_GRPC=true
|
|
|
|
-DPYTHON_EXECUTABLE=LOCATION_OF_PYTHON.EXE
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE=LOCATION_OF_VCPKG/scripts/buildsystems/vcpkg.cmake
|
|
|
|
-A x64
|
2019-05-20 06:21:02 -05:00
|
|
|
|
2019-06-09 04:28:30 -05:00
|
|
|
############ Linux as STANDALONE GPRC ###############
|
|
|
|
|
|
|
|
#########################################################################################################
|
|
|
|
# 1. install autotools, autoconf and libtool with your distributions package manager.
|
|
|
|
#
|
|
|
|
# On Centos 6 you will need a newer Python and newer version of GCC than the standard version
|
|
|
|
# ResInsight AND gRPC will build with devtoolset-3+ but apparently devtoolset-3 is now gone
|
|
|
|
# So you will need to install devtoolset-6, devtoolset-7 or devtoolset-8.
|
|
|
|
# It makes sense to install devtoolset-6* (with asterix) to get all the necessary devtoolset packages
|
|
|
|
# You will also need a version of Python 3.5
|
|
|
|
#
|
|
|
|
##########################################################################################################
|
|
|
|
|
2019-06-09 04:35:49 -05:00
|
|
|
sudo yum install autotools autoconf libtool devtoolset-6* rh-python35
|
|
|
|
|
2019-06-09 04:28:30 -05:00
|
|
|
###################################################################
|
|
|
|
# 2. Enable compiler and Python on Centos 6 (on other distributions, this may be different)
|
|
|
|
###################################################################
|
2019-06-09 04:35:49 -05:00
|
|
|
|
2019-06-09 04:28:30 -05:00
|
|
|
scl enable devtoolset-6 rh-python35 bash
|
|
|
|
|
|
|
|
################################################################################################################
|
|
|
|
# 3. Run grpc install script and install to a user-writable directory. I.e, from within the ResInsight folder:
|
|
|
|
# Most of this runs fine without root. But unfortunately grpc currently fails to install the C++ library without root.
|
|
|
|
# So the script is required to be run as root even if the provided folders are writeable by the user
|
|
|
|
# WARNING: As of grpc 1.21.1 a long install directory (/opt/grpc in the example below) may get you into trouble
|
|
|
|
# with this bug: https://github.com/grpc/grpc/issues/14844
|
|
|
|
# A patch is available in the issue, but the easiest thing to do is to ensure a short install path
|
2019-06-11 04:13:56 -05:00
|
|
|
#
|
|
|
|
# NOTE: The shell running build-grpc-linux.sh will need the scl enables listed in the previous step.
|
|
|
|
# This means that if you run the script as root by first doing su and then running without sudo
|
|
|
|
# ... then root will need to run the scl enable commands
|
2019-06-09 04:28:30 -05:00
|
|
|
################################################################################################################
|
|
|
|
|
2019-06-11 04:11:02 -05:00
|
|
|
sudo ./build-grpc-linux.sh /tmp/grpc /opt/grpc
|
2019-06-09 04:28:30 -05:00
|
|
|
|
|
|
|
##############################################################################
|
2019-06-09 04:35:49 -05:00
|
|
|
# Python GRPC module, OPTION 1
|
|
|
|
# 5a. Install grpcio-tools for Python as root user. If you cannot install python packages as root user, see 4b.
|
|
|
|
# NOTE: IF THIS FAILS WITH AN ERROR MESSAGE FROM PIP ABOUT
|
|
|
|
# "YOU SHOULD CONSIDER UPGRADING VIA 'python -m pip install --upgrade pip'"
|
|
|
|
# Then performing this should fix the problem.
|
2019-06-09 04:28:30 -05:00
|
|
|
##############################################################################
|
|
|
|
|
2019-06-09 04:35:49 -05:00
|
|
|
sudo python -m pip install grpcio-tools
|
2019-05-20 06:21:02 -05:00
|
|
|
|
2019-06-09 04:35:49 -05:00
|
|
|
##############################################################################
|
|
|
|
# Python GRPC module, OPTION 2
|
|
|
|
# 5b. Install grpcio-tools for Python as regular user.
|
|
|
|
# NOTE: IF THIS FAILS WITH AN ERROR MESSAGE FROM PIP ABOUT
|
|
|
|
# "YOU SHOULD CONSIDER UPGRADING VIA 'python -m pip install --upgrade pip'"
|
|
|
|
# Then performing this should fix the problem.
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
python -m pip install --user grpcio-tools
|
|
|
|
|
|
|
|
|
|
|
|
#################################################################################
|
|
|
|
# 6. Run cmake making sure of the following:
|
|
|
|
# * GRPC_INSTALL_PREFIX is set to the Grpc install folder,
|
|
|
|
# * PYTHON_EXECUTABLE set to a good python 3
|
|
|
|
# * RESINSIGHT_ENABLE_GRPC = true
|
|
|
|
################################
|
|
|
|
See regular build instructions for the rest
|