Skip to content

tests not linking to zlib #157

Closed
Closed

Description

@loriab

Expected Behavior

Even when zlib is in a strange place (that cmake finds), tests should like to it.

Current Behavior

/theoryfs2/common/software/intel2018/compilers_and_libraries_2018.2.199/linux/bin/intel64/icc -gnu-prefix=x86_64-conda_cos6-linux-gnu- -msse2 -axCORE-AVX2,AVX -Wl,--as-needed -static-intel -wd10237 -restrict -DRESTRICT=restrict -std=c99 -fPIC -qopenmp -O3 -ip -DNDEBUG  -rdynamic CMakeFiles/C_host.dir/C_host.c.o  -o ../../bin/C_host  -L/scratch/psilocaluser/conda-builds/pcmsolver_1524607017729/work/build/boost/lib -Wl,-rpath,/scratch/psilocaluser/conda-builds/pcmsolver_1524607017729/work/build/boost/lib:/scratch/psilocaluser/conda-builds/pcmsolver_1524607017729/work/build/lib ../../lib/libpcm.so.1 -lm 
x86_64-conda_cos6-linux-gnu-ld: warning: libz.so.1, needed by ../../lib/libpcm.so.1, not found (try using -rpath or -rpath-link)
../../lib/libpcm.so.1: undefined reference to `crc32'

Possible Solution

If I add full path to zlib into the target's link.txt, it builds.

Steps to Reproduce (for bugs)

I've seen this in 1.1.12 and 1.2.0-rc1.

Below is the build script. It looks ghastly, but I think it's just the non /usr/lib/libz.so that's the issue.

    # load Intel compilers
    set +x
    source /theoryfs2/common/software/intel2018/bin/compilervars.sh intel64
    set -x

    # link against conda GCC
    OPTS="'-msse2 -axCORE-AVX2,AVX -Wl,--as-needed -static-intel -wd10237'"
    HOST="x86_64-conda_cos6-linux-gnu"
    ALLOPTS="-gnu-prefix=${HOST}- ${OPTS}"

    # squash Intel fortran libs
    LIBC_INTERJECT="${PREFIX}/lib/libz.so;-liomp5;-Wl,-Bstatic;-lifport;-lifcoremt_pic;-Wl,-Bdynamic"

    # configure
    ${BUILD_PREFIX}/bin/cmake \
        -H${SRC_DIR} \
        -Bbuild \
        -DCMAKE_INSTALL_PREFIX=${PREFIX} \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_C_COMPILER=icc \
        -DCMAKE_C_FLAGS="${ALLOPTS}" \
        -DCMAKE_CXX_COMPILER=icpc \
        -DCMAKE_CXX_FLAGS="${ALLOPTS}" \
        -DCMAKE_Fortran_COMPILER=ifort \
        -DCMAKE_Fortran_FLAGS="${ALLOPTS}" \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DPYMOD_INSTALL_LIBDIR=${PYMOD_INSTALL_LIBDIR} \
        -DPYTHON_INTERPRETER=${PYTHON} \
        -DENABLE_OPENMP=ON \
        -DENABLE_GENERIC=OFF \
        -DLIBC_INTERJECT="${LIBC_INTERJECT}" \
        -DENABLE_DOCS=OFF \
        -DENABLE_TESTS=ON \
        -DENABLE_TIMER=OFF \
        -DENABLE_LOGGER=OFF \
        -DBUILD_STANDALONE=OFF \
        -DENABLE_FORTRAN_API=OFF \
        -DENABLE_CXX11_SUPPORT=ON

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions