NickFort
Technical User
- Jun 10, 2010
- 113
I'm playing around with FLIBS ( and getting some strange behaviour with csv_write.
To test just this module, I copy "csv_tst.f90" from "/tests/strings" and "csv_file.f90", "csv_file_1d.f90", "csv_file_2d.f90" from "/src/strings" to the same folder.
If I compile it with
it runs just fine.
However, if I compile the module to a shared library like so:
the test doesn't work properly. It writes the correct output, except not to the specified file, but to "fort.10" (10 is the unit number specified for the file). The specified file remains empty.
Does anyone have any idea why this is happening, and more importantly, how to get it to work correctly?
--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
To test just this module, I copy "csv_tst.f90" from "/tests/strings" and "csv_file.f90", "csv_file_1d.f90", "csv_file_2d.f90" from "/src/strings" to the same folder.
If I compile it with
Code:
gfortran csv_file.f90 csv_tst.f90 -o test
it runs just fine.
However, if I compile the module to a shared library like so:
Code:
gfortran csv_file.f90 -c
gfortran -shared csv_file.f90 -o csv.dll
gfortran csv_tst.f90 -L. csv.dll -o test
the test doesn't work properly. It writes the correct output, except not to the specified file, but to "fort.10" (10 is the unit number specified for the file). The specified file remains empty.
Does anyone have any idea why this is happening, and more importantly, how to get it to work correctly?
--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.