Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#34 CALL_EXTERNAL

closed
nobody
None
5
2011-04-27
2010-10-27
Christoph Fuchs
No

The attached files implement the CALL_EXTERNAL function for GDL on Unix/Linux Systems (with dlopen/dlsym).
The code itself is in the files new.cpp, new.hpp, and you have to define the routine in libinit.cpp (see the instructions in README.call_external).
The files test_ce.pro and test_ce.c can be used to test the routine.

Shared objects which are used with IDL can also be used with GDL, even strings and structures are passed the same way as in IDL to the called routine.
All IDL keywords are implemented except CDECL (relevant for MS Windows only), WRITE_WRAPPER and all AUTO_GLUE keywords (you have to write and compile your routines yourself :-)

See the attached File README.call_external for more information on Installation, Testing and Syntax.

Discussion

  • CALL_EXTERNAL for GDL

     
  • README file

     
    Attachments
  • Thanks!

    I've just put it into the CVS. I haven't got it working yet (i.e. the test-routine fails with a segfault inside the loaded library)... but I've tried it only on a Mac. I'll be cut from internet in a moment :( but I'll come back to it this week. Please test.

    Cheers,
    Sylwester

    P.S. The test-routine is included in the "make check" run.

     
  • Well... it wasn't "this week" as, apart from not having Internet connection, I encountered a hard disk failure soon after I've sent the last message...

    Anyhow, the test routine in the current CVS is working both on Mac and Linux
    (test_ce.pro that is run as a part of "make check" together with compilation of the libtest_ce.so)

    I had to comment out a couple of lines from the testsuite/libtest_ce.cpp. All are marked with "//??" - could you please have a look at it if possible:

    http://gnudatalanguage.cvs.sourceforge.net/viewvc/gnudatalanguage/gdl/testsuite/libtest_ce.cpp?r1=1.2&r2=1.3

    Best,
    Sylwester

     
  • Joanna
    Joanna
    2011-01-05

    Dear vulpeculas and Sylwester,

    I have found a bug in the call_external routine, and I have posted it in the bugs tracker.

    Joanna

     
    • status: open --> closed
     
  • The contents of README.call_external are now part of the docs (http://gnudatalanguage.sourceforge.net/gdl.pdf) together with a step-by-step example using C and CMake. I'm closing this item - please report any bugs/issues as separate tracker entries.

    Thanks a lot Christoph!
    Best,
    Sylwester