Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with the provided libmpir.a? #74

Closed
szyszkos opened this issue Feb 12, 2017 · 7 comments
Closed

Problem with the provided libmpir.a? #74

szyszkos opened this issue Feb 12, 2017 · 7 comments

Comments

@szyszkos
Copy link

Compiling meshlab_full results in an abort with link failure and this message:

error: ../../../src/external/lib/linux-g++/libmpir.a(lt4-clear.o): unrecognized relocation (0x2a) in section `.text'

@DBobkov
Copy link

DBobkov commented Feb 12, 2017

Likely that your compiler differs from the standard one, thus you need to compile libmpir on your own. For more details see issue #47

@cignoni
Copy link
Member

cignoni commented Feb 12, 2017

Agree, while for targeted osx releases it make sense to have binaries of libs, for linux it does not. We definitely need someone fully dedicated to maintain the linux distribution.
Currently none of our core developers use linux as its main platform...
Any help is welcome.

@DBobkov
Copy link

DBobkov commented Feb 12, 2017

I just put together a small BASH script to make Meshlab 2016.12 on Linux Ubuntu distribution. I had issues with io_txt, mpir and plugins. Thus, I included all the issues and their fixes in the code. Tested on Ubuntu 14.04.5 64-bit with gcc-4.9. You are welcome to include this if you consider it worthy.

QT57_exec=<path-to-your-qt5.7-qmake>

1. vcglib

git clone https://github.com/cnr-isti-vclab/vcglib.git

2. meshlab

git clone https://github.com/cnr-isti-vclab/meshlab.git
cd meshlab
git checkout tags/v2016.12
cd src/external/
${QT57_exec} external.pro -o Makefile
make

3. now fix mpir issue

cd ../../../ # get out of the folder
wget http://mpir.org/mpir-2.4.0.tar.bz2
tar xjvf mpir-2.4.0.tar.bz2
cd mpir-2.4.0/
./configure --enable-cxx --enable-static --with-pic
make
cp .libs/libmpir*.a ../meshlab/src/external/lib/linux-g++/
cp mpir*.h ../meshlab/src/external/inc/linux-g++/mpir-2.4.0

4. now compile meshlab

cd ../meshlab/src
sed -i 's/io_TXT/io_txt/' meshlab_full.pro # there is an issue with io_TXT otherwise
mv plugins_experimental/io_TXT plugins_experimental/io_txt
${QT57_exec} meshlab_full.pro -o Makefile

poisson filter enable (#44)

cp meshlabplugins/filter_measure/filter_measure.xml distrib/plugins/
cp meshlabplugins/filter_mutualinfoxml/filter_mutualinfo.xml distrib/plugins/
cp meshlabplugins/filter_screened_poisson/filter_screened_poisson.xml distrib/plugins/
make

@szyszkos
Copy link
Author

Thank you very much! I'll try this out on my 2 linux distributions (Debian and PCLinuxOS) at the earliest opportunity (next week) and report back.

@szyszkos
Copy link
Author

Well, this does, in fact, work.
But I had to make a few tweaks:
I compiled with gcc-4.9.2. on a x86-64 PCLinuxOS distribution running the 4.7.5 kernel and Qt5.8. (I pointed {QT57_exec} to my Qt5.8 bin directory).

Compiling the meshlab externals worked fine but then could not at first compile mpir.

After replacing ./mpir-2.4.0/mpn/generic/preinv_divrem_1.c with ./mpir-2.4.0/tune/preinv_divrem_1.c, mpir compiled OK and created the needed .a and .h files, which I copied as described in step 3.

In step 4, "mv plugins_experimental/io_TXT plugins_experimental/io_txt" failed due to file not found, so I skipped it and proceeded with step 4 and on through the following "poisson filter enable" steps to the make, which succeeded and generated a working Meshlab executable in Linux! I will compare it to the windows version to check functionality and plugins, etc.

One other thing - during my initial attempt to compile 2 weeks ago, there were four functions in a switch which were failing. For expediency and without trying to solve the problem, I simply changed the cases to execute functions that compiled.

In /meshlab/src/meshlabplugins/filter_meshing/meshfilter.cpp

Original code starting at line 1242:

	switch(par.getEnum("CurvColorMethod"))
	{
		case 0: tri::UpdateQuality<CMeshO>::VertexFromMeanCurvatureDir    (m.cm); break;
		case 1: tri::UpdateQuality<CMeshO>::VertexFromGaussianCurvatureDir(m.cm); break;
		case 2: tri::UpdateQuality<CMeshO>::VertexFromMinCurvatureDir(m.cm); break;
        case 3: tri::UpdateQuality<CMeshO>::VertexFromMaxCurvatureDir(m.cm); break;
        case 4: tri::UpdateQuality<CMeshO>::VertexFromShapeIndexCurvatureDir(m.cm); break;
        case 5: tri::UpdateQuality<CMeshO>::VertexFromCurvednessCurvatureDir(m.cm); break;
        case 6: tri::UpdateQuality<CMeshO>::VertexConstant(m.cm,0); break;          

}

My altered version:
switch(par.getEnum("CurvColorMethod"))
{
case 0: tri::UpdateQuality::VertexFromMeanCurvatureDir (m.cm); break;
case 1: tri::UpdateQuality::VertexFromGaussianCurvatureDir(m.cm); break;
case 2: tri::UpdateQuality::VertexFromMeanCurvatureDir (m.cm); break;
case 3: tri::UpdateQuality::VertexConstant(m.cm,0); break;
case 4: tri::UpdateQuality::VertexConstant(m.cm,0); break;
case 5: tri::UpdateQuality::VertexConstant(m.cm,0); break;
case 6: tri::UpdateQuality::VertexConstant(m.cm,0); break;
}

Thanks again!

Steve

@cignoni
Copy link
Member

cignoni commented Feb 28, 2017

Probably your compiling failure was due to using an updated version of the meshlab repo with a non-up-to-date version of the vcglib (devel branch) repo.

@szyszkos
Copy link
Author

My vcglib version and meshlab versions are up-to-date. I still get the following errors but I think I have found the cause:

meshfilter.cpp:856:12: error: 'class vcg::tri::TriEdgeCollapseQuadricParameter' has no member named 'BoundaryQuadricWeight' pp.BoundaryQuadricWeight = pp.BoundaryQuadricWeight * par.getFloat("BoundaryWeight"); ^ meshfilter.cpp:856:39: error: 'class vcg::tri::TriEdgeCollapseQuadricParameter' has no member named 'BoundaryQuadricWeight' pp.BoundaryQuadricWeight = pp.BoundaryQuadricWeight * par.getFloat("BoundaryWeight");

and

meshfilter.cpp:1246:12: error: 'VertexFromMinCurvatureDir' is not a member of 'vcg::tri::UpdateQuality<CMeshO>' case 2: tri::UpdateQuality<CMeshO>::VertexFromMinCurvatureDir(m.cm); break; ^ meshfilter.cpp:1247:21: error: 'VertexFromMaxCurvatureDir' is not a member of 'vcg::tri::UpdateQuality<CMeshO>' case 3: tri::UpdateQuality<CMeshO>::VertexFromMaxCurvatureDir(m.cm); break; ^ meshfilter.cpp:1248:21: error: 'VertexFromShapeIndexCurvatureDir' is not a member of 'vcg::tri::UpdateQuality<CMeshO>' case 4: tri::UpdateQuality<CMeshO>::VertexFromShapeIndexCurvatureDir(m.cm); break; ^ meshfilter.cpp:1249:21: error: 'VertexFromCurvednessCurvatureDir' is not a member of 'vcg::tri::UpdateQuality<CMeshO>' case 5: tri::UpdateQuality<CMeshO>::VertexFromCurvednessCurvatureDir(m.cm); break; ^ Makefile:1907: recipe for target 'meshfilter.o' failed make[1]: *** [meshfilter.o] Error 1 make[1]: Leaving directory '/home/steve/devel/meshlab/src/meshlabplugins/filter_meshing' Makefile:1487: recipe for target 'sub-meshlabplugins-filter_meshing-make_first-ordered' failed make: *** [sub-meshlabplugins-filter_meshing-make_first-ordered] Error 2

=================================================================

As best I can figure it out, appears that the errors generated by line 856 in meshfilter.cpp are due to an improper name for the class member. Meshfilter.cpp calls for "BoundaryQuadraticWeight".
But in vcglib/vcg/complex/algorithms/local_optimization/tri_edge_collapse_quadratic_tex.h, we have "BoundaryWeight". I edited line 856 to "BoundaryWeight" and that error went away.

Regarding the second set of errors for cases 2,3,4,5 in the switch, thhe functions:
VertexFromMinCurvatureDir
VertexFromMaxCurvatureDir
VertexFromShapeIndexCurvatureDir
VertexFromCurvednessCurvatureDir

are missing from vcglib/vcg/complex/algorithms/update/quality.h . The functions called in cases 0,1, and 6. (VertexFromMeanCurvatureDir, VertexFromGaussianCurvatureDir, VertexConstant) are present.

I presume that the missing functions belong also in quality.h (?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants