Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors "`.rodata' can not be used when making a shared object " occurred when I typed "cmake .." and "make"! #4

Open
zengletian1491 opened this issue Nov 12, 2019 · 1 comment

Comments

@zengletian1491
Copy link

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!

@zengletian1491
Copy link
Author

Solution:
1、cmake .. -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_LIBRARY_PATH=/usr/lib/

2、make
3、sudo make install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant