Repository: spack/spack

Issue:
Why openexr doesn't find the zlib?
I want to install `openexr` to the already existing Ubuntu 16.04 machine through Spack. Configure fails with error message "OpenEXR requires a recent version of zlib, which you don't appear to have."

Can you help me to diagnoze the problem? Of course zlib is installed (via Spack), because it is the dependency and (required by `spack bootstrap`).

Here is the output of `spack --debug --verbose install openexr`:

```
==> Reading config file /home/adam/spack/etc/spack/defaults/packages.yaml
==> READ LOCK: /home/adam/.spack/cache/providers/.builtin-index.yaml.lock[0:0] [Acquiring]
==> READ LOCK: /home/adam/.spack/cache/providers/.builtin-index.yaml.lock[0:0] [Acquired]
==> READ LOCK: /home/adam/.spack/cache/providers/.builtin-index.yaml.lock[0:0] [Released]
==> Reading config file /home/adam/.spack/linux/compilers.yaml
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquiring]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquired]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/lock[0:0] [Acquiring]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/lock[0:0] [Acquired]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/lock[0:0] [Released]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Released]
==> link /home/adam/spack/var/spack/stage/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau -> /tmp/adam/spack-stage/spack-stage-r6a1Ob
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquiring]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquired]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Released]
==> Installing openexr dependencies
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Acquiring]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Acquired]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Released]
==> link /home/adam/spack/var/spack/stage/ilmbase-2.2.0-ouuejt5d2rq2v5je7lfbh5occkxk475w -> /tmp/adam/spack-stage/spack-stage-XEfHMz
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Acquiring]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Acquired]
==> ilmbase is already installed in /home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/ilmbase-2.2.0-ouuejt5d2rq2v5je7lfbh5occkxk475w
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Released]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Acquiring]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Acquired]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Released]
==> link /home/adam/spack/var/spack/stage/pkgconf-1.4.0-c5lf2hilcinnqpf3nojkif3eauay2gko -> /tmp/adam/spack-stage/spack-stage-613ikE
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Acquiring]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Acquired]
==> pkgconf is already installed in /home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/pkgconf-1.4.0-c5lf2hilcinnqpf3nojkif3eauay2gko
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Released]
==> Installing openexr
==> Using cached archive: /home/adam/spack/var/spack/cache/openexr/openexr-2.2.0.tar.gz
==> Staging archive: /home/adam/spack/var/spack/stage/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau/openexr-2.2.0.tar.gz
==> '/bin/tar' '-xf' '/home/adam/spack/var/spack/stage/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau/openexr-2.2.0.tar.gz'
==> Created stage in /home/adam/spack/var/spack/stage/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau
==> No patches needed for openexr
==> Building openexr [Package]
==> WRITE LOCK: /home/adam/spack/var/spack/stage/.lock[5482083359908941077:1] [Acquiring]
==> WRITE LOCK: /home/adam/spack/var/spack/stage/.lock[5482083359908941077:1] [Acquired]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquiring]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquired]
==> Executing phase: 'install'
==> './configure' '--prefix=/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau' '--disable-debug'
configure: WARNING: unrecognized options: --disable-debug
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether /home/adam/spack/lib/spack/env/gcc/g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of /home/adam/spack/lib/spack/env/gcc/g++... gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... /home/adam/spack/lib/spack/env/gcc/gcc
checking whether we are using the GNU C compiler... yes
checking whether /home/adam/spack/lib/spack/env/gcc/gcc accepts -g... yes
checking for /home/adam/spack/lib/spack/env/gcc/gcc option to accept ISO C89... none needed
checking dependency style of /home/adam/spack/lib/spack/env/gcc/gcc... gcc3
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by /home/adam/spack/lib/spack/env/gcc/gcc... /home/adam/spack/lib/spack/env/ld
checking if the linker (/home/adam/spack/lib/spack/env/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /home/adam/spack/lib/spack/env/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from /home/adam/spack/lib/spack/env/gcc/gcc object... ok
checking how to run the C preprocessor... /home/adam/spack/lib/spack/env/gcc/gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether /home/adam/spack/lib/spack/env/gcc/g++ accepts -g... (cached) yes
checking dependency style of /home/adam/spack/lib/spack/env/gcc/g++... (cached) gcc3
checking how to run the C++ preprocessor... /home/adam/spack/lib/spack/env/gcc/g++ -E
checking for objdir... .libs
checking if /home/adam/spack/lib/spack/env/gcc/gcc supports -fno-rtti -fno-exceptions... no
checking for /home/adam/spack/lib/spack/env/gcc/gcc option to produce PIC... -fPIC -DPIC
checking if /home/adam/spack/lib/spack/env/gcc/gcc PIC flag -fPIC -DPIC works... yes
checking if /home/adam/spack/lib/spack/env/gcc/gcc static flag -static works... yes
checking if /home/adam/spack/lib/spack/env/gcc/gcc supports -c -o file.o... yes
checking if /home/adam/spack/lib/spack/env/gcc/gcc supports -c -o file.o... (cached) yes
checking whether the /home/adam/spack/lib/spack/env/gcc/gcc linker (/home/adam/spack/lib/spack/env/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ld used by /home/adam/spack/lib/spack/env/gcc/g++... /home/adam/spack/lib/spack/env/ld -m elf_x86_64
checking if the linker (/home/adam/spack/lib/spack/env/ld -m elf_x86_64) is GNU ld... yes
checking whether the /home/adam/spack/lib/spack/env/gcc/g++ linker (/home/adam/spack/lib/spack/env/ld -m elf_x86_64) supports shared libraries... yes
checking for /home/adam/spack/lib/spack/env/gcc/g++ option to produce PIC... -fPIC -DPIC
checking if /home/adam/spack/lib/spack/env/gcc/g++ PIC flag -fPIC -DPIC works... yes
checking if /home/adam/spack/lib/spack/env/gcc/g++ static flag -static works... yes
checking if /home/adam/spack/lib/spack/env/gcc/g++ supports -c -o file.o... yes
checking if /home/adam/spack/lib/spack/env/gcc/g++ supports -c -o file.o... (cached) yes
checking whether the /home/adam/spack/lib/spack/env/gcc/g++ linker (/home/adam/spack/lib/spack/env/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether make sets $(MAKE)... (cached) yes
test_prefix = NONE
checking for pkg-config... /home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/pkgconf-1.4.0-c5lf2hilcinnqpf3nojkif3eauay2gko/bin/pkg-config
using pkg-config to set ILMBASE_CXXFLAGS and ILMBASE_LDFLAGS:
    ILMBASE_CXXFLAGS = -pthread -I/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/ilmbase-2.2.0-ouuejt5d2rq2v5je7lfbh5occkxk475w/include/OpenEXR 
    ILMBASE_LDFLAGS = -L/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/ilmbase-2.2.0-ouuejt5d2rq2v5je7lfbh5occkxk475w/lib 
    ILMBASE_LIBS = -L/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/ilmbase-2.2.0-ouuejt5d2rq2v5je7lfbh5occkxk475w/lib -lImath -lHalf -lIex -lIexMath -lIlmThread -pthread 
checking for IlmBase... yes
Compiled and ran IlmBase test program.
checking for ANSI C header files... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking for compress in -lz... no
configure: error:
*** OpenEXR requires a recent version of zlib, which you don't appear to
*** have.
***
*** This could be because the run-time linker is not finding zlib, or it
*** is finding the wrong version.  In this case, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the proper version.  Also, make sure you have run ldconfig if
*** that is required on your system.
			   
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Released]
==> WRITE LOCK: /home/adam/spack/var/spack/stage/.lock[5482083359908941077:1] [Released]
==> Error: ProcessError: Command exited with status 1:
    './configure' '--prefix=/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau' '--disable-debug'

1 error found in build log:
     100    checking for limits.h... yes
     101    checking for unistd.h... (cached) yes
     102    checking for an ANSI C-conforming const... yes
     103    checking for inline... inline
     104    checking for size_t... yes
     105    checking for compress in -lz... no
  >> 106    configure: error:
     107    *** OpenEXR requires a recent version of zlib, which you don't appear to
     108    *** have.
     109    ***
     110    *** This could be because the run-time linker is not finding zlib, or it
     111    *** is finding the wrong version.  In this case, you'll need to set your
     112    *** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point

See build log for details:
  /home/adam/spack/var/spack/stage/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau/openexr-2.2.0/spack-build.out
Traceback (most recent call last):
  File "/home/adam/spack/lib/spack/spack/build_environment.py", line 666, in child_process
    return_value = function()
  File "/home/adam/spack/lib/spack/spack/package.py", line 1459, in build_process
    phase(self.spec, self.prefix)
  File "/home/adam/spack/lib/spack/spack/package.py", line 115, in phase_wrapper
    phase(spec, prefix)
  File "/home/adam/spack/var/spack/repos/builtin/packages/openexr/package.py", line 53, in install
    configure(*configure_options)
  File "/home/adam/spack/lib/spack/spack/util/executable.py", line 183, in __call__
    proc.returncode, cmd_line)
ProcessError: Command exited with status 1:
    './configure' '--prefix=/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau' '--disable-debug'
```

