Monday, April 7, 2014

Building emacs on NERSC systems

Emacs on NERSC systems are old, so I tried to compile emacs from source. The compiler is older as well, so I encountered errors during compile time.

regex.o: In function `stpncpy': 
/usr/include/bits/string3.h:160: multiple definition of `stpncpy' /tmp/ccntBfBN.o:/usr/include/bits/string3.h:160: first defined here 
regex.o: In function `realpath': 
/usr/include/bits/stdlib.h:37: multiple definition of `realpath' /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:37: first defined here 
regex.o: In function `ptsname_r': 
/usr/include/bits/stdlib.h:53: multiple definition of `ptsname_r' /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:53: first defined here 
regex.o: In function `wctomb': 
/usr/include/bits/stdlib.h:74: multiple definition of `wctomb' /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:74: first defined here 
regex.o: In function `mbstowcs': 
/usr/include/bits/stdlib.h:95: multiple definition of `mbstowcs' /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:95: first defined here 
regex.o: In function `wcstombs': 
/usr/include/bits/stdlib.h:114: multiple definition of `wcstombs' /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:114: first defined here 

To get around this, use this trick:
./configure CPPFLAGS="-fgnu89-inline"

Source: http://stackoverflow.com/questions/15285776/multiple-definitions-when-linking-collect2-error-ld-returned-1-exit-status


No comments:

Post a Comment