mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-03 13:28:19 +00:00
Bash on Ubuntu on Windows instructions, readme and cmake improvements (#113)
* README.md: add note about Visual C++ Build Tools and Bash on Ubuntu on Windows. Enhance the Compiling on *nix instructions. * Fix newline. * README.md tweak * CMakeLists.txt: remove CHECK_ADD_OCE_OCC_DEF INCLUDE() for good as these are not needed any more at all (OCE codebase also checked and no signs of these).
This commit is contained in:
committed by
Thomas Krijnen
parent
4b90e618b0
commit
a26253321f
@@ -11,7 +11,7 @@ Prerequisites
|
|||||||
-------------
|
-------------
|
||||||
* Git
|
* Git
|
||||||
* CMake (2.6 or newer)
|
* CMake (2.6 or newer)
|
||||||
* Windows: Visual Studio 2008 or newer with C++ toolset or [MSYS2] + MinGW
|
* Windows: [Visual Studio] 2008 or newer with C++ toolset (or [Visual C++ Build Tools]) or [MSYS2] + MinGW
|
||||||
* *nix: GCC 4.7 or newer, or Clang (any version)
|
* *nix: GCC 4.7 or newer, or Clang (any version)
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
@@ -36,7 +36,7 @@ Building IfcOpenShell
|
|||||||
The preferred way to fetch and build this project's dependencies is to use the build scripts
|
The preferred way to fetch and build this project's dependencies is to use the build scripts
|
||||||
in win/ folder. **See [win/readme.md] for more information**.
|
in win/ folder. **See [win/readme.md] for more information**.
|
||||||
|
|
||||||
#### Compiling using Visual Studio
|
#### Using Visual Studio
|
||||||
Instructions in a nutshell (**assuming Visual Studio 2015 x64 environment variables set**):
|
Instructions in a nutshell (**assuming Visual Studio 2015 x64 environment variables set**):
|
||||||
|
|
||||||
> cd IfcOpenShell\win
|
> cd IfcOpenShell\win
|
||||||
@@ -56,7 +56,7 @@ Alternatively, one can use the utility batch files to build and install the proj
|
|||||||
> build-ifcopenshell.bat
|
> build-ifcopenshell.bat
|
||||||
> install-ifcopenshell.bat
|
> install-ifcopenshell.bat
|
||||||
|
|
||||||
#### Compiling using MSYS2 + MinGW
|
#### Using MSYS2 + MinGW
|
||||||
|
|
||||||
Start the MSYS2 Shell and then:
|
Start the MSYS2 Shell and then:
|
||||||
|
|
||||||
@@ -66,17 +66,29 @@ Start the MSYS2 Shell and then:
|
|||||||
$ ./build-ifcopenshell.sh
|
$ ./build-ifcopenshell.sh
|
||||||
$ ./install-ifcopenshell.sh
|
$ ./install-ifcopenshell.sh
|
||||||
|
|
||||||
|
#### Using Bash on Ubuntu on Windows
|
||||||
|
|
||||||
|
Start Bash on Ubuntu on Windows and follow the instructions below. Ubuntu 14.04.4 LTS with GCC 4.8.4 has been
|
||||||
|
confirmed to work.
|
||||||
|
|
||||||
### Compiling on *nix
|
### Compiling on *nix
|
||||||
There might be an Open CASCADE package in your operating system's software repository. If not, you will need to compile
|
|
||||||
Open CASCADE yourself. See http://opencascade.org.
|
|
||||||
|
|
||||||
For building the IfcPython wrapper, SWIG and Python development are
|
The following instructions are for Ubuntu, modify as required for other operating systems. [nix/build-all.sh] script
|
||||||
required.
|
can be experimented with and studied for pointers for other operating systems, but note that this script is not currently
|
||||||
|
meant to be used for a typical IfcOpenShell workspace setup.
|
||||||
|
|
||||||
Additionally, on Ubuntu (and possibly other linux flavors) the following steps
|
Install most of the prerequisites and dependencies:
|
||||||
install some of the prerequisites:
|
|
||||||
|
|
||||||
$ sudo apt-get install git swig cmake gcc g++ libftgl-dev libtbb2 libtbb-dev libboost-all-dev libgl1-mesa-dev libfreetype6-dev
|
$ sudo apt-get install git cmake gcc g++ libboost-all-dev libicu-dev
|
||||||
|
|
||||||
|
There might be an Open CASCADE package in your operating system's software repository (see http://opencascade.org
|
||||||
|
for additional information):
|
||||||
|
|
||||||
|
$ sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
|
||||||
|
|
||||||
|
If not, you will need to compile Open CASCADE yourself:
|
||||||
|
|
||||||
|
$ sudo apt-get install libftgl-dev libtbb2 libtbb-dev libgl1-mesa-dev libfreetype6-dev
|
||||||
$ git clone https://github.com/tpaviot/oce.git
|
$ git clone https://github.com/tpaviot/oce.git
|
||||||
$ cd oce
|
$ cd oce
|
||||||
$ mkdir build && cd build
|
$ mkdir build && cd build
|
||||||
@@ -84,21 +96,46 @@ install some of the prerequisites:
|
|||||||
$ make
|
$ make
|
||||||
$ sudo make install
|
$ sudo make install
|
||||||
|
|
||||||
|
For building IfcConvert with COLLADA (.dae) support (on by default), OpenCOLLADA is needed:
|
||||||
|
|
||||||
|
$ sudo apt-get install libpcre3-dev
|
||||||
|
$ git clone https://github.com/KhronosGroup/OpenCOLLADA.git
|
||||||
|
$ cd OpenCOLLADA
|
||||||
|
Using a known good revision, but HEAD should work too:
|
||||||
|
$ git checkout 064a60b65c2c31b94f013820856bc84fb1937cc6
|
||||||
|
$ mkdir build && cd build
|
||||||
|
$ cmake ..
|
||||||
|
$ make
|
||||||
|
$ sudo make install
|
||||||
|
|
||||||
|
For building the IfcPython wrapper (on by default), SWIG and Python development are needed, if not already available:
|
||||||
|
|
||||||
|
$ sudo apt-get install python-all-dev swig
|
||||||
|
|
||||||
To build IfcOpenShell please take the following steps:
|
To build IfcOpenShell please take the following steps:
|
||||||
|
|
||||||
$ cd /path/to/IfcOpenShell/cmake
|
$ cd /path/to/IfcOpenShell
|
||||||
$ mkdir build
|
$ mkdir build
|
||||||
$ cd build
|
$ cd build
|
||||||
Optionally:
|
Optionally, if required:
|
||||||
$ OCC_INCLUDE_PATH="/path/to/OpenCASCADE/include"
|
$ OCC_INCLUDE_PATH="/path/to/OpenCASCADE/include"
|
||||||
$ OCC_LIBRARY_PATH="/path/to/OpenCASCADE/lib"
|
$ OCC_LIBRARY_PATH="/path/to/OpenCASCADE/lib"
|
||||||
$ export OCC_INCLUDE_PATH
|
$ export OCC_INCLUDE_PATH
|
||||||
$ export OCC_LIBRARY_PATH
|
$ export OCC_LIBRARY_PATH
|
||||||
$ cmake ../
|
If building with COLLADA support (path might vary):
|
||||||
|
$ OPENCOLLADA_INCLUDE_DIR="/usr/local/include/opencollada"
|
||||||
|
$ OPENCOLLADA_LIBRARY_DIR="/usr/local/lib/opencollada"
|
||||||
|
$ export OPENCOLLADA_INCLUDE_DIR
|
||||||
|
$ export OPENCOLLADA_LIBRARY_DIR
|
||||||
|
$ cmake ../cmake
|
||||||
$ make
|
$ make
|
||||||
|
|
||||||
If all worked out correctly you can now use IfcOpenShell. See the examples below.
|
If all worked out correctly you can now use IfcOpenShell. See the examples below.
|
||||||
|
|
||||||
|
Install the project if wanted:
|
||||||
|
|
||||||
|
$ sudo make install
|
||||||
|
|
||||||
Usage examples
|
Usage examples
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
@@ -174,5 +211,8 @@ Usage examples
|
|||||||
[IFC]: http://www.buildingsmart-tech.org/specifications/ifc-overview "IFC"
|
[IFC]: http://www.buildingsmart-tech.org/specifications/ifc-overview "IFC"
|
||||||
[IFC2x3 TC1]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc2x3-tc1-release "IFC2x3 TC1"
|
[IFC2x3 TC1]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc2x3-tc1-release "IFC2x3 TC1"
|
||||||
[IFC4 Add1]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc4-add1-release "IFC4 Add1"
|
[IFC4 Add1]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc4-add1-release "IFC4 Add1"
|
||||||
|
[Visual Studio]: https://www.visualstudio.com/ "Visual Studio"
|
||||||
|
[Visual C++ Build Tools]: http://landinghub.visualstudio.com/visual-cpp-build-tools "Visual C++ Build Tools"
|
||||||
[MSYS2]: https://msys2.github.io/ "MSYS2"
|
[MSYS2]: https://msys2.github.io/ "MSYS2"
|
||||||
[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md"
|
[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md"
|
||||||
|
[nix/build-all.sh]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/nix/build-all.sh "nix/build-all.sh"
|
||||||
@@ -245,31 +245,6 @@ IF(COLLADA_SUPPORT)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# TODO Are these needed on other platforms still or can these be removed for good?
|
|
||||||
IF (NOT WIN32)
|
|
||||||
INCLUDE(CheckIncludeFileCXX)
|
|
||||||
|
|
||||||
MACRO(CHECK_ADD_OCE_OCC_DEF INCLUDE)
|
|
||||||
STRING(REPLACE . _ STR ${INCLUDE})
|
|
||||||
STRING(TOUPPER ${STR} STR)
|
|
||||||
CHECK_INCLUDE_FILE_CXX("${INCLUDE}" FOUND_${STR})
|
|
||||||
IF(FOUND_${STR})
|
|
||||||
ADD_DEFINITIONS(-DOCE_HAVE_${STR})
|
|
||||||
ADD_DEFINITIONS(-DHAVE_${STR})
|
|
||||||
ENDIF(FOUND_${STR})
|
|
||||||
ENDMACRO()
|
|
||||||
|
|
||||||
CHECK_ADD_OCE_OCC_DEF(limits)
|
|
||||||
CHECK_ADD_OCE_OCC_DEF(climits)
|
|
||||||
CHECK_ADD_OCE_OCC_DEF(limits.h)
|
|
||||||
CHECK_ADD_OCE_OCC_DEF(fstream)
|
|
||||||
CHECK_ADD_OCE_OCC_DEF(fstream.h)
|
|
||||||
CHECK_ADD_OCE_OCC_DEF(iomanip)
|
|
||||||
CHECK_ADD_OCE_OCC_DEF(iomanip.h)
|
|
||||||
CHECK_ADD_OCE_OCC_DEF(iostream)
|
|
||||||
CHECK_ADD_OCE_OCC_DEF(iostream.h)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(NOT CMAKE_BUILD_TYPE)
|
IF(NOT CMAKE_BUILD_TYPE)
|
||||||
SET(CMAKE_BUILD_TYPE "Release")
|
SET(CMAKE_BUILD_TYPE "Release")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|||||||
Reference in New Issue
Block a user