Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fortran interface for matio #51

Open
onyukim opened this issue Feb 8, 2017 · 10 comments
Open

Fortran interface for matio #51

onyukim opened this issue Feb 8, 2017 · 10 comments

Comments

@onyukim
Copy link

onyukim commented Feb 8, 2017

Hello,

I have found that Fortran interface for matio cannot be compiled.
I would be grateful if you could fix that.

@tbeu
Copy link
Owner

tbeu commented Feb 8, 2017

I am afraid the Fortran interface is not well maintained. I would be very glad if you could figure out what the problem is.

@onyukim
Copy link
Author

onyukim commented Feb 9, 2017

Thank you for the response.

  • Configurations for src/fortran/Makefile.am and src/fortran/matio_t.inc.in are missing in configure.ac
  • Configurations for a Fortran compiler is also missing in that file.

I added some lines as shown below. However, I don't know whether it is correct because of my lack of knowledge about autoconf and automake.

diff --git a/configure.ac b/configure.ac
index 5631856..d353c6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,6 +56,7 @@ dnl  Build programs, C compiler, F77 compiler, make, install, etc.
 dnl
 AC_PROG_CC([pgcc icc gcc cc])

+AC_PROG_FC(ifort)
 AC_ARG_ENABLE(coverage,
 [  --enable-coverage       Enable coverage testing],
 [CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"])
@@ -356,6 +357,8 @@ AC_SUBST([AUTOTEST], ['$(AUTOM4TE) --language=Autotest'])
 AC_CONFIG_FILES([Makefile \
                  matio.pc \
                  src/Makefile \
+                 src/fortran/Makefile \
+                 src/fortran/matio_t.inc
                  getopt/Makefile \
                  tools/Makefile \
                  test/Makefile \

After ./autogen.sh and ./configure, the desired files were generated, but make in src/fortran failed to compile the interface.
I attached the message given by a compiler (I use Intel C and Fortran compilers). It appears that something wrong happened in compiling matio_internal.c.

message_from_compiler.txt

@tbeu
Copy link
Owner

tbeu commented Feb 10, 2017

fd2ca03 removed the Fortran support from the configure and build options. I do not know why it was removed and will see if I get it running again.

@tbeu
Copy link
Owner

tbeu commented Feb 14, 2017

There is now a branch fortran with reverted fd2ca03. However it does not build. Also, the original developer of matio did not yet reply on my mail asking for support.

@onyukim
Copy link
Author

onyukim commented Feb 14, 2017

Thank you so much for your consideration.

tbeu added a commit that referenced this issue Mar 6, 2017
* Make all symbols public
* As reported by #51
* [ci skip]
@tbeu
Copy link
Owner

tbeu commented Mar 6, 2017

Thanks to the original author of matio, I got this one running with gfortran

git clone https://github.com/tbeu/matio --branch fortran matio_fortran
cd matio_fortran
./autogen.sh
./configure --enable-fortran
make
./test/test_matf

However, linking now fails if no fortran compiler is found or --enable-fortran=no. I've already spent 3 hours trying to fix the FCLINK, but I still failed with autotools. 😞

@onyukim
Copy link
Author

onyukim commented Mar 27, 2017

Thanks for your effort to fix that problem.
I hope that matio is available in Fortran.

@tbeu
Copy link
Owner

tbeu commented Mar 27, 2017

Does this mean branch fortran works for you?

@onyukim
Copy link
Author

onyukim commented Mar 28, 2017

In my case, I have no problem with compiling.
I cannot have tested that the interface work well because I have no time to do that in recent days.

I will report to you the result after testing the interface.

@tbeu tbeu mentioned this issue Dec 2, 2017
@tbeu
Copy link
Owner

tbeu commented Jan 4, 2020

I will report to you the result after testing the interface.

@onyukim Did yiu succeed to test the interface meanwhile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants