OVERVIEW:
========

pythonOCC is a python library whose purpose is to provide 3D modeling features, as well as
parametric modeling, data exchange, meshing etc. It's intended to developers who aim at developing
a complete CAD/PLM application, and to engineers who want to have a total control over the data
during complex design activities.

ABOUT THIS DOCUMENT:
====================

This file explains how to build pythonOCC from scratch under any Linux or MacOSX platform. Windows
users are encouraged to download the precompiled binaries available from the pythonocc website
(http://www.pythonocc.org)

REQUIREMENTS:
=============

pythonOCC needs the following libraries to be installed in order to provide full features:

- the python programming language (http://www.python.org). Python 2.5 or higher is required,

- a fortran compiler. Linux users should use gfortran.

NOTE FOR MACOSX USERS: you must use f77/f2c. To install/build f77/f2c, just download and run the script
named 'buildf2c' available from this url: http://hpc.sourceforge.net/buildf2c
then:
sudo buildf2c
Now you have a working f2c/f77. 

- SWIG 1.3.36 or higher,

- OpenCASCADE 6.3.0 (download from http://www.opencascade.org).

At the end of the compilation process, be sure the CASROOT env var is set.

- salomegeometry 5.1.2.7. Download the file geom-5.1.2.7.zip from http://sourceforge.net/projects/salomegeometry/
Extract the content of this file to any temporary folder then:
cd geom-5.1.2.7
cd adm/lin
autoreconf -- install
./configure --prefix=/somewhere
make
sudo make install

NOTE: when installation is done, you should add the GEOM_ROOT env var to your .bash_profile

- boost headers >= 1.38.0 (http://www.boost.org). boost headers are required by salomesmesh (see next item).
Just download the boost archive and extract the content of this file.
NOTE: it's not necessary to build boost.python or anything else. Just the headers are required.

- salomesmesh 5.1.2.2 . Download the file smesh-5.1.2.2.zip from http://sourceforge.net/projects/salomesmesh/.
Exract the content of this file to any temporary folder then:
cd smesh-5.1.1.2
cd adm/lin
autoreconf --install
./configure --prefix=/somewhere_else
make
sudo make install

Note: it may be necessary that you provide the boost headers path to the configure script. To do so, just export the
CPPFLAGS env var before you call the configure script:
export CPPFLAGS=-I/me/boost-1.38.0

 
BUILD:
======

cd pythonOCC-0.4
cd src

The setup.py script hat to be run.
python setup.py build --enable-geom --enable-smesh install

NOTE: the setup.py script looks for the CASROOT, GEOM_ROOT and SMESH_ROOT to find where dynamic libraries are located.
If the libraries are not found (i.e. the compilation process fails), you have to specify the path of these libraries from
the command line:

python setup.py build install --enable-geom --enable-smesh --with-geom-lib=/path_to_geom_libs 
--with-smesh-lib=/path_to_smesh_libs
--with-boost-include=/path_to_boost_headers --with-occ-include=/path_to_opencascade_inc
--with-occ-libs=/path_to_opencascade_libs

NOTE: you can speed up the compilation process with multiprocessing. If you have a dual core machine, just add the -j flag
with the number of cores:
python setup.py build install --enable-geom --enable-smesh -j2

