Opened 6 months ago

Closed 6 months ago

#68721 closed defect (fixed)

[Solved] OpenBLAS finding still broken: madness port configure ignores BLA_VENDOR and uses Accelerate, which breaks the build

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: catap (Kirill A. Korinsky), szhorvat (Szabolcs Horvát), michaelld (Michael Dickens)
Port: OpenBLAS, madness

Description

This is with CMake 3.24:

--->  Configuring madness
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_madness/madness/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DBLA_VENDOR=OpenBLAS -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DENABLE_ACML=OFF -DENABLE_BOOST=ON -DENABLE_ELEMENTAL=OFF -DENABLE_GENTENSOR=OFF -DENABLE_GPERFTOOLS=ON -DENABLE_LIBUNWIND=OFF -DENABLE_LIBXC=OFF -DENABLE_MKL=OFF -DENABLE_MPI=OFF -DENABLE_NEVER_SPIN=OFF -DENABLE_PAPI=OFF -DENABLE_PCM=OFF -DENABLE_SPINLOCKS=ON -DENABLE_TCMALLOC_MINIMAL=OFF -DFORTRAN_INTEGER_SIZE=4 -DMADNESS_TASK_BACKEND="Pthreads" -DBOOST_ROOT=/opt/local/libexec/boost/1.81 -DBOOSTROOT=/opt/local/libexec/boost/1.81 -DBOOST_INCLUDEDIR=/opt/local/libexec/boost/1.81/include -DBOOST_LIBRARYDIR=/opt/local/libexec/boost/1.81/lib -DBOOST_INCLUDE_DIR=/opt/local/libexec/boost/1.81/include -DBOOST_LIBRARY_DIR=/opt/local/libexec/boost/1.81/lib -DBOOST_LIB_DIR=/opt/local/libexec/boost/1.81/lib -DBoost_NO_SYSTEM_PATHS=ON -DBoost_INCLUDE_DIR=/opt/local/libexec/boost/1.81/include -DBoost_DIR=/opt/local/libexec/boost/1.81 -DCMAKE_OSX_ARCHITECTURES="ppc" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.6" -DCMAKE_OSX_SYSROOT="/" /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_madness/madness/work/madness-4f7d30b0a738621037b96bb5b820029835753667 
-- The CXX compiler identification is GNU 13.2.0
-- The C compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/local/bin/gcc-mp-13
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/local/bin/g++-mp-13 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/local/bin/gcc-mp-13 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Assertion type: assert
-- Performing Test HAVE_CRAYXE
-- Performing Test HAVE_CRAYXE - Failed
-- Performing Test HAVE_CRAYXT
-- Performing Test HAVE_CRAYXT - Failed
-- Performing Test HAVE_IBMBGP
-- Performing Test HAVE_IBMBGP - Failed
-- Performing Test HAVE_IBMBGQ
-- Performing Test HAVE_IBMBGQ - Failed
-- Performing Test USE_X86_64_ASM
-- Performing Test USE_X86_64_ASM - Failed
-- Performing Test USE_X86_32_ASM
-- Performing Test USE_X86_32_ASM - Failed
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of int64_t
-- Check size of int64_t - done
-- Check size of long double
-- Check size of long double - done
-- Check size of long long
-- Check size of long long - done
-- Performing Test SYS_TYPES_H_HAS_PID_T
-- Performing Test SYS_TYPES_H_HAS_PID_T - Success
-- Looking for fork
-- Looking for fork - found
-- Looking for memset
-- Looking for memset - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Performing Test CHECK_STDLIB_H_HAS_POSIX_MEMALIGN_THROW
-- Performing Test CHECK_STDLIB_H_HAS_POSIX_MEMALIGN_THROW - Success
-- Looking for pow
-- Looking for pow - found
-- Looking for random
-- Looking for random - found
-- Looking for sleep
-- Looking for sleep - found
-- Looking for strchr
-- Looking for strchr - found
-- Performing Test HAVE_STD_ABS_LONG
-- Performing Test HAVE_STD_ABS_LONG - Success
-- Performing Test THREAD_LOCAL_SUPPORT
-- Performing Test THREAD_LOCAL_SUPPORT - Success
-- Thread local keyword: thread_local
-- Performing Test RESTRICT_SUPPORT
-- Performing Test RESTRICT_SUPPORT - Failed
-- Performing Test RESTRICT_SUPPORT
-- Performing Test RESTRICT_SUPPORT - Success
-- Restrict keyword: __restrict
-- Performing Test HAVE_UNQUALIFIED_STATIC_DECL
-- Performing Test HAVE_UNQUALIFIED_STATIC_DECL - Success
-- Checking for PIE-disabling linker flags
-- PIE-disabling linker flags: -Wl,-no_pie
-- Found Doxygen: /opt/local/bin/doxygen (found version "1.9.8") found components: doxygen dot 
-- Found LATEX: /opt/local/bin/latex   
-- Found xterm: /opt/local/bin/xterm
-- Found gdb: /usr/bin/gdb
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found Gperftools: /opt/local/lib/libtcmalloc.dylib;/opt/local/lib/libprofiler.dylib  found components: tcmalloc profiler 
-- Found Boost: /opt/local/libexec/boost/1.81/include (found suitable version "1.81.0", minimum required is "1.4") found components: math_tr1 
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- A library with BLAS API found.
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK API found.
-- Found LAPACK: -framework Accelerate
-- Found Python3: /opt/local/bin/python3.12 (found version "3.12.0") found components: Interpreter 
-- === MADNESS Package/Feature Info ===
-- The following features have been enabled:

 * SPINLOCKS, Enables use of spinlocks instead of mutexes (faster unless over subscribing processors)
 * DQ_PREBUF, Enables thread-local buffer for task aggregation to reduce lock contention
 * BSEND_ACKS, Use MPI Send instead of MPI Bsend for huge message acknowledgements
 * FORTRAN_INTEGER_SIZE=4, assumes Fortran integers to be 4 bytes long
 * ASSERTION_TYPE=assert, controls how MADNESS assertions (MADNESS_ASSERT) are handled
 * MPI_THREAD=multiple, controls the level of thread-safety support in MPI

-- The following OPTIONAL packages have been found:

 * Doxygen
 * LATEX
 * Gperftools
 * Python3

-- The following REQUIRED packages have been found:

 * Threads
 * Boost (required version >= 1.4)

-- The following features have been disabled:

 * Elemental, compiles parallel linear-algebra library Elemental as part of MADNESS
 * GENTENSOR, enables use of MRA Function compression that allows computing in 6 dimensions
 * TASK_PROFILER, supports task-level tracing of program execution
 * WORLD_PROFILE, supports simple profiling of MADworld runtime
 * MEM_STATS, gather fine-grained memory statistics (expensive)
 * MEM_PROFILE, instrumented aggregate memory profiling
 * TENSOR_BOUNDS_CHECKING, Enable checking of bounds in tensors ... slow but useful for debugging
 * TENSOR_INSTANCE_COUNT, Enable counting of allocated tensors for memory leak detection
 * NEVER_SPIN, Disables use of spinlocks (notably for use inside virtual machines)
 * WORLD_GET_DEFAULT_DISABLE, Disables World::get_default()
 * TASK_DEBUG_TRACE, supports debug trace of task engine
 * ASSUMES_ASLR_DISABLED, MADNESS runtime assumes the Address Space Layout Randomization (ASLR) to be disabled

-- Configuring done (27.4s)
-- Generating done (0.7s)
CMake Warning:
  Manually-specified variables were not used by the project:

    BLA_VENDOR
    BOOST_INCLUDE_DIR
    BOOST_LIBRARY_DIR
    BOOST_LIB_DIR
    CMAKE_OBJCXX_COMPILER
    CMAKE_OBJC_COMPILER
    CMAKE_POLICY_DEFAULT_CMP0025
    CMAKE_POLICY_DEFAULT_CMP0060


