geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
223 stars 235 forks source link

backport world builder simplify cmake -fPIC #5766

Closed MFraters closed 4 months ago

MFraters commented 4 months ago

A follow up to #5676 and #5669. @bangerth suggested that the -fPIC flags could also be removed.

The -fPIC flag should be automatically set by cmake, so there is no need to specify it manually.

This is a backport of https://github.com/GeodynamicWorldBuilder/WorldBuilder/pull/736 into aspect.

tjhei commented 4 months ago
/usr/bin/ld: lib/libWorldBuilder.a(unity_0_cxx.cxx.o): relocation R_X86_64_PC32 against symbol `_ZTVN12WorldBuilder17CoordinateSystems9CartesianE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
MFraters commented 4 months ago

Yes, it seems that -fPIC is actually needed to get it to work with aspect, but also in the world builder repository. Maybe I need to set something for cmake that it adds it when needed.

bangerth commented 4 months ago

@MFraters Would you mind updating this accordingly?

MFraters commented 4 months ago

@MFraters Would you mind updating this accordingly?

Done!