[MacPorts] #64379: lapack @3.10.0: cmake files in wrong location

MacPorts noreply at macports.org
Fri Mar 15 10:03:02 UTC 2024


#64379: lapack @3.10.0: cmake files in wrong location
------------------------+----------------------
  Reporter:  lepus2589  |      Owner:  (none)
      Type:  defect     |     Status:  reopened
  Priority:  Normal     |  Milestone:
 Component:  ports      |    Version:  2.7.1
Resolution:             |   Keywords:  haspatch
      Port:  lapack     |
------------------------+----------------------
Changes (by lepus2589):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Sorry for the late reply. Unfortunately, the linked PR did not fix this!
 The problematic lines in the Portfile are [https://github.com/macports
 /macports-
 ports/blob/4fac663bd99bc4571e9dac13c1707c7a380d0098/math/lapack/Portfile#L77-L78
 math/lapack/Portfile#L77-L78]. They move the CMake scripts to the MacPorts
 CMake Module folder post-build!

 TL;DR: Don't move the CMake scripts after build!

 This is wrong in two ways: First, the CMake scripts provided by the
 reference lapack project are config modules. They don't belong into the
 CMake Modules folder. They belong exactly, where the project places them.
 Which leads to the second problem: Config module scripts don't need to be
 and, in fact, are often not relocatable. They may contain hard-coded paths
 specific to the environment the package was configured in. Moving them
 post-build just breaks them.

 The intended install location of these CMake scripts is (for LAPACKE) {{{
 ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake/${LAPACKELIB}-${LAPACK_VERSION}
 }}}, which should be {{{ /opt/local/lib/cmake/lapacke-3.12.0/ }}} for the
 latest version, which is also a location {{{ find_package(lapacke) }}}
 would search by default (see default search paths above). Moving this to
 {{{ /opt/local/share/cmake/Modules/lapacke-3.12.0/ }}}, which is the
 MacPorts {{{{cmake_share_module_dir} }}}, breaks them. The same applies to
 {{{cblas}}} and {{{lapack}}}, of course.

 -----

 Also, the Portfile overwrites {{{CMAKE_INSTALL_LIBDIR}}} to be
 {{{lib/lapack}}} instead of {{{lib}}}. I can see, why this is being done
 (to place the binaries into a subfolder), but unfortunately, this also
 places the CMake scripts into a non-default location. This is a separate
 issue. It is also something, that can be worked around and also happens at
 CMake configure time, at least, so the generated CMake config files are
 consistent. The LAPACK project doesn't offer a separate variable to
 configure the install location of the CMake scripts, so I can't really
 think of a solution to this.

-- 
Ticket URL: <https://trac.macports.org/ticket/64379#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list