Editing Fortran

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 131: Line 131:
=== Compiling the code ===
=== Compiling the code ===


Generate {{Path|octave_file_io.o}} from {{Path|octave_file_io.cc}}.
  mkoctfile -I. octave_file_io.cc  
 
  mkoctfile -I. --mkoctfile --link-stand-alone octave_file_io_example.f90 octave_file_io.o -o octave_file_io_example
mkoctfile -I. -c octave_file_io.cc
 
Generate {{Path|octave_file_io_example.exe}} from {{Path|octave_file_io_example.f90}} including {{Path|octave_file_io.o}}.
 
mkoctfile -I. --link-stand-alone octave_file_io_example.f90 octave_file_io.o -o octave_file_io_example.exe -lgfortran
 
If you receive errors about missing libraries, make sure your <code>LD_LIBRARY_PATH</code> is set correctly to find all Octave libraries, e.g.
 
$ ldd ./octave_file_io_example.exe
...
        libgfortran.so.4 => /usr/lib64/libgfortran.so.4 (0x00007fe9eb62b000)
        liboctinterp.so.8 => not found
        liboctave.so.8 => not found
...
 
Then find {{Path|liboctinterp.so.8}} and {{Path|liboctave.so.8}} on your system and type
 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/lib/octave/{{Release}}/
 


[[Category:Examples]]
[[Category:Examples]]
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: