From fb767445d06a9c8164f1c0650a556f7c612b713f Mon Sep 17 00:00:00 2001 From: Fabian Brinkmann Date: Fri, 24 Apr 2026 12:11:06 +0200 Subject: [PATCH 1/4] add GSL_PREFIX for custom GSL path --- mesh2hrtf/NumCalc/src/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mesh2hrtf/NumCalc/src/Makefile b/mesh2hrtf/NumCalc/src/Makefile index a7624f95..a96211b5 100644 --- a/mesh2hrtf/NumCalc/src/Makefile +++ b/mesh2hrtf/NumCalc/src/Makefile @@ -8,15 +8,17 @@ EXECUTABLE=../bin/NumCalc GSLFLAG=-DUSE_GSL LAPACKFLAG=-DUSE_LAPACK OPTIM=-O2 -LDFLAGS=-llapacke -lgsl -lblas +GSL_PREFIX ?= /usr/local +LDFLAGS=-llapacke -lgsl -lblas -L$(GSL_PREFIX)/lib +CFLAGS+=-I$(GSL_PREFIX)/include #DEBUG=-g all: $(SOURCES) $(EXECUTABLE) -$(EXECUTABLE): $(OBJECTS) +$(EXECUTABLE): $(OBJECTS) $(CC) $(OBJECTS) $(LDFLAGS) $(OPTIM) $(GSLFLAG) $(LAPACKFLAG) -o $@ .cpp.o: - $(CC) $(CFLAGS) $(DEBUG) $(OPTIM) $< + $(CC) $(CFLAGS) $(DEBUG) $(OPTIM) $(GSLFLAG) $(LAPACKFLAG) $< clean: rm *.o From ff8913f4889def19e2446370e143328afd91d01d Mon Sep 17 00:00:00 2001 From: Fabian Brinkmann Date: Fri, 24 Apr 2026 12:11:35 +0200 Subject: [PATCH 2/4] explicit cmath include and system agnostic gsl include --- mesh2hrtf/NumCalc/src/NC_MLFMM.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mesh2hrtf/NumCalc/src/NC_MLFMM.h b/mesh2hrtf/NumCalc/src/NC_MLFMM.h index 7ef9e229..e1557131 100644 --- a/mesh2hrtf/NumCalc/src/NC_MLFMM.h +++ b/mesh2hrtf/NumCalc/src/NC_MLFMM.h @@ -7,15 +7,14 @@ #include #include #include -#include -//#include +#include +#include -#include extern Vector Sourpoi3; extern Vector Norvci3; extern void BAsinguII(ofstream&, Vector&, const int&, const int&, Vector&, Matrix&, - const int&, const int&); + const int&, const int&); extern void BAreguII(ofstream&, Vector&, const int&, const int&, const int&, const int&, Vector&, Matrix&, From a9ba3d4262bfc3e8568ae1d8d46501447cf1c262 Mon Sep 17 00:00:00 2001 From: Fabian Brinkmann Date: Fri, 24 Apr 2026 12:12:16 +0200 Subject: [PATCH 3/4] encpsulate legendre call --- mesh2hrtf/NumCalc/src/NC_MLFMM.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mesh2hrtf/NumCalc/src/NC_MLFMM.cpp b/mesh2hrtf/NumCalc/src/NC_MLFMM.cpp index 472f1cb1..f6fdc423 100644 --- a/mesh2hrtf/NumCalc/src/NC_MLFMM.cpp +++ b/mesh2hrtf/NumCalc/src/NC_MLFMM.cpp @@ -584,9 +584,14 @@ void Get_Interpolation_Matrices(double** Ylev, int nlevels) { if( l == 0 ) // Ylev[lev-1][i * Ncurrent + j] = 0.25/PI; Ylev[lev-1][i * Ncurrent + j] = 1.0; - else + else { // Ylev[lev-1][i * Ncurrent + j] += (2.0 * double(l) + 1.0) / (4.0 * PI) * legendre(l,Angle); +#ifdef USE_GSL + Ylev[lev-1][i * Ncurrent + j] += (2.0 * double(l) + 1.0) * gsl_sf_legendre_Pl(l,Angle); +#else Ylev[lev-1][i * Ncurrent + j] += (2.0 * double(l) + 1.0) * legendre(l,Angle); +#endif + } } } } From 7ce0d1cd86a604f33f1d42e5ced9701438e26992 Mon Sep 17 00:00:00 2001 From: Fabian Brinkmann Date: Tue, 28 Apr 2026 11:23:44 +0200 Subject: [PATCH 4/4] add lapack prefix --- mesh2hrtf/NumCalc/src/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesh2hrtf/NumCalc/src/Makefile b/mesh2hrtf/NumCalc/src/Makefile index a96211b5..c37cf14a 100644 --- a/mesh2hrtf/NumCalc/src/Makefile +++ b/mesh2hrtf/NumCalc/src/Makefile @@ -9,8 +9,10 @@ GSLFLAG=-DUSE_GSL LAPACKFLAG=-DUSE_LAPACK OPTIM=-O2 GSL_PREFIX ?= /usr/local -LDFLAGS=-llapacke -lgsl -lblas -L$(GSL_PREFIX)/lib +LAPACK_PREFIX ?= /usr/local +LDFLAGS=-L$(LAPACK_PREFIX)/lib -L$(GSL_PREFIX)/lib -llapacke -lgsl -lblas CFLAGS+=-I$(GSL_PREFIX)/include +CFLAGS+=-I$(LAPACK_PREFIX)/include #DEBUG=-g all: $(SOURCES) $(EXECUTABLE)