From 4ae2b544bf6f042ebf0691aa5afa2a29370ea13c Mon Sep 17 00:00:00 2001 From: tpaviot Date: Fri, 29 Aug 2014 14:38:35 +0200 Subject: [PATCH 1/8] Fixed compilation issue on Linux --- src/Visualization/Display3d.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Visualization/Display3d.cpp b/src/Visualization/Display3d.cpp index 2ac4dcd1f..caf3b18c8 100644 --- a/src/Visualization/Display3d.cpp +++ b/src/Visualization/Display3d.cpp @@ -38,7 +38,15 @@ void Display3d::Init(long window_handle) { printf(" ###### 3D rendering pipe initialisation #####\n"); printf("Display3d class initialization starting ...\n"); - // Create Graphic Device and Window + // Create graphic driver + Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection(); + printf("Aspect_DisplayConnection created.\n"); + if (GetGraphicDriver().IsNull()) + { + GetGraphicDriver() = Graphic3d::InitGraphicDriver (aDisplayConnection); + } + printf("Graphic_Driver created.\n"); + // Create Graphic Device and Window #ifdef WNT myWindow = new WNT_Window((Aspect_Handle) window_handle); printf("WNT window created.\n"); @@ -46,26 +54,19 @@ void Display3d::Init(long window_handle) myWindow = new Cocoa_Window((NSView *) window_handle); printf("Cocoa window created.\n"); #else - Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection(); myWindow =new Xw_Window(aDisplayConnection, (Window) window_handle); printf("Xw_Window created.\n"); #endif - // Create graphic driver - Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection(); - if (GetGraphicDriver().IsNull()) - { - GetGraphicDriver() = Graphic3d::InitGraphicDriver (aDisplayConnection); - } // Create V3dViewer and V3d_View myV3dViewer = new V3d_Viewer(GetGraphicDriver(), (short* const)"viewer"); - printf("Viewer created.\n"); + printf("V3d_Viewer created.\n"); myV3dView = myV3dViewer->CreateView(); - printf("View created\n"); + printf("V3d_View created\n"); myV3dView->SetWindow(myWindow); if (!myWindow->IsMapped()) myWindow->Map(); // Create AISInteractiveViewer myAISContext = new AIS_InteractiveContext(myV3dViewer); - printf("Interactive context created.\n"); + printf("AIS_InteractiveContext created.\n"); printf("Display3d class successfully initialized.\n"); printf(" ########################################\n"); } From 317ae7e59a81dbb0dacbad52ac43745175b096d2 Mon Sep 17 00:00:00 2001 From: tpaviot Date: Fri, 29 Aug 2014 13:49:04 +0200 Subject: [PATCH 2/8] Added travis-ci.org support --- .travis.build.sh | 19 +++++++++++++++++++ .travis.yml | 30 ++++++++++++++++++++++++++++++ README.md | 3 +++ 3 files changed, 52 insertions(+) create mode 100755 .travis.build.sh create mode 100644 .travis.yml diff --git a/.travis.build.sh b/.travis.build.sh new file mode 100755 index 000000000..ed1b3213a --- /dev/null +++ b/.travis.build.sh @@ -0,0 +1,19 @@ +#! /bin/sh +set -e + +ncpus=1 +if test -x /usr/bin/getconf; then + ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN) +fi + +echo "Timestamp" && date +cmake .. +echo "" +echo "Timestamp" && date +echo "Starting build with -j$ncpus ..." + +make -j$ncpus + +# Run tests +#echo "Timestamp" && date +#make test diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..ab587bde2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +language: cpp +compiler: + - gcc + - clang +before_install: + - sudo apt-get install swig + - sudo add-apt-repository "deb http://ftp.us.debian.org/debian/ experimental main" -y + - sudo apt-get update -q + - sudo apt-get install -t experimental liboce-ocaf-dev oce-draw liboce-foundation-dev liboce-modeling-dev +before_script: + - mkdir cmake-build + - cd cmake-build +# Depth is necessary, otherwise DRAWEXE exits with this message: +# Tcl Exception: ** Exception ** 0x7fee03adb307 : Aspect_WindowDefinitionError: Xw_Window, couldn't find compatible Visual (RGBA, double-buffered) +script: xvfb-run -s "-screen 0 1024x768x16" ../.travis.build.sh +#after_script: +# - test ! -r occt/summary.xml || xsltproc --param duration 1 ../.travis.xsl occt/summary.xml +# - if [ -r occt/summary.xml ]; then +# xsltproc ../.travis.xsl occt/summary.xml > occt/summary.failed; +# if [ -s occt/summary.failed ]; then +# echo "FAILED TESTS:"; +# cat occt/summary.failed; +# for file in $(cat occt/summary.failed); do head -n -1 occt/$file.{tcl,log}; done; +# fi; +# fi +branches: + only: + - master + - /^review/ + diff --git a/README.md b/README.md index 341b8844f..47d8cc416 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +Travis-CI Build Status : +[![Build Status](https://travis-ci.org/tpaviot/pythonocc-core.png?branch=master)](https://travis-ci.org/tpaviot/pythonocc-core) + pythonocc-core ============== From 1975052b329a80942e28375f69dafc62c8c49b1f Mon Sep 17 00:00:00 2001 From: tpaviot Date: Fri, 29 Aug 2014 18:39:01 +0200 Subject: [PATCH 3/8] Fake commit to trigger travis-ci compilation --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab587bde2..547e6b9a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ before_install: - sudo apt-get install swig - sudo add-apt-repository "deb http://ftp.us.debian.org/debian/ experimental main" -y - sudo apt-get update -q - - sudo apt-get install -t experimental liboce-ocaf-dev oce-draw liboce-foundation-dev liboce-modeling-dev + - sudo apt-get install -t experimental liboce-ocaf-dev oce-draw before_script: - mkdir cmake-build - cd cmake-build @@ -27,4 +27,4 @@ branches: only: - master - /^review/ - +# From a189b170c2ec7fad4b475836a1e10ba362ab915e Mon Sep 17 00:00:00 2001 From: Denis Barbier Date: Sun, 31 Aug 2014 20:16:09 +0200 Subject: [PATCH 4/8] Minor changes in .travis.yml --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 547e6b9a2..30b364347 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,8 @@ compiler: before_install: - sudo apt-get install swig - sudo add-apt-repository "deb http://ftp.us.debian.org/debian/ experimental main" -y - - sudo apt-get update -q + - sudo apt-get update + - apt-cache policy oce-draw libtcl8.5 libtk8.5 - sudo apt-get install -t experimental liboce-ocaf-dev oce-draw before_script: - mkdir cmake-build From c80bed4333084785d636032a40dc7d0d65713e0f Mon Sep 17 00:00:00 2001 From: Denis Barbier Date: Sun, 31 Aug 2014 20:49:38 +0200 Subject: [PATCH 5/8] Change Travis-ci URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 47d8cc416..b59d96eef 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ Travis-CI Build Status : -[![Build Status](https://travis-ci.org/tpaviot/pythonocc-core.png?branch=master)](https://travis-ci.org/tpaviot/pythonocc-core) +[![Build Status](https://travis-ci.org/dbarbier/pythonocc-core.png?branch=master)](https://travis-ci.org/dbarbier/pythonocc-core) pythonocc-core ============== From d814f0470f7f8b32f28302f83f8b8c8e03147b58 Mon Sep 17 00:00:00 2001 From: Denis Barbier Date: Mon, 1 Sep 2014 11:44:50 +0200 Subject: [PATCH 6/8] Travis: Change tcl/tk dependencies --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 30b364347..a6d839060 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ before_install: - sudo apt-get install swig - sudo add-apt-repository "deb http://ftp.us.debian.org/debian/ experimental main" -y - sudo apt-get update - - apt-cache policy oce-draw libtcl8.5 libtk8.5 + - apt-cache policy oce-draw tcl8.5-dev tk8.5-dev - sudo apt-get install -t experimental liboce-ocaf-dev oce-draw before_script: - mkdir cmake-build From 6625c714b31c8e20677bb64f769d40b0e43cdaec Mon Sep 17 00:00:00 2001 From: Denis Barbier Date: Mon, 1 Sep 2014 11:55:08 +0200 Subject: [PATCH 7/8] Travis: explicitly list all dependencies --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a6d839060..6e89855bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ before_install: - sudo add-apt-repository "deb http://ftp.us.debian.org/debian/ experimental main" -y - sudo apt-get update - apt-cache policy oce-draw tcl8.5-dev tk8.5-dev - - sudo apt-get install -t experimental liboce-ocaf-dev oce-draw + - sudo apt-get install -t experimental oce-draw liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev liboce-modeling-dev liboce-foundation-dev liboce-ocaf9 liboce-visualization9 liboce-ocaf-lite9 liboce-modeling9 liboce-foundation9 tcl8.5-dev tk8.5-dev libtcl8.5 libtk8.5 before_script: - mkdir cmake-build - cd cmake-build From 8de2ae244705cb78a77e546eee2bfd30f03880f8 Mon Sep 17 00:00:00 2001 From: Denis Barbier Date: Mon, 1 Sep 2014 11:59:11 +0200 Subject: [PATCH 8/8] Travis: Fix tcl/Tk package names on Ubuntu --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6e89855bf..1a376503f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ before_install: - sudo add-apt-repository "deb http://ftp.us.debian.org/debian/ experimental main" -y - sudo apt-get update - apt-cache policy oce-draw tcl8.5-dev tk8.5-dev - - sudo apt-get install -t experimental oce-draw liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev liboce-modeling-dev liboce-foundation-dev liboce-ocaf9 liboce-visualization9 liboce-ocaf-lite9 liboce-modeling9 liboce-foundation9 tcl8.5-dev tk8.5-dev libtcl8.5 libtk8.5 + - sudo apt-get install -t experimental oce-draw liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev liboce-modeling-dev liboce-foundation-dev liboce-ocaf9 liboce-visualization9 liboce-ocaf-lite9 liboce-modeling9 liboce-foundation9 tcl8.5-dev tk8.5-dev tcl8.5 tk8.5 before_script: - mkdir cmake-build - cd cmake-build