Skip to content

Commit

Permalink
Merge pull request #2 from FreeCAD/master
Browse files Browse the repository at this point in the history
Synchronizing
  • Loading branch information
Dgatibelza authored Dec 15, 2020
2 parents d20c437 + e672aa2 commit cdc6a33
Show file tree
Hide file tree
Showing 5,120 changed files with 809,625 additions and 478,126 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
liberapay: FreeCAD
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://www.patreon.com/yorikvanhavre', 'https://www.patreon.com/kkremitzki', 'https://www.patreon.com/thundereal']
custom: ["https://wiki.freecadweb.org/Donate"]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# file types to ignore

*.DS_Store
*.pyc
*.obj
*.lib
Expand Down
148 changes: 96 additions & 52 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
####
######
#
# Travis-CI configuration file for FreeCAD.
#
# This build configuration will build and test FreeCAD on both Linux
Expand All @@ -16,7 +17,7 @@
#
# DEPLOY: Repo setting to deploy (defaults to no deploy to reduce
# Travis build times. Set DEPLOY=1 to enable in repo settings.
##
######
env:
global:
- GENERATOR="Unix Makefiles"
Expand Down Expand Up @@ -48,7 +49,8 @@ jobs:
# - python: 3.7
fast_finish: true # https://blog.travis-ci.com/2013-11-27-fast-finishing-builds
include:
- os: linux
- if: type != pull_request
os: linux
dist: bionic
language: cpp
compiler: clang
Expand All @@ -57,33 +59,33 @@ jobs:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- clang-9
- clang-10
env:
- CC=clang-9
- CXX=clang++-9
- CC=clang-10
- CXX=clang++-10
- CMAKE_ARGS="-DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_FEM_NETGEN=ON -DBUILD_QT5=ON"
- CACHE_NAME=JOB1

- os: linux
dist: bionic
language: cpp
compiler: gcc-9
compiler: gcc-10
cache: ccache
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- gcc-9
- g++-9
- gcc-10
- g++-10
env:
- CC=gcc-9
- CXX=g++-9
- CC_FOR_BUILD=gcc-9
- CXX_FOR_BUILD=g++-9
- CC=gcc-10
- CXX=g++-10
- CC_FOR_BUILD=gcc-10
- CXX_FOR_BUILD=g++-10
- CMAKE_ARGS="-DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_C_COMPILER=/usr/bin/cc -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_FEM_NETGEN=ON -DBUILD_QT5=ON"
- CACHE_NAME=JOB2

Expand All @@ -100,6 +102,20 @@ jobs:
- CMAKE_ARGS="-DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_C_COMPILER=/usr/bin/cc"
- CACHE_NAME=JOB3

- os: osx
osx_image: xcode11.6
language: cpp
cache:
- ccache: true
- directories:
- $HOME/.ccache
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
env:
- CMAKE_OPTS="-DBUILD_QT5=ON -DBUILD_ENABLE_CXX_STD='C++17' -DUSE_PYTHON3=1 -DCMAKE_CXX_FLAGS='-Wno-deprecated-declarations' -DBUILD_FEM_NETGEN=1 -DBUILD_FEM=1 -DBUILD_TECHDRAW=0 -DCMAKE_PREFIX_PATH='/usr/local/opt/qt/lib/cmake;/usr/local/opt/nglib/Contents/Resources' -DBUILD_FEM_NETGEN:BOOL=ON -DFREECAD_USE_EXTERNAL_KDL=ON -DCMAKE_BUILD_TYPE=Release"
- PATH=/usr/local/bin:$PATH
- CACHE_NAME=OSX1

- os: windows
language: cpp
env:
Expand All @@ -119,7 +135,7 @@ jobs:
cache:
directories:
- $HOME/clcache

# - language: python
# python: 3.7
# dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
Expand All @@ -128,6 +144,9 @@ jobs:
# # fail the build if there are Python syntax errors or undefined names
# script: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

before_cache:
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then find /usr/local/Homebrew \! -regex ".+\.git.+" -delete; fi

before_install:
# - eval "$(curl -fsSL "https://raw.githubusercontent.com/${OSX_PORTS_CACHE}/v${FREECAD_RELEASE}/travis-helpers.sh")"
Expand Down Expand Up @@ -188,6 +207,11 @@ before_install:
# Runtime deps
sudo apt-get install -y --no-install-recommends freecad-daily-python3 python-pivy python3-pivy python-ply python3-ply
# Use newer Eigen to suppress warnings
# https://github.com/FreeCAD/FreeCAD/pull/3485
wget http://mirrors.kernel.org/ubuntu/pool/universe/e/eigen3/libeigen3-dev_3.3.7-2_all.deb
sudo dpkg -i libeigen3-dev_3.3.7-2_all.deb
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
Expand All @@ -196,40 +220,55 @@ before_install:
;;
"osx")
#xcodebuild -version -sdk
#brew --config
#if [ "${OSX_PORTS_CACHE}X" != "X" ]; then
# brew install jq
# cacheContext=$(create_helper_context repo=${OSX_PORTS_CACHE} auth_token=${GH_TOKEN} release=${FREECAD_RELEASE})
# travis_wait prime_local_ports_cache $cacheContext
#fi
#brew update >/dev/null
#brew --config
#brew tap FreeCAD/freecad
#brew install --verbose --only-dependencies freecad --with-packaging-utils
#pip install six
## Qt5: Set Qt5 build flag and CMAKE_PREFIX
#QT5_CMAKE_PREFIX=$(ls -d $(brew --cellar)/qt/*/lib/cmake)
#QT5_WEBKIT_CMAKE_PREFIX=$(ls -d $(brew --cellar)/qtwebkit/*/lib/cmake)
#CMAKE_OPTS="${CMAKE_OPTS} -DBUILD_QT5=ON -DCMAKE_PREFIX_PATH=${QT5_CMAKE_PREFIX};${QT5_WEBKIT_CMAKE_PREFIX}"
xcodebuild -version -sdk
brew --config
brew install ccache
brew install coreutils
brew update >/dev/null
brew --config
brew update
brew upgrade
brew install [email protected]
brew unlink [email protected]
brew link --overwrite --force [email protected]
rm /usr/local/bin/python
ln -s /usr/local/bin/python3 /usr/local/bin/python
pip3 install six
pip3 install pyyaml
pip3 install ply
export PATH=/usr/local/bin:$PATH
brew reinstall [email protected]
brew link --force [email protected]
which python
python --version
brew install boost
brew install boost-python3
brew tap FreeCAD/freecad
brew install freecad/freecad/coin
brew install freecad/freecad/nglib
brew install freecad/freecad/med-file
brew install freecad/freecad/opencamlib
brew install freecad/freecad/shiboken2
brew install freecad/freecad/pyside2
brew install freecad/freecad/pyside2-tools
brew install freecad/freecad/pivy
brew install freecad/freecad/matplotlib
##Install the 3DConnexion frameworks
#if [ "${DEPLOY}" == "1" ]; then
# if [ ! -d /Library/Frameworks/3DconnexionClient.framework ]; then
# curl -o /tmp/3dFW.dmg -L 'http://www.3dconnexion.com/index.php?eID=sdl&ext=tx_iccsoftware&oid=a273bdbc-c289-e10d-816b-567043331c9e&filename=3DxWareMac_v10-4-1_r2428.dmg'
# hdiutil attach -readonly /tmp/3dFW.dmg
# sudo installer -package /Volumes/3Dconnexion\ Software/Install\ 3Dconnexion\ software.pkg -target /
# diskutil eject /Volumes/3Dconnexion\ Software
# fi
# export CMAKE_OPTS="${CMAKE_OPTS} -DFREECAD_CREATE_MAC_APP=ON"
# export INSTALLED_APP_PATH="/usr/local/FreeCAD.app/Contents/MacOS/FreeCAD"
#else
# export INSTALLED_APP_PATH="/usr/local/MacOS/FreeCAD"
#fi
if [ ! -d /Library/Frameworks/3DconnexionClient.framework ]; then
curl -o /tmp/3dFW.dmg -L 'https://download.3dconnexion.com/drivers/mac/10-6-6_360DF97D-ED08-4ccf-A55E-0BF905E58476/3DxWareMac_v10-6-6_r3234.dmg'
hdiutil attach -readonly /tmp/3dFW.dmg
sudo installer -package /Volumes/3Dconnexion\ Software/Install\ 3Dconnexion\ software.pkg -target /
diskutil eject /Volumes/3Dconnexion\ Software
fi
export CMAKE_OPTS="${CMAKE_OPTS} -DFREECAD_CREATE_MAC_APP=OFF"
export INSTALLED_APP_PATH="/usr/local/MacOS/FreeCAD"
#export CMAKE_ARGS="${CMAKE_OPTS} -DFREECAD_USE_EXTERNAL_KDL=ON"
export CMAKE_ARGS="${CMAKE_OPTS} -DFREECAD_USE_EXTERNAL_KDL=ON"
brew link --overwrite matplotlib
if [ -f "/usr/local/Cellar/opencascade/7.4.0_1/include/opencascade/Standard_Macro.hxx" ]; then
sed '1,$s/\[\[nodiscard\]\]//' /usr/local/Cellar/opencascade/7.4.0_1/include/opencascade/Standard_Macro.hxx > /tmp/Standard_Macro.hxx && cp /tmp/Standard_Macro.hxx /usr/local/Cellar/opencascade/7.4.0_1/include/opencascade/Standard_Macro.hxx ;
fi
;;
"windows")
Expand All @@ -245,12 +284,12 @@ before_install:
# clcache stats before compilation
cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -s'
curl -L https://github.com/FreeCAD/FreeCAD/releases/download/0.19_pre/FreeCADLibs_12.1.4_x64_VC15.7z --output FreeCADLibs.7z
curl -L https://github.com/FreeCAD/FreeCAD/releases/download/0.19_pre/FreeCADLibs_12.1.6_x64_VC15.7z --output FreeCADLibs.7z
7z x FreeCADLibs.7z -oFreeCADLibs > /dev/null
rm -f FreeCADLibs.7z
export FREECAD_LIBPACK_DIR="$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.4_x64_VC15"
export FREECAD_LIBPACK_DIR="$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.6_x64_VC15"
export CMAKE_ARGS="${CMAKE_OPTS} -DFREECAD_LIBPACK_DIR=$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.4_x64_VC15 -DPYTHON_EXECUTABLE=$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.4_x64_VC15\bin\python.exe \
export CMAKE_ARGS="${CMAKE_OPTS} -DFREECAD_LIBPACK_DIR=$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.6_x64_VC15 -DPYTHON_EXECUTABLE=$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.1.6_x64_VC15\bin\python.exe \
-DBUILD_QT5=TRUE"
export PATH=$MSBUILD_PATH:$PATH
;;
Expand All @@ -265,7 +304,9 @@ install:
####
# Build FreeCAD with cmake options set above for each platform
##
- mkdir build && cd build && cmake -G"${GENERATOR}" ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ../
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export PATH="/usr/local/bin:/usr/local/opt/ccache/libexec:$PATH"; fi
- echo ${CMAKE_ARGS}
- mkdir build && cd build && cmake -Wno-dev -G"${GENERATOR}" ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ../

script:
####
Expand All @@ -280,7 +321,7 @@ script:
cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\.travis\build.bat'
# ls -lahR
mkdir bin/
mv ../FreeCADLibs/FreeCADLibs_12.1.4_x64_VC15/bin/* bin/
mv ../FreeCADLibs/FreeCADLibs_12.1.6_x64_VC15/bin/* bin/
du -hs bin/
# show clcache hit stats
cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -s'
Expand All @@ -294,9 +335,12 @@ script:
# Stop compiling (GCC) after 2 hrs 50 min (3 hrs limit).
# Preserves created ccache for the next build job.
# if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo timeout -k 175m 170m make -j2 install || true; fi
# if [ "${TRAVIS_OS_NAME}" == "osx" ]; then sudo make -j2 install; fi
# if [ "${TRAVIS_OS_NAME}" == "osx" ]; then sudo gtimeout -s KILL make -j2 install; fi
cat $HOME/.ccache/ccache.conf
ccache -z -s
df -h
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then export PATH="/usr/local/opt/ccacche/libexec:$PATH"; sudo gtimeout -s KILL 7200 make -j2; [ $? == 124 ] && { ccache -s; return 0; } fi
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo timeout -k 175m 170m make -j2 install || true; fi
sudo make -j2 install
ccache -s
${INSTALLED_APP_PATH} --console --run-test 0 || travis_terminate 1
Expand Down
38 changes: 38 additions & 0 deletions BUILD_OSX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Building FreeCAD on Mac OS 10.15.x -- Catalina #

General notes on how the tooling works:

This setup uses [conda](https://docs.conda.io) for dependency management.
Conda is able to pull the deps from a repository called conda-forge and
setup an isolated build environment. Not quite as isolated as docker, but
it is a good option for Mac and its what the FreeCAD CI system uses.

Once the dependencies are installed into a conda environment, then the
build uses the standard `cmake` configuration process to configure the build
and `ninja` to invoke the actual compilation against whatever host compiler
(gcc, clang, etc.) was installed by conda's `cxx-compiler` package for
that architecture.

All of this, and some sanity checks, are in a unified shell script. See below.

# Directions #

## Install XCode Command line tools ##

Run `xcode-select --install` and click through.

## Install Conda ##

Refer to [MiniConda Docs](https://docs.conda.io/en/latest/miniconda.html).

## Run the shell script ##

Run the `./build_unix_dev_conda.sh` and go get coffee. Builds take
an hour+ on a 2012 Retina MacBook.

Output binaries will be in the `./build/bin/FreeCAD` *and*
`${CONDA_PREFIX}/bin/FreeCAD` directories.

You can code/build/test using the cmake configuration folder `./build` in
the standard way *from within the freecad_dev conda environment*.

27 changes: 10 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
# april 2020, the oldest we have to support : Ununtu 16.04 LTS (Xenial)
cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)

if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif(POLICY CMP0020)
# added in cmake 3.0
if(POLICY CMP0050)
cmake_policy(SET CMP0050 NEW)
endif(POLICY CMP0050)
if (POLICY CMP0045)
cmake_policy(SET CMP0045 NEW)
endif(POLICY CMP0045)
if (POLICY CMP0072)
cmake_policy(SET CMP0072 OLD)
endif(POLICY CMP0072)
endif(COMMAND cmake_policy)
# policy CMP0072 was introduced with CMake 3.11
# relates to FindOpenGL module
# and cache variables OPENGL_gl_LIBRARY, OPENGL_glu_LIBRARY
if (POLICY CMP0072)
cmake_policy(SET CMP0072 OLD)
endif(POLICY CMP0072)

find_program(CCACHE_PROGRAM ccache) #This check should occur before project()
if(CCACHE_PROGRAM)
Expand All @@ -36,6 +27,7 @@ set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE
set(PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}")

# include local modules
include(CheckCXXCompilerFlag)
include(AddFileDependencies)
include(cMake/FreeCadMacros.cmake)
# include helper functions/macros
Expand All @@ -48,6 +40,7 @@ ConfigureCMakeVariables()
InitializeFreeCADBuildOptions()
CheckInterModuleDependencies()
FreeCADLibpackChecks()
SetupDoxygen()
if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
SetupPython()
SetupPCL()
Expand Down
Loading

0 comments on commit cdc6a33

Please sign in to comment.