The first step is again:
https://forum.freecadweb.org/viewtopic. ... 20#p177784
So pulling the sources:
Code: Select all
mkdir netgen
cd netgen
apt-get source netgen
Code: Select all
mkdir netgen
cd netgen
apt-get source netgen
Wow looo, very ambitious
Code: Select all
Built packages (from the FreeCAD PPA)
libnglib-4.9.13 Automatic 3d tetrahedral mesh generator shared library
libnglib-dev Automatic 3d tetrahedral mesh generator development files
netgen Automatic 3d tetrahedral mesh generator
netgen-doc Automatic 3d tetrahedral mesh generator documentation
netgen-headers Automatic 3d tetrahedral mesh generator internal headers
I think moving to occt7.2.0 is not a big problem, so I will use the available libraries...sgrogan wrote:Unless you want to go through the exercise of doing everything with occt7.1.0 and then upgrading to occt7.2.0, then we need to update occt on the PPA first.
This is a script which compiles netgen with a virgin ubuntu16.04 from docker:sgrogan wrote:Also a list CMake flags needed to build nglib locally would help.
Code: Select all
sudo docker run -i -t --name xenial ubuntu:xenial
Code: Select all
apt-get update
apt-get install software-properties-common build-essential cmake zlib1g-dev python3-dev git tk-dev tcl-dev -y
add-apt-repository ppa:freecad-maintainers/freecad-daily -y
apt-get update
apt-get install libopencascade-data-exchange-dev \
libopencascade-foundation-dev \
libopencascade-modeling-algorithms-dev \
libopencascade-modeling-data-dev -y
rm /usr/bin/python
ln -s /usr/bin/python3 /usr/bin/python
git clone https://github.com/pybind/pybind11
cp -r pybind11/include/pybind11 /usr/include/python3.5/
git clone https://github.com/looooo/netgen
cd netgen
git checkout 6.2_rebased5
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DUSE_OCC=ON \
-DUSE_PYTHON=ON \
-DUSE_GUI=ON \
-DUSE_SUPERBUILD=OFF \
-DNG_INSTALL_DIR=/usr/lib/netgen \
..
make -j3
cpack .
Code: Select all
sudo docker run -i -t --name trusty ubuntu:trusty
Code: Select all
apt-get update
apt-get install software-properties-common build-essential cmake zlib1g-dev python3-dev git tk-dev tcl-dev -y
add-apt-repository ppa:freecad-maintainers/freecad-daily -y
apt-get update
apt-get install libopencascade-data-exchange-dev \
libopencascade-foundation-dev \
libopencascade-modeling-algorithms-dev \
libopencascade-modeling-data-dev -y
rm /usr/bin/python
ln -s /usr/bin/python3 /usr/bin/python
git clone https://github.com/pybind/pybind11
cp -r /pybind11/include/pybind11 /usr/include/python3.4/
git clone https://github.com/looooo/netgen
cd netgen
git checkout 6.2_rebased5
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DUSE_OCC=ON \
-DUSE_PYTHON=ON \
-DUSE_GUI=ON \
-DUSE_SUPERBUILD=OFF \
-DNG_INSTALL_DIR=/usr/lib/netgen \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.4/ \
-DPYTHON_INCLUDE_DIR2=/usr/include/python3.4/ \
..
make -j3
cpack .
Code: Select all
dpkg: dependency problems prevent configuration of netgen:
netgen depends on liboce-ocaf-dev;
Code: Select all
if(USE_OCC)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, liboce-ocaf-dev")
endif(USE_OCC)
I think the docker image is a subset of any ubuntu... So any ubuntu should contain at least the dependencies which are included in the docker image. But I am only guessing...gdo35 wrote:Even if I am confident about it, we cannot guarantee that the netgen dependencies are not already installed in the docker image.
Code: Select all
mkdir build_dir;cd build_dir;
cmake -DCMAKE_BUILD_TYPE=Release \
-DUSE_OCC=ON \
-DUSE_PYTHON=ON \
-DUSE_GUI=ON \
-DUSE_SUPERBUILD=OFF \
-DNG_INSTALL_DIR=/usr/lib/netgen/ \
-DNG_INSTALL_DIR_INCLUDE=/usr/include/netgen/ \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.4/ \
-DPYTHON_INCLUDE_DIR2=/usr/include/python3.4/ \
-DPYTHON_LIBRARY=/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu/libpython3.4.so \
..
CMake Error: The source directory "/<<BUILDDIR>>" does not appear to contain CMakeLists.txt.
no there is no need to package 6.2, but cmake simplifies the build quite a bit...gdo35 wrote:I was away for months so maybe I miss the need of netgen 6.2 but we could work together to package it if this version is now needed.
It is a trap !
+1
I don't think that binary debs can be uploaded to Launchpad. Launchpad only accepts a "Debianized" source package and then builds and publishes that package. There is a loop hole that pre-compiled binaries can be included in the source package. So in practice the Launchpad "build" could just copy files. This is not the ideal method. We will need a binary deb somewhere on Launchpad to link FreeCAD against it for the PPA.
Can you post a link to the debian folder you are using? For FreeCAD on the PPA we do it like this: https://git.launchpad.net/~freecad-main ... build-occtlooo wrote: ↑Wed Sep 27, 2017 8:36 pm Anyway I started to work on the ppa-build and the difficult stuff is already done. Build stops at this error: https://launchpadlibrarian.net/33891648 ... ING.txt.gz
Code: Select all
%:
dh $@ --buildsystem=cmake --parallel --with python2
ok I understandgdo35 wrote:It is a trap !
To create a minimal virgin rootfs for ubuntu or other debian like distro, you have to use a tool called debootstrap.
pbuilder uses debootstrap.
gdo35 wrote: But... packaging binaries with cpack will be useless as only source packages can be uploaded on launchpad. (it answers a previous question you asked).
I do not know enough cpack but I guess it should generate the sources package that we could upload. Anyway we would have to maintain the debian folder.
I have come to the same conclusion. So I have added a debian directory with 4 files: https://github.com/looooo/netgen/tree/6 ... ed5/debiansgrogan wrote:Can you post a link to the debian folder you are using?
https://ngsolve.org/news/releases I don't know if it is officially released. But patching older stuff is for sure the not so good option, as it makes sending patches to upstream a lot more difficult...gdo35 wrote:5.3.1 is the last release on SourceForge. Is 6.2 pre-release ? (SourceForge git repo is down so I cannot check...).
Yes, I think we had this discussion already some time ago with the pivy package... It would have been a nice solution as cpack is really simple to use...sgrogan wrote:I don't think that binary debs can be uploaded to Launchpad. Launchpad only accepts a "Debianized" source package and then builds and publishes that package. There is a loop hole that pre-compiled binaries can be included in the source package. So in practice the Launchpad "build" could just copy files. This is not the ideal method. We will need a binary deb somewhere on Launchpad to link FreeCAD against it for the PPA.
For testing I stay with debuild for now. I think dependencies are already working. The problem is the build-script... Also having the failed build-logs online isn't a bad idea as we can all try to guess what is wrong with the builds...gdo35 wrote:Moreover, using pbuilder instead of directly test on launchpad avoids overloading servers with debug that can be done locally
Code: Select all
cd build_dir; cmake -P cmake_install.cmake
-- Install configuration: "Release"
-- Installing: /<<PKGBUILDDIR>>/debian/tmp/usr/lib/cmake/netgen/netgen-targets.cmake
-- Installing: /<<PKGBUILDDIR>>/debian/tmp/usr/lib/cmake/netgen/netgen-targets-release.cmake
-- Installing: /<<PKGBUILDDIR>>/debian/tmp/usr/lib/cmake/netgen/NetgenConfig.cmake
CMake Error at libsrc/general/cmake_install.cmake:44 (FILE):
file cannot create directory: /usr/include/netgen. Maybe need
administrative privileges.
Call Stack (most recent call first):
libsrc/cmake_install.cmake:37 (INCLUDE)
cmake_install.cmake:60 (INCLUDE)