user157588
user157588

Reputation: 259

Directly linking a library inside fortran code without compiler flag

To link a library, say, BLAS, in gfortran one needs to use gfortran file.f90 -lblas to compile.

Is there any way to avoid that part by directly writing some command inside the main program so that one does not need to add some extra command while compiling?

Upvotes: 2

Views: 167

Answers (1)

axwr
axwr

Reputation: 2236

No.

Theoretically, I suppose you could do some crazy stuff where you go a grab that file in code essentially linking it yourself but that would be.. unusual. The general solution to this is to use a makefile or if you are really just messing around a temporary alias in your terminal can keep things simple.

Upvotes: 4

Related Questions