ports/162686: atlas build tries to use 64 bit fortran compiler on AMD64 hardware running 32 bit kernel [patch]

Don Lewis truckman at FreeBSD.org
Sat Nov 19 22:50:06 UTC 2011


>Number:         162686
>Category:       ports
>Synopsis:       atlas build tries to use 64 bit fortran compiler on AMD64 hardware running 32 bit kernel [patch]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 19 22:50:04 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Don Lewis
>Release:        FreeBSD 9.9-CURRENT i386
>Organization:
none
>Environment:
System: FreeBSD scratch.catspoiler.org 9.9-CURRENT FreeBSD 10.0-CURRENT #64: Mon Nov 14 15:09:48 PST 2011 dl at scratch.catspoiler.org:/usr/obj/usr/src/sys/GENERICSMB i386

	AMD64 running i386 kernel, userland, and ports
	gcc-4.6.3.20111111

>Description:

	When attempting to build the math/atlas port on x86_64 hardware
	running a 32 bit kernel, userland, and ports, the atlas hardware
	probe detects that it is running on an x86_64 architecture CPU.
	The build then assumes that it should do a 64 bit build and falls
	over when gfortran rejects the -m64 option.  Strangely, it doesn't
	attempt this when compiling C code with gcc.

	cmnd=make IRunCComp CC='gcc46' CCFLAGS='-O -fomit-frame-pointer -Wl,-rpath=/usr/local/lib/gcc46  -fpic -DPIC  ' | fgrep SUCCESS
	   gcc46 -O -fomit-frame-pointer -Wl,-rpath=/usr/local/lib/gcc46  -fpic -DPIC   : SUCCESS!
	f951: sorry, unimplemented: 64-bit mode not compiled in
	cmnd=make IRunF77Comp F77='gfortran46' F77FLAGS='-fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -Wl,-rpath=/usr/local/lib/gcc46  -fpic -DPIC  -m64' | fgrep SUCCESS
	   gfortran46 -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -Wl,-rpath=/usr/local/lib/gcc46  -fpic -DPIC  -m64 : FAILURE!
	f951: sorry, unimplemented: 64-bit mode not compiled in
	cmnd=make IRunF77Comp F77='gfortran46' F77FLAGS='-O -Wl,-rpath=/usr/local/lib/gcc46  -fpic -DPIC  -m64' | fgrep SUCCESS
	   gfortran46 -O -Wl,-rpath=/usr/local/lib/gcc46  -fpic -DPIC  -m64 : FAILURE!
	g77: not found
	cmnd=make IRunF77Comp F77='g77' F77FLAGS='-O -Wl,-rpath=/usr/local/lib/gcc46  -fpic -DPIC  ' | fgrep SUCCESS
	   g77 -O -Wl,-rpath=/usr/local/lib/gcc46  -fpic -DPIC   : FAILURE!
	f77: not found
	cmnd=make IRunF77Comp F77='f77' F77FLAGS='-O -Wl,-rpath=/usr/local/lib/gcc46  -fpic -DPIC  ' | fgrep SUCCESS
	   f77 -O -Wl,-rpath=/usr/local/lib/gcc46  -fpic -DPIC   : FAILURE!
	
	
	Unable to find usable compiler for F77; abortingMake sure compilers are in your path, and specify good compilers to configure
	(see INSTALL.txt or 'configure --help' for details)*** Error code 7
	
	Stop in /usr/ports/math/atlas/work/ATLAS/shared.
	*** Error code 1
	
	Stop in /usr/ports/math/atlas/work/ATLAS/shared.
	Assertion failed: (!system(ln)), function ProbeComp, file /usr/ports/math/atlas/work/ATLAS/shared/..//CONFIG/src/config.c, line 125.
	cmnd=make IRun_OS args="-v 2 " | fgrep 'OS='
	
	OS configured as FreeBSD (10)
	cmnd=make IRun_asm args="-v 2  -O 10" | fgrep 'ASM='
	
	Assembly configured as GAS_x8632 (1)
	cmnd=make IRun_vec args="-v 2  -O 10 -s 1" | fgrep 'VECFLAG='
	
	Vector ISA Extension configured as  SSE3 (2,60)
	cmnd=make IRun_arch args="-v 2  -O 10 -s 1 -a" | fgrep 'MACHTYPE='
	
	Architecture configured as  HAMMER (24)
	cmnd=make IRun_arch args="-v 2  -O 10 -s 1 -m" | fgrep 'CPU MHZ='
	
	Clock rate configured as 2500Mhz
	cmnd=make IRun_arch args="-v 2  -O 10 -s 1 -n" | fgrep 'NCPU='
	
	Maximum number of threads configured as  2
	cmnd=make IRun_arch args="-v 2  -O 10 -s 1 -b" | fgrep 'PTR BITS='
	
	Pointer width configured as 64
	cmnd=make IRun_arch args="-v 2  -O 10 -s 1 -t" | fgrep 'CPU THROTTLE='
	Cannot detect CPU throttling.
	Abort trap (core dumped)
	xconfig exited with 134
	*** Error code 134
	
	Stop in /usr/ports/math/atlas.
	*** Error code 1
	
	Stop in /usr/ports/math/atlas.

>How-To-Repeat:

	Attempt to build the math/atlas port on x86_64 hardware running
	a 32 bit kernel and userland.

>Fix:

	There is probably a way that the hardware probe could detect that
	the CPU is running in 32 bit mode on x86_64 hardware that could
	be added to the generic probe code.  The following patch just
	skips the generic probe so that the FreeBSD specific probe is
	executed instead.

--- CONFIG/src/probe_arch.c.orig	2011-05-14 10:33:24.000000000 -0700
+++ CONFIG/src/probe_arch.c	2011-10-24 18:29:44.000000000 -0700
@@ -107,7 +107,7 @@
 /*
  * If Assembler right or unspecified, try x86 probe
  */
-   if (asmd == gas_x86_32 || asmd == gas_x86_64)
+   if ((asmd == gas_x86_32 || asmd == gas_x86_64) && OS != OSFreeBSD)
    {
       sprintf(cmnd, "make IRunArchInfo_x86 MYFLAGS=\"-DATL_OS_%s -DATL_%s\" args=\"%s\" %s | fgrep '%s'",
               osnam[OS], ASMNAM[asmd], flag, targ, find);

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list