Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 85 lines (67 sloc) 2.2 KB
#! /bin/bash
set -xe
PKG=brlcad
VERSION=7.28.0
SRCURL=https://sourceforge.net/projects/brlcad/files/BRL-CAD%20Source/$VERSION/$PKG-$VERSION.tar.gz
SRC=$PKG-$VERSION.tar.gz
BUILD=0
PREFIX=/pkg/$PKG-$VERSION-$BUILD
# PREFIX=/dev/shm/pkg/$PKG-$VERSION-$BUILD
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
EOF
source $PREFIX/profile
mkdir -p $PREFIX/build
cd $PREFIX/build
test -e $PKG-$VERSION.tar.gz || wget --no-verbose $SRCURL
test -n "$XWIPE" && rm -rf $PKG-$VERSION
test -d $PKG-$VERSION || tar -xf $PKG-$VERSION.tar.gz
mkdir -p $PKG-$VERSION/build
cd $PKG-$VERSION/build
# The slackbuild was again a valuable source to get this thing build
# https://slackbuilds.org/slackbuilds/14.2/graphics/brlcad/brlcad.SlackBuild
#
# lessons learned:
# - Warnings need to be turened off (at least for gcc5 builds).
# - gcc7 will throw weird errors from the depths of the cstdlib (include_next, OMG!):
#
# In file included from /dev/shm/brlcad-7.28.0/build/include/clipper.hpp:40:0,
# from /dev/shm/brlcad-7.28.0/src/libged/polyclip.cpp:31:
# /usr/include/c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
# #include_next <stdlib.h>
# ^~~~~~~~~~
#
# - BRLCAD_ENABLE_RUNTIME_DEBUG is strongly encouraged
#
source /pkg/gcc-5.5.0-1/profile
MXCFLAGS="-O2 -fPIC"
cmake \
-DCMAKE_COLOR_MAKEFILE=OFF \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_C_FLAGS:STRING="$MXCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$MXCFLAGS" \
-DBRLCAD_BUNDLED_LIBS=AUTO \
-DBRLCAD_ENABLE_RUNTIME_DEBUG=ON \
-DBRLCAD_FLAGS_DEBUG=OFF \
-DBRLCAD_ENABLE_STRICT=OFF \
-DBRLCAD_ENABLE_COMPILER_WARNINGS=OFF\
-DBRLCAD_FLAGS_OPTIMIZATION=ON \
-DBRLCAD_ENABLE_OPENGL=ON \
-DBRLCAD_TCL=BUNDLED \
-DBRLCAD_TK=BUNDLED \
-DBRLCAD_ITCL=BUNDLED \
-DBRLCAD_ITK=BUNDLED \
-DBRLCAD_ENABLE_QT=OFF \
-DBRLCAD_ENABLE_OSG=OFF \
-DBRLCAD_ENABLE_RTGL=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DBRLCAD_ENABLE_EXTRADOCS=ON \
-DBRLCAD_INSTALL_EXAMPLE_GEOMETRY=ON \
..
NUMJOBS=$(nproc)
if test $NUMJOBS -gt 96 ; then NUMJOBS=96; fi
nice -12 make -j $NUMJOBS
make install
exit