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

Lapack dependency on Windows #958

Open
Beliavsky opened this issue Jul 20, 2023 · 1 comment
Open

Lapack dependency on Windows #958

Beliavsky opened this issue Jul 20, 2023 · 1 comment

Comments

@Beliavsky
Copy link

Trying FPM on the project at https://github.com/gha3mi/foreig I don't get an executable because it cannot find Lapack. I get errors such as

>fpm test
[  0%]                      test1.exe
[100%]                      test1.exe  done.

c:/programs/gcc/bin/../lib/gcc/x86_64-w64-mingw32/13.0.0/../../../../x86_64-w64-mingw32/bin/ld.exe: build\gfortran_A18F5477E168D1CF\foreig\libforeig.a(src_foreig.f90.o): in function `dsyev_rel':
c:\...\foreig/././src/foreig.f90:69: undefined reference to `dsyev_'
c:/programs/gcc/bin/../lib/gcc/x86_64-w64-mingw32/13.0.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:\...\foreig/././src/foreig.f90:80: undefined reference to `dsyev_'

as detailed in gha3mi/foreig#1. (Following the advice given did not solve the problem.) I have compiled Lapack and BLAS on my PC to create .a files, and the following command creates an executable:

gfortran build\dependencies\kinds\src\kinds.f90 src\foreig.f90 test\test1.f90 liblapack.a librefblas.a

I have copied the .a files to c:\lib, and the following command also works:

gfortran build\dependencies\kinds\src\kinds.f90 src\foreig.f90 test\test1.f90 -LC:\\lib -llapack -lrefblas

How do I tell FPM to look in c:\lib for needed libraries?

@gnikit
Copy link
Member

gnikit commented Jan 8, 2024

Something like this should work I think,

fpm test --link-flag "-LC:\\lib"

or by setting the environmental variable FPM_LDFLAGS

FPM_LDFLAGS="-LC:\\lib
fpm test

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

No branches or pull requests

2 participants