-- Build files have been written to: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_science_madness/madness/work/build
--->  Building madness

Same problem with cmake-devel.

Notice, linear_algebra PG is not used here at all. Also this is not upstream issue, since I have this version built correctly earlier:

36-158% port -v installed madness
The following ports are currently installed:
  madness @2023.02.07_0 requested_variants='' platform='darwin 10' archs='ppc' date='2023-02-16T17:01:03+0800'
  madness @2023.04.04_0 requested_variants='' platform='darwin 10' archs='ppc' date='2023-04-15T01:02:41+0800'
  madness @2023.04.23_0 requested_variants='' platform='darwin 10' archs='ppc' date='2023-05-09T10:44:25+0800'
  madness @2023.05.30_0 requested_variants='' platform='darwin 10' archs='ppc' date='2023-06-01T20:57:32+0800'
  madness @2023.06.07_0 requested_variants='' platform='darwin 10' archs='ppc' date='2023-06-19T01:36:01+0800'
  madness @2023.07.03_0 requested_variants='' platform='darwin 10' archs='ppc' date='2023-07-06T16:04:28+0800'
  madness @2023.07.17_0 requested_variants='' platform='darwin 10' archs='ppc' date='2023-07-23T03:09:00+0800'
  madness @2023.08.09_0 requested_variants='' platform='darwin 10' archs='ppc' date='2023-08-10T20:35:25+0800'
  madness @2023.09.29_0 requested_variants='' platform='darwin 10' archs='ppc' date='2023-10-16T00:42:13+0800'
  madness @2023.10.16_0+gfortran requested_variants='' platform='darwin 10' archs='ppc' date='2023-10-18T10:04:30+0800'
  madness @2023.10.26_0+gfortran (active) requested_variants='' platform='darwin 10' archs='ppc' date='2023-10-29T09:20:03+0800'
36-158% otool -L /opt/local/lib/libmadness.dylib 
/opt/local/lib/libmadness.dylib:
	/opt/local/lib/libmadness.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libMacportsLegacySupport.dylib (compatibility version 1.0.0, current version 1.1.99)
	/opt/local/lib/libtcmalloc.9.10.5.dylib (compatibility version 9.10.5, current version 9.10.5)
	/opt/local/lib/libprofiler.5.5.5.dylib (compatibility version 5.5.5, current version 5.5.5)
	/opt/local/lib/libopenblas-r1.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libgcc/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.32.0)
	/opt/local/lib/libgcc/libgcc_s.1.1.dylib (compatibility version 1.0.0, current version 1.1.0)
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 117.0.0)

Attachments (1)

CMakeConfigureLog.yaml (153.0 KB) - added by barracuda156 6 months ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 6 months ago by barracuda156

Now it fails with:

/opt/local/bin/g++-mp-13 -pipe -I/opt/local/libexec/boost/1.81/include -Os -fpermissive -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/libexec/boost/1.81/include -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17 -arch ppc -mmacosx-version-min=10.6 -dynamiclib -Wl,-headerpad_max_install_names -L/opt/local/libexec/boost/1.81/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -L/opt/local/lib -lMacportsLegacySupport -o libMADlinalg.dylib -install_name @rpath/libMADlinalg.dylib "CMakeFiles/MADlinalg-obj.dir/lapack.cc.o" "CMakeFiles/MADlinalg-obj.dir/solvers.cc.o" "CMakeFiles/MADlinalg-obj.dir/elem.cc.o" "CMakeFiles/MADlinalg-obj.dir/SVDTensor.cc.o" "CMakeFiles/MADlinalg-obj.dir/RandomizedMatrixDecomposition.cc.o" "CMakeFiles/MADlinalg-obj.dir/linalg_wrappers.cc.o"  -Wl,-rpath,/opt/local/lib libMADtensor.dylib -framework Accelerate ../misc/libMADmisc.dylib ../world/libMADworld.dylib /opt/local/lib/libtcmalloc.dylib /opt/local/lib/libprofiler.dylib -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free 
Undefined symbols:
  "_zpstrf_", referenced from:
      __ZN7madness11rr_choleskyISt7complexIdEEEvRNS_6TensorIT_EENS5_11scalar_typeERNS3_IiEERi in lapack.cc.o
  "_cpstrf_", referenced from:
      __ZN7madness11rr_choleskyISt7complexIfEEEvRNS_6TensorIT_EENS5_11scalar_typeERNS3_IiEERi in lapack.cc.o
  "_spstrf_", referenced from:
      __ZN7madness11rr_choleskyIfEEvRNS_6TensorIT_EENS3_11scalar_typeERNS1_IiEERi in lapack.cc.o
  "_dpstrf_", referenced from:
      __ZN7madness11rr_choleskyIdEEvRNS_6TensorIT_EENS3_11scalar_typeERNS1_IiEERi in lapack.cc.o
ld: symbol(s) not found

Which is a known issue: https://github.com/m-a-d-n-e-s-s/madness/issues/458 That is why the port should use OpenBLAS and was successfully using it until a couple of weeks ago (last time I built madness was 2023-10-29).

Changed 6 months ago by barracuda156

Attachment: CMakeConfigureLog.yaml added

comment:2 Changed 6 months ago by szhorvat (Szabolcs Horvát)

If it says,

  Manually-specified variables were not used by the project:

    BLA_VENDOR

then I think it is not using CMake's built-in FindBLAS, https://cmake.org/cmake/help/latest/module/FindBLAS.html It probably has its own way to look for BLAS.

comment:3 Changed 6 months ago by catap (Kirill A. Korinsky)

Are you sure that it isn't upstream issue / assumption? See: https://github.com/m-a-d-n-e-s-s/madness/blob/master/external/lapack.cmake#L43-L47

comment:4 in reply to:  3 Changed 6 months ago by barracuda156

Replying to catap:

Are you sure that it isn't upstream issue / assumption? See: https://github.com/m-a-d-n-e-s-s/madness/blob/master/external/lapack.cmake#L43-L47

Well, it could be something wrong with upstream, however it did work earlier with whatever they had.

UPD. I have looked and yes, it is obviously wrong, but it did work somehow until very recent anyway.

Last edited 6 months ago by barracuda156 (previous) (diff)

comment:5 in reply to:  3 Changed 6 months ago by barracuda156

Replying to catap:

Are you sure that it isn't upstream issue / assumption? See: https://github.com/m-a-d-n-e-s-s/madness/blob/master/external/lapack.cmake#L43-L47

Okay, I know what happened. Here is why it worked before: https://github.com/macports/macports-ports/pull/20901/files

I was fixing Sonoma and has broken other systems -_- (Perhaps it linked to Accelerate on Sonoma either, but there it had needed symbols.)

Anyway, can be closed, I will fix it now. Sorry :)

comment:6 Changed 6 months ago by barracuda156

Summary: OpenBLAS finding still broken: madness port configure ignores BLA_VENDOR and uses Accelerate, which breaks the build[Solved] OpenBLAS finding still broken: madness port configure ignores BLA_VENDOR and uses Accelerate, which breaks the build

comment:7 Changed 6 months ago by barracuda156

I will close the ticket with PR with an update to madness.

comment:8 Changed 6 months ago by barracuda156

Fixed by: https://github.com/macports/macports-ports/commit/75479b9d028b1b4a4723291b2d1fc3c0b5e068cf (Well, OpenBLAS finding was broken, but I switched new systems to Accelerate, which is the choice of upstream anyway; it just does not work on older systems.)

comment:9 Changed 6 months ago by herbygillot (Herby Gillot)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.