Issue #3 resolved

use of top() function creates problems in octave

Andres Colubri avatarAndres Colubri created an issue

Hello, I recently installed the version 0.36 of ITE, and when I try running the following sample code:

Y1 = randn(3,2000); Y2 = randn(3,3000);
mult = 1;
co = DRenyi_kNN_k_initialization(mult);
D = DRenyi_kNN_k_estimation(Y1,Y2,co);

I get the following error in the last line:

error: `top' undefined near line 10 column 11 error: called from: error: /Users/andres/Research/NHANES/Statistics/ITE/ITE-0.36_code/code/shared/embedded/knn/knn.m at line 10, column 9 error: /Users/andres/Research/NHANES/Statistics/ITE/ITE-0.36_code/code/H_I_D_A_C/utilities/kNN_squared_distances.m at line 28, column 30 error: /Users/andres/Research/NHANES/Statistics/ITE/ITE-0.36_code/code/H_I_D_A_C/utilities/estimate_Dtemp1.m at line 24, column 21 error: /Users/andres/Research/NHANES/Statistics/ITE/ITE-0.36_code/code/H_I_D_A_C/base_estimators/DRenyi_kNN_k_estimation.m at line 35, column 8

It appears that the function top() is not recognized by octave. I tested it on octave 3.6.2 on Linux Ubuntu 12.10 and 3.4.0 on OSX 10.8.3.

Comments (8)

  1. Zoltán Szabó

    Hi,

    Thanks for the feedback.

    The 'top' function is part of the embedded 'knn' package (C++ accelerated k-nearest neighbor search, see 'shared/embedded/knn/top.cpp'), and is compiled at the installation stage (provided that compile_knn = 1; that is the default option):

    cd ITE_code_directory;
    ITE_install(pwd);
    ...
    knn (top.cpp) compilation: started.
    knn (top.cpp) compilation: ready.
    ...
    

    Some questions:

    1. Haven't you accidentally set 'compile_knn = 0'?
    2. Have you obtained/noticed any error message at installation ('top.cpp' compilation)?
    3. Is the compiled 'top' function available on your octave path?

    Zoltan

  2. Andres Colubri

    Hello Zoltan, thanks for your prompt reply. I'm new to octave, so I'm still not familiar with things like setting its path. Once thing I notice in the installation process of ITE on OSX is that the following error occurred:

    octave-3.4.0:11> ITE_install(pwd); remove entire contents of /Users/andres/Research/NHANES/Statistics/ITE/ITE-0.36_code/code/shared/embedded/ann_wrapperM/? (yes or no) yes Installation: started. We are working in Octave environment => ann_wrapper for Matlab: deleted. ARfit package: downloading, extraction: started. ARfit package: downloading, extraction: ready. warning: function /Users/andres/Research/NHANES/Statistics/ITE/ITE-0.36_code/code/shared/embedded/E4/vech.m shadows a core library function /Applications/Octave.app/Contents/Resources/bin/mkoctfile-3.4.0: line 472: /usr/bin/gcc-4.2: No such file or directory /Applications/Octave.app/Contents/Resources/bin/mkoctfile-3.4.0: line 505: /usr/bin/g++-4.2: No such file or directory /Applications/Octave.app/Contents/Resources/bin/mkoctfile-3.4.0: line 505: /usr/bin/g++-4.2: No such file or directory /Applications/Octave.app/Contents/Resources/bin/mkoctfile-3.4.0: line 505: /usr/bin/g++-4.2: No such file or directory /Applications/Octave.app/Contents/Resources/bin/mkoctfile-3.4.0: line 505: /usr/bin/g++-4.2: No such file or directory /Applications/Octave.app/Contents/Resources/bin/mkoctfile-3.4.0: line 505: /usr/bin/g++-4.2: No such file or directory /Applications/Octave.app/Contents/Resources/bin/mkoctfile-3.4.0: line 505: /usr/bin/g++-4.2: No such file or directory /Applications/Octave.app/Contents/Resources/bin/mkoctfile-3.4.0: line 472: /usr/bin/gcc-4.2: No such file or directory ITE directory: added with subfolders to the Octave PATH. 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. KDP (kdpee.c, kdpeemex.c) compilation: ready.

    but knn appeared to be be compiled successfully nonetheless, so perhaps I'm not setting the path properly. I found the reference for path manipulation in octave:

    http://www.gnu.org/software/octave/doc/interpreter/Manipulating-the-load-path.html

    should I explicitly add the path to knn using the addpath() function?

    I'm not on Linux right now, but I will run some more tests on a machine with Ubuntu and let you know if I encounter issues. The first time I tried it seems that didn't find top() as in OSX, but I need to double check.

    Thanks, Andres

  3. Zoltán Szabó

    Hi,

    Unfortunately, I do not have access to an OSX system (I tested ITE on Windows and Linux, see ITE documentation), so I try to help and solve your problem based on your installation messages.

    The line

    addpath(genpath(ITE_code_dir));
    

    in ITE_install.m adds the ITE code directory and its subfolders recursively to your Matlab/Octave path; it should be sufficient.

    The output of mkoctfile could be the key to your issue:

    /usr/bin/gcc-4.2: No such file or directory
    /usr/bin/g++-4.2: No such file or directory
    

    In other words, it seems that (on OSX) only your C/C++ compiler is missing.

    Note: the

    XY compilation: ready
    

    messages can be somewhat misleading in your case; I implicitly assumed that upon a compilation error, ITE_install.m immediately terminates.

    Zoltan

  4. Andres Colubri

    Hi Zoltan,

    I run the installation script on Linux again (the first time I was missing the liboctave-dev package), and it appears to work fine, although I got the following warning during compilation:

    warning: function /home/andres/Research/NHANES/ITE-0.36/code/shared/embedded/E4/vech.m shadows a core library function

    and during the installation tests:

    warning: /home/andres/Research/NHANES/ITE-0.36/code/shared/downloaded/ARfit/arsim.m: possible Matlab-style short-circuit operator at line 40, column 22 warning: /home/andres/Research/NHANES/ITE-0.36/code/shared/downloaded/ARfit/arfit.m: possible Matlab-style short-circuit operator at line 61, column 27 ARfit quick test: successful.

    As for OSX, I got the compilation to work by creating the symlinks /usr/bin/gcc-4.2 and /usr/bin/g++-4.2 that point to /usr/bin/gcc and /usr/bin/g++ respectively. But then I got several errors related to architecture mismatch, like:

    ld: warning: directory not found for option '-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib' ld: warning: directory not found for option '-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/..' ld: warning: ld: warning: ignoring file /Applications/Octave.app/Contents/Resources/lib/octave-3.4.0/liboctinterp.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Applications/Octave.app/Contents/Resources/lib/octave-3.4.0/liboctinterp.dylibignoring file /Applications/Octave.app/Contents/Resources/bin/octave-3.4.0, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 2 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Applications/Octave.app/Contents/Resources/bin/octave-3.4.0

    <snip>

    ld: warning: ignoring file /Applications/Octave.app/Contents/Resources/lib/gcc/i686-apple-darwin9/4.2.1/libgfortranbegin.a, file was built for archive which is not the architecture being linked (x86_64): /Applications/Octave.app/Contents/Resources/lib/gcc/i686-apple-darwin9/4.2.1/libgfortranbegin.a Undefined symbols for architecture x86_64: "_mxCreateDoubleMatrix", referenced from: _mexFunction in chol_gauss.o "_mxGetM", referenced from: _mexFunction in chol_gauss.o

    <snip>

    but this is probably due to the fact that the octave package I installed is 32 bit, while the compilation is trying to generate 64 bit binaries. I might update octave to a 64 build, or compile it myself from source, but now that I have the Linux version working properly, is not a big concert at least for the moment.

    Thanks for your support! Andres

  5. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.