Closed alexpattyn closed 6 years ago
The mex file was built under Octave 4.2, it needs to be rebuilt for Octave 4.4. Does it work if you delete the mex file and build the project again in the flatpak app environment?
I rebuild it for 4.4.1, but I tried to build it to a octfile and got some errors. Is there anything specifically different between the two (in terms of the C, C++ or FORTRAN code they take in)?
But either way mex("mmc.c") ran without errors, but I got the following when running another example.
creating volumetric mesh from a surface mesh ... volume mesh generation is complete error: mmclab: /var/home/$USER/Downloads/toolbox/mmclab/mmc.mex: failed to load: /var/home/$USER/Downloads/toolbox/mmclab/mmc.mex: undefined symbol: mmc_init_from_cmd error: called from mmclab at line 322 column 24 demo_example_meshtest at line 102 column 5
So I'll have to look and see if there is anything special I need to do for this file in the toolbox README.
It turns out you need to run make oct
but since octave is in a flatpak it isn't in the $PATH it isn't that easy. So I am using buildah to build it in a container with a ubuntu base image, so hopefully it works out.
You can run make oct
in the flatpak environment, for example
flatpak run --command=make org.octave.Octave oct
or start Octave and run
system ('make oct');
at the Octave prompt.
Thanks! I ended up with...
Building bin/mmc
CC=cc CXX=g++ LFLAGS='-fopenmp' LDFLAGS='' CPPFLAGS='-c -Wall -g -fno-strict-aliasing -m64 -DMMC_USE_SSE -DHAVE_SSE2 -msse -msse2 -msse3 -mssse3 -msse4.1 -O3 -fopenmp -fPIC -DMCX_CONTAINER -DUSE_OS_TIMER -std=c++11' mkoctfile --mex mmclab.cpp -I../src -o bin/mmc built/posix_randr.o built/simpmesh.o built/tettracing.o built/mcx_utils.o built/tictoc.o built/mmc.o built/mmc_host.o built/cjson/cJSON.o -o ../mmclab/mmc
mmclab.cpp: In function ‘void mexFunction(int, mxArray**, int, constmxArray**)’:
mmclab.cpp:273:95: error: cannot convert ‘dimtype* {aka int*}’ to ‘const mwSize* {aka const long int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(mwSize, const mwSize*, mxClassID, mxComplexity)’
,jstruct,0, mxCreateNumericArray(3,fielddim,mxSINGLE_CLASS,mxREAL));
^
mmclab.cpp:279:103: error: cannot convert ‘dimtype* {aka int*}’ to ‘const mwSize* {aka const long int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(mwSize, const mwSize*, mxClassID, mxComplexity)’
,jstruct,0, mxCreateNumericArray(2,fielddim,mxSINGLE_CLASS,mxREAL));
^
mmclab.cpp:284:115: error: cannot convert ‘dimtype* {aka int*}’ to ‘const mwSize* {aka const long int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(mwSize, const mwSize*, mxClassID, mxComplexity)’
],jstruct,0, mxCreateNumericArray(2,fielddim,mxUINT8_CLASS,mxREAL));
^
mmclab.cpp:350:101: error: cannot convert ‘dimtype* {aka int*}’ to ‘const mwSize* {aka const long int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(mwSize, const mwSize*, mxClassID, mxComplexity)’
,jstruct,0, mxCreateNumericArray(4,fielddim,mxDOUBLE_CLASS,mxREAL));
^
mmclab.cpp:352:105: error: cannot convert ‘dimtype* {aka int*}’ to ‘const mwSize* {aka const long int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(mwSize, const mwSize*, mxClassID, mxComplexity)’
,jstruct,0, mxCreateNumericArray(2,fielddim,mxDOUBLE_CLASS,mxREAL));
^
mmclab.cpp: In function ‘void mmc_set_field(const mxArray*, const mxArray*, int, mcconfig*, tetmesh*)’:
mmclab.cpp:438:38: error: cannot convert ‘const mwSize* {aka const long int*}’ to ‘const dimtype* {aka const int*}’ in assignment
arraydim=mxGetDimensions(item);
^
mmclab.cpp:450:38: error: cannot convert ‘const mwSize* {aka const long int*}’ to ‘const dimtype* {aka const int*}’ in assignment
arraydim=mxGetDimensions(item);
^
mmclab.cpp:463:38: error: cannot convert ‘const mwSize* {aka const long int*}’ to ‘const dimtype* {aka const int*}’ in assignment
arraydim=mxGetDimensions(item);
^
mmclab.cpp:474:38: error: cannot convert ‘const mwSize* {aka const long int*}’ to ‘const dimtype* {aka const int*}’ in assignment
arraydim=mxGetDimensions(item);
^
mmclab.cpp:487:38: error: cannot convert ‘const mwSize* {aka const long int*}’ to ‘const dimtype* {aka const int*}’ in assignment
arraydim=mxGetDimensions(item);
^
mmclab.cpp:498:38: error: cannot convert ‘const mwSize* {aka const long int*}’ to ‘const dimtype* {aka const int*}’ in assignment
arraydim=mxGetDimensions(item);
^
mmclab.cpp:510:38: error: cannot convert ‘const mwSize* {aka const long int*}’ to ‘const dimtype* {aka const int*}’ in assignment
arraydim=mxGetDimensions(item);
^
mmclab.cpp:565:38: error: cannot convert ‘const mwSize* {aka const long int*}’ to ‘const dimtype* {aka const int*}’ in assignment
arraydim=mxGetDimensions(item);
^
mmclab.cpp:613:38: error: cannot convert ‘const mwSize* {aka const long int*}’ to ‘const dimtype* {aka const int*}’ in assignment
arraydim=mxGetDimensions(item);
^
mmclab.cpp:630:38: error: cannot convert ‘const mwSize* {aka const long int*}’ to ‘const dimtype* {aka const int*}’ in assignment
arraydim=mxGetDimensions(item);
^
mmclab.cpp:638:31: error: cannot convert ‘const mwSize* {aka const long int*}’ to ‘const dimtype* {aka const int*}’ in assignment
arraydim=mxGetDimensions(item);
^
make: *** [../commons/Makefile_common.mk:180: bin/mmc] Error 1
ans = 2
So it looks like an issue with their c-code?
Yes, it looks that way to me. Please file an issue with that project about failure to build with Octave 4.4. If you resolve that but still have issues with the flatpak feel free to come back here.
Should we reopen the issue due to some errors I got at https://github.com/fangq/mmc/pull/17?
@koenigjaeger I have reported https://github.com/fangq/mmc/issues/18 for your remaining issue, we can discuss there. With the link options set appropriately, there is no issue with building against flatpak Octave.
OS: Fedora Silverblue 28 CPU: Intel® Core™ i5-5200U CPU @ 2.20GHz × 4 GPU: Intel® HD Graphics 5500 (Broadwell GT2)
I was running a toolbox mmclab (https://github.com/fangq/mmc) and when running an example of theirs Octave was reporting that ...
error: mmclab: /var/home/$USER/LabData/Toolboxes/mmclab-linux-x86_64-v2018/mmclab/mmc.mex: failed to load: liboctinterp.so.4: cannot open shared object file: No such file or directory error: called from mmclab at line 322 column 24 demo_mmclab_basic at line 24 column 5
I saw that liboctinterp.so, liboctinterp.so.6, and liboctinterp.so.6.0.0 are in the flatpak so I am not sure if the fix is to just include liboctinterp.so.4?