As you can see, I use the Ubuntu build-in `gcc-5.4.0`. 

Loading the `zlib` through the `spack load zlib` prior to build seems to make no effect.
Why openexr doesn't find the zlib?
I want to install `openexr` to the already existing Ubuntu 16.04 machine through Spack. Configure fails with error message "OpenEXR requires a recent version of zlib, which you don't appear to have."

Can you help me to diagnoze the problem? Of course zlib is installed (via Spack), because it is the dependency and (required by `spack bootstrap`).

Here is the output of `spack --debug --verbose install openexr`:

```
==> Reading config file /home/adam/spack/etc/spack/defaults/packages.yaml
==> READ LOCK: /home/adam/.spack/cache/providers/.builtin-index.yaml.lock[0:0] [Acquiring]
==> READ LOCK: /home/adam/.spack/cache/providers/.builtin-index.yaml.lock[0:0] [Acquired]
==> READ LOCK: /home/adam/.spack/cache/providers/.builtin-index.yaml.lock[0:0] [Released]
==> Reading config file /home/adam/.spack/linux/compilers.yaml
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquiring]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquired]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/lock[0:0] [Acquiring]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/lock[0:0] [Acquired]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/lock[0:0] [Released]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Released]
==> link /home/adam/spack/var/spack/stage/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau -> /tmp/adam/spack-stage/spack-stage-r6a1Ob
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquiring]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquired]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Released]
==> Installing openexr dependencies
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Acquiring]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Acquired]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Released]
==> link /home/adam/spack/var/spack/stage/ilmbase-2.2.0-ouuejt5d2rq2v5je7lfbh5occkxk475w -> /tmp/adam/spack-stage/spack-stage-XEfHMz
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Acquiring]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Acquired]
==> ilmbase is already installed in /home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/ilmbase-2.2.0-ouuejt5d2rq2v5je7lfbh5occkxk475w
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[4221036580051759317:1] [Released]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Acquiring]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Acquired]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Released]
==> link /home/adam/spack/var/spack/stage/pkgconf-1.4.0-c5lf2hilcinnqpf3nojkif3eauay2gko -> /tmp/adam/spack-stage/spack-stage-613ikE
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Acquiring]
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Acquired]
==> pkgconf is already installed in /home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/pkgconf-1.4.0-c5lf2hilcinnqpf3nojkif3eauay2gko
==> READ LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[840816945095314796:1] [Released]
==> Installing openexr
==> Using cached archive: /home/adam/spack/var/spack/cache/openexr/openexr-2.2.0.tar.gz
==> Staging archive: /home/adam/spack/var/spack/stage/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau/openexr-2.2.0.tar.gz
==> '/bin/tar' '-xf' '/home/adam/spack/var/spack/stage/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau/openexr-2.2.0.tar.gz'
==> Created stage in /home/adam/spack/var/spack/stage/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau
==> No patches needed for openexr
==> Building openexr [Package]
==> WRITE LOCK: /home/adam/spack/var/spack/stage/.lock[5482083359908941077:1] [Acquiring]
==> WRITE LOCK: /home/adam/spack/var/spack/stage/.lock[5482083359908941077:1] [Acquired]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquiring]
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Acquired]
==> Executing phase: 'install'
==> './configure' '--prefix=/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau' '--disable-debug'
configure: WARNING: unrecognized options: --disable-debug
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether /home/adam/spack/lib/spack/env/gcc/g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of /home/adam/spack/lib/spack/env/gcc/g++... gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... /home/adam/spack/lib/spack/env/gcc/gcc
checking whether we are using the GNU C compiler... yes
checking whether /home/adam/spack/lib/spack/env/gcc/gcc accepts -g... yes
checking for /home/adam/spack/lib/spack/env/gcc/gcc option to accept ISO C89... none needed
checking dependency style of /home/adam/spack/lib/spack/env/gcc/gcc... gcc3
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by /home/adam/spack/lib/spack/env/gcc/gcc... /home/adam/spack/lib/spack/env/ld
checking if the linker (/home/adam/spack/lib/spack/env/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /home/adam/spack/lib/spack/env/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from /home/adam/spack/lib/spack/env/gcc/gcc object... ok
checking how to run the C preprocessor... /home/adam/spack/lib/spack/env/gcc/gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether /home/adam/spack/lib/spack/env/gcc/g++ accepts -g... (cached) yes
checking dependency style of /home/adam/spack/lib/spack/env/gcc/g++... (cached) gcc3
checking how to run the C++ preprocessor... /home/adam/spack/lib/spack/env/gcc/g++ -E
checking for objdir... .libs
checking if /home/adam/spack/lib/spack/env/gcc/gcc supports -fno-rtti -fno-exceptions... no
checking for /home/adam/spack/lib/spack/env/gcc/gcc option to produce PIC... -fPIC -DPIC
checking if /home/adam/spack/lib/spack/env/gcc/gcc PIC flag -fPIC -DPIC works... yes
checking if /home/adam/spack/lib/spack/env/gcc/gcc static flag -static works... yes
checking if /home/adam/spack/lib/spack/env/gcc/gcc supports -c -o file.o... yes
checking if /home/adam/spack/lib/spack/env/gcc/gcc supports -c -o file.o... (cached) yes
checking whether the /home/adam/spack/lib/spack/env/gcc/gcc linker (/home/adam/spack/lib/spack/env/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ld used by /home/adam/spack/lib/spack/env/gcc/g++... /home/adam/spack/lib/spack/env/ld -m elf_x86_64
checking if the linker (/home/adam/spack/lib/spack/env/ld -m elf_x86_64) is GNU ld... yes
checking whether the /home/adam/spack/lib/spack/env/gcc/g++ linker (/home/adam/spack/lib/spack/env/ld -m elf_x86_64) supports shared libraries... yes
checking for /home/adam/spack/lib/spack/env/gcc/g++ option to produce PIC... -fPIC -DPIC
checking if /home/adam/spack/lib/spack/env/gcc/g++ PIC flag -fPIC -DPIC works... yes
checking if /home/adam/spack/lib/spack/env/gcc/g++ static flag -static works... yes
checking if /home/adam/spack/lib/spack/env/gcc/g++ supports -c -o file.o... yes
checking if /home/adam/spack/lib/spack/env/gcc/g++ supports -c -o file.o... (cached) yes
checking whether the /home/adam/spack/lib/spack/env/gcc/g++ linker (/home/adam/spack/lib/spack/env/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether make sets $(MAKE)... (cached) yes
test_prefix = NONE
checking for pkg-config... /home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/pkgconf-1.4.0-c5lf2hilcinnqpf3nojkif3eauay2gko/bin/pkg-config
using pkg-config to set ILMBASE_CXXFLAGS and ILMBASE_LDFLAGS:
    ILMBASE_CXXFLAGS = -pthread -I/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/ilmbase-2.2.0-ouuejt5d2rq2v5je7lfbh5occkxk475w/include/OpenEXR 
    ILMBASE_LDFLAGS = -L/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/ilmbase-2.2.0-ouuejt5d2rq2v5je7lfbh5occkxk475w/lib 
    ILMBASE_LIBS = -L/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/ilmbase-2.2.0-ouuejt5d2rq2v5je7lfbh5occkxk475w/lib -lImath -lHalf -lIex -lIexMath -lIlmThread -pthread 
checking for IlmBase... yes
Compiled and ran IlmBase test program.
checking for ANSI C header files... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking for compress in -lz... no
configure: error:
*** OpenEXR requires a recent version of zlib, which you don't appear to
*** have.
***
*** This could be because the run-time linker is not finding zlib, or it
*** is finding the wrong version.  In this case, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the proper version.  Also, make sure you have run ldconfig if
*** that is required on your system.
			   
==> WRITE LOCK: /home/adam/spack/opt/spack/.spack-db/prefix_lock[8917411056477007060:1] [Released]
==> WRITE LOCK: /home/adam/spack/var/spack/stage/.lock[5482083359908941077:1] [Released]
==> Error: ProcessError: Command exited with status 1:
    './configure' '--prefix=/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau' '--disable-debug'

1 error found in build log:
     100    checking for limits.h... yes
     101    checking for unistd.h... (cached) yes
     102    checking for an ANSI C-conforming const... yes
     103    checking for inline... inline
     104    checking for size_t... yes
     105    checking for compress in -lz... no
  >> 106    configure: error:
     107    *** OpenEXR requires a recent version of zlib, which you don't appear to
     108    *** have.
     109    ***
     110    *** This could be because the run-time linker is not finding zlib, or it
     111    *** is finding the wrong version.  In this case, you'll need to set your
     112    *** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point

See build log for details:
  /home/adam/spack/var/spack/stage/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau/openexr-2.2.0/spack-build.out
Traceback (most recent call last):
  File "/home/adam/spack/lib/spack/spack/build_environment.py", line 666, in child_process
    return_value = function()
  File "/home/adam/spack/lib/spack/spack/package.py", line 1459, in build_process
    phase(self.spec, self.prefix)
  File "/home/adam/spack/lib/spack/spack/package.py", line 115, in phase_wrapper
    phase(spec, prefix)
  File "/home/adam/spack/var/spack/repos/builtin/packages/openexr/package.py", line 53, in install
    configure(*configure_options)
  File "/home/adam/spack/lib/spack/spack/util/executable.py", line 183, in __call__
    proc.returncode, cmd_line)
ProcessError: Command exited with status 1:
    './configure' '--prefix=/home/adam/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/openexr-2.2.0-66baioac47m2rqr3lsjjaet73wlx3tau' '--disable-debug'
```

