![]() Most C and Fortran libraries ship compiled as shared libraries already, but if you are compiling the code yourself using GCC (or Clang), you will need to use the -shared and -fPIC options. The code to be called must be available as a shared library. This is accomplished just by making an appropriate call with ccall syntax, which looks like an ordinary function call. Julia has a "no boilerplate" philosophy: functions can be called directly from Julia without any "glue" code, code generation, or compilation – even from the interactive prompt. To allow easy use of this existing code, Julia makes it simple and efficient to call C and Fortran functions. Though most code can be written in Julia, there are many high-quality, mature libraries for numerical computing already written in C and Fortran. Edit on GitHub Calling C and Fortran Code ![]()
0 Comments
Leave a Reply. |