Compiling with Linux kernel 2.6 (FC10)
Hi,
I've been using sm for years, but just built a new computer and installed Fedora Core 10 with the 64 bit libraries. Has anyone had luck compiling on this platform? I have version sm2_4_30. set_opts runs okay, but when I type make, I get the output I'll put below.
Thanks for any help,
Mike
( cd src ; \
make "CC=cc -Wall -Dlinux -DNEED_SWAP" "CFLAGS=-g -I/usr/local/src/sm2_4_30/src" "RANLIB=/usr/bin/ranlib" \
DEFAULT_PATH=". ~ /usr/local/lib/sm/" all_src )
make[1]: Entering directory `/usr/local/src/sm2_4_30/src'
Makefile:154: warning: overriding commands for target `.PRECIOUS'
Makefile:125: warning: ignoring old commands for target `.PRECIOUS'
Makefile:157: warning: overriding commands for target `.PRECIOUS'
Makefile:154: warning: ignoring old commands for target `.PRECIOUS'
( cd bison ;\
make CC="cc -Wall -Dlinux -DNEED_SWAP" CFLAGS="-c" LDFLAGS="-s" bison )
make[2]: Entering directory `/usr/local/src/sm2_4_30/src/bison'
cc -Dlinux -DNEED_SWAP -c -c $(PFILES) lr0.c
lr0.c: In function ‘free_storage’:
lr0.c:129: warning: incompatible implicit declaration of built-in function ‘free’
lr0.c:129: error: void value not ignored as it ought to be
lr0.c:130: error: void value not ignored as it ought to be
lr0.c:131: error: void value not ignored as it ought to be
lr0.c:132: error: void value not ignored as it ought to be
lr0.c:133: error: void value not ignored as it ought to be
lr0.c:134: error: void value not ignored as it ought to be
lr0.c:135: error: void value not ignored as it ought to be
lr0.c: In function ‘augment_automaton’:
lr0.c:546: warning: incompatible implicit declaration of built-in function ‘free’
lr0.c:546: error: void value not ignored as it ought to be
lr0.c:583: warning: incompatible implicit declaration of built-in function ‘free’
lr0.c:583: error: void value not ignored as it ought to be
make[2]: *** [lr0.o] Error 1
make[2]: Leaving directory `/usr/local/src/sm2_4_30/src/bison'
make[1]: *** [Bison] Error 2
make[1]: Leaving directory `/usr/local/src/sm2_4_30/src'
make: *** [sm] Error 2
- Forums:
Who's online
Online users
- karuiner

Hi superluminique, I have the
Hi superluminique,
I have the same problem too, I try to follow your way to fix the problems, but after I checked that I have bison installed. And run ./set_opts
I look into the makefile in the sm2_4_34 directory, I could not locate the YACC=/usr/bin/bison -y at L84
and L101: all_src: Bison, sm
Not sure how to proceed now?
Thanks
How do I fix this problem?
How do I fix this problem?
Thanks
Sorry if I'm misunderstanding
Sorry if I'm misunderstanding you, but make sure you are looking at and editing at 'sm2_4_34/src/Makefile', not 'sm2_4_34/Makefile' after running set_opts.
I don't have a copy of 2.4.34 myself so I don't know if it's changed, but I'm guessing it hasn't by a whole lot between minor revisions.
I think I fixed all this
I think I fixed all this bison mess recently in cvs (I'd have
to check the logs). We really don't need to ship bison any more,
although it is a bit of a moving target as our build scripts
move some variables from global to local scope.
Compiling with Linux kernel 2.6 (FC10)
lr0.c: In function ‘free_storage’:
lr0.c:129: error: void value not ignored as it ought to be
to avoid this error I have simply changed all occurences of
FREE()
uppercase to
free()
lowercase in all *.c files in directory src/bison
to kill the warning:
lr0.c:129: warning: incompatible implicit declaration of built-in function ‘free’
one can add a line
(pound sign) include stdlib.h
into the same files, but sm compiles and runs OK even without this header
(its name should be in angular braces, of course)
Solution
This problem is not unique to Fedora and it did happen to me on Ubuntu 8.04 as well. Here's how I solved it:
1. Using your package manager (apt, dpkg, synaptic, etc.) make sure that you install the "bison" package.
2. Run ./set_opts as usual.
3. Go to the sm2_4_30/src directory and edit Makefile.
At L87, make sure that:
YACC = /usr/bin/bison -y
At L101, change:
all_src : Bison, sm
for:
all_src : sm
(i.e. remove Bison) This will prevent the make script to try to compile Bison from the source code included with SM, which, for some reason, crashed at compilation.
4. Do the "make" as usual.
5. Do the "make install" as usual.
This should solve your problem. At least it did solve mine (I had the same error log as you).
Also, I've experienced problems with the swig part (required if you want to make the python module to access SM). Here's the end of the faulty "make" log:
"""""""""""""""""""""""""""""
make[1]: Entering directory `/home/breton/sm/sm2_4_30/swigInterfaces'
swig -python -I../src smLib.i
cc -Wall -Dlinux -DNEED_SWAP -c -g -I/home/breton/sm/sm2_4_30/src -I/usr/include/python2.5 -I/usr/lib/python2.5/site-packages/numpy/core/include smLib_wrap.c -fPIC
cc -Wall -Dlinux -DNEED_SWAP -o _smLib.so -shared smLib_wrap.o -L../src -lplotsub -ldevices -lutils -lX11 -lm -fPIC
/usr/bin/ld: ../src/libplotsub.a(dummies.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
../src/libplotsub.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [_smLib.so] Error 1
make[1]: Leaving directory `/home/breton/sm/sm2_4_30/swigInterfaces'
make: *** [swig] Error 2
"""""""""""""""""""""""""
Here's how I fixed it:
1. Run ./set_opts and at the question:
"""
You are on linux using the
cc -Wall -Dlinux -DNEED_SWAP
compiler; is this OK? [y|n]
"""
Answer no (i.e. type "n")
Then set_opts will prompt you with:
"""
type compiler command or q to exit
"""
You should type "cc -Wall -Dlinux -DNEED_SWAP -fPIC", i.e. you copy paste to proposed compiler line but you add "-fPIC".
2. You run "make" as usual.
3. You run "make install" as usual. Note that "make install" might fail to copy the python module
"""cp: cannot stat `swigInterfaces/{_smLib*,*.py}': No such file or directory
make: *** [install] Error 1
"""
In this case, simply copy the files manually:
cp sm2_4_30/swigInterfaces/_smLib* /usr/local/lib/
cp sm2_4_30/swigInterfaces/*.py /usr/local/lib/
float vs double and compiling vs non-compiling
The error above appears to be affecting 2.4.34 as well, but not 2.4.35 This latter version, however, does not appear to allow to choose the old double-precision compiling option... so that my 10^46 luminosities now break the interpreter. Is there any way one can compile a recent supermongo in double precision under a recent linux?
Cheers - Mattia
compiling in double precision still possible
Yes, it seems it's still possible, at least in version 2.4.36.
For some reason set_opts does not prompt any longer about which precision to choose, however it can be specified by adding the flag "-p double" when running set_opts.
Type "set_opts -h" to see what other options are available.
Cheers
Nicola