Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 466258 - [science overlay] sci-mathematics/scilab-5.4.0 does not link with CC - fixed using CXX as linker
Summary: [science overlay] sci-mathematics/scilab-5.4.0 does not link with CC - fixed ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: PATCH
Depends on: 466112
Blocks:
  Show dependency tree
 
Reported: 2013-04-17 17:23 UTC by cmuelle8
Modified: 2013-10-31 16:55 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log 1366161542-install-sci-mathematics_scilab-5.4.0:0::science.out.gz (1366161542-install-sci-mathematics_scilab-5.4.0:0::science.out.gz,212.79 KB, application/octet-stream)
2013-04-17 17:25 UTC, cmuelle8
Details
scilab-5.4.0.ebuild.patch (scilab-5.4.0.ebuild.patch,1.69 KB, patch)
2013-04-17 17:28 UTC, cmuelle8
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cmuelle8 2013-04-17 17:23:54 UTC
cave show -f scilab::science
* sci-mathematics/scilab::science
    ::science                 5.3.3-r1(~) 5.4.0(~)* {:0}
    sci-mathematics/scilab-5.4.0:0::science (world)
    Description               Scientific software package for numerical computations
    Homepage                  http://www.scilab.org/
    Herds                     sci-mathematics
    Long Description          Scilab is a matrix-based scientific software package. Scilab contains hundreds of built-in mathematical functions, rich data structures (including polynomials, rationals,linear systems, lists, etc...) and comes with a number of specific toolboxes for control, signal processing, ...
    Use flags                 bash-completion -debug doc fftw gui matio nls openmp -static-libs tk umfpack xcos (-test) linguas: -ca_ES de -es_ES -fr_FR -it -ja -pl -pt_BR -ru -uk -zh_CN -zh_TW build_options: symbols=strip dwarf_compress -optional_tests -trace work=tidyup 
        Overridden Masks
            Keywords          ~amd64 ~x86


Building with the stock ebuild from science overlay:

 - fails to configure at -lblas and -llapack (same problem as in bug #466112)
 - scilab-bin does not link (see build log attachment)


# zgrep "error:" 1366161542-install-sci-mathematics_scilab-5.4.0:0::science.out.gz
[...]
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& std::basic_ostream<wchar_t, std::char_traits<wchar_t> >::_M_insert<unsigned long>(unsigned long)'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::istream::seekg(std::fpos<__mbstate_t>)'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::istream::tellg()'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::basic_stringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::~basic_stringstream()'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::basic_iostream<wchar_t, std::char_traits<wchar_t> >::~basic_iostream()'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::basic_ios<wchar_t, std::char_traits<wchar_t> >::~basic_ios()'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::basic_ios<wchar_t, std::char_traits<wchar_t> >::clear(std::_Ios_Iostate)'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& std::__ostream_insert<wchar_t, std::char_traits<wchar_t> >(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >&, wchar_t const*, long)'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/history_manager/.libs/libscihistory_manager.so: error: undefined reference to 'std::string::_M_mutate(unsigned long, unsigned long, unsigned long)'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'typeinfo for std::bad_alloc'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'VTT for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'vtable for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::ostream::put(char)'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::ostream::flush()'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::ctype<char>::_M_widen_init() const'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::__throw_bad_cast()'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_stringstream()'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to 'std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/.libs/libscilab-cli.so: error: undefined reference to '__cxa_demangle'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/completion/.libs/libscicompletion.so: error: undefined reference to 'vtable for __cxxabiv1::__vmi_class_type_info'
/var/tmp/paludis/sci-mathematics-scilab-5.4.0/work/scilab-5.4.0/modules/completion/.libs/libscicompletion.so: error: undefined reference to '__cxa_pure_virtual'


Reproducible: Always
Comment 1 cmuelle8 2013-04-17 17:25:14 UTC
Created attachment 345810 [details]
build log 1366161542-install-sci-mathematics_scilab-5.4.0:0::science.out.gz
Comment 2 cmuelle8 2013-04-17 17:28:22 UTC
Created attachment 345812 [details, diff]
scilab-5.4.0.ebuild.patch

Add

+       # use CXX as a linker for scilab-bin
+       sed -e '/^CCLD/ s/CC)/CXX)/' \
+               -i Makefile.in || die "failed to sed Makefile.in"

prettify some other sed lines..
Comment 3 Guillaume Horel 2013-05-04 23:03:50 UTC
Can you show which error you get with lapack and blas during configure? The ebuild exports the variables BLAS_LIBS ans LAPACK_LIBS which contain the output pkg-config --libs blas and pkg-config --libs lapack respectively. If these variables are in the environment the configure script use them overy anything else, so there shouldn't be an issue (and this is unrelated to bug #466112).

The package links fine with CCLD on my machine. It also works with your patch, so I could apply it I guess, but I don't see why it should be needed. Can you report it upstream? Maybe they can shed light on this.
Comment 4 cmuelle8 2013-05-05 14:43:27 UTC
(In reply to comment #3)
> The package links fine with CCLD on my machine. It also works with your
> patch, so I could apply it I guess, but I don't see why it should be needed.
> Can you report it upstream? Maybe they can shed light on this.

I'd point upstream here.  Which compiler version do you use?  I tested with 4.7.2-r1 - the errors in the build log clearly show that libstdc++ is not linked, which is due to gcc being used as a linker that does not default to use -lstdc++ 

Exporting BLAS_LIBS to the environment of the ebuild might be a portage/paludis issue, I'll have a look and report back..
Comment 5 cmuelle8 2013-05-05 19:00:52 UTC
(In reply to comment #3)
> Can you show which error you get with lapack and blas during configure? The
> ebuild exports the variables BLAS_LIBS ans LAPACK_LIBS which contain the
> output pkg-config --libs blas and pkg-config --libs lapack respectively.

This issue seems to be gone, configure script shows that variables are taken just as you've stated, see snippet below.  I do not get linking errors anymore.

But the CCLD issue remains.

-->8--
checking if BLAS, ATLAS or MKL is available... 
checking how to get verbose linking output from x86_64-pc-linux-gnu-gfortran... -v
checking for Fortran 77 libraries of x86_64-pc-linux-gnu-gfortran...  -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../.. -lpthread -ldl -lcurses -lgfortran -lm -lquadmath
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no extra underscore
checking for sgemm_ in -L//opt/acml5.3.0/gfortran64_mp/lib -lacml_mp ... yes
Using BLAS_LIBS environment variable found
checking if LAPACK is available... 
checking for cheev_ in -L//opt/acml5.3.0/gfortran64_mp/lib -lacml_mp ... yes
LAPACK_LIBS env variable found
checking if ARPACK-NG is available... 
checking for znaupd_ in -larpack... yes
ARPACK-NG library found
--8<--