Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#65668 closed defect (fixed)

OpenBLAS @0.3.21 has a problem on PPC Mac OS X 10.4.11, Tiger, with 'mktemp'

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: tiger haspatch Cc: NicosPavlov
Port: OpenBLAS

Description

gmake: Entering directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/xianyi-OpenBLAS-b89fb70'
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix 
./c_check: line 248: /a.c: Permission denied
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix 
./c_check: line 248: /a.c: Permission denied
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix 
./c_check: line 248: /a.c: Permission denied
gmake[1]: Entering directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/xianyi-OpenBLAS-b89fb70/interface'

The code is:

  244	case "$data" in
  245	    *HAVE_C11*)
  246	        tmpd=`mktemp -d`
  247	        tmpf="$tmpd/a.c"
  248	        printf "#include <stdatomic.h>\nint main(void){}\n" >> "$tmpf"
  249	        args=" -c -o $tmpf.o $tmpf"
  250	        c11_atomics=1
  251	        {
  252	            $compiler_name $flags $args >/dev/null 2>&1
  253	        } || {
  254	            c11_atomics=0
  255	        }
  256	
  257	        rm -rf "$tmpd"
  258	        ;;
  259	esac

My PowerBook G4 has:

-rwxr-xr-x 1 root admin 13716 19. Jan 2022  /opt/local/lib/bash/mktemp
lrwxr-xr-x 1 root admin    22  7. Jul 12:06 /opt/local/libexec/gnubin/mktemp -> /opt/local/bin/gmktemp
-r-xr-xr-x 1 root wheel 14076 21. Mär 2005  /usr/bin/mktemp

