0

I am trying to compile a program called randfold which deals with RNA folding. However during sudo make , I am getting the following messages for c programs.

params.o: In function `scale_parameters':
params.c:(.text+0x160): undefined reference to `log'
params.c:(.text+0x1bc): undefined reference to `log'
fold.o: In function `HairpinE':
fold.c:(.text+0x3981): undefined reference to `log'
fold.o: In function `LoopEnergy':
fold.c:(.text+0x3bd3): undefined reference to `log'
fold.c:(.text+0x3dfa): undefined reference to `log'
fold.o:fold.c:(.text+0x4f81): more undefined references to `log' follow
collect2: ld returned 1 exit status
make: *** [randfold] Error 1

What could be the reason for these errors?

madhead
  • 31,729
  • 16
  • 153
  • 201
The Last Word
  • 203
  • 1
  • 7
  • 24
  • Please don't do `sudo make`! Just `make`! It doesn't make any sense at all to run the build as `root`, and it can be very risky. – unwind Jul 08 '14 at 09:31
  • @jongware yes it probably is. I couldn't find it and there were so many questions on this forum that I found it easier to just ask the question. I will be more careful – The Last Word Jul 08 '14 at 14:34

1 Answers1

5

Add -lm at the end of your compilation (linker) line to link with the math library.

ouah
  • 142,963
  • 15
  • 272
  • 331