Skip to content

Commit a262533

Browse files
Stinkfist0aothms
authored andcommitted
Bash on Ubuntu on Windows instructions, readme and cmake improvements (IfcOpenShell#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).
1 parent 4b90e61 commit a262533

File tree

2 files changed

+55
-40
lines changed

2 files changed

+55
-40
lines changed

README.md

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Prerequisites
1111
-------------
1212
* Git
1313
* CMake (2.6 or newer)
14-
* Windows: Visual Studio 2008 or newer with C++ toolset or [MSYS2] + MinGW
14+
* Windows: [Visual Studio] 2008 or newer with C++ toolset (or [Visual C++ Build Tools]) or [MSYS2] + MinGW
1515
* *nix: GCC 4.7 or newer, or Clang (any version)
1616

1717
Dependencies
@@ -36,7 +36,7 @@ Building IfcOpenShell
3636
The preferred way to fetch and build this project's dependencies is to use the build scripts
3737
in win/ folder. **See [win/readme.md] for more information**.
3838

39-
#### Compiling using Visual Studio
39+
#### Using Visual Studio
4040
Instructions in a nutshell (**assuming Visual Studio 2015 x64 environment variables set**):
4141

4242
> cd IfcOpenShell\win
@@ -56,7 +56,7 @@ Alternatively, one can use the utility batch files to build and install the proj
5656
> build-ifcopenshell.bat
5757
> install-ifcopenshell.bat
5858

59-
#### Compiling using MSYS2 + MinGW
59+
#### Using MSYS2 + MinGW
6060

6161
Start the MSYS2 Shell and then:
6262

@@ -66,39 +66,76 @@ Start the MSYS2 Shell and then:
6666
$ ./build-ifcopenshell.sh
6767
$ ./install-ifcopenshell.sh
6868

69+
#### Using Bash on Ubuntu on Windows
70+
71+
Start Bash on Ubuntu on Windows and follow the instructions below. Ubuntu 14.04.4 LTS with GCC 4.8.4 has been
72+
confirmed to work.
73+
6974
### Compiling on *nix
70-
There might be an Open CASCADE package in your operating system's software repository. If not, you will need to compile
71-
Open CASCADE yourself. See http://opencascade.org.
7275

73-
For building the IfcPython wrapper, SWIG and Python development are
74-
required.
76+
The following instructions are for Ubuntu, modify as required for other operating systems. [nix/build-all.sh] script
77+
can be experimented with and studied for pointers for other operating systems, but note that this script is not currently
78+
meant to be used for a typical IfcOpenShell workspace setup.
79+
80+
Install most of the prerequisites and dependencies:
81+
82+
$ sudo apt-get install git cmake gcc g++ libboost-all-dev libicu-dev
7583

76-
Additionally, on Ubuntu (and possibly other linux flavors) the following steps
77-
install some of the prerequisites:
84+
There might be an Open CASCADE package in your operating system's software repository (see http://opencascade.org
85+
for additional information):
7886

79-
$ sudo apt-get install git swig cmake gcc g++ libftgl-dev libtbb2 libtbb-dev libboost-all-dev libgl1-mesa-dev libfreetype6-dev
87+
$ sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
88+
89+
If not, you will need to compile Open CASCADE yourself:
90+
91+
$ sudo apt-get install libftgl-dev libtbb2 libtbb-dev libgl1-mesa-dev libfreetype6-dev
8092
$ git clone https://github.com/tpaviot/oce.git
8193
$ cd oce
8294
$ mkdir build && cd build
8395
$ cmake ..
8496
$ make
85-
$ sudo make install
97+
$ sudo make install
98+
99+
For building IfcConvert with COLLADA (.dae) support (on by default), OpenCOLLADA is needed:
100+
101+
$ sudo apt-get install libpcre3-dev
102+
$ git clone https://github.com/KhronosGroup/OpenCOLLADA.git
103+
$ cd OpenCOLLADA
104+
Using a known good revision, but HEAD should work too:
105+
$ git checkout 064a60b65c2c31b94f013820856bc84fb1937cc6
106+
$ mkdir build && cd build
107+
$ cmake ..
108+
$ make
109+
$ sudo make install
110+
111+
For building the IfcPython wrapper (on by default), SWIG and Python development are needed, if not already available:
112+
113+
$ sudo apt-get install python-all-dev swig
86114