As you can see, I use the Ubuntu build-in `gcc-5.4.0`. 

Loading the `zlib` through the `spack load zlib` prior to build seems to make no effect.


Discussion:
It looks like the `openexr` package is missing a dependency on `zlib`.
It looks like the `openexr` package is missing a dependency on `zlib`.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/ilmbase/package.py b/var/spack/repos/builtin/packages/ilmbase/package.py
--- a/var/spack/repos/builtin/packages/ilmbase/package.py
+++ b/var/spack/repos/builtin/packages/ilmbase/package.py
@@ -10,10 +10,17 @@ class Ilmbase(AutotoolsPackage):
     """OpenEXR ILM Base libraries (high dynamic-range image file format)"""
 
     homepage = "http://www.openexr.com/"
-    url      = "http://download.savannah.nongnu.org/releases/openexr/ilmbase-2.2.0.tar.gz"
+    url      = "https://github.com/openexr/openexr/releases/download/v2.3.0/ilmbase-2.3.0.tar.gz"
 
-    version('2.2.0', 'b540db502c5fa42078249f43d18a4652')
-    version('2.1.0', 'af1115f4d759c574ce84efcde9845d29')
-    version('2.0.1', '74c0d0d2873960bd0dc1993f8e03f0ae')
-    version('1.0.2', '26c133ee8ca48e1196fbfb3ffe292ab4')
-    version('0.9.0', '4df45f8116cb7a013b286caf6da30a2e')
+    version('2.3.0', sha256='456978d1a978a5f823c7c675f3f36b0ae14dba36638aeaa3c4b0e784f12a3862')
+
+    version('2.2.0', 'b540db502c5fa42078249f43d18a4652',
+            url='http://download.savannah.nongnu.org/releases/openexr/ilmbase-2.2.0.tar.gz')
+    version('2.1.0', 'af1115f4d759c574ce84efcde9845d29',
+            url='http://download.savannah.nongnu.org/releases/openexr/ilmbase-2.1.0.tar.gz')
+    version('2.0.1', '74c0d0d2873960bd0dc1993f8e03f0ae',
+            url='http://download.savannah.nongnu.org/releases/openexr/ilmbase-2.0.1.tar.gz')
+    version('1.0.2', '26c133ee8ca48e1196fbfb3ffe292ab4',
+            url='http://download.savannah.nongnu.org/releases/openexr/ilmbase-1.0.2.tar.gz')
+    version('0.9.0', '4df45f8116cb7a013b286caf6da30a2e',
+            url='http://download.savannah.nongnu.org/releases/openexr/ilmbase-0.9.0.tar.gz')
diff --git a/var/spack/repos/builtin/packages/openexr/package.py b/var/spack/repos/builtin/packages/openexr/package.py
--- a/var/spack/repos/builtin/packages/openexr/package.py
+++ b/var/spack/repos/builtin/packages/openexr/package.py
@@ -10,22 +10,34 @@ class Openexr(Package):
     """OpenEXR Graphics Tools (high dynamic-range image file format)"""
 
     homepage = "http://www.openexr.com/"
-    url = "https://savannah.nongnu.org/download/openexr/openexr-2.2.0.tar.gz"
-
-    version('2.2.0', 'b64e931c82aa3790329c21418373db4e')
-    version('2.1.0', '33735d37d2ee01c6d8fbd0df94fb8b43')
-    version('2.0.1', '4387e6050d2faa65dd5215618ff2ddce')
-    version('1.7.0', '27113284f7d26a58f853c346e0851d7a')
-    version('1.6.1', '11951f164f9c872b183df75e66de145a')
-    version('1.5.0', '55342d2256ab3ae99da16f16b2e12ce9')
-    version('1.4.0a', 'd0a4b9a930c766fa51561b05fb204afe')
-    version('1.3.2', '1522fe69135016c52eb88fc7d8514409')
+    url = "https://github.com/openexr/openexr/releases/download/v2.3.0/openexr-2.3.0.tar.gz"
+
+    # New versions should come from github now
+    version('2.3.0', sha256='fd6cb3a87f8c1a233be17b94c74799e6241d50fc5efd4df75c7a4b9cf4e25ea6')
+
+    version('2.2.0', 'b64e931c82aa3790329c21418373db4e',
+            url="http://download.savannah.nongnu.org/releases/openexr/openexr-2.2.0.tar.gz")
+    version('2.1.0', '33735d37d2ee01c6d8fbd0df94fb8b43',
+            url="http://download.savannah.nongnu.org/releases/openexr/openexr-2.1.0.tar.gz")
+    version('2.0.1', '4387e6050d2faa65dd5215618ff2ddce',
+            url="http://download.savannah.nongnu.org/releases/openexr/openexr-2.0.1.tar.gz")
+    version('1.7.0', '27113284f7d26a58f853c346e0851d7a',
+            url="http://download.savannah.nongnu.org/releases/openexr/openexr-1.7.0.tar.gz")
+    version('1.6.1', '11951f164f9c872b183df75e66de145a',
+            url="http://download.savannah.nongnu.org/releases/openexr/openexr-1.6.1.tar.gz")
+    version('1.5.0', '55342d2256ab3ae99da16f16b2e12ce9',
+            url="http://download.savannah.nongnu.org/releases/openexr/openexr-1.5.0.tar.gz")
+    version('1.4.0a', 'd0a4b9a930c766fa51561b05fb204afe',
+            url="http://download.savannah.nongnu.org/releases/openexr/openexr-1.4.0a.tar.gz")
+    version('1.3.2', '1522fe69135016c52eb88fc7d8514409',
+            url="http://download.savannah.nongnu.org/releases/openexr/openexr-1.3.2.tar.gz")
 
     variant('debug', default=False,
             description='Builds a debug version of the libraries')
 
     depends_on('pkgconfig', type='build')
     depends_on('ilmbase')
+    depends_on('zlib', type=('build', 'link'))
 
     def install(self, spec, prefix):
         configure_options = ['--prefix={0}'.format(prefix)]


Test patch: