Skip to content

Commit

Permalink
mac package: try using otool to detect blas variant
Browse files Browse the repository at this point in the history
  • Loading branch information
AllinCottrell committed Jan 9, 2025
1 parent d04b08a commit bae9294
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/src/gretl_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -2560,16 +2560,17 @@ static int detect_blas_via_ldd (void)
gchar *errout = NULL;
gint status = 0;
GError *gerr = NULL;
int variant = 0;

#ifdef __APPLE__
int variant = BLAS_VECLIB;
gchar *argv[4];
targ = g_strdup_printf("%sgretlcli", gretl_bindir());
argv[0] = "otool";
argv[1] = "-L";
argv[2] = targ;
argv[3] = NULL;
#else
int variant = BLAS_UNKNOWN;
gchar *argv[3];
targ = g_strdup(GRETL_PREFIX "/lib/libgretl-1.0.so");
argv[0] = "ldd";
Expand Down Expand Up @@ -2951,19 +2952,13 @@ static void blas_init (void)
{
void *ptr = NULL;

#if defined(__APPLE__) && defined(PKGBUILD)
blas_variant = BLAS_VECLIB; /* the default */
return;
#else
blas_variant = BLAS_UNKNOWN;
#endif

ptr = dlopen(NULL, RTLD_NOW);
if (ptr == NULL) {
#ifdef WIN32
return;
#else
goto getout;
goto try_ldd;
#endif
}

Expand Down Expand Up @@ -3005,7 +3000,7 @@ static void blas_init (void)
}

#ifndef WIN32
getout:
try_ldd:

if (blas_variant == BLAS_UNKNOWN) {
blas_variant = detect_blas_via_ldd();
Expand Down

0 comments on commit bae9294

Please sign in to comment.