Errors "`.rodata' can not be used when making a shared object " occurred when I typed "cmake .." and "make"!
When I typed "cmake .." and "make", errors occurred as follows: [ 58%] Linking CXX shared library libcvsba.so /usr/bin/ld: /usr/local/lib/liblapack.a(dgeqrf.f.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/liblapack.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status src/CMakeFiles/cvsba.dir/build.make:217: recipe for target 'src/libcvsba.so' failed make[2]: *** [src/libcvsba.so] Error 1 CMakeFiles/Makefile2:124: recipe for target 'src/CMakeFiles/cvsba.dir/all' failed make[1]: *** [src/CMakeFiles/cvsba.dir/all] Error 2 Makefile:151: recipe for target 'all' failed make: *** [all] Error 2 I saw many solutions on the Internet, but they didn't work! Please give me some suggestions!Thanks very much!
Solution: 1、cmake .. -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_LIBRARY_PATH=/usr/lib/
2、make 3、sudo make install