tyler123durden / rtklib

RTKLIB modifications for embedded systems
13 stars 23 forks source link

rnx2rtkp build on rasPi does not find LAPACK files #2

Closed wolfgangr closed 11 years ago

wolfgangr commented 11 years ago

Symptom: cannot find -llapack -lblas System: Rapberry Pi debian wheezy, compile on target

cc -c -Wall -O3 -ansi -pedantic -I../../../src -DLAPACK -DTRACE -DENAGLO -DENAQZS -DENAGAL -DNFREQ=3 ../../../src/rtkpos_gsi.c
cc   rnx2rtkp.o rtkcmn.o rinex.o rtkpos.o postpos.o solution.o lambda.o geoid.o sbas.o preceph.o pntpos.o ephemeris.o options.o ppp.o ppp_ar.o rtcm.o rtcm2.o rtcm3.o rtcm3e.o ionex.o stec.o rtkpos_gsi.o  -lm -llapack -lblas -o rnx2rtkp
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas

What helped for me: First, check wheter LAPACK stuff ist installed:

dpkg -l | grep lapack
    liblapack3
    liblapack3gf
dpkg -l | grep blas
    libblas3
    libblas3gf 

/usr/lib/lapack/liblapack.so.3.0
/usr/share/lintian/overrides/liblapack3gf
/usr/lib/libblas/libblas.so.3.0
/usr/share/lintian/overrides/libblas3gf

so, since we have no matching file names, we create some by symbolic links: implicitly hoping for backwards compatibility:

sudo ln -s libblas.so.3.0 /usr/lib/libblas/libblas.so
sudo ln -s liblapack.so.3.0 /usr/lib/lapack/liblapack.so

and tell the linker where to look for the libraries:

pi@raspberrypi ~/test/rtklib $ diff rtklib_2.4.2b9/app/rnx2rtkp/gcc/makefile.000 rtklib_2.4.2b9/app/rnx2rtkp/gcc/makefile
13c13,15
< LDLIBS  = -lm -llapack -lblas

---
> # LDLIBS  = -lm -llapack -lblas
> LDLIBS  = -lm  -L/usr/lib/lapack -L/usr/lib/libblas -L/usr/lib -llapack -lblas

At least it builds, and the executable can be invoked to spit its help message. Testing still going on

wolfgangr commented 11 years ago

Hi tyler123durden,

what is the github way to deal with such an issue? Shuld I create a fork now, apply my changes, commit them and issue a pull request? And which steps in which sequence is recommended? Or ist the fork / pull more suitable for complex rearrangements, not just such simple one-point-issues?

yours Wolfgang

tyler123durden commented 11 years ago

Pulled changes from you and fiexd with commt 7e92ca887556ba8e1ef9abbe7713fb867cf14d7e

But I think this needs further investigations to get done automatically.

wolfgangr commented 11 years ago

I think this needs further investigations to get done automatically.

well, there is a standard way to automate this: Gnu auto tools

http://en.wikipedia.org/wiki/GNU_build_system

But to mee, this looks like a tremendous hill of learning curve to climb. But when rtklib will end up as a full fledged linux component one day, it will be auto-tooled.