1

This is the Guide to the Installation:

https://github.com/atchekho/harmpi/blob/master/tutorial.md

I get this result on make clean :

/bin/rm -f *.o *.il
/bin/rm -f harm image_interp 

but this, when I try to make:

//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
makefile:109: recipe for target 'harm' failed
make: *** [harm] Error 1

I have installed Open-MPI using this guide http://lsi.ugr.es/jmantas/pdp/ayuda/datos/instalaciones/Install_OpenMPI_en.pdf

I COULDN'T Install libopenmpi-dbg and I installed libopenmpi2 instead of libopenmpi1.3

Don't know if that mattered

and I have this result on GCC-Version:

gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • Is your first link correct? it appears to be about OpenMPI not HARM – steeldriver Sep 11 at 12:34
  • DSO missing from command line usually means there should be a -lxxx (in this case, -lm) on the linker command line but it's missing – steeldriver Sep 11 at 12:35
  • @steeldriver I added it. You were right, I'm really sry. How do I add this -lm ? – Billy Matlock Sep 11 at 13:16
  • Try make EXTRALIBS=-lm – steeldriver Sep 11 at 13:27
  • @steeldriver It runs and the second time I run it, is : image_interp.c: In function ‘main’: image_interp.c:111:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread(&oldimage[i][j], sizeof(unsigned char), 1, stdin) ; – Billy Matlock Sep 11 at 14:09
2

The error message

//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line

means that the linker can't find symbols from the standard math library: it knows where they should be, and expected a linker directive -lm on the command line, but didn't find one.

If you look at the provided makefile, you can see there's some back-and-forth about the appropriate linker flags when building with MPI:

ifeq ($(USEMPI),1)
EXTRALIBS= #-lm #-lmpi
EXTRACCFLAGS=-DMPI
CC=mpicc #/usr/local/bin/mpicc
else
EXTRALIBS = -lm
EXTRACCFLAGS =
endif

At some point, the software's author must have decided that linking libm was not necessary in this case. You can override that decision on the command line as follows

make EXTRALIBS=-lm

There will likely be a number of compiler warnings which you may ignore.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.