Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3916 closed Bugs (fixed)

implicit gcc fortran generator omits -fPIC when buildung shared libs

Reported by: jan.boehme@… Owned by: Vladimir Prus
Milestone: Component: build
Version: Boost Development Trunk Severity: Problem
Keywords: boost build gcc gfortran shared Cc:

Description

Checked against boost development trunk r59615.

Change History (4)

comment:1 by Vladimir Prus, 13 years ago

Could you expand somewhat? Given your description, I cannot understand what the problem. In fact, I don't even know what is 'implicig gcc fortran generator'.

Thanks, Volodya

comment:2 by jan.boehme@…, 13 years ago

Hi Volodya!

Sorry for missing something. A rule like this is given:

lib mixture : source.f csource.cpp ;

bjam -a -d2 mixture link=shared

leads to the following output:

gcc.compile.fortran bin/gcc-4.4.3/debug/source.o

  "g++"  -O0 -fno-inline -Wall -g     -c -o "bin/gcc-4.4.3/debug/source.o" "source.f" 

gcc.compile.c++ bin/gcc-4.4.3/debug/csource.o

    "g++"  -ftemplate-depth-128 -O0 -fno-inline -Wall -g -fPIC     -c -o "bin/gcc-4.4.3/debug/csource.o" "csource.cpp"

gcc.link.dll bin/gcc-4.4.3/debug/libmixture.so

As you can see, only the cpp-object was compiled using "-fPIC".

With "implicit" I want to say that the gnu fortran compiler will be used implicitly here. What if I want to use gnu for C++ only and the intel tools for fortran? I guess I would get errors caused by ambiguous generators.

Cheers, Jan.

comment:3 by Vladimir Prus, 13 years ago

Resolution: fixed
Status: newclosed

(In [59986]) Use same flags for fortran compilation as for C and C++.

Fixes #3916.

comment:4 by Vladimir Prus, 13 years ago

Jan, as you see, I've fixed this issue. Could you try with SVN HEAD? As for your second question -- it might be possible to use intel for fortran sources, but only explicitly, for example: obj a : a.f : <toolset>intel ; exe main : main.cpp a ;

This is untested code, beware.

Thanks, Volodya

Note: See TracTickets for help on using tickets.