Obviously Apples /usr/bin/mktemp` is being used:

pete 241 /\ /usr/bin/mktemp -d
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix 
Exit 1
pete 242 /\ /opt/local/libexec/gnubin/mktemp -d
/tmp/tmp.vqK25Du8tm
pete 243 /\ rmdir /tmp/tmp.vqK25Du8tm

Using /usr/bin/mktemp it would need an additional -d /tmp/tmpdir${$} or such argument.

Later this warning appears:

gmake[1]: Entering directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/xianyi-OpenBLAS-b89fb70/driver/others'
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cc/opt/local/bin/gcc-mp-7 -Os -arch ppc -O3 -DMAX_STACK_ALLOC=2048 -Wall -m32 -DF_INTERFACE_GFORT -fPIC -DNO_AVX -DNO_AVX2 -DNO_AVX512 -DMAX_CPU_NUMBER=1 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"1\" -force_cpusubtype_ALL -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=_ -DASMFNAME=__ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I. -O3 -DSMALL_MATRIX_OPT -DMAX_STACK_ALLOC=2048 -Wall -m32 -DF_INTERFACE_GFORT -fPIC -DNO_AVX -DNO_AVX2 -DNO_AVX512 -DMAX_CPU_NUMBER=1 -DMAX_PARALLEL_NUMBER=1 -DBUILD_BFLOAT16 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"1\" -force_cpusubtype_ALL -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=_memory -DASMFNAME=_memory_ -DNAME=memory_ -DCNAME=memory -DCHAR_NAME=\"memory_\" -DCHAR_CNAME=\"memory\" -DNO_AFFINITY -I../.. -c memory.c -o memory.o
memory.c:106:2: warning: #warning BUFFER_SIZE is too small for P, Q, and R of SGEMM - large calculations may crash ! [-Wcpp]
 #warning BUFFER_SIZE is too small for P, Q, and R of SGEMM - large calculations may crash !
  ^~~~~~~
memory.c:111:2: warning: #warning BUFFER_SIZE is too small for P, Q, and R of DGEMM - large calculations may crash ! [-Wcpp]
 #warning BUFFER_SIZE is too small for P, Q, and R of DGEMM - large calculations may crash !
  ^~~~~~~
memory.c:116:2: warning: #warning BUFFER_SIZE is too small for P, Q, and R of CGEMM - large calculations may crash ! [-Wcpp]
 #warning BUFFER_SIZE is too small for P, Q, and R of CGEMM - large calculations may crash !
  ^~~~~~~
memory.c:121:2: warning: #warning BUFFER_SIZE is too small for P, Q, and R of ZGEMM - large calculations may crash ! [-Wcpp]
 #warning BUFFER_SIZE is too small for P, Q, and R of ZGEMM - large calculations may crash !
  ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cc/opt/local/bin/gcc-mp-7 -Os -arch ppc -O3 -DMAX_STACK_ALLOC=2048 -Wall -m32 -DF_INTERFACE_GFORT -fPIC -DNO_AVX -DNO_AVX2 -DNO_AVX512 -DMAX_CPU_NUMBER=1 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"1\" -force_cpusubtype_ALL -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=_ -DASMFNAME=__ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I. -O3 -DSMALL_MATRIX_OPT -DMAX_STACK_ALLOC=2048 -Wall -m32 -DF_INTERFACE_GFORT -fPIC -DNO_AVX -DNO_AVX2 -DNO_AVX512 -DMAX_CPU_NUMBER=1 -DMAX_PARALLEL_NUMBER=1 -DBUILD_BFLOAT16 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"1\" -force_cpusubtype_ALL -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=_xerbla -DASMFNAME=_xerbla_ -DNAME=xerbla_ -DCNAME=xerbla -DCHAR_NAME=\"xerbla_\" -DCHAR_CNAME=\"xerbla\" -DNO_AFFINITY -I../.. -c xerbla.c -o xerbla.o

There are more warnings, about variables used uninitialised or that could change in value when inherently converted between different types, or were left unused or ignored. (Compilation still going on.)

Attachments (1)

patch-MacOSX-mktemp.diff (354 bytes) - added by ballapete (Peter "Pete" Dyballa) 2 years ago.
Simple patch to change too old mktemp to gmktemp in c_check shell script

Download all attachments as: .zip

Change History (11)

comment:1 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

The mktemp problems repeats near the end:

DEBUG: system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/OpenBLAS-0.3.21" && /opt/local/bin/gmake -w install PREFIX=/opt/local CC="/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cc/opt/local/bin/gcc-mp-7" CXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/cxx/opt/local/bin/g++-mp-7" OBJC="/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objc/opt/local/bin/gcc-mp-7" OBJCXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/objcxx/opt/local/bin/g++-mp-7" FC="/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/fc/opt/local/bin/gfortran-mp-7" F77="/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f77/opt/local/bin/gfortran-mp-7" F90="/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/compwrap/f90/opt/local/bin/gfortran-mp-7" INSTALL="/usr/bin/install -c" DESTDIR=/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/destroot 
gmake: Entering directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/xianyi-OpenBLAS-b89fb70'
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix 
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix 
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-q] [-u] -t prefix 
/opt/local/bin/gmake -j 1 -f Makefile.install install
gmake[1]: Entering directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/xianyi-OpenBLAS-b89fb70'
Generating openblas_config.h in /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/destroot/opt/local/include
Generating f77blas.h in /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/destroot/opt/local/include
Generating cblas.h in /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/destroot/opt/local/include
Copying LAPACKE header files to /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/destroot/opt/local/include
Copying the static library to /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/destroot/opt/local/lib
Copying the shared library to /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/destroot/opt/local/lib
Generating openblas.pc in /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/destroot/opt/local/lib/pkgconfig
Generating OpenBLASConfig.cmake in /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/destroot/opt/local/lib/cmake/openblas
Generating OpenBLASConfigVersion.cmake in /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/destroot/opt/local/lib/cmake/openblas
Install OK!
gmake[1]: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_math_OpenBLAS/OpenBLAS/work/xianyi-OpenBLAS-b89fb70'

comment:2 Changed 2 years ago by kencu (Ken)

the usual drill for this is to add a dep on coreutils and patch in gmktemp

comment:3 in reply to:  2 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

On PPC Leopard, Mac OS X 10.5.8 I changed mktemp to gmktemp and the build suceeded. I'll attach my simple patch afterwards.

Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: patch-MacOSX-mktemp.diff added

Simple patch to change too old mktemp to gmktemp in c_check shell script

comment:4 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: NicosPavlov added; nicos@… michaelld@… removed
Keywords: haspatch added
Owner: set to michaelld
Status: newassigned

comment:5 Changed 2 years ago by NicosPavlov <pavillon.nicolas@…>

In c695cff543596a7c83e212c1325ec0d1d6dc879b/macports-ports (master):

OpenBLAS: update *-devel to latest commit (63d063)
Fix build on older PPC macs (see #65668)

comment:6 Changed 2 years ago by NicosPavlov

Thank you for the patch, I left the ticket open in order to confirm that it indeed fixes the issue before closing it.

comment:7 Changed 2 years ago by kencu (Ken)

forgot the coreutils dep.

See comment:2

Last edited 2 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:8 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

OpenBLAS built nevertheless overnight.

comment:9 Changed 2 years ago by NicosPavlov <pavillon.nicolas@…>

In 5fba12a6edc2dcde2974bd56b591972a78c33b64/macports-ports (master):

OpenBLAS: add forgotten dependency (see #65668)

comment:10 Changed 2 years ago by NicosPavlov

Resolution: fixed
Status: assignedclosed

Thanks for the comment, I added the dependency. I'll mark the ticket as fixed at this point.

Note: See TracTickets for help on using tickets.