Compilation error when building getdp 3.6.0. on FreeBSD,
In line 120 of src/kernel/LinAlg_SPARSKIT.cpp, the function declaration of LinAlg_CreateMatrix conflicts with its prototype defined on line 99 src/kernel/LinAlg.h. Using the clang-17.0.6 compiler gives the error:
ld: error: undefined symbol: LinAlg_CreateMatrix(gMatrix*, gSolver*, int, int, bool)
referenced by EigenSolve_ARPACK.cpp CMakeFiles/getdp.dir/src/kernel/EigenSolve_ARPACK.cpp.o:(EigenSolve_ARPACK(DofData*, int, double, double, int)) referenced by Cal_AssembleTerm.cpp CMakeFiles/getdp.dir/src/kernel/Cal_AssembleTerm.cpp.o:(Cal_AssembleTerm_NoDt(Dof*, Dof*, double*)) referenced by Cal_AssembleTerm.cpp CMakeFiles/getdp.dir/src/kernel/Cal_AssembleTerm.cpp.o:(Cal_AssembleTerm_DtDof(Dof*, Dof*, double*)) referenced 34 more times did you mean: LinAlg_CreateMatrix(gMatrix*, gSolver*, int, int) defined in: CMakeFiles/getdp.dir/src/kernel/LinAlg_SPARSKIT.cpp.o c++: error: linker command failed with exit code 1 (use -v to see invocation)
I could fix it with the following patch (which will be mangled by the editor, but is easy to do by hand):
--- src/kernel/LinAlg_SPARSKIT.cpp.orig 2024-03-08 06:48:58 UTC
+++ src/kernel/LinAlg_SPARSKIT.cpp
@@ -117,7 +117,7 @@ void LinAlg_CreateVector(gVector *V, gSolver *Solver, V->N = n; }
-void LinAlg_CreateMatrix(gMatrix *M, gSolver *Solver, int n, int m)
+void LinAlg_CreateMatrix(gMatrix *M, gSolver *Solver, int n, int m, bool silent )
{
init_matrix(n, &M->M, &Solver->Params);
}