Re: CMake, file extensions

Felix Salfelder <[email protected]>
Newsgroups gmane.comp.gnu.gnucap.devel
Message-ID <[email protected]>
On Mon, Feb 13, 2017 at 10:59:27AM +0000, Richard Crozier wrote:
> You could do something similar to what matlab does. It uses custom suffix
> for compiled shared libraries (mex files) but with a platform specific
> extension (e.g. .mexw64 for win 64, .mexa64 for linux 64 bit etc.). Under
> the hood they are just shared libraries.

with this, i understand that in matlab-ui you do load("module"), and it
then (roughly) calls dlopen("module" + ".mexa64").

what if you wanted to dlopen just "module.so"? (would that be
useful/worth supporting?)

> The advantage of this approach is that they can be on the Maltab search path
> and easily found without mixing up with other shared libraries and different
> platforms versions can coexist.

indeed, with just .so/.dll/.dylib, we will not be able to have both
32bit and 64bit libraries in one directory... i totally see the use
case.

instead of using md.h, we should add a configure flag for that
extension, so it will properly end up in the makefiles *and* in
c_attach. then it can be anything, and also work for future whatever
os/arch/abi combinations.

thanks for sharing
felix
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.