Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to readme link to binaries, and correct mkoctfile line to create sqlite3.mex on macos #3

Open
dukechem opened this issue Feb 20, 2019 · 1 comment

Comments

@dukechem
Copy link

Please add to readme info below.
(1.) Macos and linux HOWTO.
To create sqlite3.mex on macosx or linux.

  • Macos brew install octave && git clone https://github.com/rmartinjak/mex-sqlite3.git
  • Linux. Get mkoctfile. Debian/Ubuntu: apt-get install liboctave-dev

mkoctfile --mex -lsqlite3 -loctave -o sqlite3.mex sqlite3.c structlist.c . && cp sqlite3.mex ~/octave/ && octave
GNU Octave, version 4.4.1
octave:1> sqlite3
error: sqlite3: usage: sqlite3(file, query[, params]

I tried putting sqlite3.mex in octave path, but only seems to find it if running from dir where it is. That is I have same problem in octave as does @chappjc in matlab per their comment at https://stackoverflow.com/questions/26189163/mex-compiled-function-not-recognized-by-matlab

Thanks, I its weird, I had to explicitly go to the directory of the mex file and only then did the function become available. Adding its directory via addpath(genpath('the/path')) did not work for some reason

I copied sqlite3.mex to ~/Documents/MATLAB/ but matlab still says Undefined function or variable 'sqlite3' so Matlab does not recognize .mex. Maybe sqlite3.mex is really is an .oct file, as mkoctfile creates identical files with and without --mex. If I rename it sqlite3.mexmaci64 it crashes matlab.

(2.) Windows and Linux binaries.
At matlab FEX site for sqlite3 you can download a zip with compiled_mex folder that has one linux binary, and all the rest are windows binaries:

862208 Apr 11 2018 sqlite3_matlab.exe 
966706 Mar 3 2017 sqlite3_matlab.mexa64 
741888 Mar 3 2017 sqlite3_matlab.mexw32 
962560 Mar 3 2017 sqlite3_matlab.mexw64 
29032 May 13 2018 sqlite3_octave_lnx_i686.mex 
145052 May 13 2018 sqlite3_octave_win_64.mex 
114247 May 13 2018 sqlite3_octave_win_i686.mex 
@thrynae
Copy link

thrynae commented Jan 22, 2022

I don't know if you're still watching this thread, but I just published an update of my sqlite3 function (which adapts much of the C code of this project). You might be interested to give it a try. You can either use the same FEX link as in your post, or go directly to the release tag.

It contains C code that can be compiled with every compiler I managed to get to work with Matlab/Octave. I even got it to work on my Raspberry Pi. There is also a Mac binary, although I am not sure how many releases back it will work. You can check out the HTML documentation page to see the full test matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants