Commit 5bcf3d88 authored by Aitor Henry's avatar Aitor Henry Committed by Sebastien Petitdemange

added some options for windows install script.

parent 8a3c705a
The LIMA team (lima@esrf.fr)
The LIMA team, ESRF, Grenoble, France
---------------------------------------
Alejandro Homs Puron
Sebastien Petitdemange
Laurent Claustre
Roberto Homs-Regojo
Emmanuel Papillon
Tiago Coutinho
Aitor Henry
Cyril Guilloud
Yves Watier
Assen Kirov
Contributors
-------------
Florent Langlois, SOLEIL Synchrotron, Paris, France
Arafat Noureddine, SOLEIL Synchrotron, Paris, France
Serge Cohen, SOLEIL Synchrotron, Paris, France
Maria-Teresa Nunez Pardo de Vera, DESY laboratory, Hambourg, Germany
Geoff Mant, STFC Daresbury Laboratory, Warrington, UK
Jordi Andreu, ALBA Synchrotron, Barcelona, Spain
Andrea Parenti, European XFEL, Hamburg, Germany
Alexander Lenz, MLZ, Germany
Andreas Persson, MAXLAB Laboratory, Lund, Sweden
Sebastien Gara, Nexeya, France
Justin Anderson, Rayonix L.L.C, Evanston, Illinois, USA
Julien Cristau, Logilab, France
Philippe Pepiot, Logilab, France
Yann Voté, Cristau, Logilab, France
Sebastien Petitdemange (ESRF)
Alejandro Homs Puron (ESRF)
Emmanuel Papillon (ESRF)
Laurent Claustre (ESRF)
Assen Kirov (ESRF)
Florent Langlois (SOLEIL)
Arafat Noureddine (SOLEIL)
###########################################################################
This file is part of LImA, a Library for Image Acquisition
Copyright (C) : 2009-2014
European Synchrotron Radiation Facility
BP 220, Grenoble 38043
FRANCE
This is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>.
###########################################################################
For compilation, installation and other instructions please refer to the
online documentation at:
http://lima.blissgarden.org
Or download the pdf documentation at:
http://lima.blissgarden.org/latex/Lima.pdf
---------------------
Lima Team
mailto: lima@esrf.fr
---------------------
.. image:: http://lima.blissgarden.org/_static/lima-logo-2-40perc.png
Library for Image Acquisition
Description
-----------
Lima ( **L** ibrary for **Im** age **A** cquisition) is a project for the unified control of 2D detectors. The aim is to clearly separate hardware specific code from common software configuration and features, like setting standard acquisition parameters (exposure time, external trigger), file saving and image processing.
Lima is a C++ library which can be used for many different cameras. The library is also available for Python_ and it provides a PyTango_ server for remote control.
Documentation: http://lima.blissgarden.org
Requirements
------------
Lima_ is compatible with python 2 and 3
Build dependencies:
- gcc
- cmake_ >= 3
- gsl_
Python dependencies:
- numpy_ >= 1.1
- sip_ >= 4.2
Optional dependencies:
- tiff_
- libz_
- cbf_
- hdf5_
- ccfits_
- lz4_
Tango_ server dependencies:
- PyTango_
- libtango_
How to build and install
------------------------
Using scripts
``````````````
the **install** script will run cmake, compile and install.
It accepts input arguments (see below) but it also use the configuration file **scripts/config.txt**. Feel free to update this file for setting a permanent configuration for your own installation.
Linux::
[sudo] install.sh
[--git]
[--prefix=<desired installation path>]
[--python-packages=<desired python installation path>]
[options]
Windows::
install.bat
[--git]
[--prefix=<desired installation path>]
[--python-packages=<desired python installation path>]
[options]
The **--git** option will tell the script to clone the required submodules as a prerequisite. Otherwise you should install the submodules with git commands, for instance::
$ git submodule init third-party/Processlib
$ git submodule init camera/basler
$ git submodule init applications/tango/python
$ git submodule update
Options are <camera-name> <saving-format> python pytango-server:
- camera-name::
andor|andor3|basler|prosilica|adsc|mythen3|ueye|xh|xspress3|ultra|
xpad|mythen|pco|marccd|pointgrey|imxpad|dexela|merlin|v4l2|
eiger|pixirad|hexitec|aviex|roperscientific|rayonixhs|espia|maxipix|frelon
- saving-format::
cbf|nxs|fits|edfgz|edflz4|tiff|hdf5
- python: to compile python module
- pytango-server: to install the PyTango_ server
Example::
$ sudo install.sh --git
--prefix=./install
--python-packages=./install/python
tiff basler python pytango-server
Using cmake
`````````````
Install first the project submodules::
$ git submodule init third-party/Processlib
$ git submodule init camera/basler
$ git submodule init applications/tango/python
$ git submodule update
Run cmake in the build directory::
$ mkdir build;
$ cd build/;
$ cmake ..
[-DCMAKE_INSTALL_PREFIX=<desired installation path>]
[-DPYTHON_SITE_PACKAGES_DIR=<desired python installation path>]
-DLIMA_ENABLE_TIFF=true
-DLIMACAMERA_BASLER=true
-DLIMA_ENABLE_PYTANGO_SERVER=true
-DLIMA_ENABLE_TANGO=true
Then compile and install::
$ make
$ sudo make install
Lima Team contact: lima@esrf.fr
.. _Python: http://python.org
.. _Lima: http://lima.blissgarden.org
.. _gsl: https://www.gnu.org/software/gsl
.. _cmake: https://cmake.org
.. _Tango: http://tango-control.org
.. _PyTango: http://github.com/tango-cs/pytango
.. _libtango: http://tango-controls.org/downloads/source
.. _numpy: http://pypi.python.org/pypi/numpy
.. _sip: https://www.riverbankcomputing.com/software/sip
.. _tiff: http://www.libtiff.org/
.. _libz: https://zlib.net/
.. _cbf: http://www.bernstein-plus-sons.com/software/CBF
.. _hdf5: https://support.hdfgroup.org/HDF5
.. _ccfits: https://heasarc.gsfc.nasa.gov/fitsio/ccfits
.. _lz4: https://lz4.github.io/lz4
......@@ -22,55 +22,107 @@ rem You should have received a copy of the GNU General Public License
rem along with this program; if not, see <http://www.gnu.org/licenses/>.
rem ###########################################################################
rem @echo off
rem setlocal enabledelayedexpansion
setlocal enabledelayedexpansion
rem We create the install and build directory, if they already exist they are deleted.
if "%~1"=="--help" ( goto :help )
if "%~1"=="-help" ( goto :help )
if "%~1"=="-h" ( goto :help )
if "%~1"=="-?" ( goto :help )
rem We create the install and build directory, if they already exist they are deleted.
set sourcepath=%cd%
set installpath=
set pythonpath=
if exist "cmake-build" (
rmdir /S /Q cmake-build
if exist "build" (
rmdir /S /Q build
)
mkdir cmake-build
cd cmake-build
mkdir build
cd build
set buildpath=%cd%
cd ..
if exist "cmake-install" (
rmdir /S /Q cmake-install
for %%x in (%*) do (
if "%%x"=="--local-install" (
if exist "install" (
rmdir /S /Q install
)
mkdir install
set installpath=%sourcepath%\install
cd /D %sourcepath%
)
if "%%x"=="--local-python" (
if exist "install" (
cd install
mkdir python
cd python
set pythonpath=%sourcepath%\install\python
) else (
mkdir install
cd install
mkdir python
set pythonpath=%sourcepath%\install\python
)
cd /D %sourcepath%
)
)
mkdir cmake-install
cd cmake-install
mkdir python
set installpath=%cd%
cd /D %sourcepath%
cd /D %sourcepath%\scripts
rem we create the config.txt which will be used by python script. The one users will modify as they want.
if not exist "scripts/config.txt" (
copy /y scripts/config.txt_default scripts/config.txt
if not exist config.txt (
copy /y config.txt_default config.txt
)
rem deleting the output of python script if it exists
if exist "scripts/output_config" (
del "scripts/output_config"
if exist output_config (
del output_config
)
pause
cd /D %sourcepath%
call python scripts/config.py %*> scripts/output_config
set /p cmake_configs=<scripts/output_config
if exist "scripts/output_config" (
del "scripts/output_config"
if exist scripts/output_config (
del scripts/output_config
)
rem we go in the build directory
cd /D %buildpath%
rem calling cmake with arguments we need. Need to check for 64 or 32bits windows version. To do so just check if ProgramFiles(x86) exists.
if defined ProgramFiles(x86) (
cmake -G "Visual Studio 9 2008 Win64" -DCMAKE_INSTALL_PREFIX="%installpath%" %cmake_configs% -DPYTHON_SITE_PACKAGES_DIR="%installpath%\python" "%sourcepath%"
if defined ProgramFiles(x86) (
if defined installpath (
if defined pythonpath (
cmake -G "Visual Studio 9 2008 Win64" -DCMAKE_INSTALL_PREFIX="%installpath%" %cmake_configs% -DPYTHON_SITE_PACKAGES_DIR="%pythonpath%" "%sourcepath%"
) else (
cmake -G "Visual Studio 9 2008 Win64" -DCMAKE_INSTALL_PREFIX="%installpath%" %cmake_configs% "%sourcepath%"
)
) else (
if defined pythonpath (
cmake -G "Visual Studio 9 2008 Win64" %cmake_configs% -DPYTHON_SITE_PACKAGES_DIR="%pythonpath%" "%sourcepath%"
) else (
cmake -G "Visual Studio 9 2008 Win64" %cmake_configs% "%sourcepath%"
)
)
) else (
cmake -G "Visual Studio 9 2008" -DCMAKE_INSTALL_PREFIX="%installpath%" %cmake_configs% -DPYTHON_SITE_PACKAGES_DIR="%installpath%\python" "%sourcepath%"
if defined installpath (
if defined pythonpath (
cmake -G "Visual Studio 9 2008" -DCMAKE_INSTALL_PREFIX="%installpath%" %cmake_configs% -DPYTHON_SITE_PACKAGES_DIR="%pythonpath%" "%sourcepath%"
) else (
cmake -G "Visual Studio 9 2008" -DCMAKE_INSTALL_PREFIX="%installpath%" %cmake_configs% "%sourcepath%"
)
) else (
if defined pythonpath (
cmake -G "Visual Studio 9 2008" %cmake_configs% -DPYTHON_SITE_PACKAGES_DIR="%pythonpath%" "%sourcepath%"
) else (
cmake -G "Visual Studio 9 2008" %cmake_configs% "%sourcepath%"
)
)
)
rem configuration of env variables for visual c++ 2008 version.
......@@ -82,6 +134,56 @@ cd /D %buildpath%
cmake --build . --target install --config Release
cd ..
goto :EOF
:help
echo Description :
echo this script build and install lima project, depending on arguments pass.
echo install directories are set by default in the default cmake directory.
echo Probably "c:\Program Files\lima" and "python2X/site-packages/"
echo However you can choose to install C++ lib and python lib in lima/install/ directory.
echo Just need to add --local-install and --local-python
echo or just --local-install if you compile without python option.
echo or only --local-python if you only want python libs in lima/install/ directory.
echo USING scripts/config.txt FILE :
echo once you have executed a first install.bat a config.txt file is created in scripts/ directory.
echo If you plan to compile with the same parameters a lot of time you can edit this file and select your options.
echo Then you just have to run install.bat and lima will compile with what you asked in config.txt.
echo By default camera simulator is always compile. You can change that with editing config.txt file :
echo "LIMACAMERA_SIMULATOR=0" instead of "LIMACAMERA_SIMULATOR=1"
echo execution (with cmd.exe in lima/ directory) :
echo "install.bat [options]"
echo [options] : can be any camera name or saving format.
echo other otions are : _ python : Build python wrapping.
echo _ tests : compile unitest in build directory.
echo _ config : for the fun !
echo examples :
echo "install.bat basler python"
echo - compile and install lima with camera basler with python wrapping
echo - install directory for C++ library and python library will be in cmake default directories.
echo (you can check them in cmake-gui)
echo this is equivalent to change config.txt with this options :
echo _ LIMACAMERA_BASLER=1
echo _ LIMA_ENABLE_PYTHON=1
echo "install.bat --local-install basler"
echo - compile and install camera basler in the lima/install directory.
goto :EOF
rem the following code might be use one day.
rem cd %~2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment