Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Mingw compilation #52

Merged
merged 1 commit into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions CMAKE/FortranMangling.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
FUNCTION(COMPILE RESULT)
MESSAGE(STATUS "=========")
MESSAGE(STATUS "Compiling and Building BLACS INSTALL Testing to set correct variables")


if(CMAKE_BUILD_TYPE)
SET(BUILD_TYPE -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
endif()

# Configure:
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
"-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}"
"-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" "${PROJECT_SOURCE_DIR}//BLACS/INSTALL"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/BLACS/INSTALL/
"${PROJECT_SOURCE_DIR}/BLACS/INSTALL"
-G ${CMAKE_GENERATOR} ${BUILD_TYPE}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/BLACS/INSTALL/
RESULT_VARIABLE RESVAR OUTPUT_VARIABLE LOG1_OUT ERROR_VARIABLE LOG1_ERR
)
if(RESVAR EQUAL 0)
Expand Down
23 changes: 9 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ endif ()
#
# MPI
#
#set(MPI_BASE_DIR "/Users/julie/opt/openmpi/" CACHE PATH "MPI Path")
#set(MPI_BASE_DIR "/Users/julie/opt/mpich2/" CACHE PATH "MPI Path")
set(CMAKE_PREFIX_PATH "${MPI_BASE_DIR};${CMAKE_PREFIX_PATH}")
#set(MPI_COMPILER ${MPI_BASE_DIR}/bin/mpicc)

find_package(MPI)
if (MPI_FOUND)
Expand All @@ -51,8 +48,6 @@ if (MPI_FOUND)
DOC "MPI Fortran compiler.")
MARK_AS_ADVANCED(MPI_Fortran_COMPILER)



if ("${MPI_Fortran_COMPILER}" STREQUAL "MPI_Fortran_COMPILER-NOTFOUND")
message(ERROR "--> MPI Fortran Compiler NOT FOUND (please set MPI_BASE_DIR accordingly")
else()
Expand Down Expand Up @@ -161,18 +156,18 @@ else(LAPACK_FOUND)
message(STATUS "--> LAPACK and BLAS were not found. Reference LAPACK and BLAS will be downloaded and installed")
include(ExternalProject)
ExternalProject_Add(
lapack
URL http://www.netlib.org/lapack/lapack.tgz
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${SCALAPACK_BINARY_DIR}
lapack
URL http://www.netlib.org/lapack/lapack.tgz
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${SCALAPACK_BINARY_DIR}
PREFIX ${SCALAPACK_BINARY_DIR}/dependencies
)
if (UNIX)
if (NOT MSVC)
SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.a CACHE STRING "LAPACK library" FORCE)
SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.a CACHE STRING "BLAS library" FORCE)
else (UNIX) # On Windows
else () # MSVC
SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.lib CACHE STRING "LAPACK library" FORCE)
SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.lib CACHE STRING "BLAS library" FORCE)
endif (UNIX)
endif ()
ENDIF()
ENDIF()

Expand Down Expand Up @@ -234,14 +229,14 @@ add_subdirectory(SRC)
append_subdir_files(src "SRC")
append_subdir_files(src-C "SRC")

if (UNIX)
if (NOT MSVC)
add_library(scalapack ${blacs} ${tools} ${tools-C} ${extra_lapack} ${pblas} ${pblas-F} ${ptzblas} ${ptools} ${pbblas} ${redist} ${src} ${src-C})
set_target_properties(scalapack PROPERTIES
VERSION ${SCALAPACK_VERSION}
SOVERSION ${SCALAPACK_VERSION_MAJOR}.${SCALAPACK_VERSION_MINOR})
target_link_libraries( scalapack ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
scalapack_install_library(scalapack)
else (UNIX) # Need to separate Fortran and C Code
else () # Need to separate Fortran and C Code
OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON )
add_library(scalapack ${blacs} ${tools-C} ${pblas} ${ptools} ${redist} ${src-C})
set_target_properties(scalapack PROPERTIES
Expand All @@ -255,7 +250,7 @@ else (UNIX) # Need to separate Fortran and C Code
target_link_libraries( scalapack-F ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
scalapack_install_library(scalapack)
scalapack_install_library(scalapack-F)
endif (UNIX)
endif ()

if(TARGET lapack)
add_dependencies(scalapack lapack)
Expand Down
224 changes: 0 additions & 224 deletions scalapack_build.cmake

This file was deleted.