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

CGAL.Polygon_mesh_processing not found in Java binding #69

Open
agodemar opened this issue Jun 13, 2016 · 9 comments
Open

CGAL.Polygon_mesh_processing not found in Java binding #69

agodemar opened this issue Jun 13, 2016 · 9 comments

Comments

@agodemar
Copy link

I am on Windows 10 and compiled successfully the Java bindings generated by cmake.
When I try to compile in Java the example program test_pmp.java the imports CGAL.Polygon_mesh_processing.* are not recognized.
Is there a particular dll/lib on the CGAL side that I have to generate in order to have this example working?

@sloriot
Copy link
Member

sloriot commented Jun 13, 2016

What version of CGAL are you using? Polygon_mesh_processing is only available starting with CGAL 4.7 and some parts only with 4.8 and later.

@agodemar
Copy link
Author

I'm using 4.8. But I can't figure out how to get CGAL.Polygon_mesh_processing.*
Do I have to make sure to use Eigen3 or BLAS?

@sloriot
Copy link
Member

sloriot commented Jun 13, 2016

Oh I see. Then I guess this is a problem with the java CLASSPATH variable.
Try setting CLASSPATH where the java class are generated.
By default something like:
export CLASSPATH=/where/I/called/cmaked/build-java
For running, you need to had $CLASSPATH/lib in your PATH or LD_LIBRARY_PATH

@agodemar
Copy link
Author

I am using Eclipse MARS and I have a project that includes all the *.java generated by cmake. All is fine when I compile the basic Java examples.
Setting the CLASSPATH variable as you suggest seems a 'run configuration' workaround.
The problem is that ther is no Java class or package named Polygon_mesh_processing in the generated file set. I am afraid I am missing some important configuration steps when I configure/compile CGAL.

@sloriot
Copy link
Member

sloriot commented Jun 14, 2016

Look at the value of JAVA_OUTDIR_PREFIX in your CMakeCache.txt, then each CGAL package will be located in its own directory in ${JAVA_OUTDIR_PREFIX}/CGAL

@agodemar
Copy link
Author

I am a few steps ahead now. I did not configure Eigen3 correctly when compiling CGAL.
Now I have CGAL configured for vc14 and compiled with boost 1.61.0, QT5.6.1, Eigen3, BLAS & Lapack, TBB 4.4.
With Eigen3 in place now cmake configures CGAL-swig-bindings differently and produces the wrapping C++/Java code for a larger set of classes.
Still I've got an error in the file path/to/build-java/CGAL/Polygon_mesh_processing/CGAL_Polygon_mesh_processingJAVA_wrap.cxx

In function: SWIGEXPORT jintArray JNICALL Java_CGAL_Polygon_1mesh_1processing_CGAL_1Polygon_1mesh_1processingJNI_connected_1components(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
the line
jenv->SetIntArrayRegion(jInts, 0, size, &((*result)[0]));
give a conversion error from int * to const jint *

@sloriot
Copy link
Member

sloriot commented Jun 15, 2016

What version of swig are you using?

@agodemar
Copy link
Author

Yes maybe it'is a swig related issue. I'm using swig 3.0.9
It gave me similar problems with java bindings for OpenCascade.

@cstampfel
Copy link

cstampfel commented Nov 19, 2019

I am a few steps ahead now. I did not configure Eigen3 correctly when compiling CGAL.
Now I have CGAL configured for vc14 and compiled with boost 1.61.0, QT5.6.1, Eigen3, BLAS & Lapack, TBB 4.4.
With Eigen3 in place now cmake configures CGAL-swig-bindings differently and produces the wrapping C++/Java code for a larger set of classes.
Still I've got an error in the file path/to/build-java/CGAL/Polygon_mesh_processing/CGAL_Polygon_mesh_processingJAVA_wrap.cxx

In function: SWIGEXPORT jintArray JNICALL Java_CGAL_Polygon_1mesh_1processing_CGAL_1Polygon_1mesh_1processingJNI_connected_1components(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_)
the line
jenv->SetIntArrayRegion(jInts, 0, size, &((*result)[0]));
give a conversion error from int * to const jint *

Hey,

I have exactly the same issue here. Is there any progress in this topic?
I am using the following versions:

  • OS: Windows 10
  • SWIG: 4.0.1
  • CGAL-Bindings: master branch of today
  • CGAL 4.14.2
  • Eigen: 3.3.7

Thank you

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

3 participants