[Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Post by sgrogan »

NormandC wrote:What gkv311 suggested was very interesting, but complicates things. I think we could start with where gdo left off, and with the same number of packages as current liboce then we see what can be done next.
Thanks NormandC! I'm a little intimidated by this. I was able to upgrade to OCCT 7.0 on win, but broke netgen, it's still not fixed. On gitter @bblacey has provided a patch for nglib 5.3.1 for OCCT 7.1.
What can I do to help?
"fight the good fight"
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Post by blacey »

sgrogan wrote:
NormandC wrote:What gkv311 suggested was very interesting, but complicates things. I think we could start with where gdo left off, and with the same number of packages as current liboce then we see what can be done next.
Thanks NormandC! I'm a little intimidated by this. I was able to upgrade to OCCT 7.0 on win, but broke netgen, it's still not fixed. On gitter @bblacey has provided a patch for nglib 5.3.1 for OCCT 7.1.
What can I do to help?
For those not on Gitter, you can apply netgen nglib patch set for OCCT 7.x as follows:

Code: Select all

tar xvzf netgen-5.3.1.tar.gz
cd netgen-5.3.1
curl -L https://github.com/FreeCAD/homebrew-freecad/releases/download/0/nglib-occt7.patch | patch -p1
Output

Code: Select all

patching file configure
patching file libsrc/meshing/improve2.hpp
patching file libsrc/meshing/meshclass.hpp
patching file libsrc/meshing/meshtype.hpp
patching file libsrc/occ/Partition_Inter2d.hxx
patching file libsrc/occ/Partition_Inter3d.hxx
patching file libsrc/occ/Partition_Loop.hxx
patching file libsrc/occ/Partition_Loop2d.cxx
patching file libsrc/occ/Partition_Loop2d.hxx
patching file libsrc/occ/Partition_Loop3d.hxx
patching file libsrc/occ/Partition_Spliter.hxx
patching file libsrc/occ/occgeom.cpp
patching file libsrc/occ/occgeom.hpp
patching file libsrc/occ/occmeshsurf.hpp
patching file libsrc/occ/vsocc.cpp
patching file ng/Makefile.in
patching file ng/ngpkg.cpp
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Post by NormandC »

sgrogan wrote:Thanks NormandC! I'm a little intimidated by this. I was able to upgrade to OCCT 7.0 on win, but broke netgen, it's still not fixed.
I would like to start with OCCT packaging, then migrate the PPA over it first, if it doesn't bring conflicts with the existing libraries. I'll build a local package with pbuilder and validate first. As agreed previously OCCT would not be compiled against VTK, but TBB would be enabled. A visualization package not relying on VTK would be created, but FreeCAD would not depend on it.

Then move on to netgen, vtk7, med, etc.
sgrogan wrote:What can I do to help?
I still suck at Git. Here's what I have in mind, the two first points I can do on my own but not the following ones...
  • git clone https://git.launchpad.net/~freecad-main ... +git/OCCT7 (easy enough that one I can do on my own)
  • create a new branch, let's call it the occt710 branch (can do)
  • import the OCCT7.1.0 tarball in it
  • merge the occt710 branch to master - actually not sure it would be a merge, since it basically needs to overwrite the current master?
  • push the occt710 branch and the new master to Launchpad
My basic idea is that our Launchpad OCCT git repo, while it would be devoid of the original git history, would have one of its own so we could go back a commit for 7.0.0, for example.

Or maybe that's unnecessary? Would it be simpler to clone the repo, delete everything in my local branch, extract the 7.1.0 tarball in it, commit then push to Launchpad? Could it be as simple?
blacey wrote:For those not on Gitter, you can apply netgen nglib patch set for OCCT 7.x as follows:
The problem is applying such a patch to a Debian package. Or maybe we stop trying to follow the Debian rule book, patch the source before packaging it (heresy!!!) and that is that. :roll:

Please tell me: nglib is part of netgen, right?
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Post by blacey »

NormandC wrote: Please tell me: nglib is part of netgen, right?
Yes. nglib is a stand-alone messier library that is also included in Netgen. In fact, 5.3.1 is the last stand-alone library release and the author does not intend to make any more stand-alone releases, only full Netgen releases. @ian.reese and @vejmarie, are both trying to convince him/her otherwise but for now we need to patch or move to the full Netgen.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Post by NormandC »

Hello gdo35,

In reference to your reply https://forum.freecadweb.org/viewtopic. ... 70#p141790
gdo35 wrote:To build the package, just decompress debian.tar.gz (in attachment) into OCCT source folder and run :

Code: Select all

debuild -uc -us  -j$(nproc) --lintian-opts --profile debian
This command does not work.

Code: Select all

$ debuild -uc -us  -j$(nproc) --lintian-opts --profile debian
debuild: unknown dpkg-buildpackage/debuild option: -us 
 dpkg-buildpackage -rfakeroot -D -us -uc -us  -j4
dpkg-buildpackage: option ou paramètre inconnu -us 

Utilisez --help pour de l'information sur l'utilisation du programme.
debuild: fatal error at line 1376:
dpkg-buildpackage -rfakeroot -D -us -uc -us  -j4 failed
Not sure why the error report lists "-us" twice.

I noticed there were two spaces between -us and -j$(nproc). I removed one.

Next here's what I got:

Code: Select all

$ debuild -uc -us -j$(nproc) --lintian-opts --profile debian
 dpkg-buildpackage -rfakeroot -D -us -uc -j4
dpkg-buildpackage: paquet source opencascade
dpkg-buildpackage: version source 7.0.0
dpkg-buildpackage: distribution source unstable
dpkg-buildpackage: source changé par xxxxxxxxxxxx <xxxxx@gmail.com>
 dpkg-source --before-build opencascade-7.1.0
dpkg-buildpackage: architecture hôte amd64
dpkg-source: erreur: impossible de lire opencascade-7.1.0/debian/control: No such file or directory
dpkg-buildpackage: erreur: dpkg-source --before-build opencascade-7.1.0 a produit une erreur de sortie de type 2
debuild: fatal error at line 1376:
dpkg-buildpackage -rfakeroot -D -us -uc -j4 failed
Basically it is looking for a /debian/control file but it's not finding it, since it is generated later in the process...
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Post by looo »

Just wondering why you are not going for a newer netgen version? With cmake things are much simpler now.

ps. sorry for interrupting,I forgot about c++14 dependencies.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Post by sgrogan »

NormandC wrote:Or maybe that's unnecessary? Would it be simpler to clone the repo, delete everything in my local branch, extract the 7.1.0 tarball in it, commit then push to Launchpad? Could it be as simple?
I think this more likely to work. Merging 7.1 into 7.0 will probably result in merge conflicts. I'll try this locally and see what happens..
NormandC wrote:Please tell me: nglib is part of netgen, right?
Yes, we only need a subset of netgen. libnglib-dev gets pulled in as a dependency of netgen-headers. We don't have the netgen package as a depends for FreeCAD.
looo wrote:Just wondering why you are not going for a newer netgen version? With cmake things are much simpler now.

ps. sorry for interrupting,I forgot about c++14 dependencies.

This is only true for VS2013 on win. Using 5.3.1 is motivated by using blaceys prior art. I think the packaging for 6.x changed and my answer to NormandC may be invalid. 5.3.1 seems to be where we can have parity for OSX/Ubuntu/Win
"fight the good fight"
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Post by NormandC »

I'm stuck.

Since gdo35 was not responding and his stuff doesn't seem to work, I continued with editing the *.install files like I was originally doing. That part I'm pretty sure I've got covered.

The problem is with the $%?&*! rules file. :evil: I reused gdo35's rules file, but I removed the entry calling his script.

Content of the rules file:

Code: Select all

#!/usr/bin/make -f

CFLAGS   := $(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS  := $(shell dpkg-buildflags --get LDFLAGS)

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

ifeq ($(findstring parallel=,$(DEB_BUILD_OPTIONS)),)
	export DEB_BUILD_OPTIONS+=parallel=$(shell getconf _NPROCESSORS_ONLN)
endif

%:
	dh $@ --buildsystem=cmake --parallel --with quilt

override_dh_auto_configure:
	# See in debian/patches/split-export.patch why we must ignore cmake return value
	-dh_auto_configure -- \
        -DFREETYPE_INCLUDE_DIR_freetype2=/usr/include/freetype2 \
        -DOCE_BUILD_SHARED_LIB:BOOL=ON \
        -DOCE_TESTING:BOOL=ON \
        -DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON \
        -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
        -DOCE_INSTALL_PREFIX:PATH=/usr \
        -DOCE_INSTALL_LIB_DIR:PATH=lib/$(DEB_HOST_MULTIARCH) \
        -DOCE_INSTALL_CMAKE_DATA_DIR:PATH=lib/$(DEB_HOST_MULTIARCH)/oce-0.16 \
        -DOCE_DRAW:BOOL=ON \
        -DOCE_RPATH_FILTER_SYSTEM_PATHS:BOOL=ON \
        -DCMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES:STRING='/lib/$(DEB_HOST_MULTIARCH);/usr/lib/$(DEB_HOST_MULTIARCH)' \
        -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING='$(CFLAGS)' \
        -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING='$(CXXFLAGS)' \
        -DCMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING='$(LDFLAGS)' \
        -DCMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING='$(LDFLAGS)' \
        -DOCE_MULTITHREAD_LIBRARY:STRING=NONE \
        -DOCE_WITH_FREEIMAGE:BOOL=ON \
        -DOCE_WITH_GL2PS:BOOL=ON \
        -DDART_TESTING_TIMEOUT:STRING='3600'

override_dh_auto_install:
	dh_auto_install
	-mkdir debian/tmp/usr/include/oce/$(DEB_HOST_MULTIARCH)
	mv debian/tmp/usr/include/oce/oce_build_config.defs debian/tmp/usr/include/oce/$(DEB_HOST_MULTIARCH)/oce_build_config.defs
	-mkdir debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)
	rm debian/tmp/usr/include/oce/config.h
	mv debian/tmp/usr/include/oce/oce-config.h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/
	# Improve integration in Debian desktop
	install -d debian/tmp/usr/share/applications
	cp -p debian/oce-draw.desktop debian/tmp/usr/share/applications/
	install -d debian/tmp/usr/share/pixmaps
	cp -p debian/occ-icon-32.xpm debian/tmp/usr/share/pixmaps/
	install -d debian/tmp/usr/share/man/man1
	# Install manual page
	cp -p debian/DRAWEXE.1 debian/tmp/usr/share/man/man1/
	find debian/tmp/usr/share -name FILES -exec rm -f {} \;

override_dh_install:
	dh_install --list-missing
	rm -rf debian/oce-draw/usr/include

override_dh_makeshlibs:
	dh_makeshlibs -Noce-draw
Then I ran "debuild" in a terminal. It stops quickly with an error saying the target is not specified and no makefile was found. (There's no point in pasting it here since the error message is in French)
gdo35
Posts: 189
Joined: Wed Jan 25, 2012 7:25 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Post by gdo35 »

Hi all,

Sorry I did not see your messages. ;)

Exploring Path workbench takes most of my time for now.

But I am still working on packaging OCCT. I am trying to package version 7.1.0.
I will talk about this sooner in an other post on this topic.

For now I reproduced Normandc problems with my debian folder and OCCT 7.0.0... Normandc, could you try these commands, before running debuild :

Code: Select all

mkdir debian/tmp
debian/script.sh
It is building for me. I'll see tomorrow the result.

++
gdo
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Post by NormandC »

Thanks Gilles,

So the script needs to be run first! That was not mentioned in your previous reply.

I just did as you suggested and then ran debuild -uc -us -j$(nproc) --lintian-opts --profile debian. It was building for a few minutes, but then it stopped at 43%. I have no clue what made it stop...

Code: Select all

[ 43%] Building CXX object src/TKXSBase/CMakeFiles/TKXSBase.dir/__/MoniTool/MoniTool_TimerSentry.cxx.o
cd /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/src/TKXSBase && /usr/bin/x86_64-linux-gnu-g++   -DHAVE_FREEIMAGE -DHAVE_TBB -DOCC_CONVERT_SIGNALS -DTKXSBase_EXPORTS -I/usr/include/tcl8.5 -I/usr/include/freetype2 -I/home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/inc  -std=c++0x -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -fexceptions -fPIC -Wall -Wextra -fPIC   -o CMakeFiles/TKXSBase.dir/__/MoniTool/MoniTool_TimerSentry.cxx.o -c /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/src/MoniTool/MoniTool_TimerSentry.cxx
[ 43%] Building CXX object src/TKXSBase/CMakeFiles/TKXSBase.dir/__/MoniTool/MoniTool_TransientElem.cxx.o
cd /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/src/TKXSBase && /usr/bin/x86_64-linux-gnu-g++   -DHAVE_FREEIMAGE -DHAVE_TBB -DOCC_CONVERT_SIGNALS -DTKXSBase_EXPORTS -I/usr/include/tcl8.5 -I/usr/include/freetype2 -I/home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/inc  -std=c++0x -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -fexceptions -fPIC -Wall -Wextra -fPIC   -o CMakeFiles/TKXSBase.dir/__/MoniTool/MoniTool_TransientElem.cxx.o -c /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/src/MoniTool/MoniTool_TransientElem.cxx
[ 43%] Building CXX object src/TKXSBase/CMakeFiles/TKXSBase.dir/__/MoniTool/MoniTool_TypedValue.cxx.o
cd /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/src/TKXSBase && /usr/bin/x86_64-linux-gnu-g++   -DHAVE_FREEIMAGE -DHAVE_TBB -DOCC_CONVERT_SIGNALS -DTKXSBase_EXPORTS -I/usr/include/tcl8.5 -I/usr/include/freetype2 -I/home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/inc  -std=c++0x -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -fexceptions -fPIC -Wall -Wextra -fPIC   -o CMakeFiles/TKXSBase.dir/__/MoniTool/MoniTool_TypedValue.cxx.o -c /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/src/MoniTool/MoniTool_TypedValue.cxx
In file included from /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/inc/Standard_RangeError.hxx:1:0,
                 from /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/src/Standard/Standard_OutOfRange.hxx:23,
                 from /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/inc/Standard_OutOfRange.hxx:1,
                 from /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/src/NCollection/NCollection_Sequence.hxx:22,
                 from /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/inc/NCollection_Sequence.hxx:1,
                 from /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/src/Message/Message_SequenceOfPrinters.hxx:21,
                 from /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/inc/Message_SequenceOfPrinters.hxx:1,
                 from /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/src/Message/Message_Messenger.hxx:22,
                 from /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/inc/Message_Messenger.hxx:1,
                 from /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/src/MoniTool/MoniTool_TypedValue.cxx:15:
/home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/src/NCollection/NCollection_Array1.hxx: In member function ‘void MoniTool_TypedValue::AddEnum(Standard_CString, Standard_CString, Standard_CString, Standard_CString, Standard_CString, Standard_CString, Standard_CString, Standard_CString, Standard_CString, Standard_CString)’:
/home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/src/Standard/Standard_RangeError.hxx:30:3: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
   if (CONDITION) Standard_RangeError::Raise(MESSAGE);
   ^
/home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/src/NCollection/NCollection_Array1.hxx:164:5: note: in expansion of macro ‘Standard_RangeError_Raise_if’
     Standard_RangeError_Raise_if (theUpper < theLower, "NCollection_Array1::Create");
     ^
[ 43%] Linking CXX shared library ../../lin64/gcc/lib/libTKXSBase.so
cd /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/src/TKXSBase && /usr/bin/cmake -E cmake_link_script CMakeFiles/TKXSBase.dir/link.txt --verbose=1
/usr/bin/x86_64-linux-gnu-g++  -fPIC -std=c++0x -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -fexceptions -fPIC -Wall -Wextra -lm  -Wl,-Bsymbolic-functions -Wl,-z,relro -shared -Wl,-soname,libTKXSBase.so.7 -o ../../lin64/gcc/lib/libTKXSBase.so.7.1.0 @CMakeFiles/TKXSBase.dir/objects1.rsp ../../lin64/gcc/lib/libTKShHealing.so.7.1.0 ../../lin64/gcc/lib/libTKTopAlgo.so.7.1.0 ../../lin64/gcc/lib/libTKGeomAlgo.so.7.1.0 ../../lin64/gcc/lib/libTKBRep.so.7.1.0 ../../lin64/gcc/lib/libTKGeomBase.so.7.1.0 ../../lin64/gcc/lib/libTKG3d.so.7.1.0 ../../lin64/gcc/lib/libTKG2d.so.7.1.0 ../../lin64/gcc/lib/libTKMath.so.7.1.0 ../../lin64/gcc/lib/libTKernel.so.7.1.0 -lpthread -lrt -lstdc++ -ldl -ltbb -ltbbmalloc -Wl,-rpath,/home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/lin64/gcc/lib: 
cd /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu/src/TKXSBase && /usr/bin/cmake -E cmake_symlink_library ../../lin64/gcc/lib/libTKXSBase.so.7.1.0 ../../lin64/gcc/lib/libTKXSBase.so.7 ../../lin64/gcc/lib/libTKXSBase.so
make[3] : on quitte le répertoire « /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu »
[ 43%] Built target TKXSBase
make[2] : on quitte le répertoire « /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu »
Makefile:130 : la recette pour la cible « all » a échouée
make[1]: *** [all] Erreur 2
make[1] : on quitte le répertoire « /home/normand/compilation/OCCT/gdo35/opencascade-7.1.0/obj-x86_64-linux-gnu »
dh_auto_build: make -j4 returned exit code 2
debian/rules:14 : la recette pour la cible « build » a échouée
make: *** [build] Erreur 2
dpkg-buildpackage: erreur: debian/rules build a produit une erreur de sortie de type 2
debuild: fatal error at line 1376:
dpkg-buildpackage -rfakeroot -D -us -uc -j4 failed
I have to say that I used the 7.1.0 tarball, not the 7.0.0 one. 7.0.0 has no interest to me, as 7.1.0 comes with a much awaited bug fix on hidden line removal algorithm that should fix issues in the Drawing and TechDraw workbenches. As far as I can remember, I only edited the changelog to change it to "opencascade (7.1.0) xenial; urgency=low".

I guess the first thing that I should do is compile OCCT 7.1.0 independently with cmake so I can know that it actually builds on my set up (Ubuntu 16.04 LTS freshly installed 2 weeks ago).
Post Reply