Skip to content

Instantly share code, notes, and snippets.

@berndhahnebach
Last active May 9, 2019 05:50
Show Gist options
  • Save berndhahnebach/e4d57634fe7eebbae537bf3da1b1b95a to your computer and use it in GitHub Desktop.
Save berndhahnebach/e4d57634fe7eebbae537bf3da1b1b95a to your computer and use it in GitHub Desktop.
#!/bin/bash
# Released under GPL v2.0
# [email protected]
# Stretch--ifcplusplus.sh
# tested on Debian Stretch = 9.0
# cd ~ # on a local machine
# sudo rm -rf build_FC
mkdir build_FC
cd build_FC
base_dir=`pwd`
cd $base_dir
# *******************************************
echo START THE IfcPlusPlus JOURNEY !!!
echo ---------------------------------
# *******************************************
# update and upgrade system
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get autoremove -y
sudo apt-get update
sudo apt-get clean
# *******************************************
# get dependencies from distribution
packages_build=" \
git \
cmake \
g++ \
libboost-all-dev \
"
sudo apt-get install -y $packages_build
# Qt5
packages_qt5="\
qt5-qmake \
libqt5widgets5 \
libqt5opengl5-dev \
qttools5-dev \
qtbase5-dev \
"
sudo apt-get install -y $packages_qt5
# Ifcpp
packages_ifcpp="\
libopenscenegraph-3.4-dev
"
sudo apt-get install -y $packages_ifcpp
# libopenscenegraph-3.4-dev is linked against qt5
# *******************************************
# update system
sudo apt-get update
sudo apt-get clean
# *******************************************
# get and compile ifcplusplus, patched version from bernd
cd $base_dir
mkdir ifcpp
cd ifcpp
git clone https://github.com/berndhahnebach/ifcplusplus/ ifcpp
# building ifcplusplus
cd $base_dir
cd ifcpp
mkdir build
cd build
rm -rf *
cmake ../ifcpp
# cmake -DCMAKE_BUILD_TYPE=Debug ../ifcpp # debugbuild
make -j 4
# *******************************************
# install ifcplusplus
sudo make install
# libcarve is not found, we add the library path to .bashrc in user home dir
# to find the lib the following could be used
# sudo find / -type f -name "libcarved.so"
cd $base_dir
echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ../.bashrc
# *******************************************
echo -----------------------------
echo END THE IfcPlusPlus JOURNEY !!!
# *******************************************
# get back to bas dir
# cd $base_dir
# *******************************************
# test IfcPlusPlus
# cd $base_dir/ifcpp/ifcpp/examples
# there is a file to test: IfcOpenHouse.ifc
# *******************************************
# get 210_King_Merged.ifc
# in Mai 2018 the site was offline
# cd $base_dir
# wget "http://www.digital210king.org/downloader.php?file=24"
# mv "downloader.php?file=24" 10-King-IFC-Merged__2012-02-07.zip
# unzip 10-King-IFC-Merged__2012-02-07.zip # we hopefully get the file: 210_King_Merged.ifc
# rm 10-King-IFC-Merged__2012-02-07.zip
# open kings file with viewer, does not work through vagrant
# SimpleViewerExampled 210_King_Merged.ifc
# SimpleViewerExampled $base_dir/ifcplusplus/IfcOpenHouse.ifc
# https://forum.freecadweb.org/viewtopic.php?f=4&t=24115&p=232676#p232676
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
@berndhahnebach
Copy link
Author

I may update the script in this regard ...

@berndhahnebach
Copy link
Author

I may update the script in this regard ...

done :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment