Linux using lapack library
lapack, linux, makefile
Solution
It looks like liblapack isn't in the path that ld can find. I would suggest two things:
- Establish a symbolic link manually. It is possible (and sometimes common) that ld cannot recognize `liblapack.so.3gf` or `liblapack.so.3.0.1` or so are essentially `liblapack.so`. You can set up a link by `ln -s liblapack.so.3gf liblapack.so`
- Install `liblapack-dev` package instead if you're using ubuntu or debian repos. For some unclear reasons, `liblapack3gf` is not the same as `liblapack-dev`. I am not sure if in any circumstances, both will do or not do the same thing.
I think the first item should be able to resolve your problem (hopefully).
Problem
I have an error making a code project because of what I believe is a missing routine from lapack: ``` HomographyInit.cc:(.text+0x385): undefined reference to `dgesvd_' ``` I think I need to add lapack library somehow to my Makefile. Here is part of my Makefile: ``` CC = g++ COMPILEFLAGS = -I MY_CUSTOM_INCLUDE_PATH -D_LINUX -D_REENTRANT -Wall -O3 -march=nocona -msse3 LINKFLAGS = -L MY_CUSTOM_LINK_PATH -lGVars3 -lcvd ``` I tried doing the following to no avail: ``` CC = g++ COMPILEFLAGS = -I MY_CUSTOM_INCLUDE_PATH -D_LINUX -D_REENTRANT -Wall -O3 -march=nocona -msse3 LINKFLAGS = -L MY_CUSTOM_LINK_PATH -lGVars3 -lcvd **-llapack** ``` Result: ``` make ... /usr/bin/ld: cannot find -llapack collect2: ld returned 1 exit status ``` How can I add lapack to my project? I am pretty sure I installed it correctly, though would be willing to double-check that somehow.