Reputation: 259
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
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