Bug 223420 - ncargf90 multilib /usr/lib vs /usr/lib64 issue
ncargf90 multilib /usr/lib vs /usr/lib64 issue
Product: Fedora
Classification: Fedora
Component: ncarg (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Orion Poplawski
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2007-01-18 21:35 EST by Chris Schanzle
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 4.4.1-9.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-03-02 16:04:26 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Chris Schanzle 2007-01-18 21:35:32 EST
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\*

How reproducible:

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 11:51:46 EST
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 16:15:23 EST
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
(.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

ncargex agex06
export GRAPHCAP=X11 
idt agex06.ncgm

Comment 3 Orion Poplawski 2007-01-23 13:30:21 EST
Fixed fc6 version finally built...
Comment 4 Chris Schanzle 2007-01-26 12:43:24 EST
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\*

$ 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

$ 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 12:51:13 EST
Please run "rpm -V ncarg"

Are there any /etc/profile.d/ncarg.*sh.rpmnew files?
Comment 6 Chris Schanzle 2007-01-26 13:40:32 EST
[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 14:44:31 EST
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 14:20:56 EST
Sorry for the delay - and for the bad news (no change):

# rpm -q ncarg

# 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 16:48:58 EST
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 17:15:54 EST
After hand-editing the pristine
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 13:33:27 EST
Changed to not modify the source files.  Please try again with -8.
Comment 12 Chris Schanzle 2007-02-12 17:45:24 EST
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
$ 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
$ 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 18:05:15 EST
Another great reason not to modify your SOURCE files directly, how embarrassing.

-9 is now being built...
Comment 14 Chris Schanzle 2007-02-27 15:08:43 EST
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.