8

What the -fpic flag does? I want to install a library (OpenSFM) and it is stated that it will need the Ceres Solver built and installed with the -fPIC compilation flag.

The problem is I already installed the Ceres Solver without the -fPIC flag and other library already depended on it. How can I solve this?

sepp2k
  • 363,768
  • 54
  • 674
  • 675

1 Answers1

5

A good explaination for -fPIC can be found here.

I think the main question here is whether if you can still go ahead and install OpenSfM without rebuilding Ceres Solver. As far as I know, you can't.

The most straightforward thing you can do is rebuild Ceres Solver and reinstall the PIC version.

cmake .. -DCMAKE_C_FLAGS=fPIC \
   -DCMAKE_CXX_FLAGS=-fPIC \ 
   -DSOMEOTHERARGUMENTSTHATYOUMIGHTHAVE

Let us know how it worked out for you. :)

Community
  • 1
  • 1
bot1131357
  • 877
  • 8
  • 25