Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hdf5iotest recipe does not compile with mpicc or supply libmpi to linker -> error adding symbols: DSO missing from command line #29

Open
Noerr opened this issue Mar 22, 2023 · 1 comment

Comments

@Noerr
Copy link
Contributor

Noerr commented Mar 22, 2023

Following the spack install instructions, I arrive at the following error regarding undefined reference to ompi_mpi_byte and libmpi.so.40: error adding symbols: DSO missing from command line
If we look at the gcc command line it seem odd that neither mpicc is used or -lmpi is explicitly linked.

mv -f .deps/hdf5_iotest.Tpo .deps/hdf5_iotest.Po
mv -f .deps/write_test.Tpo .deps/write_test.Po
/home/noah/spack/lib/spack/env/gcc/gcc  -g -O2   -o hdf5_iotest configuration.o dataset.o hdf5_iotest.o ini.o read_test.o utils.o write_test.o -lhdf5 -luuid
/usr/bin/ld: hdf5_iotest.o: undefined reference to symbol 'ompi_mpi_byte'
/usr/bin/ld: /home/noah/spack/opt/spack/linux-ubuntu22.04-icelake/gcc-11.3.0/openmpi-4.1.5-yofs4yotlug5xwx4lgkndha4jvwdcnsk/lib/libmpi.so.40: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:365: hdf5_iotest] Error 1
make[1]: Leaving directory '/tmp/noah/spack-stage/spack-stage-hdf5iotest-master-vrzqpeiaqi4rlery3yjdxms43gsykkuc/spack-src/src'
make: *** [Makefile:333: all-recursive] Error 1
@Noerr
Copy link
Contributor Author

Noerr commented Mar 22, 2023

I was able to complete the build of hdf5_iotest executable by starting from this failed spack install, chdir into the /tmp spack build staging. Rexecute the final link command using mpicc.

/home/noah/spack/opt/spack/linux-ubuntu22.04-icelake/gcc-11.3.0/openmpi-4.1.5-yofs4yotlug5xwx4lgkndha4jvwdcnsk/bin/mpicc -g -O2   -o hdf5_iotest configuration.o dataset.o hdf5_iotest.o ini.o read_test.o utils.o write_test.o  -L /home/noah/spack/opt/spack/linux-ubuntu22.04-icelake/gcc-11.3.0/util-linux-uuid-2.38.1-mutzzr33dylliaew3ftjs2ksge4vtsmi/lib/ -L/home/noah/spack/opt/spack/linux-ubuntu22.04-icelake/gcc-11.3.0/hdf5-1.14.0-atpncwlkmdpd4ir53ladkxm2txpl77pr/lib/  -lhdf5 -luuid

Unlike other libraries, rpath doesn't get set so I have to set LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/home/noah/spack/opt/spack/linux-ubuntu22.04-icelake/gcc-11.3.0/util-linux-uuid-2.38.1-mutzzr33dylliaew3ftjs2ksge4vtsmi/lib/:/home/noah/spack/opt/spack/linux-ubuntu22.04-icelake/gcc-11.3.0/hdf5-1.14.0-atpncwlkmdpd4ir53ladkxm2txpl77pr/lib/:${LD_LIBRARY_PATH}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant