开源CAD——从源代码安装到依赖关系分析 __02
开源CAD——从源代码安装到依赖关系分析 __02
首分成4大类,
1, FreeCAD+openCASCADE
2, LibreCAD or Qcad,
3, OpenSCAD
4, gCAD3D
others PythonCAD, salome, varkon, CADvas, etc ... (资料相对不太完善)
关于文件格式的介绍:
二维软件主要以dxf, xxx.py为主,autodesk CAD format.
三维的格式主要以stl为主。 3D system format.
且都可以输出图片格式。
本节主要介绍第一类 FreeCAD + OpenCASCADE,
OpenCASCADE && FreeCAD 说明书pdf下载地址:
http://ishare.iask.sina.com.cn/f/34233319.html
http://ishare.iask.sina.com.cn/f/33416712.html
FreeCAD+OpenCASCADE依赖关系分析
OpenCASCADE
Linux Intel
Operating System
32/64-bit:
Debian: 4.0
Mandriva: 2010*
Minimum memory
512 Mb, 1 Gb recommended
Free disk space
(complete installation)
For full installation Open CASCADE Technology requires 600 Mb of disk space.
Minimum swap space
500 Mb
Video card
GeForce
The following versions of GeForce drivers are recommended:
64-bit Version: 100.14.19 or later http://www.nvidia.com/object/linux_display_amd64_100.14.19.html
32-bit Version: 100.14.19 or later http://www.nvidia.com/object/linux_display_ia32_100.14.19.html
Guide for building third-party products on Linux
CONTENTS
1. INTRODUCTION ___________________________________________________________ 2
2. BUILDING MANDATORY THIRD-PARTY PRODUCTS __________________________________ 2
2.1. Tcl/Tk 8.5 ____________________________________________________________________
2.1.1. installation from binaries _____________________________________________________
2.1.2. Installation from sources: Tcl 8.5 _______________________________________________
2.1.3. Installation from sources: Tk 8.5 _______________________________________________
2.2. FreeType 2.3.7 ________________________________________________________________ 3
2.3. Ftgl 2.1.2_____________________________________________________________________ 3
3. BUILDING OPTIONAL THIRD-PARTY PRODUCTS____________________________________ 3
3.1. TBB 3.0-018 __________________________________________________________________ 3
3.2. gl2ps 1.3.5 ___________________________________________________________________ 4
3.3. FreeImage 3.14.1 ______________________________________________________________ 4
4. REFERENCES ____________________________________________________________ 5
1. INTRODUCTION
This document presents additional guidelines for building third-party products used by Open
CASCADE Technology and samples on Linux platform (Mandriva 2008 and Debian 4.0).
The links for downloading the third-party products are available on the web site of OPEN CASCADE
S.A.S at http://www.opencascade.org/getocc/require/.
There are two types of third-party products, which are necessary to build OCCT:
a) Mandatory products: Tcl 8.5, Tk 8.5, FreeType 2.3.7, Ftgl 2.1.2
b) Optional products: gl2ps 1.3.5, FreeImage 3.14.1, TBB 30-018
2. BUILDING MANDATORY THIRD-PARTY PRODUCTS
2.1. Tcl/Tk 8.5
Tcl/Tk is required for DRAW test harness.
2.1.1. installation from binaries
It is possible to download ready-to-install binaries from
http://www.activestate.com/activetcl/downloads
1. Download binaries archive and unpack it into some <TCL_SRC_DIR>.
2. Enter the directory <TCL_SRC_DIR>.
cd <TCL_SRC_DIR>
3. Run the install command
install.sh
and follow instructions.
2.1.2. Installation from sources: Tcl 8.5
Download necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the unix sub-directory of the directory where source files of Tcl are located
(<TCL_SRC_DIR>).
cd <TCL_SRC_DIR>/unix
2. Run the configure command
configure --enable-gcc --enable-shared --enable-threads --prefix=<TCL_INSTALL_DIR>
For 64 bit platform add also --enable-64bit option to the command line.
3. If the configure command is finished successfully, start the building process
make
4. If building is finished successfully, start installation of Tcl. All binary and service files of the product
will be copied to the directory defined by <TCL_INSTALL_DIR>
make install
2.1.3. Installation from sources: Tk 8.5
Download necessary archive from http://www.tcl.tk/software/tcltk/download.html and unpack it.
1. Enter the unix sub-directory of the directory where source files of Tk are located (<TK_SRC_DIR>).
cd <TK_SRC_DIR>/unix
2. Run the configure command, where <TCL_LIB_DIR> is <TCL_INSTALL_DIR>/lib
configure
--enable-gcc
--enable-shared
--enable-threads
--with-tcl=<TCL_LIB_DIR>
--
prefix=<TK_INSTALL_DIR>
where <TCL_LIB_DIR> is <TCL_INSTALL_DIR>/lib
For 64 bit platform add also --enable-64bit option to the command line.
3. If the configure command is finished successfully, start the building process
make
4. If building is finished successfully, start installation of Tk. All binary and service files of the product
will be copied to the directory defined by <TK_INSTALL_DIR> (usually <TK_INSTALL_DIR> is
<TCL_INSTALL_DIR>)
make install
2.2. FreeType 2.3.7
FreeType is required for Ftgl which links it as static library.
Download necessary archive from http://sourceforge.net/projects/freetype/files/ and unpack it.
1. Enter the directory where source files of FreeType are located (<FREETYPE_SRC_DIR>).
cd <FREETYPE_SRC_DIR>
2. Run the configure command
configure --prefix=<FREETYPE_INSTALL_DIR>
For 64 bit platform add also CFLAGS="-fPIC -m64" option to the command line.
3. If the configure command is finished successfully, start the building process
make
4. If building is finished successfully, start installation of FreeType. All binary and service files of the
product will be copied to the directory defined by <FREETYPE_INSTALL_DIR>
make install
2.3. Ftgl 2.1.2
Ftgl is required for OCCT Visualization libraries.
Download necessary archive from http://sourceforge.net/projects/ftgl/files/ and unpack it. The directory
with unpacked sources is named further as <FTGL_SRC_DIR>.
1. Modify <FTGL_SRC_DIR>/include/FTTextureGlyph.h:
change line 55
from: static void FTTextureGlyph::ResetActiveTexture(){ activeTextureID = 0;}
to:
static void ResetActiveTexture(){ activeTextureID = 0;}
2. Enter the unix sub-directory of <FTGL_SRC_DIR>.
cd <FTGL_SRC_DIR>/unix
3. Run the configure command
configure
--enable-shared=yes
--with-freetype-prefix=<FREETYPE_INSTALL_DIR>
--
prefix=<FTGL_INSTALL_DIR>
4. If the configure command is finished successfully, start the building process
make
5. If building is finished successfully, start installation of Ftgl. All binary and service files of the product
will be copied to the directory defined by <FTGL_INSTALL_DIR>
make install
3. BUILDING OPTIONAL THIRD-PARTY PRODUCTS
3.1. TBB 3.0-018
This third-party product is installed with binaries from the archive that could be downloaded
from http://threadingbuildingblocks.org/. Go to “Downloads / Commercial Aligned Release“,
find the needed release version (tbb30_018oss) and pick the archive for Linux platform.
The installation process is the following:
?
Unpack the downloaded archive of TBB 3.0 product (tbb30_018oss_lin.tgz).
3.2. gl2ps 1.3.5
Download necessary archive from http://geuz.org/gl2ps/ and unpack it.
1. Install or build cmake product from source file.
2. Start cmake in GUI mode with the directory where source files of fl2ps are located
ccmake <GL2PS_SRC_DIR>
2.1. Press [c] to make the initial configuration
2.2. Define necessary options CMAKE_INSTALL_PREFIX
2.3. Press [c] to make the final configuration
2.4. Press [g] to generate Makefile and exit
or just run the following command:
cmake –DCMAKE_INSTALL_PREFIX=<GL2PS_INSTALL_DIR> –DCMAKE_BUILD_TYPE=Release
3. Start building of gl2ps
make
4. Start the installation of gl2ps. Binaries will be installed according to the CMAKE_INSTALL_PREFIX
option
make install
3.3. FreeImage 3.14.1
Download necessaryarchivefrom
http://sourceforge.net/projects/freeimage/files/Source%20Distribution/
and unpack it. The directory with unpacked sources is named further as <FREEIMAGE_SRC_DIR>.
1. Modify <FREEIMAGE_SRC_DIR>/Source/OpenEXR/Imath/ImathMatrix.h:
In the line 60 insert the following:
#include <string.h>
2. Enter the directory where source files of FreeImage are located (<FREEIMAGE_SRC_DIR>).
cd <FREEIMAGE_SRC_DIR>
3. Run the building process
make
4. Run the installation process
4.1. If you have permissions to write into /usr/include and /usr/lib directories then run the following
command:
make install
4.2. If you have not permissions to write into /usr/include and /usr/lib directories then you have to
modify the file <FREEIMAGE_SRC_DIR>/Makefile.gnu:
Replace lines 7-9
from:
DESTDIR ?= /
INCDIR ?= $(DESTDIR)/usr/include
INSTALLDIR ?= $(DESTDIR)/usr/lib
to:
DESTDIR ?= $(DESTDIR)
INCDIR ?= $(DESTDIR)/include
INSTALLDIR ?= $(DESTDIR)/lib
Replace lines 65-67
from:
install -m 644 -o root -g root $(HEADER) $(INCDIR)
install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
to:
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
from:
to:
Replace line 70
ldconfig
#
ldconfig
Then run the installation process by the following command:
make DESTDIR=<FREEIMAGE_INSTALL_DIR> install
5. Clean temporary files
make clean
6. If FreeImage library is created successfully, then build its C++ wrapper (FreeImagePlus library).
Start building of FreeImagePlus
make –f Makefile.fip
7. Start installation of FreeImagePlus
7.1. If you have permissions to write into /usr/include and /usr/lib directories then run the following
command:
make –f Makefile.fip install
7.2. If you have not permissions to write into /usr/include and /usr/lib directories then you have to
modify the file <FREEIMAGE_SRC_DIR>/Makefile.fip:
Replace lines 7-9
from:
DESTDIR ?= /
INCDIR ?= $(DESTDIR)/usr/include
INSTALLDIR ?= $(DESTDIR)/usr/lib
to:
DESTDIR ?= $(DESTDIR)
INCDIR ?= $(DESTDIR)/include
INSTALLDIR ?= $(DESTDIR)/lib
Replace lines 66-69
from:
install -m 644 -o root -g root $(HEADER) $(INCDIR)
install -m 644 -o root -g root $(HEADERFIP) $(INCDIR)
install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
to:
install -m 755 $(HEADER) $(INCDIR)
install -m 755 $(HEADERFIP) $(INCDIR)
install -m 755 $(STATICLIB) $(INSTALLDIR)
install -m 755 $(SHAREDLIB) $(INSTALLDIR)
ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
Then run the installation process by the following command:
make –f Makefile.fip DESTDIR=<FREEIMAGE_INSTALL_DIR> install
10. Remove temporary files
make –f Makefile.fip clean
4. REFERENCES
[1]
Open CASCADE Technology web site: http://www.opencascade.org
OPEN CASCADE SAS
Page 5 / 5
FreeCAD
http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=CompileOnUnix
source level compile