From 11cbc77cfd7e83ef8fb162e82cb068a86135402f Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Tue, 2 Aug 2022 09:36:59 -0400 Subject: [PATCH] Try putting gfortran and pthread last. --- CMake/ConfigureCrossCompile.cmake | 3 +-- CMakeLists.txt | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CMake/ConfigureCrossCompile.cmake b/CMake/ConfigureCrossCompile.cmake index 73628560b9..a320d32932 100644 --- a/CMake/ConfigureCrossCompile.cmake +++ b/CMake/ConfigureCrossCompile.cmake @@ -40,6 +40,5 @@ macro(search_openblas version) endif() find_library(GFORTRAN NAMES libgfortran.a) find_library(PTHREAD NAMES libpthread.a) - set(MLPACK_LIBRARIES ${MLPACK_LIBRARIES} ${GFORTRAN} ${PTHREAD}) - message(STATUS "mlpack_libraries: ${MLPACK_LIBRARIES}") + set(CROSS_COMPILE_SUPPORT_LIBRARIES ${GFORTRAN} ${PTHREAD}) endmacro() diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ed60b710e..28573fea24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,6 @@ include(CMake/Autodownload.cmake) include(CMake/ConfigureCrossCompile.cmake) include(CMake/CheckAtomic.cmake) -message(STATUS "now mlpack_libraries ${MLPACK_LIBRARIES}") - # First, define all the compilation options. # We default to debugging mode for developers. option(DEBUG "Compile with debugging information." OFF) @@ -224,8 +222,6 @@ if (CMAKE_COMPILER_IS_GNUCC) set(MLPACK_LIBRARIES ${MLPACK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) endif() -message(STATUS "now 2nd mlpack_libraries ${MLPACK_LIBRARIES}") - # Debugging CFLAGS. Turn optimizations off; turn debugging symbols on. if (DEBUG) if (NOT MSVC) @@ -481,6 +477,10 @@ if (BUILD_CLI_EXECUTABLES AND UNIX) endif () endif () +# Finally, add any cross-compilation support libraries (they may need to come +# last). If we are not cross-compiling, no changes will happen here. +set(MLPACK_LIBRARIES ${MLPACK_LIBRARIES} ${CROSS_COMPILE_SUPPORT_LIBRARIES}) + # Recurse into the rest of the project. add_subdirectory(src/mlpack)