2014-07-03 16:20 GMT+02:00 Anders Logg <[email protected]>: > On Thu, Jul 03, 2014 at 04:02:09PM +0200, Benjamin Kehlet wrote: >> 2014-07-02 12:40 GMT+02:00 Marco Morandini <[email protected]>: >> > I tried to build mshr from git. >> > >> > I had to modify CMakeCache: >> > >> > 1) my Vtk is installed in a non-standard location >> > 2) it was not finding numpy's headers >> > 2) it was selecting python 3 and not python 2, and then >> > complaining because no definition of PyInt_FromSsize_t >> > was provided. >> > >> > Patch attached. The numpy detection script is copied verbatim from Dolfin's >> > sources. >> > >> > >> > After that, the compilation is ok, but the demos do not work. >> > >> > Some of them because the number of arguments of the init functions is wrong >> > (e.g. simple-csg-3D.py: >> > TypeError: new_Box expected 2 arguments, got 6 >> > ) >> >> This is fixed now. >> >> > >> > others because of CGAL (e.g. icecream.py): >> > >> > ----------- >> > marco@pao:~/Programmi/Dolphin/src_from_dorsal/mshr/demo/python (master>)> >> > python icecream.py >> > Convert to nef polyhedron >> > Number of vertices: 826 >> > Number of facets: 1648 >> > Cleaning degenerate facets >> > Collapsing short edges >> > Removing colinear facets by edge flipping >> > Writing to file: icecream.off >> > Convert to nef polyhedron >> > Number of vertices: 826 >> > Number of facets: 1648 >> > Cleaning degenerate facets >> > Collapsing short edges >> > Removing colinear facets by edge flipping >> > Traceback (most recent call last): >> > File "icecream.py", line 41, in <module> >> > m = generate_mesh(geometry, 16, "cgal") >> > File "/home/marco/local/Fenics/lib64/python2.7/site-packages/mshr.py", >> > line 458, in generate_mesh >> > _generate(m, geometry, resolution, backend) >> > StandardError: CGAL ERROR: assertion violation! >> > Expr: check_protocoll == 2 >> > File: >> > /home/marco/Programmi/Dolphin/src_from_dorsal/mshr/dorsal_build_dir/CGAL-4.4-installdir/include/CGAL/Polyhedron_incremental_builder_3.h >> > Line: 286 >> > ------------- >> > >> > Any hint? >> >> Did you build Dolfin with CGAL support? >> mshr builds its own CGAL and think this is bug in the build script >> that causes the linker to pick up the "wrong" CGAL. I will take a >> look. >> >> As a workaround, build Dolfin without CGAL support. (CGAL is used only >> for mesh generation in Dolfin, and will be removed soon, so you don't >> loose anything with this). Please report back if this does not solve >> the problem. > > I can confirm that the demos work fine after removing CGAL > (libcgal-dev) and then rebuilding DOLFIN without CGAL support, then > rebuilding mshr. > > If I don't do that, the demos crash.
Ok, thanks! I decided to build CGAL from source automatically when building mshr. I'm still not sure that is the best solution. Some pros are: 1) The problems we had with Dolfin with different CGAL versions around. 2) CGAL can be patched internally. Relying heavily on CGAL, this is important. The CGAL community has fixed a few critical bugs I have reported and without this we would have to wait for the next CGAL release. 3) Easy for the user (and doesn't add much to overall build time or binary size, since CGAL is almost a header only library) And some cons: 1) Need to robustly choose the right CGAL when it is already present. The is the reported problem. I believe it should be possible (maybe even easy) to fix. 2) Cmake's external_project module (which is used to build CGAL) is very badly designed for this. It postpones the configuration time of the external project (=CGAL) to the compile time of the main project (=mshr). This means that CGALConfig.cmake is not available when configuring mshr. Instead the mshr's cmake scripts have to what compiler flags to add to get a working CGAL. 3) The general policy (in particular on various Linux distributions) that external libraries should be add as dependencies to the package system instead of shipping a "bloated" library which includes everything. This may (or may not) be a problem if we want to provide official debian packages. I don't know the details, but I have heard that Debian doesn't like this. If anyone has experience with similar issues, I'd be happy to hear about it. Benjamin > > -- > Anders _______________________________________________ fenics mailing list [email protected] http://fenicsproject.org/mailman/listinfo/fenics
