Bug 186657

Summary: C++ API clash in octave and octave-forge ports
Product: Ports & Packages Reporter: Steven G. Kargl <kargl>
Component: Individual Port(s)Assignee: Tijl Coosemans <tijl>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Steven G. Kargl 2014-02-11 18:00:00 UTC
On an up-tp-date FreeBSD-current,

% uname -a
FreeBSD troutmask.apl.washington.edu 11.0-CURRENT FreeBSD 11.0-CURRENT #0
r261721M: Mon Feb 10 13:05:20 PST 2014
kargl@troutmask.apl.washington.edu:/usr/obj

where all remnants of base gcc have been removed via 'make delete-old delete-old-libs'

Installation of octave and octave-forge-netcdf and octave-forge-octcdf leads to a 
clash of libc++ API.

% octave
octave:1> pkg load netcdf
octave:2> test_netcdf
error: import_netcdf: /usr/local/lib/octave/packages/netcdf-1.0.1/amd64-portbld-freebsd11.0-api-v49+/__netcdf__.oct: failed to load: /usr/local/lib/octave/packages/netcdf-1.0.1/amd64-portbld-freebsd11.0-api-v49+/__netcdf__.oct: Undefined symbol "_ZNK5ArrayISsE17resize_fill_valueEv"
error: called from:
error:   /usr/local/share/octave/packages/netcdf-1.0.1/import_netcdf.m at line 2, column 20
error:   /usr/local/share/octave/packages/netcdf-1.0.1/test_netcdf.m at line 6, column 1

Clearly, _ZNK5ArrayISsE17resize_fill_valueEv is a name-mangled entity.  So, lets look at ldd output.

% ldd ./netcdf.oct
./netcdf.oct:
        liboctinterp.so.2 => not found (0)
        liboctave.so.2 => not found (0)
        libstdc++.so.6 => /usr/local/lib/gcc46/libstdc++.so.6 (0x201631000)
        libm.so.5 => /lib/libm.so.5 (0x201930000)
        libgcc_s.so.1 => /usr/local/lib/gcc46/libgcc_s.so.1 (0x201b58000)
        libthr.so.3 => /lib/libthr.so.3 (0x201d6d000)
        libc.so.7 => /lib/libc.so.7 (0x20081d000)
troutmask:fvwm:kargl[251] ldd /usr/local./
/usr/local./ not found

% ldd /usr/local/bin/octave
/usr/local/bin/octave:
        libX11.so.6 => /usr/local/lib/libX11.so.6 (0x20081f000)
        libxcb.so.2 => /usr/local/lib/libxcb.so.2 (0x200b52000)
        libXau.so.6 => /usr/local/lib/libXau.so.6 (0x200d70000)
        libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x200f72000)
        libpthread-stubs.so.0 => /usr/local/lib/libpthread-stubs.so.0 (0x201177000)
        librpcsvc.so.5 => /usr/lib/librpcsvc.so.5 (0x201378000)
        libm.so.5 => /lib/libm.so.5 (0x201581000)
        libc++.so.1 => /usr/lib/libc++.so.1 (0x2017a9000)
        libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x201a68000)
        libgcc_s.so.1 => /usr/local/lib/gcc46/libgcc_s.so.1 (0x201c82000)
        libthr.so.3 => /lib/libthr.so.3 (0x201e97000)
        libc.so.7 => /lib/libc.so.7 (0x2020bc000)

Whoops.  octave-forge-netcdf was built with /usr/local/bin/g++46.

How-To-Repeat: 
Install freebsd-current
Install octave
Install octave-forge-netcdf
Comment 1 Tijl Coosemans freebsd_committer freebsd_triage 2014-02-11 18:34:46 UTC
Responsible Changed
From-To: freebsd-ports-bugs->tijl

I'll be committing a massive patch to all Fortran ports in a few days 
which should fix this.
Comment 2 Tijl Coosemans freebsd_committer freebsd_triage 2014-02-16 17:32:03 UTC
Hi,

Can you check if this fixed after r344614?
Comment 3 Steven G. Kargl 2014-02-16 20:23:14 UTC
Tijl Coosemans wrote:
> Hi,
> 
> Can you check if this fixed after r344614?

Yes, r344614 seems to have fixed the problem.
After 'portmaster -r octave-3.8.0_1', I have

octave:1> pkg load netcdf
octave:2> test_netcdf
Using NetCDF library version "4.1.3 of Feb 16 2014 10:01:44 $"
run test_netcdf_constant..............   OK  
run test_netcdf_create................   OK  
run test_netcdf_low_level_interface...   OK  
run test_netcdf_datatypes.............   OK  
run test_netcdf_scalar_variable.......   OK  
run test_netcdf_attributes............   OK  
run test_netcdf_high_level_interface.. warning: isequalwithequalnans is obsolete and will be removed from a future version of Octave, please use isequaln instead
  OK  
run test_netcdf_ncwriteschema.........   OK  
run test_netcdf_ncwriteschema_unlim...   OK  
run test_netcdf_ncwriteschema_chunking   OK  
run test_netcdf_ncwriteschema_group...   OK  

Thanks!

-- 
Steve
http://troutmask.apl.washington.edu/~kargl/
Comment 4 Tijl Coosemans freebsd_committer freebsd_triage 2014-02-16 22:08:52 UTC
State Changed
From-To: open->closed

Fixed in r344614.