Installing Openslide with Matlab toolbox

Jocelyn Barker jbarker2 at stanford.edu
Thu Jun 26 13:34:51 EDT 2014


 Hi Mr. Gilbert,

*1.  This is the contents of mHeader.m:*

function [methodinfo,structs,enuminfo,ThunkLibName]=mHeader
%MHEADER Create structures to define interfaces found in 'openslide'.

%This function was generated by loadlibrary.m parser version 1.1.6.37 on
Thu Jun 26 10:15:12 2014
%perl options:'openslide.i -outfile=mHeader.m
-thunkfile=libopenslide0x2D0_thunk_glnxa64.c -header=openslide.h'
ival={cell(1,0)}; % change 0 to the actual number of functions to
preallocate the data.
structs=[];enuminfo=[];fcnNum=1;
fcns=struct('name',ival,'calltype',ival,'LHS',ival,'RHS',ival,'alias',ival,'thunkname',
ival);
MfilePath=fileparts(mfilename('fullpath'));
ThunkLibName=fullfile(MfilePath,'libopenslide0x2D0_thunk_glnxa64');
% __attribute__ (( visibility (" default "))) _Bool openslide_can_open (
const char * filename );
fcns.thunkname{fcnNum}='(visibility("default")))_Boolopenslide_can_open(char*filenameThunk';
fcns.name{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__';
fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error';
fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;
% __attribute__ (( visibility (" default "))) openslide_t * openslide_open
( const char * filename );
fcns.thunkname{fcnNum}='(visibility("default")))openslide_t*openslide_open(char*filenameThunk';
fcns.name{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__';
fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error';
fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;
% __attribute__ (( visibility (" default "))) int32_t
openslide_get_level_count ( openslide_t * osr );
fcns.thunkname{fcnNum}='(visibility("default")))int32_topenslide_get_level_count(openslide_t*osrThunk';
fcns.name{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__';
fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error';
fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;
% __attribute__ (( visibility (" default "))) void openslide_close (
openslide_t * osr );
fcns.thunkname{fcnNum}='(visibility("default")))voidopenslide_close(openslide_t*osrThunk';
fcns.name{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__';
fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error';
fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;
% __attribute__ (( visibility (" default "))) const char *
openslide_get_error ( openslide_t * osr );
fcns.thunkname{fcnNum}='(visibility("default")))char*openslide_get_error(openslide_t*osrThunk';
fcns.name{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__';
fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error';
fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;
% __attribute__ (( visibility (" default "))) const char * const *
openslide_get_property_names ( openslide_t * osr );
fcns.thunkname{fcnNum}='(visibility("default")))char*const*openslide_get_property_names(openslide_t*osrThunk';
fcns.name{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__';
fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error';
fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;
% __attribute__ (( visibility (" default "))) const char * const *
openslide_get_associated_image_names ( openslide_t * osr );
fcns.thunkname{fcnNum}='(visibility("default")))char*const*openslide_get_associated_image_names(openslide_t*osrThunk';
fcns.name{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__';
fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error';
fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;
% __attribute__ (( visibility (" default "))) const char *
openslide_get_version ( void );
fcns.thunkname{fcnNum}='(visibility("default")))char*openslide_get_version(voidThunk';
fcns.name{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__';
fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error';
fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;
% __attribute__ (( visibility (" default "))) __attribute__ (( deprecated
(" Use " " openslide_get_level_count " " instead "))) int32_t
openslide_get_layer_count ( openslide_t * osr );
fcns.thunkname{fcnNum}='(visibility("default")))__attribute__((deprecated("Use""openslide_get_level_count""instead")))int32_topenslide_get_layer_count(openslide_t*osrThunk';
fcns.name{fcnNum}='__attribute__'; fcns.alias{fcnNum}='attribute__';
fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='error';
fcns.RHS{fcnNum}={'error'};fcnNum=fcnNum+1;
% int _openslide_give_prefetch_hint_UNIMPLEMENTED ( void );
fcns.thunkname{fcnNum}='int32voidThunk';fcns.name{fcnNum}='_openslide_give_prefetch_hint_UNIMPLEMENTED';
fcns.alias{fcnNum}='openslide_give_prefetch_hint_UNIMPLEMENTED';
fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='int32';
fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1;
% void _openslide_cancel_prefetch_hint_UNIMPLEMENTED ( void );
fcns.thunkname{fcnNum}='voidvoidThunk';fcns.name{fcnNum}='_openslide_cancel_prefetch_hint_UNIMPLEMENTED';
fcns.alias{fcnNum}='openslide_cancel_prefetch_hint_UNIMPLEMENTED';
fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}=[];
fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1;
structs.s_openslide.members=struct('');
methodinfo=fcns;

*2. after editing openslide-features.h to remove the space, I ran
openslide_load_library and got a similar error as before:*

Warning: Warnings messages were produced while parsing.  Check the
functions you intend to
use for correctness.  Warning text can be viewed using:
 [notfound,warnings]=loadlibrary(...)
> In loadlibrary at 344
  In openslide_load_library at 40
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********

Type '' was not found.  Defaulting to type error.

Found on line 103 of input from line 67 of file
/usr/include/openslide/openslide.h

Failed to parse type '( visibility (" default "))) _Bool openslide_can_open
( char * filename' original input '( visibility (" default "))) _Bool
openslide_can_open ( const char * filename '
Found on line 103 of input from line 67 of file
/usr/include/openslide/openslide.h
Error parsing argument for function __attribute__ function may be invalid.

Type '' was not found.  Defaulting to type error.

Found on line 106 of input from line 81 of file
/usr/include/openslide/openslide.h

Failed to parse type '( visibility (" default "))) openslide_t *
openslide_open ( char * filename' original input '( visibility (" default
"))) openslide_t * openslide_open ( const char * filename '
Found on line 106 of input from line 81 of file
/usr/include/openslide/openslide.h
Error parsing argument for function __attribute__ function may be invalid.

Type '' was not found.  Defaulting to type error.

Found on line 109 of input from line 92 of file
/usr/include/openslide/openslide.h

Failed to parse type '( visibility (" default "))) int32_t
openslide_get_level_count ( openslide_t * osr' original input '( visibility
(" default "))) int32_t openslide_get_level_count ( openslide_t * osr '
Found on line 109 of input from line 92 of file
/usr/include/openslide/openslide.h
Error parsing argument for function __attribute__ function may be invalid.

Type '' was not found.  Defaulting to type error.

Found on line 133 of input from line 182 of file
/usr/include/openslide/openslide.h

Failed to parse type '( visibility (" default "))) void openslide_close (
openslide_t * osr' original input '( visibility (" default "))) void
openslide_close ( openslide_t * osr '
Found on line 133 of input from line 182 of file
/usr/include/openslide/openslide.h
Error parsing argument for function __attribute__ function may be invalid.

Type '' was not found.  Defaulting to type error.

Found on line 136 of input from line 227 of file
/usr/include/openslide/openslide.h

Failed to parse type '( visibility (" default "))) char *
openslide_get_error ( openslide_t * osr' original input '( visibility ("
default "))) const char * openslide_get_error ( openslide_t * osr '
Found on line 136 of input from line 227 of file
/usr/include/openslide/openslide.h
Error parsing argument for function __attribute__ function may be invalid.

Type '' was not found.  Defaulting to type error.

Found on line 139 of input from line 302 of file
/usr/include/openslide/openslide.h

Failed to parse type '( visibility (" default "))) char * *
openslide_get_property_names ( openslide_t * osr' original input '(
visibility (" default "))) const char * const *
openslide_get_property_names ( openslide_t * osr '
Found on line 139 of input from line 302 of file
/usr/include/openslide/openslide.h
Error parsing argument for function __attribute__ function may be invalid.

Type '' was not found.  Defaulting to type error.

Found on line 145 of input from line 345 of file
/usr/include/openslide/openslide.h

Failed to parse type '( visibility (" default "))) char * *
openslide_get_associated_image_names ( openslide_t * osr' original input '(
visibility (" default "))) const char * const *
openslide_get_associated_image_names ( openslide_t * osr '
Found on line 145 of input from line 345 of file
/usr/include/openslide/openslide.h
Error parsing argument for function __attribute__ function may be invalid.

Type '' was not found.  Defaulting to type error.

Found on line 158 of input from line 400 of file
/usr/include/openslide/openslide.h

Failed to parse type '( visibility (" default "))) char *
openslide_get_version ( void' original input '( visibility (" default ")))
const char * openslide_get_version ( void '
Found on line 158 of input from line 400 of file
/usr/include/openslide/openslide.h
Error parsing argument for function __attribute__ function may be invalid.

Type '' was not found.  Defaulting to type error.

Found on line 162 of input from line 422 of file
/usr/include/openslide/openslide.h

Failed to parse type '( visibility (" default "))) __attribute__ ((
deprecated (" Use " " openslide_get_level_count " " instead "))) int32_t
openslide_get_layer_count ( openslide_t * osr' original input '( visibility
(" default "))) __attribute__ (( deprecated (" Use " "
openslide_get_level_count " " instead "))) int32_t
openslide_get_layer_count ( openslide_t * osr '
Found on line 162 of input from line 422 of file
/usr/include/openslide/openslide.h
Error parsing argument for function __attribute__ function may be invalid.
*********
Error using loadlibrary (line 419)
Building openslidelib_thunk_glnxa64 failed.  Compiler output is:
gcc -I"/usr/local/MATLAB/R2012b/extern/include"  -D_GNU_SOURCE
-fexceptions -fPIC
-fno-omit-frame-pointer -pthread -I"/home/jbarker/Documents/MATLAB"
-I"/usr/include/openslide" "openslidelib_thunk_glnxa64.c" -o
"openslidelib_thunk_glnxa64.so"
-Wl,-E -shared
openslidelib_thunk_glnxa64.c:25:30: error: expected declaration specifiers
or ‘...’ before
string constant
 EXPORT_EXTERN_C
(visibility("default")))_Boolopenslide_can_open(char*filenameThunk(void
 fcn(),const char *callstack,int stacksize)
                              ^
openslidelib_thunk_glnxa64.c:34:30: error: expected declaration specifiers
or ‘...’ before
string constant
 EXPORT_EXTERN_C
(visibility("default")))openslide_t*openslide_open(char*filenameThunk(void
 fcn(),const char *callstack,int stacksize)
                              ^
openslidelib_thunk_glnxa64.c:43:30: error: expected declaration specifiers
or ‘...’ before
string constant
 EXPORT_EXTERN_C
 (visibility("default")))int32_topenslide_get_level_count(openslide_t*osrThunk(void
 fcn(),const char *callstack,int stacksize)
                              ^
openslidelib_thunk_glnxa64.c:52:30: error: expected declaration specifiers
or ‘...’ before
string constant
 EXPORT_EXTERN_C
(visibility("default")))voidopenslide_close(openslide_t*osrThunk(void
 fcn(),const char *callstack,int stacksize)
                              ^
openslidelib_thunk_glnxa64.c:61:30: error: expected declaration specifiers
or ‘...’ before
string constant
 EXPORT_EXTERN_C
(visibility("default")))char*openslide_get_error(openslide_t*osrThunk(void
 fcn(),const char *callstack,int stacksize)
                              ^
openslidelib_thunk_glnxa64.c:70:30: error: expected declaration specifiers
or ‘...’ before
string constant
 EXPORT_EXTERN_C
 (visibility("default")))char*const*openslide_get_property_names(openslide_t*osrThunk(void
 fcn(),const char *callstack,int stacksize)
                              ^
openslidelib_thunk_glnxa64.c:79:30: error: expected declaration specifiers
or ‘...’ before
string constant
 EXPORT_EXTERN_C
 (visibility("default")))char*const*openslide_get_associated_image_names(openslide_t*osrThunk(void
 fcn(),const char *callstack,int stacksize)
                              ^
openslidelib_thunk_glnxa64.c:88:30: error: expected declaration specifiers
or ‘...’ before
string constant
 EXPORT_EXTERN_C
(visibility("default")))char*openslide_get_version(voidThunk(void
 fcn(),const char *callstack,int stacksize)
                              ^
openslidelib_thunk_glnxa64.c:97:30: error: expected declaration specifiers
or ‘...’ before
string constant
 EXPORT_EXTERN_C
 (visibility("default")))__attribute__((deprecated("Use""openslide_get_level_count""instead")))int32_topenslide_get_layer_count(openslide_t*osrThunk(void
 fcn(),const char *callstack,int stacksize)
                              ^


Error in openslide_load_library (line 40)
loadlibrary('libopenslide-0.dll','openslide.h','alias','openslidelib')


*3. after editing openslide-features.h to remove the line, I got a new
error:*
Warning: Warnings messages were produced while parsing.  Check the
functions you intend to
use for correctness.  Warning text can be viewed using:
 [notfound,warnings]=loadlibrary(...)
> In loadlibrary at 344
  In openslide_load_library at 40
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********

Type '' was not found.  Defaulting to type error.

Found on line 162 of input from line 422 of file
/usr/include/openslide/openslide.h

Failed to parse type '( deprecated (" Use " " openslide_get_level_count " "
instead "))) int32_t openslide_get_layer_count ( openslide_t * osr'
original input '( deprecated (" Use " " openslide_get_level_count " "
instead "))) int32_t openslide_get_layer_count ( openslide_t * osr '
Found on line 162 of input from line 422 of file
/usr/include/openslide/openslide.h
Error parsing argument for function __attribute__ function may be invalid.
*********
Error using loadlibrary (line 419)
Building openslidelib_thunk_glnxa64 failed.  Compiler output is:
gcc -I"/usr/local/MATLAB/R2012b/extern/include"  -D_GNU_SOURCE
-fexceptions -fPIC
-fno-omit-frame-pointer -pthread -I"/home/jbarker/Documents/MATLAB"
-I"/usr/include/openslide" "openslidelib_thunk_glnxa64.c" -o
"openslidelib_thunk_glnxa64.so"
-Wl,-E -shared
openslidelib_thunk_glnxa64.c:214:30: error: expected declaration specifiers
or ‘...’ before
string constant
 EXPORT_EXTERN_C
 (deprecated("Use""openslide_get_level_count""instead")))int32_topenslide_get_layer_count(openslide_t*osrThunk(void
 fcn(),const char *callstack,int stacksize)
                              ^


Error in openslide_load_library (line 40)
loadlibrary('libopenslide-0.dll','openslide.h','alias','openslidelib')


*4. I do not believe I got the error you referred to about
libopenslide-0.dll however for completeness I also edited that line to get
what appears to be the same error:*

Warning: Warnings messages were produced while parsing.  Check the
functions you intend to
use for correctness.  Warning text can be viewed using:
 [notfound,warnings]=loadlibrary(...)
> In loadlibrary at 344
  In openslide_load_library at 40
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********

Type '' was not found.  Defaulting to type error.

Found on line 162 of input from line 422 of file
/usr/include/openslide/openslide.h

Failed to parse type '( deprecated (" Use " " openslide_get_level_count " "
instead "))) int32_t openslide_get_layer_count ( openslide_t * osr'
original input '( deprecated (" Use " " openslide_get_level_count " "
instead "))) int32_t openslide_get_layer_count ( openslide_t * osr '
Found on line 162 of input from line 422 of file
/usr/include/openslide/openslide.h
Error parsing argument for function __attribute__ function may be invalid.
*********
Error using loadlibrary (line 419)
Building openslidelib_thunk_glnxa64 failed.  Compiler output is:
gcc -I"/usr/local/MATLAB/R2012b/extern/include"  -D_GNU_SOURCE
-fexceptions -fPIC
-fno-omit-frame-pointer -pthread -I"/home/jbarker/Documents/MATLAB"
-I"/usr/include/openslide" "openslidelib_thunk_glnxa64.c" -o
"openslidelib_thunk_glnxa64.so"
-Wl,-E -shared
openslidelib_thunk_glnxa64.c:214:30: error: expected declaration specifiers
or ‘...’ before
string constant
 EXPORT_EXTERN_C
 (deprecated("Use""openslide_get_level_count""instead")))int32_topenslide_get_layer_count(openslide_t*osrThunk(void
 fcn(),const char *callstack,int stacksize)
                              ^


Error in openslide_load_library (line 40)
loadlibrary('libopenslide.so.0','openslide.h','alias','openslidelib')

Thank you very much for all your help!

Jocelyn


On Thu, Jun 26, 2014 at 1:57 AM, Benjamin Gilbert <bgilbert at cs.cmu.edu>
wrote:

> On 06/25/2014 01:33 AM, Jocelyn Barker wrote:
>
>> I am not sure if the problem is with openslide or the Matlab toolbox,
>> but any help would be greatly appreciated.
>>
>
> MATLAB tries to parse openslide.h and appears to be choking on it. Please
> try these things, in order, and let us know your results:
>
> 1.  In MATLAB, run loadlibrary('libopenslide-0.dll', 'openslide.h',
> 'mfilename', 'mHeader').  This will fail after writing a file called
> "mHeader.m".  Please forward the contents of that file.
>
> 2.  Edit /usr/include/openslide/openslide-features.h and remove the space
> between '__attribute__' and '((visibility("default")))', then try
> openslide_load_library again.
>
> 3.  Edit /usr/include/openslide/openslide-features.h and delete
> '__attribute__((visibility("default")))', then try openslide_load_library
> again.
>
> 4.  Steps 2 or 3 may produce a new error about not finding
> libopenslide-0.dll.  If so, edit openslide_load_library.m and replace
> 'libopenslide-0.dll' with 'libopenslide.so.0'.
>
> --Benjamin Gilbert
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20140626/995d6a15/attachment-0001.html 


More information about the openslide-users mailing list