87115
To build IfcOpenShell please take the following steps:
88116

89-
$ cd /path/to/IfcOpenShell/cmake
117+
$ cd /path/to/IfcOpenShell
90118
$ mkdir build
91119
$ cd build
92-
Optionally:
120+
Optionally, if required:
93121
$ OCC_INCLUDE_PATH="/path/to/OpenCASCADE/include"
94122
$ OCC_LIBRARY_PATH="/path/to/OpenCASCADE/lib"
95123
$ export OCC_INCLUDE_PATH
96124
$ export OCC_LIBRARY_PATH
97-
$ cmake ../
125+
If building with COLLADA support (path might vary):
126+
$ OPENCOLLADA_INCLUDE_DIR="/usr/local/include/opencollada"
127+
$ OPENCOLLADA_LIBRARY_DIR="/usr/local/lib/opencollada"
128+
$ export OPENCOLLADA_INCLUDE_DIR
129+
$ export OPENCOLLADA_LIBRARY_DIR
130+
$ cmake ../cmake
98131
$ make
99132

100133
If all worked out correctly you can now use IfcOpenShell. See the examples below.
101134

135+
Install the project if wanted:
136+
137+
$ sudo make install
138+
102139
Usage examples
103140
--------------
104141

@@ -174,5 +211,8 @@ Usage examples
174211
[IFC]: http://www.buildingsmart-tech.org/specifications/ifc-overview "IFC"
175212
[IFC2x3 TC1]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc2x3-tc1-release "IFC2x3 TC1"
176213
[IFC4 Add1]: http://www.buildingsmart-tech.org/specifications/ifc-releases/ifc4-add1-release "IFC4 Add1"
214+
[Visual Studio]: https://www.visualstudio.com/ "Visual Studio"
215+
[Visual C++ Build Tools]: http://landinghub.visualstudio.com/visual-cpp-build-tools "Visual C++ Build Tools"
177216
[MSYS2]: https://msys2.github.io/ "MSYS2"
178-
[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md"
217+
[win/readme.md]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/win/readme.md "win/readme.md"
218+
[nix/build-all.sh]: https://github.com/IfcOpenShell/IfcOpenShell/tree/master/nix/build-all.sh "nix/build-all.sh"

cmake/CMakeLists.txt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -245,31 +245,6 @@ IF(COLLADA_SUPPORT)
245245
ENDIF()
246246
ENDIF()
247247

248-
# TODO Are these needed on other platforms still or can these be removed for good?
249-
IF (NOT WIN32)
250-
INCLUDE(CheckIncludeFileCXX)
251-
252-
MACRO(CHECK_ADD_OCE_OCC_DEF INCLUDE)
253-
STRING(REPLACE . _ STR ${INCLUDE})
254-
STRING(TOUPPER ${STR} STR)
255-
CHECK_INCLUDE_FILE_CXX("${INCLUDE}" FOUND_${STR})
256-
IF(FOUND_${STR})
257-
ADD_DEFINITIONS(-DOCE_HAVE_${STR})
258-
ADD_DEFINITIONS(-DHAVE_${STR})
259-
ENDIF(FOUND_${STR})
260-
ENDMACRO()
261-
262-
CHECK_ADD_OCE_OCC_DEF(limits)
263-
CHECK_ADD_OCE_OCC_DEF(climits)
264-
CHECK_ADD_OCE_OCC_DEF(limits.h)
265-
CHECK_ADD_OCE_OCC_DEF(fstream)
266-
CHECK_ADD_OCE_OCC_DEF(fstream.h)
267-
CHECK_ADD_OCE_OCC_DEF(iomanip)
268-
CHECK_ADD_OCE_OCC_DEF(iomanip.h)
269-
CHECK_ADD_OCE_OCC_DEF(iostream)
270-
CHECK_ADD_OCE_OCC_DEF(iostream.h)
271-
ENDIF()
272-
273248
IF(NOT CMAKE_BUILD_TYPE)
274249
SET(CMAKE_BUILD_TYPE "Release")
275250
ENDIF()

0 commit comments

Comments
 (0)