[R-sig-Debian] configure: error: linking to Fortran libraries from C fails

Dirk Eddelbuettel edd at debian.org
Fri Sep 26 19:32:40 CEST 2014


Hi Matt,

On 26 September 2014 at 18:00, Matt Dowle wrote:
| Nice one for a Friday afternoon ...
| 
| I'm trying to follow this section of the manual :
| 
| http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Using-Undefined-Behaviour-Sanitizer
| 
| to build R-devel (as of a few hours ago: rev 66684) with 
| -fsanitize=undefined,address.
| 
| My OS is Linux Mint Debian Edition.  To get gcc-4.9 I added Debian 

I can't speak to Mint but I have set up ASAN/UBSAN detection via Dockerfiles
and provide Docker containers you can run 'as is' (ie no building).

That used plain Debian testing; the recipes are on

   https://github.com/eddelbuettel/docker-debian-r

but will morph/move more to 

   https://github.com/eddelbuettel/rocker

which is a repo Carl Boettiger (CC'ed) and I are working on.

I hope to update some files this weekend; right now only two of the rocker
'recipes' (ie Dockerfiles) are up-to-date.  You can get the images via

   https://registry.hub.docker.com/u/eddelbuettel/

A working demonstration was at the end of my useR! keynote, and I alluded to
that again yesterday in a talk to the Docker Chicago Meetup.

Now, I can't from the top of my head see what you did wrong. Besides not using
Debian (ie I have no idea what is different at Mint, maybe nothing).  

With a bit of luck I may get to updating the ASAN/UBSAN image in the next few
days and few can compare notes then.

Hth, Dirk



| testing to my apt sources and ran :
| 
|     sudo apt-get install gcc-4.9, g++-4.9 gfortran-4.9
| 
| in the root of a clean Rtrunk.  I then started simple with just ASAN 
| first of all :
| 
| ./configure CC="gcc-4.9 -std=gnu99 -fsanitize=address" 
| CFLAGS="-fno-omit-frame-pointer -O0 -g -Wall -pedantic -mtune=native" 
| --without-recommended-packages --enable-strict-barrier 
| --disable-byte-compiled-packages
| 
| This runs for a while and then returns the following error :
| 
| checking for dummy main to link with Fortran 77 libraries... unknown
| configure: error: in `/home/mdowle/R/Rtrunk':
| configure: error: linking to Fortran libraries from C fails
| See `config.log' for more details
| 
| Looking in config.log there are a lot of errors but I believe that's the 
| way it works as it tests what is available on the system.  If I change 
| "gcc-4.9" to "gcc" (which is 4.8.2 on my system), then it works fine 
| (but then I won't be able to do UBSAN with gcc).
| 
| Looking at the last error in config.log,  it seems to be this :
| 
| configure:23682: gcc-4.9 -std=gnu99 -fsanitize=address -o conftest 
| -fno-omit-frame-pointer -O0 -g -Wall -pedantic -mtune=native 
| -I/usr/local/include -L/usr/local/lib conftest.c -ldl -lm 
| -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -lgfortran -lm -lquadmath >&5
| /usr/lib/gcc/x86_64-linux-gnu/4.9/libasan_preinit.o:(.preinit_array+0x0): undefined 
| reference to `__asan_init_v3'
| /tmp/cchWOhDV.o: In function `_GLOBAL__sub_I_00099_0__main':
| /home/mdowle/R/Rtrunk/conftest.c:113: undefined reference to 
| `__asan_init_v3'
| collect2: error: ld returned 1 exit status
| configure:23682: $? = 1
| configure: failed program was:
| | /* confdefs.h */
| | #define PACKAGE_NAME "R"
| | #define PACKAGE_TARNAME "R"
| | #define PACKAGE_VERSION "3.2.0"
| | #define PACKAGE_STRING "R 3.2.0"
| | #define PACKAGE_BUGREPORT "http://bugs.r-project.org"
| | #define PACKAGE_URL "http://www.r-project.org"
| | #define PACKAGE "R"
| | #define VERSION "3.2.0"
| | #define R_PLATFORM "x86_64-unknown-linux-gnu"
| | #define R_CPU "x86_64"
| | #define R_VENDOR "unknown"
| | #define R_OS "linux-gnu"
| | #define Unix 1
| | #define TESTING_WRITE_BARRIER 1
| | #define R_ARCH ""
| | #define HAVE_VISIBILITY_ATTRIBUTE 1
| | #define STDC_HEADERS 1
| | #define HAVE_SYS_TYPES_H 1
| | #define HAVE_SYS_STAT_H 1
| | #define HAVE_STDLIB_H 1
| | #define HAVE_STRING_H 1
| | #define HAVE_MEMORY_H 1
| | #define HAVE_STRINGS_H 1
| | #define HAVE_INTTYPES_H 1
| | #define HAVE_STDINT_H 1
| | #define HAVE_UNISTD_H 1
| | #define __EXTENSIONS__ 1
| | #define _ALL_SOURCE 1
| | #define _GNU_SOURCE 1
| | #define _POSIX_PTHREAD_SEMANTICS 1
| | #define _TANDEM_SOURCE 1
| | #define HAVE_DLFCN_H 1
| | #define LT_OBJDIR ".libs/"
| | #define HAVE_LIBM 1
| | #define HAVE_LIBDL 1
| | #define HAVE_READLINE_HISTORY_H 1
| | #define HAVE_READLINE_READLINE_H 1
| | #define HAVE_LIBREADLINE 1
| | #define HAVE_HISTORY_TRUNCATE_FILE 1
| | #define HAVE_RL_COMPLETION_MATCHES 1
| | #define STDC_HEADERS 1
| | #define HAVE_DIRENT_H 1
| | #define HAVE_SYS_WAIT_H 1
| | #define HAVE_ARPA_INET_H 1
| | #define HAVE_DLFCN_H 1
| | #define HAVE_ELF_H 1
| | #define HAVE_FCNTL_H 1
| | #define HAVE_FPU_CONTROL_H 1
| | #define HAVE_GLOB_H 1
| | #define HAVE_GRP_H 1
| | #define HAVE_LANGINFO_H 1
| | #define HAVE_NETDB_H 1
| | #define HAVE_NETINET_IN_H 1
| | #define HAVE_PWD_H 1
| | #define HAVE_SCHED_H 1
| | #define HAVE_STRINGS_H 1
| | #define HAVE_SYS_PARAM_H 1
| | #define HAVE_SYS_RESOURCE_H 1
| | #define HAVE_SYS_SELECT_H 1
| | #define HAVE_SYS_SOCKET_H 1
| | #define HAVE_SYS_STAT_H 1
| | #define HAVE_SYS_TIME_H 1
| | #define HAVE_SYS_TIMES_H 1
| | #define HAVE_SYS_UTSNAME_H 1
| | #define HAVE_UNISTD_H 1
| | #define HAVE_UTIME_H 1
| | #define HAVE_ERRNO_H 1
| | #define HAVE_INTTYPES_H 1
| | #define HAVE_LIMITS_H 1
| | #define HAVE_LOCALE_H 1
| | #define HAVE_STDARG_H 1
| | #define HAVE_STDBOOL_H 1
| | #define HAVE_STDINT_H 1
| | #define HAVE_STRING_H 1
| | #define HAVE_DECL_SIGSETJMP 1
| | #define HAVE_DECL_SIGLONGJMP 1
| | #define HAVE_POSIX_SETJMP 1
| | #define HAVE_GLIBC2 1
| | #define RETSIGTYPE void
| | #define HAVE_INT64_T 1
| | #define HAVE_INT_FAST64_T 1
| | #define HAVE_DECL_SIZE_MAX 1
| | #define R_SOCKLEN_T socklen_t
| | #define HAVE_STACK_T 1
| | #define HAVE_INTPTR_T 1
| | #define HAVE_UINTPTR_T 1
| | #define R_INLINE inline
| | #define SIZEOF_INT 4
| | #define INT_32_BITS 1
| | #define SIZEOF_LONG 8
| | #define SIZEOF_LONG_LONG 8
| | #define SIZEOF_DOUBLE 8
| | #define SIZEOF_SIZE_T 8
| | #define HAVE_LONG_DOUBLE 1
| | #define SIZEOF_LONG_DOUBLE 16
| | /* end confdefs.h.  */
| | #define F77_DUMMY_MAIN _main
| | #ifdef F77_DUMMY_MAIN
| |
| | #  ifdef __cplusplus
| |      extern "C"
| | #  endif
| |    int F77_DUMMY_MAIN() { return 1; }
| |
| | #endif
| | int
| | main ()
| | {
| |
| |   ;
| |   return 0;
| | }
| configure:23698: result: unknown
| configure:23715: error: in `/home/mdowle/R/Rtrunk':
| configure:23717: error: linking to Fortran libraries from C fails
| See `config.log' for more details
| 
| I've searched for the error messages but no luck so far.  Can anyone see 
| what I've done wrong?
| 
| I just installed  lib64gcc-4.9-dev  as well (includes quadmath and asan 
| libraries) but that didn't help, same error as above.
| 
| Thanks!
| Matt
| 
| _______________________________________________
| R-SIG-Debian mailing list
| R-SIG-Debian at r-project.org
| https://stat.ethz.ch/mailman/listinfo/r-sig-debian

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-SIG-Debian mailing list