Bug 223420 - ncargf90 multilib /usr/lib vs /usr/lib64 issue
Summary: ncargf90 multilib /usr/lib vs /usr/lib64 issue
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: ncarg
Version: 6
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-01-19 02:35 UTC by Chris Schanzle
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 4.4.1-9.fc6
Clone Of:
Environment:
Last Closed: 2007-03-02 21:04:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Chris Schanzle 2007-01-19 02:35:32 UTC
Description of problem:

Can't use ncargf90 on x86_64 FC6 system, I believe because /usr/bin/ncargf90
sets $libdir based on the output of 'ncargpath lib'.  But that is returning
/usr/lib, instead of /usr/lib64 (or /usr/lib64/ncarg, I don't know for sure).

Version-Release number of selected component (if applicable):
$ rpm -qa ncarg\*
ncarg-devel-4.4.1-4.fc6.x86_64
ncarg-4.4.1-4.fc6.x86_64


How reproducible:
always

Steps to Reproduce:
1.$ ncargf90
  
Actual results:
gfortran -O -L/usr/lib -L/usr/lib64/hdf -L/usr/lib/hdf -lncarg -lncarg_gks
-lncarg_c -lX11 -lXext
/usr/bin/ld: cannot find -lncarg
collect2: ld returned 1 exit status

Comment 1 Orion Poplawski 2007-01-19 16:51:46 UTC
The NCARG_LIB environment variable should be being set to /usr/lib64/ncarg by
/etc/profile.d/ncargs.{sh,csh}.  Are you overriding it?

Comment 2 Chris Schanzle 2007-01-19 21:15:23 UTC
[bling!]
NCARG_LIB is not set in those files.  They contain just the NCARG_ROOT:

$ head -99 /etc/profile.d/ncarg.*
==> /etc/profile.d/ncarg.csh <==
setenv NCARG_ROOT /usr

==> /etc/profile.d/ncarg.sh <==
export NCARG_ROOT=/usr

Test manual setting:
$ export NCARG_LIB=/usr/lib64/ncarg
$ ncargf90 
gfortran -O -L/usr/lib64/ncarg -L/usr/lib64/hdf -L/usr/lib/hdf -lncarg
-lncarg_gks -lncarg_c -lX11 -lXext
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/libgfortranbegin.a(fmain.o): In function
`main':
(.text+0xa): undefined reference to `MAIN__'
collect2: ld returned 1 exit status

Far more reasonable (again, I'm not an ncarg user, but obviously, with no file
named above, that's a reasonable message).

Further, following the getting started guide, this got me to display a pretty
picture:

ncargex agex06
export GRAPHCAP=X11 
idt agex06.ncgm



Comment 3 Orion Poplawski 2007-01-23 18:30:21 UTC
Fixed fc6 version finally built...

Comment 4 Chris Schanzle 2007-01-26 17:43:24 UTC
Umm, yeah, no.  :-)  On x86_64, NCARG_LIB must point to /usr/lib64/ncarg!

$ uname -a
Linux grad 2.6.19-1.2895.fc6 #1 SMP Wed Jan 10 18:50:56 EST 2007 x86_64 x86_64
x86_64 GNU/Linux

$ rpm -qa ncarg\*
ncarg-4.4.1-6.fc6.x86_64
ncarg-devel-4.4.1-6.fc6.x86_64

$ ncargf90
Library directory </usr/lib/ncarg> does not exist.

$ ls -ld /usr/lib*/ncarg
drwxr-xr-x 3 root root 4096 Jan 26 12:23 /usr/lib64/ncarg

$ env|egrep NCARG
NCARG_ROOT=/usr
NCARG_LIB=/usr/lib/ncarg

$ cat /etc/profile.d/ncarg.sh
export NCARG_ROOT=/usr
export NCARG_LIB=/usr/lib/ncarg

$ cat /etc/profile.d/ncarg.csh
setenv NCARG_ROOT /usr
setenv NCARG_LIB /usr/lib/ncarg


Comment 5 Orion Poplawski 2007-01-26 17:51:13 UTC
Please run "rpm -V ncarg"

Are there any /etc/profile.d/ncarg.*sh.rpmnew files?


Comment 6 Chris Schanzle 2007-01-26 18:40:32 UTC
[schanzle@grad ~]$ rpm -V ncarg
[schanzle@grad ~]$ ls -l /etc/profile.d/ncarg*
-rwxr-xr-x 1 root root 55 Jan 22 13:10 /etc/profile.d/ncarg.csh
-rwxr-xr-x 1 root root 55 Jan 22 13:10 /etc/profile.d/ncarg.sh


Comment 7 Orion Poplawski 2007-01-26 19:44:31 UTC
Let's try again with -7 (just built).  If that doesn't work, I'm not sure what's
going on.

Comment 8 Chris Schanzle 2007-01-31 19:20:56 UTC
Sorry for the delay - and for the bad news (no change):

# rpm -q ncarg
ncarg-4.4.1-7.fc6

# head /etc/profile.d/ncarg*
==> /etc/profile.d/ncarg.csh <==
setenv NCARG_ROOT /usr
setenv NCARG_LIB /usr/lib/ncarg

==> /etc/profile.d/ncarg.sh <==
export NCARG_ROOT=/usr
export NCARG_LIB=/usr/lib/ncarg


Comment 9 Chris Schanzle 2007-01-31 21:48:58 UTC
Looking at your .spec, in %prep you do this:

sed -i -e s,/LIB/,/%{_lib}/, config/Site.local %{SOURCE2} %{SOURCE3}

First, I wouldn't edit your pristine sources like that, because a subsequent
rpmbuild -bs (or -ba) will result in the modified sources packaged (is that what
is happening?  i386 is being built first, then x86_64 with modified sources?). 
Also, another rpmbuild -b without a reinstall of the source packages will result
in unexpected behaviour.

Second, you want to substitute /lib/, not /LIB/ in %{SOURCE2} and %{SOURCE3}, as
I see from the .src.rpm, which may be moot by fixing above, but given the
pristine .src.rpm contains:

$ cat ncarg.sh
export NCARG_ROOT=/usr
export NCARG_LIB=/usr/lib/ncarg

The above sed isn't going to do anything.


Comment 10 Chris Schanzle 2007-01-31 22:15:54 UTC
After hand-editing the pristine
http://download.fedora.redhat.com/pub/fedora/linux/extras/6/SRPMS/ncarg-4.4.1-7.fc6.src.rpm
sources/ncarg.{sh,csh} to contain (.sh shown below):

export NCARG_ROOT=/usr
export NCARG_LIB=/usr/LIB/ncarg

A subsequent rpmbuild -bb works per manufacturer's advertised specifications,
but again, sources/ncarg.sh are left modified/broken for a subsequent rebuild.

$ head /var/tmp/ncarg-4.4.1-7-root-schanzle/etc/profile.d/ncarg.*sh
==> /var/tmp/ncarg-4.4.1-7-root-schanzle/etc/profile.d/ncarg.csh <==
setenv NCARG_ROOT /usr
setenv NCARG_LIB /usr/lib64/ncarg

==> /var/tmp/ncarg-4.4.1-7-root-schanzle/etc/profile.d/ncarg.sh <==
export NCARG_ROOT=/usr
export NCARG_LIB=/usr/lib64/ncarg


Comment 11 Orion Poplawski 2007-02-09 18:33:27 UTC
Changed to not modify the source files.  Please try again with -8.

Comment 12 Chris Schanzle 2007-02-12 22:45:24 UTC
Sorry.  :-(

Your original SOURCE2 and SOURCE3 files packaged with the .src.rpm do not have
/LIB/ in them, so the sed commands don't actually do anything.  Fix the sources
so /usr/lib/ looks like /usr/LIB/, and I think you'll be golden.

Contents of SOURCE2 and SOURCE3 (after rpm -ivh ../ncarg-4.4.1-8.fc6.src.rpm):

$ head ncarg.{csh,sh}
==> ncarg.csh <==
setenv NCARG_ROOT /usr
setenv NCARG_LIB /usr/lib/ncarg

==> ncarg.sh <==
export NCARG_ROOT=/usr
export NCARG_LIB=/usr/lib/ncarg

$ ncargf90
Library directory </usr/lib/ncarg> does not exist.
$ env|egrep NCARG
NCARG_ROOT=/usr
NCARG_LIB=/usr/lib/ncarg
$ uname -a
Linux <hostname> 2.6.19-1.2895.fc6 #1 SMP Wed Jan 10 18:50:56 EST 2007 x86_64
x86_64 x86_64 GNU/Linux
$ rpm -q ncarg
ncarg-4.4.1-8.fc6.x86_64
$ head /etc/profile.d/ncarg.sh*
export NCARG_ROOT=/usr
export NCARG_LIB=/usr/lib/ncarg

(wildcard included above to show there are no .rpmnew files)

Comment 13 Orion Poplawski 2007-02-12 23:05:15 UTC
Another great reason not to modify your SOURCE files directly, how embarrassing.

-9 is now being built...

Comment 14 Chris Schanzle 2007-02-27 20:08:43 UTC
5th time's the charm.  Looks good from my perspective, but no feedback from end
user yet, but didn't want to leave you hanging.

Thanks for your persistence.  :-)


Note You need to log in before you can comment on or make changes to this bug.