[Simh] SIMH compile/link bug fix for openSUSE and Kubuntu Linux...

Lyle Bickley lbickley at bickleywest.com
Mon Apr 21 19:23:16 EDT 2008


On Monday 21 April 2008 12:06, Lyle Bickley wrote:
> I'm on the PDP-1 and IBM1620 Restoration Teams at the Computer
> History Museum. We use SIMH regularly.
>
> Attempting to compile SIMH for any system with release 37-2 or
> 37-3 on openSUSE or Kubuntu Linux produced the following error:
> ---------------------------------------------------------
> /home/lpb/simh/sim_timer.c:302: undefined reference to
> `clock_getres' collect2: ld returned 1 exit status
> make: *** [BIN/pdp1] Error 1
> ---------------------------------------------------------
>
> The problem was resolved by insuring -lrt is included in the
> makefile. I did so by removing the $(OSTYPE),macos test from the
> makefile.

--snip--

Here's a better solution - it permits different CC options 
for 'macos', 'linux', and others:
==================================================================
diff makefile.orig makefile
12a13
> CC = gcc -std=c99 -O2 -U__STRICT_ANSI__ -g -lm $(OS_CCDEFS) -I .
15,16c16,18
< else
< CC = gcc -std=c99 -O2 -U__STRICT_ANSI__ -g -lm $(OS_CCDEFS) -I .
---
> endif
> ifeq ($(OSTYPE),linux)
> CC = gcc -std=c99 -O2 -U__STRICT_ANSI__ -g -lm -lrt 
$(OS_CCDEFS) -I .
===================================================================
Cheers,
Lyle
-- 
Lyle Bickley
Bickley Consulting West Inc.
Mountain View, CA
http://bickleywest.com

"Black holes are where God is dividing by zero"



More information about the Simh mailing list