Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: static compilation

28 views
Skip to first unread message

Nasser M. Abbasi

unread,
May 22, 2013, 7:55:08 AM5/22/13
to
On 5/22/2013 5:39 AM, Rudra Banerjee wrote:
> Hello,
> This is possibly more a linux(or even fedora) question, then fortran.
> In my code, while compiling I get error as:
> $ gfortran -static prime.f90
> /usr/bin/ld: cannot find -lgfortran
> /usr/bin/ld: cannot find -lm
> /usr/bin/ld: cannot find -lquadmath
> /usr/bin/ld: cannot find -lm
> /usr/bin/ld: cannot find -lc
> collect2: error: ld returned 1 exit status
>
> So, I need static libraries. Any help for fedora user?
>

I copied my static build command. Try something like this
(some of these libs you might not need)

LIBS="/usr/lib/gcc/i686-linux-gnu/4.6/libgfortran.a /usr/gnat/lib/libstdc++.a"

gfortran main.f90 -static $LIBS -o main

--Nasser
0 new messages