1. Zoltán Szabó
  2. ITE
Issue #4 resolved

mex (matlab) and ann_octave (octave)

Jonathan Berrebi
created an issue

Dear Zoltàn,

As I am trying to estimate entropy (e.g. H(Xn-p,Xn-p+1,...,Xn)) and mutual information (e.g. I(Xn-p,Xn-p+1,..,Xn-1;Xn) ) I found your ITE toolbox very interesting. It seems to me that your toolbox allows for estimation of multivariate time series and hence for the estimation of structures like I(Xn-p,Xn-p+1,..,Xn-1;Xn).

I have installed the ITE on my linux x86_64 where I have both ubuntu and matlab (with only signal processing toolbox).

It seems that running in matlab the installation returns the following:

ITE_install Installation: started. Warning: Removed '/home/jonathan/ITEm/code/shared/embedded/ann_wrapperO' from the MATLAB path for this MATLAB session. See 'doc path' for more information. In ITE_install at 55 We are working in Matlab environment => ann_wrapper for Octave: deleted. ARfit package: downloading, extraction: started. ARfit package: downloading, extraction: ready. ITE code directory: added with subfolders to the Matlab PATH. ANN compilation: started. In file included from kd_pr_search.h:30:0, from kd_pr_search.cpp:25: pr_queue.h: In member function ‘void ANNpr_queue::insert(PQkey, PQinfo)’: pr_queue.h:88:69: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] kd_search.cpp: In member function ‘virtual void ANNkd_tree::annkSearch(ANNpoint, int, ANNidxArray, ANNdistArray, double)’: kd_search.cpp:103:71: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] kd_tree.cpp: In constructor ‘ANNkd_tree::ANNkd_tree(ANNpointArray, int, int, int, ANNsplitRule)’: kd_tree.cpp:403:48: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] kd_dump.cpp: In function ‘ANNkd_node annReadDump(std::istream&, ANNtreeType, ANNcoord&, ANNidx&, int&, int&, int&, ANNcoord&, ANNcoord&)’: kd_dump.cpp:274:54: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] kd_dump.cpp:293:53: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] kd_dump.cpp:302:64: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] kd_dump.cpp:331:61: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] kd_dump.cpp:335:70: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] kd_dump.cpp: In function ‘ANNkd_node annReadTree(std::istream&, ANNtreeType, ANNidxArray, int&)’: kd_dump.cpp:423:62: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] kd_dump.cpp:441:54: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] In file included from kd_pr_search.h:30:0, from bd_pr_search.cpp:26: pr_queue.h: In member function ‘void ANNpr_queue::insert(PQkey, PQinfo)’: pr_queue.h:88:69: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] bd_tree.cpp: In constructor ‘ANNbd_tree::ANNbd_tree(ANNpointArray, int, int, int, ANNsplitRule, ANNshrinkRule)’: bd_tree.cpp:154:48: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] bd_tree.cpp: In function ‘ANNdecomp selectDecomp(ANNpointArray, ANNidxArray, int, int, const ANNorthRect&, ANNkd_splitter, ANNshrinkRule, ANNorthRect&)’: bd_tree.cpp:312:46: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] perf.cpp: In function ‘void annPrintStats(ANNbool)’: perf.cpp:120:58: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] perf.cpp:121:58: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] perf.cpp:122:58: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] perf.cpp:123:58: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] perf.cpp:124:58: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] perf.cpp:125:70: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] perf.cpp:126:61: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] perf.cpp:128:61: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] perf.cpp:129:58: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] brute.cpp: In member function ‘virtual void ANNbruteForce::annkSearch(ANNpoint, int, ANNidxArray, ANNdistArray, double)’: brute.cpp:65:71: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] ANN compilation: ready. NCut compilation: started. NCut compilation: ready. TCA (chol_gauss.c) compilation: started. TCA (chol_gauss.c) compilation: ready. SWICA (SW_kappa.cpp, SW_sigma.cpp) compilation: started. SWICA (SW_kappa.cpp, SW_sigma.cpp) compilation: ready. Hoeffding_term1.cpp compilation: started. Hoeffding_term1.cpp compilation: ready. Edgeworth_t1_t2_t3.cpp compilation: started. Edgeworth_t1_t2_t3.cpp compilation: ready. compute_CDSS.cpp compilation: started. compute_CDSS.cpp compilation: ready. knn (top.cpp) compilation: started. knn (top.cpp) compilation: ready. KDP (kdpee.c, kdpeemex.c) compilation: started. /usr/bin/ld: private/kdpeemex.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC private/kdpeemex.o: could not read symbols: Bad value collect2: ld returned 1 exit status

mex: link of ' "private/kdpeemex.mexa64"' failed.

**Error using mex (line 206) Unable to complete successfully.

Error in mexme (line 5) mex CFLAGS='-std=gnu99 -D_GNU_SOURCE' -outdir private -I../kdpee private/kdpeemex.c ../src/kdpee.c

Error in ITE_install (line 176) mexme;**

So I tried in octave the example 3 written in page 13 fails as there is no ann function in my matlab distribution. octave:1> cd ITE/code octave:2> ITE_add_to_path octave:3> ITE_install remove entire contents of /home/jonathan/ITE/code/shared/embedded/NCut/? (yes or no) yes octave:4> Y = rand(5,1000) octave:5> mult = 1; octave:6> co = HShannon_kNN_k_initialization(mult); error: `co' undefined near line 28 column 12 error: evaluating argument list element number 1 error: evaluating argument list element number 1 error: called from: error: /home/jonathan/ITE/code/estimators/utilities/ann_octave.m at line 28, column 6 error: /home/jonathan/ITE/code/shared/initialize_Octave_ann_wrapper_if_needed.m at line 18, column 1 error: /home/jonathan/ITE/code/estimators/base_estimators/HShannon_kNN_k_initialization.m at line 55, column 1

I would thankful for any advice or guiding.

Jonathan

Comments (2)

  1. Zoltán Szabó repo owner

    Dear Jonathan,

    Thanks for your feedback.

    Concerning your questions:

    1. Yes, ITE can be used for the estimatiion of entropy or mutual information of multidimensional variables. From theoretical point of view: in order to obtain consistency (proof), many estimators assume i.i.d. (independent identically distributed), or 'slowly mixing' properties. From practical point of view: it is expected that the estimators can provide useful approximations in your application.
    2. 'Matlab:KDP compilation': the key error message seems to be "recompile with -fPIC". I suggest you try the last compilation variant (containing the '-fPIC' flag) in 'code/shared/embedded/KDP/mat_oct/mexme.m'.

    3. 'There is no ann function in my matlab distribution': ANN is embedded in ITE; as far as I see, its compilation in Matlab was successful.

    Best,

    Zoltán

  2. Log in to comment