CGAL / cgal-swig-bindings

CGAL bindings using SWIG
Other
338 stars 92 forks source link

CGAL.Polygon_mesh_processing not found in Java binding #69

Open agodemar opened 8 years ago

agodemar commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

What version of swig are you using?

agodemar commented 8 years ago

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 commented 4 years ago

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:

Thank you