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.


  • Sylwester Arabas


    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.


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

  • Sylwester Arabas

    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:



  • 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.


  • Sylwester Arabas

    • status: open --> closed
  • Sylwester Arabas

    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!


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks