Skip to content
Snippets Groups Projects
Commit 911efaed authored by Tristan Walter's avatar Tristan Walter
Browse files

install intructions and meta

parent ca8d2164
No related branches found
No related tags found
No related merge requests found
...@@ -17,8 +17,8 @@ fi ...@@ -17,8 +17,8 @@ fi
git submodule update --recursive --init git submodule update --recursive --init
IN_CONDA="" IN_CONDA=$(printenv CONDA_PREFIX_1)
if [ ! $(printenv CONDA_PREFIX_1) ] ]; then if [ ! $IN_CONDA ]; then
IN_CONDA=${CONDA_PREFIX} IN_CONDA=${CONDA_PREFIX}
fi fi
...@@ -45,8 +45,15 @@ if [ "$(uname)" == "Linux" ]; then ...@@ -45,8 +45,15 @@ if [ "$(uname)" == "Linux" ]; then
echo "No g++ compiler found. Please provide it in PATH or as a CXX environment variable." echo "No g++ compiler found. Please provide it in PATH or as a CXX environment variable."
exit 1 exit 1
fi fi
echo "Building GLFW, ZIP, and ZLIB - checking for OpenCV."
if [ ${IN_CONDA} ]; then if [ ${IN_CONDA} ]; then
echo "**************************************"
echo "Using conda environment $CONDA_PREFIX"
echo "If you dont want this, please deactivate the conda environment first."
echo "**************************************"
CC=${CC} CXX=${CXX} PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig cmake .. \ CC=${CC} CXX=${CXX} PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig cmake .. \
-DPYTHON_INCLUDE_DIR:FILEPATH=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \ -DPYTHON_INCLUDE_DIR:FILEPATH=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_LIBRARY:FILEPATH=$(python3 ../find_library.py) \ -DPYTHON_LIBRARY:FILEPATH=$(python3 ../find_library.py) \
...@@ -59,7 +66,16 @@ if [ "$(uname)" == "Linux" ]; then ...@@ -59,7 +66,16 @@ if [ "$(uname)" == "Linux" ]; then
-DCMAKE_PREFIX_PATH="$CONDA_PREFIX;$CONDA_PREFIX/lib/pkgconfig;$CONDA_PREFIX/lib" \ -DCMAKE_PREFIX_PATH="$CONDA_PREFIX;$CONDA_PREFIX/lib/pkgconfig;$CONDA_PREFIX/lib" \
-DWITH_PYLON=ON -DWITH_PYLON=ON
else else
CC=${CC} CXX=${CXX} PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig cmake .. \ echo "**************************************"
echo "Not in a conda environment."
echo "Trying to build everything on my own."
echo "If you wish to use a conda environment, please activate it first."
echo "**************************************"
echo "If you want to specify an FFMPEG path, please set the PKG_CONFIG_PATH environment variable accordingly."
echo ""
CC=${CC} CXX=${CXX} cmake .. \
-DPYTHON_INCLUDE_DIR:FILEPATH=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \ -DPYTHON_INCLUDE_DIR:FILEPATH=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_LIBRARY:FILEPATH=$(python3 ../find_library.py) \ -DPYTHON_LIBRARY:FILEPATH=$(python3 ../find_library.py) \
-DPYTHON_EXECUTABLE:FILEPATH=$(which python3) \ -DPYTHON_EXECUTABLE:FILEPATH=$(which python3) \
...@@ -75,6 +91,7 @@ if [ "$(uname)" == "Linux" ]; then ...@@ -75,6 +91,7 @@ if [ "$(uname)" == "Linux" ]; then
else else
echo "Setting up for macOS." echo "Setting up for macOS."
echo "" echo ""
echo "Building GLFW, ZIP, and ZLIB - checking for OpenCV."
if [ ${IN_CONDA} ]; then if [ ${IN_CONDA} ]; then
echo "**************************************" echo "**************************************"
...@@ -101,7 +118,7 @@ else ...@@ -101,7 +118,7 @@ else
echo "If you wish to use a conda environment, please activate it first." echo "If you wish to use a conda environment, please activate it first."
echo "**************************************" echo "**************************************"
echo "Building GLFW, checking for OpenCV. If you want to specify an FFMPEG path, please set the PKG_CONFIG_PATH environment variable accordingly." echo "If you want to specify an FFMPEG path, please set the PKG_CONFIG_PATH environment variable accordingly."
echo "" echo ""
cmake .. \ cmake .. \
......
...@@ -4,7 +4,7 @@ package: ...@@ -4,7 +4,7 @@ package:
source: source:
git_url: https://github.com/mooch443/trex.git git_url: https://github.com/mooch443/trex.git
git_rev: f20018adcd8ef0de708b74cf89b8e713283904b0 git_rev: ca8d2164473dd208b6fbddf894cc3c6958a8784d
git_depth: 1 git_depth: 1
build: build:
...@@ -74,6 +74,7 @@ requirements: ...@@ -74,6 +74,7 @@ requirements:
- python =3.6 [not win] - python =3.6 [not win]
- glfw [linux] - glfw [linux]
- nomkl [osx] - nomkl [osx]
- xorg-libx11 [linux]
about: about:
home: https://trex.run home: https://trex.run
......
...@@ -12,43 +12,46 @@ Installation ...@@ -12,43 +12,46 @@ Installation
The easy way The easy way
************ ************
|trex| supports all major platforms. There is an easy way to install |trex| using Anaconda, by creating a new virtual environment (here named ``tracking``, which you can replace) -- the down-side is, that it needs to be compiled with fewer optimzations and features than a manually compiled one due to compatibility and licensing issues:: |trex| supports all major platforms. There is an easy way to install |trex| using Anaconda, by creating a new virtual environment (here named ``tracking``, which you can replace)::
conda create -n tracking -c main -c conda-forge -c trexing trex conda create -n tracking -c trexing trex # macOS, Windows
conda create -n tracking -c conda-forge -c trexing trex # Linux
The conda version does not offer support for Basler cameras. If you need to use |grabs| with machine vision cameras, please consider compiling the software yourself -- it has other advantages, too (such as enabling some Metal features on macOS, architecture-specific optimizations and just getting a squeaky clean, new version)! The down-side is that pre-built binaries are compiled with fewer optimzations and features than a manually compiled one (due to compatibility and licensing issues) and thus are slightly slower =(. For example, the conda version does not offer support for Basler cameras. If you need to use |grabs| with machine vision cameras, or need as much speed as possible/the newest version, please consider compiling the software yourself.
Compile it yourself Compile it yourself
******************* *******************
There are two ways to get your own version of |trex|: There are two ways to get your own version of |trex|:
* creating a local conda channel * creating a local conda channel, and installing from there
* running CMake/build manually * running CMake/build manually with customized options
Both are obviously connected (the local conda channel is essentially a script for the manual procedure), but there are differences. For example, the conda build is limited to certain compiler and OS-SDK versions -- which is something that you may want to change in order to enable certain OS features. We start out here by describing the easier way, followed by a description of how to do everything manually. Both are obviously similar in result, but there *are* differences (the local channel is essentially a script for the manual procedure, with some caveats). For example, the conda build is limited to certain compiler and OS-SDK versions -- which is something that you may want to change in order to enable certain optimizations. We start out here by describing the more automated way using conda, followed by a description of how to do everything manually.
Local conda channel Local conda channel
=================== ===================
In order to get your own conda channel, all you need to do is make sure you have Anaconda installed, as well as the ``conda-build`` package. This is a package that allows you to make your own packages from within the base environment (use ``conda deactivate``, until it says ``base`` on the left). It creates a virtual environment, within which it compiles/tests the software you are trying to build. You can install it using:: In order to get your own (local) conda channel, all you need to do is make sure you have Anaconda installed, as well as the ``conda-build`` package. This is a package that allows you to make your own packages from within the base environment (use ``conda deactivate``, until it says ``base`` on the left). It creates a virtual environment, within which it compiles/tests the software you are trying to build. You can install it using::
conda install conda-build conda install conda-build
After that, clone the |trex| repository using:: After that, from within the conda ``base`` environment, clone the |trex| repository using::
git clone --recursive https://github.com/mooch443/trex git clone --recursive https://github.com/mooch443/trex
cd FishTracker/conda cd FishTracker/conda
Now, from within that folder, run:: Now, from within that folder, run::
./build_conda_package.sh ./build_conda_package.bat # Windows
./build_conda_package.sh # Linux, macOS
This runs ``conda build``, which builds the program according to all the settings inside ``meta.yaml`` (for dependencies), using ``build.sh`` (or ``bld.bat`` on Windows) to configure CMake. If you want to enable/disable certain features (e.g. use the OpenCV from within the conda environment, etc.) the build script is the place where you can do that. This runs ``conda build .``, which builds the program according to all the settings inside ``meta.yaml`` (for dependencies), using ``build.sh`` (or ``bld.bat`` on Windows) to configure CMake. If you want to enable/disable certain features (e.g. use the OpenCV from within the conda environment, etc.) the build script, for your OS, is the place where you can do that.
After compilation was successful, |trex| can be installed using:: After compilation was successful, |trex| can be installed using::
conda create -n tracking -c main -c conda-forge -c local trex conda create -n tracking -c local trex # macOS, Windows
conda create -n tracking -c conda-forge -c local trex # Linux
Notice there is a ``-c local``, instead of the ``-c trexing`` from the first section. Notice there is a ``-c local``, instead of the ``-c trexing`` from the first section.
...@@ -71,7 +74,7 @@ As well as the general requirements: ...@@ -71,7 +74,7 @@ As well as the general requirements:
The easiest way to ensure that all requirements are met, is by using conda to create a new environment:: The easiest way to ensure that all requirements are met, is by using conda to create a new environment::
conda create -n tracking -c conda-forge cmake ffmpeg tensorflow=1.13 keras conda create -n tracking cmake ffmpeg tensorflow=1 keras py-opencv
under Linux, you may have to add the ``gtk2`` package as well. under Linux, you may have to add the ``gtk2`` package as well.
...@@ -121,14 +124,6 @@ Now we have to generate the project files for the given platform and compiler. T ...@@ -121,14 +124,6 @@ Now we have to generate the project files for the given platform and compiler. T
conda install -c conda-forge xorg-libxinerama xorg-libxcursor \ conda install -c conda-forge xorg-libxinerama xorg-libxcursor \
xorg-libxi xorg-libxrandr xorg-libxdamage libxxf86vm-cos6-x86_64 \ xorg-libxi xorg-libxrandr xorg-libxdamage libxxf86vm-cos6-x86_64 \
libselinux-cos6-x86_64 mesa-dri-drivers-cos6-x86_64 libselinux-cos6-x86_64 mesa-dri-drivers-cos6-x86_64
..
NOTE::
Under Linux, you might also have to install the OpenGL library and Xorg dependencies -- depending on your platform. For example::
..
conda install mesa-libgl-devel-cos6-x86_64 xorg-libxinerama xorg-libxcursor \
xorg-libxi xorg-libxrandr xorg-libxdamage libxxf86vm-cos6-x86_64 \
libselinux-cos6-x86_64 mesa-dri-drivers-cos6-x86_64
* **macOS**:: * **macOS**::
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment