Difference between revisions of "Cross compiling standalone packages for the camera"

From ElphelWiki
Jump to: navigation, search
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Legacy}}
 +
This page describes software for [[353_legacy]] - legacy Model 353 cameras.
 +
 
This procedure is intended to
 
This procedure is intended to
 
* test software before including it in the cvs,
 
* test software before including it in the cvs,
Line 10: Line 13:
  
 
You must source init_env from the Elphel firmware source directory, eg:
 
You must source init_env from the Elphel firmware source directory, eg:
  ELPHEL_SOURCEDIR=/usr/local/src/elphel-cvs/353/elphel353
+
  ELPHEL_SOURCEDIR=/usr/local/src/elphel353-8.0.7/elphel353
 
  cd $ELPHEL_SOURCEDIR
 
  cd $ELPHEL_SOURCEDIR
 
  source init_env
 
  source init_env
Line 18: Line 21:
 
  # toolchain
 
  # toolchain
 
  TOOLCHAIN=/usr/local/cris
 
  TOOLCHAIN=/usr/local/cris
 +
export PATH=/usr/local/crisv32/bin:$PATH
 
  export PATH=${TOOLCHAIN}/crisv32-axis-linux-gnu/bin:$PATH  
 
  export PATH=${TOOLCHAIN}/crisv32-axis-linux-gnu/bin:$PATH  
 
  export PATH=${TOOLCHAIN}/bin:$PATH  
 
  export PATH=${TOOLCHAIN}/bin:$PATH  
Line 25: Line 29:
 
  export CXX=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-g++
 
  export CXX=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-g++
 
  export CPP=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-cpp
 
  export CPP=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-cpp
 +
export AR=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-ar
 +
export RANLIB=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-ranlib
 
   
 
   
 
  # options
 
  # options
Line 47: Line 53:
 
  make install
 
  make install
  
and mount or copy the resulting /usr/local/crisv32 to the camera
+
=When the software is not packaged using autoconf and automake=
 +
Edit the Makefile
 +
 
 +
=Install the software on the camera=
 +
The first time, create a symbolic link for crisv32 directory in /usr/local, eg:
 +
ssh root@cam ln -s . /usr/local/crisv32
 +
 
 +
Copy the software to the camera /usr/local directory, eg:
 +
tar c /usr/local/crisv32/. | ssh root@cam tar xv -C /
 
(you may want to strip binaries and remove documentation before)
 
(you may want to strip binaries and remove documentation before)
  
Then to run the software on the camera you may have to define:
+
To run the software on the camera you may have to define:
  export PATH=/usr/local/crisv32/bin:$PATH
+
  export PATH=/usr/local/bin:$PATH
  export LD_LIBRARY_PATH=/usr/local/crisv32/lib:$LD_LIBRARY_PATH
+
  export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
 
 
=When the software is not packaged using autoconf and automake=
 
Edit the Makefile
 

Latest revision as of 21:13, 21 January 2019

This is a legacy page. Information may not reflect the current state of the products or code.

This page describes software for 353_legacy - legacy Model 353 cameras.

This procedure is intended to

  • test software before including it in the cvs,
  • to build software that would be too big to fit into the firmware image,
  • to build standalone packages you just dont want to include into the firmware image.

First

ELPHEL_SOURCEDIR and TOOLCHAIN values below are installation dependent, check if it match yours.

Setting environment variables

You must source init_env from the Elphel firmware source directory, eg:

ELPHEL_SOURCEDIR=/usr/local/src/elphel353-8.0.7/elphel353
cd $ELPHEL_SOURCEDIR
source init_env

and set the following variables:

# toolchain
TOOLCHAIN=/usr/local/cris
export PATH=/usr/local/crisv32/bin:$PATH 
export PATH=${TOOLCHAIN}/crisv32-axis-linux-gnu/bin:$PATH 
export PATH=${TOOLCHAIN}/bin:$PATH 

# binaries
export CC=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-gcc
export CXX=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-g++
export CPP=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-cpp
export AR=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-ar
export RANLIB=${TOOLCHAIN}/bin/crisv32-axis-linux-gnu-ranlib

# options
export CFLAGS=-I${TOOLCHAIN}/include
export CFLAGS="${CFLAGS} -I${TOOLCHAIN}/crisv32-axis-linux-gnu/sys-include"
export CXXFLAGS=${CFLAGS}
export CPPFLAGS=${CFLAGS}
export LDFLAGS=-L${TOOLCHAIN}/lib
export LDFLAGS="${LDFLAGS} -L${TOOLCHAIN}/crisv32-axis-linux-gnu/lib/"

# user includes and libraries
export LDFLAGS="${LDFLAGS} -L/usr/local/crisv32/lib"
export CFLAGS="${CFLAGS} -I/usr/local/crisv32/include"
export CXXFLAGS=${CFLAGS}

(check ./configure --help and the Makefile to see if more is needed)

When the software is packaged using autoconf and automake

You normally just have to run:

./configure --host=crisv32-axis-linux-gnu --prefix=/usr/local/crisv32  [ other options ]
make
make install

When the software is not packaged using autoconf and automake

Edit the Makefile

Install the software on the camera

The first time, create a symbolic link for crisv32 directory in /usr/local, eg:

ssh root@cam ln -s . /usr/local/crisv32

Copy the software to the camera /usr/local directory, eg:

tar c /usr/local/crisv32/. | ssh root@cam tar xv -C /

(you may want to strip binaries and remove documentation before)

To run the software on the camera you may have to define:

export PATH=/usr/local/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH