vcpkg/ports/mlpack/cmakelists.patch
Alexander Neumann f3b96f339c
[lapack-reference|fortran] Add new port (#12805)
* [vcpkg/script] add vcpkg_find_fortran

* [openblas] add pkg-config fixes

* [lapack] add lapack-reference and reduce dependency on clapack

* fix build issues

* dont touch any main files

* move toolchain var into parent scope

* fix a few more issues

* create link in the noblas case

* removed unnecessary check handled by vcpkg_find_fortran.

* move dumpbin check

* fix last issue

* depend on openblas

* set cmake_binary_dir so that compiler id run gets put into buildtree.

* more paths

* add missing PARENT_SCOPE

* ws change

* [mlpack] remove dep on clapack

* comment out patches

* remove openblas again

* Install lapack wrapper since it is missing linkage against -lm and -lgfortran

* PREPEND mingw path to make sure cmake picks it up correctly

* depend on openblas also on osx

* add clapack on windows to skip due to conflicting library installs

* add clapack to skip on linux

* add -fPIC as a fortran compiler flag

* do not add the flag on windows

* add gcc explicitly to the cmake args.

* ws change

* applyrequested changes from CR

* fix the failing patch
2020-08-12 10:28:41 -07:00

79 lines
3.6 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 26757a5..c200b40 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -288,6 +282,7 @@ endif()
# and find LAPACK and BLAS ourselves, using a slightly modified variant of the
# script Armadillo uses to find these.
if (WIN32)
+ if(0)
find_library(LAPACK_LIBRARY
NAMES lapack liblapack lapack_win32_MT lapack_win32
PATHS "C:/Program Files/Armadillo"
@@ -305,24 +306,25 @@ if (WIN32)
if (NOT BLAS_LIBRARY)
message(FATAL_ERROR "Cannot find BLAS library (.lib)!")
endif ()
+ endif()
+ find_package(LAPACK REQUIRED)
+ find_package(BLAS REQUIRED)
# Piggyback LAPACK and BLAS linking into Armadillo link.
set(ARMADILLO_LIBRARIES
- ${ARMADILLO_LIBRARIES} ${BLAS_LIBRARY} ${LAPACK_LIBRARY})
+ ${ARMADILLO_LIBRARIES} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
# Ensure that the libraries are added to the MSVC IDE runtime path.
- get_filename_component(BLAS_DIR ${BLAS_LIBRARY} DIRECTORY)
- get_filename_component(LAPACK_DIR ${LAPACK_LIBRARY} DIRECTORY)
# Sometimes, especially with an OpenBLAS install via nuget, the DLLs are
# actually in ../../bin/x64/. Automatically add these.
- if (EXISTS "${BLAS_DIR}/../../bin/x64/")
- get_filename_component(BLAS_DLL_DIR "${BLAS_DIR}/../../bin/x64" ABSOLUTE)
+ if (0)
+ get_filename_component(BLAS_DLL_DIR "${BLAS_DIR}" ABSOLUTE)
set(DLL_COPY_DIRS ${DLL_COPY_DIRS} "${BLAS_DLL_DIR}")
endif ()
- if (EXISTS "${LAPACK_DIR}/../../bin/x64/")
- get_filename_component(LAPACK_DLL_DIR "${LAPACK_DIR}/../../bin/x64" ABSOLUTE)
+ if (0)
+ get_filename_component(LAPACK_DLL_DIR "${LAPACK_DIR}" ABSOLUTE)
set(DLL_COPY_DIRS ${DLL_COPY_DIRS} "${BLAS_DLL_DIR}")
endif ()
endif ()
@@ -415,8 +423,8 @@ if (NOT ENSMALLEN_FOUND)
"Successfully downloaded ensmallen into ${CMAKE_BINARY_DIR}/deps/${ENSMALLEN_INCLUDE_DIR}/")
# Now we have to also ensure these header files get installed.
- install(DIRECTORY "${CMAKE_BINARY_DIR}/deps/${ENSMALLEN_INCLUDE_DIR}/include/ensmallen_bits/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ensmallen_bits")
- install(FILES "${CMAKE_BINARY_DIR}/deps/${ENSMALLEN_INCLUDE_DIR}/include/ensmallen.hpp" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+ #install(DIRECTORY "${CMAKE_BINARY_DIR}/deps/${ENSMALLEN_INCLUDE_DIR}/include/ensmallen_bits/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ensmallen_bits")
+ #install(FILES "${CMAKE_BINARY_DIR}/deps/${ENSMALLEN_INCLUDE_DIR}/include/ensmallen.hpp" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
else ()
message(FATAL_ERROR "Problem unpacking ensmallen! Expected only one directory ensmallen-x.y.z/; found ${ENS_DIRECTORIES}. Try removing the directory ${CMAKE_BINARY_DIR}/deps and reconfiguring.")
endif ()
@@ -472,6 +480,7 @@ find_package(Boost 1.49
REQUIRED
)
+if(0)
link_directories(${Boost_LIBRARY_DIRS})
# In Visual Studio, automatic linking is performed, so we don't need to worry
@@ -483,10 +492,12 @@ if (MSVC)
message("boost lib dirs ${Boost_LIBRARY_DIRS}")
set(Boost_LIBRARIES "")
endif ()
+endif()
+link_directories(${Boost_LIBRARIES})
set(MLPACK_INCLUDE_DIRS ${MLPACK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
set(MLPACK_LIBRARIES ${MLPACK_LIBRARIES} ${Boost_LIBRARIES})
-set(MLPACK_LIBRARY_DIRS ${MLPACK_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS})
+set(MLPACK_LIBRARY_DIRS ${MLPACK_LIBRARY_DIRS} ${Boost_LIBRARIES})
# For Boost testing framework (will have no effect on non-testing executables).
# This specifies to Boost that we are dynamically linking to the Boost test