0

i got a problem when compiling the netCDF library (parallel version).

In particular the problem is related to the different paths I guess. The problem is I'm not the admin of the machinge. However, teh admin himselfe has already installed an old version in an own directory (here: /root/treiber).

Tus I want to install an own version loacal in /home/stephcar/bin.

Thus, I prescribe the directories with different compiler flags:

CPPFLAGS=-I/home/stephcar/bin/include LDFLAGS=-L/home/stephcar/bin/lib LIBS='-L/home stephcar/bin/lib  -lnetcdf -L/home/stephcar/bin/lib -lhdf5_hl -lhdf5 -lz -lm -L/home/stephcar/bin/lib -lsz' CC=/home/stephcar/bin/bin/mpicc FC=/home/stephcar/bin/bin/mpif90  ./configure --enable-pnetcdf --prefix=/home/stephcar/bin/

In addition: I also put my --prefix-path (/home/stephcar/bin/) also at the first position in $PATH and $LD_LIBRARY_PATH.

However, for some reason I could't figure out, the root's directory (/root/treiber) is searched and not my one ... This is the error from 'make':

/bin/sh ../libtool  --tag=CC   --mode=link /home/stephcar/bin/bin/mpicc  -g -O2  -L/home/stephcar/bin/lib -o liboc.la  
liboc_la-oc.lo liboc_la-daplex.lo liboc_la-dapparse.lo liboc_la-daptab.lo liboc_la- occlientparams.lo liboc_la-occompile.lo 
liboc_la-occurlfunctions.lo liboc_la-ocdata.lo liboc_la-ocdebug.lo liboc_la-ocdump.lo liboc_la-ocinternal.lo liboc_la-ocnode.lo
liboc_la-ochttp.lo liboc_la-ocrc.lo liboc_la-ocread.lo liboc_la-ocutil.lo liboc_la-ocbytes.lo liboc_la-oclist.lo liboc_la-ocuri.lo
liboc_la-oclog.lo liboc_la-xxdr.lo   -lpnetcdf -lm -L/home/stephcar/bin/lib  -lnetcdf  -L/home/stephcar/bin/lib -lhdf5_hl -lhdf5 
-lz -lm -L/home/stephcar/bin/lib -lsz

/usr/bin/grep: /root/treiber/hdf5-1.8.8/hdf5/lib/libhdf5_hl.la: Permission denied
/usr/bin/sed: can't read /root/treiber/hdf5-1.8.8/hdf5/lib/libhdf5_hl.la: Permission denied
libtool: link: `/root/treiber/hdf5-1.8.8/hdf5/lib/libhdf5_hl.la' is not a valid libtool archive
make[2]: *** [liboc.la] Fehler 1

Do you have an idea? Did I set the flags wrong? Or is there another default path available I haven't looked at. How to search within the default paths after a pattern (here: /root/treiber)? Maybe I could get here a hint!

Thanks Stephan

EDIT Just to clarify: netCDF neads another library hdf5, which I've successfully compiled and installed into ~/bin/lib. The missing libhdf5_hl.la is thus also stored there. The actual problem is that my configure environment is not finding this directory. Instead it tries to use the one from /root/.

Stephan
  • 53
  • 1
  • 4
  • Specifying `--prefix=/home/stephcar/bin` would place the binary in a directory `/home/stephcar/bin/bin`, etc. You probably want to specify `--prefix=/home/stephcar` instead. I doubt if this is related to the rest of your trouble...or, more likely, you haven't reached this problem yet. Having said that, you seem to have other software installed with that prefix, so maybe this is a non-issue after all. – Jonathan Leffler May 16 '13 at 16:03
  • No, the --prefix-stuff is okay, I guess. I tried to clarify my issue in the main thread above. @jonathan-leffler – Stephan May 16 '13 at 17:53

1 Answers1

0

First, you generally don't want to use a bin directory as your prefix. In UNIX, the bin directory contains binaries that you run: commands like mkdir, ls, gcc etc. You don't expect it to contain subdirectories like bin/bin, bin/lib, etc. It will work, but it's not standard. YOu should use --prefix=/home/stephcar which will put stuff into /home/stephcar/bin, /home/stephcar/lib, etc. Or better yet, make a subdirectory for this package and use that: --prefix=/home/stephcar/netcdf or something.

Second, I assume that this on your example line is a typo:

LIBS='-L/home stephcar/bin/lib ...

(note the space) and you really used:

LIBS='-L/home/stephcar/bin/lib ...

Third, it's generally preferred to set those variables on the configure command line rather than in its environment; that is, put them after the configure command not before:

./configure --enable-pnetcdf --prefix=/home/stephcar/bin CPPFLAGS=-I/home/stephcar/bin/include LDFLAGS=-L...

Beyond that, this error means that your build is finding the libhdf5_hl library in the /root/treiber subdirectory, which is not readable. My suspicion is that the admin on this system did something wrong and tried to build this library in one place, then copied it into another place in a way which is not valid. You'll need to rebuild this HDF5 package as well, it looks like.

MadScientist
  • 92,819
  • 9
  • 109
  • 136
  • Thanks for the answer. You're right with the typos. Regarding your first comment I have indeed a direcory structure that contains ~/bin/bin, ~/bin/lib, ~/bin/include, ... Is that a problem? – Stephan May 16 '13 at 16:18
  • You're right the directory /root/treiber is not readable for me. However, the question is how can I define an environment for make that uses my paths ~/bin/.. instead of /root/treiber/ for looking after libhdf5_hl library? I'really have no glue why make is looking at /root at all. – Stephan May 16 '13 at 16:23
  • And I really forgot to mention (sorry!) that I habe build the hdf5-lib for my own. This one is available in ~/bin/lib. – Stephan May 16 '13 at 16:25
  • It's not a problem per se, but it's extremely non-standard and people will look at you funny when you describe it :-). Creating certain directories under `bin` have been known to cause obscure bugs. My suspicion is that the /root directory is being looked for because someone built that package with `--prefix=/root/treiber`, then copied the resulting libraries into a global location like `/usr/lib` or `/usr/local/lib`. That's Not Cool. Libtool is kind of snarky about stuff like this. Your copy of hdf5-lib is not being found. Check config.log to see if you can figure out why not. – MadScientist May 16 '13 at 16:38
  • I totally agree with you. Unfortunately, I've to work wit hthis machine ;( So, thanks for the advise to avoid 'bin' even in a local directory structure. I'll call it ~/software/bin etc. in future. What do you think. unfortunately, I cannot change the stuf root has done in his directories... Having said that, I havent't found any advise in config.log. – Stephan May 16 '13 at 18:15
  • Sure, but you own your own home directory, presumably. You don't have to put things under your own `bin` directory. You need to look at config.log and figure out why it's not finding your personal build of hdf5-lib. There's some kind of path issue or something. – MadScientist May 16 '13 at 18:20