Hello!
I am trying to compile ElmerFEM (GitHub - ElmerCSC/elmerfem: Official git repository of Elmer FEM software) using LFortran.
I am having some issues (as expected from an alpha stage compiler), but I do not want to spam the issue boards straight away because the blame might be on me. And there can be many issues between here and the successful compilation, so I’ll use this thread for asking around and for deciding if the issue should be reported to LFortran issue tracker (or that of ElmerFEM).
ElmerFEM is mainly a fortran code (F90), at least the part that I am interested in now (the ElmerSolver) and allows several 3rd party libraries to be linked in for various tasks (linear system solution, meshing, partitioning, mpi, …). Build automation is handled using cmake (trying to incorporate fpm is one other project that should be tried).
However, let’s start simple and use as little external libraries as possible:
export FC="/home/eelis/git/lfortran/src/bin/lfortran"
cmake .. -DWITH_MPI=FALSE
MPI is TRUE
by default
First relevant error is here:
Run Build Command(s):/usr/bin/make -f Makefile cmTC_f0449/fast && /usr/bin/make -f CMakeFiles/cmTC_f0449.dir/build.make CMakeFiles/cmTC_f0449.dir/build
make[1]: Entering directory '/home/eelis/git/elmerfem/build/CMakeFiles/CMakeScratch/TryCompile-E47nlM'
Building Fortran object CMakeFiles/cmTC_f0449.dir/testFortranCompiler.f.o
/home/eelis/bin/lfortran -c /home/eelis/git/elmerfem/build/CMakeFiles/CMakeScratch/TryCompile-E47nlM/testFortranCompiler.f -o CMakeFiles/cmTC_f0449.dir/testFortranCompiler.f.o
e[0;31;1msemantic errore[0;0me[0;1m: function interface must be specified explicitly; you can enable implicit interfaces with `--implicit-interface`e[0;0m
e[0;34;1m-->e[0;0m /home/eelis/git/elmerfem/build/CMakeFiles/CMakeScratch/TryCompile-E47nlM/testFortranCompiler.f:3:16
e[0;34;1m|e[0;0m
e[0;34;1m3 |e[0;0m external sgemm
e[0;34;1m|e[0;0m e[0;31;1m^^^^^ e[0;0m
e[0;1mNotee[0;0m: Please report unclear or confusing messages as bugs at
https://github.com/lfortran/lfortran/issues.
make[1]: *** [CMakeFiles/cmTC_f0449.dir/build.make:78: CMakeFiles/cmTC_f0449.dir/testFortranCompiler.f.o] Error 1
make[1]: Leaving directory '/home/eelis/git/elmerfem/build/CMakeFiles/CMakeScratch/TryCompile-E47nlM'
make: *** [Makefile:127: cmTC_f0449/fast] Error 2
Even if --implicit-interface
is used, it just ends to an error where sgemm
symbol is not found. So the issue is that libblas
is not found. Gfortran compiles the whole project without problems.
I am wondering why in the case of LFortran, libblas is not found (should I compile that first btw.)? Is omitting the --implicit-interface
functionality a “standard behaviour” among compilers?
Thanks!
edit. This may be a cmake configuration issue with lfortran