Bug 380670

Summary: build error on 0.3.6 cannot find -lRlapack
Product: [Applications] rkward Reporter: RKWard Team <rkward-devel>
Component: generalAssignee: RKWard Team <rkward-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description RKWard Team 2006-05-05 12:11:56 UTC
-- Originally posted by (AT sourceforge.net): braverock --

-- This ticket was imported from http://sourceforge.net/p/rkward/bugs/8 on 2017-05-30 15:26:34 +0100 --
I've successfu0lly built and used rkward-0.3.5.  I was
trying to create a Gentoo ebuild package file for
rkward 0.3.6 so that upgrades would be easier, and
distribution of rkward would be greater.  From both the
ebuild and from trying to build from a shell, the build
fails with the following:

i686-pc-linux-gnu-g++ -DHAVE\_CONFIG\_H -I. -I. -I..
-I/usr/kde/3.5/include -I/usr/qt/3/include -I.  
-DQT\_THREAD\_SUPPORT  -D\_REENTRANT  -Wnon-virtual-dtor
-Wno-long-long -Wundef -Wall -W -Wpointer-arith
-Wwrite-strings -ansi -D\_XOPEN\_SOURCE=500 -D\_BSD\_SOURCE
-Wcast-align -Wconversion -Wchar-subscripts -O2 -O2
-march=pentium3 -fomit-frame-pointer -Wformat-security
-Wmissing-format-attribute -fno-exceptions
-fno-check-new -fno-common  -c -o rkward\_skel.o \`test
-f 'rkward\_skel.cpp' || echo './'\`rkward\_skel.cpp
/bin/sh ../libtool --silent --mode=link --tag=CXX
i686-pc-linux-gnu-g++  -Wnon-virtual-dtor
-Wno-long-long -Wundef -Wall -W -Wpointer-arith
-Wwrite-strings -ansi -D\_XOPEN\_SOURCE=500 -D\_BSD\_SOURCE
-Wcast-align -Wconversion -Wchar-subscripts -O2 -O2
-march=pentium3 -fomit-frame-pointer -Wformat-security
-Wmissing-format-attribute -fno-exceptions
-fno-check-new -fno-common    -o rkward.bin -L/usr/lib
-L/usr/qt/3/lib -L/usr/kde/3.5/lib  -R /usr/kde/3.5/lib
-R /usr/qt/3/lib -R /usr/lib rkwatch.o rkward.o main.o
rkglobals.o robjectbrowser.o rkeditormanager.o
robjectviewer.o khelpdlg.o rkconsole.o rkward\_skel.o
../rkward/windows/libwindows.a
../rkward/agents/libagents.a
../rkward/dialogs/libdialogs.a
../rkward/plugin/libplugin.a
../rkward/settings/libsettings.a
../rkward/dataeditor/libdataeditor.a
../rkward/core/libcore.a
../rkward/rbackend/librbackend.a
../rkward/scriptbackends/libscriptbackends.a
../rkward/misc/libmisc.a -lkhtml -lkmdi -lkio -lkdeui
-lkdecore -lqt-mt  -lz -lpng -lz -lm -lXext -lX11  -lSM
-lICE -lpthread  -L/usr/lib/R/lib -lR -lRlapack
-lkatepartinterfaces
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld:
cannot find -lRlapack
collect2: ld returned 1 exit status
make\[3\]: \*\*\* \[rkward.bin\] Error 1

I think that lib Rlapack is missing.  I'm wondering if
this is something configured wrong in the build
configuration. 

I'm using R-2.2.1 with blas and lapack support compiled in.

I'm using lapack-3.0, and blas-19980702-r2.

When I look for lapack libraries that could be linked
with rkward, I see:

/usr/lib/R/modules/lapack.so
/usr/lib/liblapack.a
/usr/lib/lapack
/usr/lib/lapack/atlas
/usr/lib/lapack/atlas/liblapack.so.0
/usr/lib/lapack/atlas/liblapack.so.0.0.0
/usr/lib/lapack/atlas/liblapack.so
/usr/lib/lapack/atlas/liblapack.la
/usr/lib/lapack/atlas/liblapack.a
/usr/lib/lapack/current
/usr/lib/lapack/f77-ATLAS
/usr/lib/liblapack.so
/usr/lib/liblapack.so.0

So, I suspect that rkward probably needs 
/usr/lib/R/modules/lapack.so \(what else could Rlapack
be?\).  I tried a symbolic link from 
sudo ln -s /usr/lib/R/modules/lapack.so
/usr/lib/Rlapack.so 
but that didn't do it.

I'll try to look deeper into the code at issue, but any
assistance would be appreciated.

Regards,

\- Brian Peterson

Comment 1 RKWard Team 2006-05-05 12:12:46 UTC
-- Originally posted by (AT sourceforge.net): braverock --
- **assigned_to**: nobody --> tfry
Comment 2 RKWard Team 2006-05-05 12:13:13 UTC
-- Originally posted by (AT sourceforge.net): braverock --
- **assigned_to**: tfry --> ecoch
Comment 3 Thomas Friedrichsmeier 2006-05-05 12:46:51 UTC
Logged In: YES 
user\_id=300591

Thanks for your bug-report, and of course thanks for your
packaging efforts\!

In RKWard 0.3.6 I added the -lRlapack switch, as otherwise,
with R 2.3.0, sometimes some base packages could not be
loaded due to unresolved symbols. RKWard itself does not use
the library, but this way it loads it for R packages to use.
I have not fully investigated, why exactly this happens.
In fact, ATM, I do not seem to be able to reproduce this.
Maybe it was a temporary bug in one of the pre-release
versions of R 2.3.0 I tested, and has since been fixed. I do
not know, and would appreciate any insight.

Ok, how to work around this? Probably the most
straightforward way would be to edit rkward/Makefile.am and
remove the -lRlapack switch there \(I do not know, whether
this is possible in gentoo packaging, but I hope so\). If
everything works fine, then \(remember to test with R 2.3.0,
too\), that should be the best way, and I'll probably remove
the switch in the next release of RKWard \(after some more
testing\).

You might also try some other things first:
1\) ln -s /usr/lib/R/modules/lapack.so
/usr/lib/R/lib/libRlapack.so \(that is the location ldd will
be searching for -lRlapack\)
2\) Upgrade to R 2.3.0. Maybe some configuration options
changed there.

Please keep me up-to-date on whether or not this works.

Regards
Thomas

P.S.: Please don't set the "Assigned to" field, when
submitting bug reports. We don't really use this field ATM,
but it's rather intended to be an internal way of signalling
"I'm taking care of this" among the developers, not a
setting intended to be made by the submitter.
Comment 4 Thomas Friedrichsmeier 2006-05-05 12:46:51 UTC
- **assigned_to**: ecoch --> nobody
Comment 5 RKWard Team 2006-05-06 14:09:40 UTC
-- Originally posted by (AT sourceforge.net): braverock --
Logged In: YES 
user\_id=204919

Sorry about the Assigned To field.  I just know that
Sourceforge, by default, won't notify developers of new
Tracker items like it does for Forum posts. Also, many
projects make extensive use of the Assigned To field for
triage and coordination.  \(I run or contribute to a couple
of SF's top 100 projects\).

Creating the symbolic link resolved the problem.  I suggest
that you may want to check and see if R was built with
lapack support before making a requirement like this.

I also got a couple of build sandbox errors which I was able
to work around in the ebuild script.  I'm going to test on a
few more machines, and then I'll submit the ebuild both to
Gentoo for inclusion and to the RKWard project via the
Patches tracker.

I'll mark this as closed, but I think you still want to
consider how to make the rkward build process more
resilient, and continue to support R 2.2.x, since R 2.3.0
was only released on 2006-04-24, and is not yet widely
deployed \(or packaged with any distro that I'm aware of yet\).

Regards,

\- Brian
Comment 6 RKWard Team 2006-05-06 14:09:40 UTC
-- Originally posted by (AT sourceforge.net): braverock --
- **status**: open --> closed
Comment 7 Thomas Friedrichsmeier 2006-05-07 10:06:41 UTC
Logged In: YES 
user\_id=300591

Hi Brian,

we receive automatic messages on tracker activity in a
dedicated mailing list \(but yes, it took a long time until I
finally found at about this extremely useful feature\).
Again, we don't really use the "Assigned To"-field ATM,
since we're still a small project, and rarely need much
formal coordination. So nothing to worry about.

I suppose the symbolic link thing does not really do
anything meaningful, but satisfies the linker. I'll add a
check to ./configure to only link against -lRlapack, if that
exists.

Maybe you could drop us a mail with details about the
sandbox violations on rkward-devel? I think I have an idea,
where at least some of this comes from, but details would be
helpful.

Note that RKWard continues to support R releases starting
with R 2.1.0. The -lRlapack problem should be unrelated to R
releases \(only to R build options\). The only thing to note
is that between R 2.2.x and R 2.3.0 a rebuild of rkward is
needed \(i.e. RKWard compiled with R &lt; 2.3.0 will not work
with R &gt;= 2.3.0 and vice versa\), and unfortunately, there is
nothing we can do about this.

Regards
Thomas