Skip to content

Update cmake syntax #6

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

Merged
merged 2 commits into from
Jul 11, 2016
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
2 changes: 1 addition & 1 deletion BLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_subdirectory(SRC)
if(BUILD_TESTING)
add_subdirectory(TESTING)
endif(BUILD_TESTING)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/blas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/blas.pc)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/blas.pc
Expand Down
2 changes: 1 addition & 1 deletion BLAS/TESTING/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ macro(add_blas_test name src)
-DINTDIR=${CMAKE_CFG_INTDIR}
-P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
endif()
endmacro(add_blas_test)
endmacro()

if(BUILD_SINGLE)
add_blas_test(xblat1s sblat1.f)
Expand Down
6 changes: 3 additions & 3 deletions CBLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ endforeach()
endmacro()

append_subdir_files(CBLAS_INCLUDE "include")
INSTALL( FILES ${CBLAS_INCLUDE} ${LAPACK_BINARY_DIR}/include/cblas_mangling.h DESTINATION include )
install( FILES ${CBLAS_INCLUDE} ${LAPACK_BINARY_DIR}/include/cblas_mangling.h DESTINATION include )

# --------------------------------------------------
if(BUILD_TESTING)
add_subdirectory(testing)
add_subdirectory(examples)
endif(BUILD_TESTING)
endif()

if(NOT BLAS_FOUND)
set(ALL_TARGETS ${ALL_TARGETS} blas)
endif(NOT BLAS_FOUND)
endif()

# Export cblas targets from the
# install tree, if any.
Expand Down
2 changes: 1 addition & 1 deletion CBLAS/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SET (CBLAS_INCLUDE cblas.h cblas_f77.h cblas_test.h )
set (CBLAS_INCLUDE cblas.h cblas_f77.h cblas_test.h )

file(COPY ${CBLAS_INCLUDE} DESTINATION ${LAPACK_BINARY_DIR}/include)
8 changes: 4 additions & 4 deletions CBLAS/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,22 @@ set(ALLOBJ ${SCLEV1} ${SLEV1} ${SLEV2} ${SLEV3} ${ERRHAND}
# Single real precision
if(CBLAS_SINGLE)
set(ALLOBJ ${SCLEV1} ${SLEV1} ${SLEV2} ${SLEV3} ${ERRHAND})
endif(CBLAS_SINGLE)
endif()

# Double real precision
if(CBLAS_DOUBLE)
set(ALLOBJ ${DLEV1} ${DLEV2} ${DLEV3} ${ERRHAND})
endif(CBLAS_DOUBLE)
endif()

# Single complex precision
if (CBLAS_COMPLEX)
set(ALLOBJ ${CLEV1} ${SCLEV1} ${CLEV2} ${CLEV3} ${ERRHAND})
endif(CBLAS_COMPLEX)
endif()

# Double complex precision
if (CBLAS_COMPLEX16)
set(ALLOBJ ${ZLEV1} ${ZLEV2} ${ZLEV3} ${ERRHAND})
endif(CBLAS_COMPLEX16)
endif()

add_library(cblas ${ALLOBJ})
target_link_libraries(cblas ${BLAS_LIBRARIES} )
Expand Down
28 changes: 14 additions & 14 deletions CBLAS/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,30 @@ macro(add_cblas_test output input target)
-DINTDIR=${CMAKE_CFG_INTDIR}
-P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
endif()
endmacro(add_cblas_test)
endmacro()


# Object files for single real precision
SET( STESTL1O c_sblas1.c)
set( STESTL1O c_sblas1.c)

SET( STESTL2O c_sblas2.c c_s2chke.c auxiliary.c c_xerbla.c)
SET( STESTL2O c_sblas2.c c_s2chke.c auxiliary.c c_xerbla.c)
SET( STESTL3O c_sblas3.c c_s3chke.c auxiliary.c c_xerbla.c)
set( STESTL2O c_sblas2.c c_s2chke.c auxiliary.c c_xerbla.c)
set( STESTL2O c_sblas2.c c_s2chke.c auxiliary.c c_xerbla.c)
set( STESTL3O c_sblas3.c c_s3chke.c auxiliary.c c_xerbla.c)

# Object files for double real precision
SET( DTESTL1O c_dblas1.c)
SET( DTESTL2O c_dblas2.c c_d2chke.c auxiliary.c c_xerbla.c)
SET( DTESTL3O c_dblas3.c c_d3chke.c auxiliary.c c_xerbla.c)
set( DTESTL1O c_dblas1.c)
set( DTESTL2O c_dblas2.c c_d2chke.c auxiliary.c c_xerbla.c)
set( DTESTL3O c_dblas3.c c_d3chke.c auxiliary.c c_xerbla.c)

# Object files for single complex precision
SET( CTESTL1O c_cblat1.f c_cblas1.c)
SET( CTESTL2O c_cblas2.c c_c2chke.c auxiliary.c c_xerbla.c)
SET( CTESTL3O c_cblas3.c c_c3chke.c auxiliary.c c_xerbla.c)
set( CTESTL1O c_cblat1.f c_cblas1.c)
set( CTESTL2O c_cblas2.c c_c2chke.c auxiliary.c c_xerbla.c)
set( CTESTL3O c_cblas3.c c_c3chke.c auxiliary.c c_xerbla.c)

# Object files for double complex precision
SET( ZTESTL1O c_zblas1.c)
SET( ZTESTL2O c_zblas2.c c_z2chke.c auxiliary.c c_xerbla.c)
SET( ZTESTL3O c_zblas3.c c_z3chke.c auxiliary.c c_xerbla.c)
set( ZTESTL1O c_zblas1.c)
set( ZTESTL2O c_zblas2.c c_z2chke.c auxiliary.c c_xerbla.c)
set( ZTESTL3O c_zblas3.c c_z3chke.c auxiliary.c c_xerbla.c)



Expand Down
6 changes: 3 additions & 3 deletions CMAKE/CheckTimeFunction.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ macro(CHECK_TIME_FUNCTION FUNCTION VARIABLE)
message(STATUS "Looking for Fortran ${FUNCTION} - found")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Fortran ${FUNCTION} exists. ${OUTPUT} \n\n")
else(RES)
else()
message(STATUS "Looking for Fortran ${FUNCTION} - not found")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Fortran ${FUNCTION} does not exist. \n ${OUTPUT} \n")
endif(RES)
endmacro(CHECK_TIME_FUNCTION)
endif()
endmacro()


68 changes: 34 additions & 34 deletions CMAKE/FortranMangling.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@
# UpCase
#
macro(FORTRAN_MANGLING CDEFS)
MESSAGE(STATUS "=========")
GET_FILENAME_COMPONENT(F77_NAME ${CMAKE_Fortran_COMPILER} NAME)
GET_FILENAME_COMPONENT(F77_PATH ${CMAKE_Fortran_COMPILER} PATH)
SET(F77 ${F77_NAME} CACHE INTERNAL "Name of the fortran compiler.")
message(STATUS "=========")
get_filename_component(F77_NAME ${CMAKE_Fortran_COMPILER} NAME)
get_filename_component(F77_PATH ${CMAKE_Fortran_COMPILER} PATH)
set(F77 ${F77_NAME} CACHE INTERNAL "Name of the fortran compiler.")

IF(${F77} STREQUAL "ifort.exe")
if(${F77} STREQUAL "ifort.exe")
#settings for Intel Fortran
SET(F77_OPTION_COMPILE "/c" CACHE INTERNAL
set(F77_OPTION_COMPILE "/c" CACHE INTERNAL
"Fortran compiler option for compiling without linking.")
SET(F77_OUTPUT_OBJ "/Fo" CACHE INTERNAL
set(F77_OUTPUT_OBJ "/Fo" CACHE INTERNAL
"Fortran compiler option for setting object file name.")
SET(F77_OUTPUT_EXE "/Fe" CACHE INTERNAL
set(F77_OUTPUT_EXE "/Fe" CACHE INTERNAL
"Fortran compiler option for setting executable file name.")
ELSE(${F77} STREQUAL "ifort.exe")
else()
# in other case, let user specify their fortran configrations.
SET(F77_OPTION_COMPILE "-c" CACHE STRING
set(F77_OPTION_COMPILE "-c" CACHE STRING
"Fortran compiler option for compiling without linking.")
SET(F77_OUTPUT_OBJ "-o" CACHE STRING
set(F77_OUTPUT_OBJ "-o" CACHE STRING
"Fortran compiler option for setting object file name.")
SET(F77_OUTPUT_EXE "-o" CACHE STRING
set(F77_OUTPUT_EXE "-o" CACHE STRING
"Fortran compiler option for setting executable file name.")
SET(F77_LIB_PATH "" CACHE PATH
set(F77_LIB_PATH "" CACHE PATH
"Library path for the fortran compiler")
SET(F77_INCLUDE_PATH "" CACHE PATH
set(F77_INCLUDE_PATH "" CACHE PATH
"Include path for the fortran compiler")
ENDIF(${F77} STREQUAL "ifort.exe")
endif()


MESSAGE(STATUS "Testing FORTRAN_MANGLING")
message(STATUS "Testing FORTRAN_MANGLING")

MESSAGE(STATUS "Compiling Finface.f...")
message(STATUS "Compiling Finface.f...")

execute_process ( COMMAND ${CMAKE_Fortran_COMPILER} ${F77_OPTION_COMPILE} ${PROJECT_SOURCE_DIR}/lapacke/mangling/Fintface.f
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
Expand All @@ -49,13 +49,13 @@ MESSAGE(STATUS "Compiling Finface.f...")
ERROR_VARIABLE ERROR)

if(RESULT EQUAL 0)
MESSAGE(STATUS "Compiling Finface.f successful")
message(STATUS "Compiling Finface.f successful")
else()
MESSAGE(FATAL_ERROR " Compiling Finface.f FAILED")
MESSAGE(FATAL_ERROR " Error:\n ${ERROR}")
message(FATAL_ERROR " Compiling Finface.f FAILED")
message(FATAL_ERROR " Error:\n ${ERROR}")
endif()

MESSAGE(STATUS "Compiling Cintface.c...")
message(STATUS "Compiling Cintface.c...")

execute_process ( COMMAND ${CMAKE_C_COMPILER} ${F77_OPTION_COMPILE} ${PROJECT_SOURCE_DIR}/lapacke/mangling/Cintface.c
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
Expand All @@ -64,13 +64,13 @@ MESSAGE(STATUS "Compiling Cintface.c...")
ERROR_VARIABLE ERROR)

if(RESULT EQUAL 0)
MESSAGE(STATUS "Compiling Cintface.c successful")
message(STATUS "Compiling Cintface.c successful")
else()
MESSAGE(FATAL_ERROR " Compiling Cintface.c FAILED")
MESSAGE(FATAL_ERROR " Error:\n ${ERROR}")
message(FATAL_ERROR " Compiling Cintface.c FAILED")
message(FATAL_ERROR " Error:\n ${ERROR}")
endif()

MESSAGE(STATUS "Linking Finface.f and Cintface.c...")
message(STATUS "Linking Finface.f and Cintface.c...")

execute_process ( COMMAND ${CMAKE_Fortran_COMPILER} ${F77_OUTPUT_OBJ} xintface.exe Fintface.o Cintface.o
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
Expand All @@ -79,13 +79,13 @@ MESSAGE(STATUS "Linking Finface.f and Cintface.c...")
ERROR_VARIABLE ERROR)

if(RESULT EQUAL 0)
MESSAGE(STATUS "Linking Finface.f and Cintface.c successful")
message(STATUS "Linking Finface.f and Cintface.c successful")
else()
MESSAGE(FATAL_ERROR " Linking Finface.f and Cintface.c FAILED")
MESSAGE(FATAL_ERROR " Error:\n ${ERROR}")
message(FATAL_ERROR " Linking Finface.f and Cintface.c FAILED")
message(FATAL_ERROR " Error:\n ${ERROR}")
endif()

MESSAGE(STATUS "Running ./xintface...")
message(STATUS "Running ./xintface...")

execute_process ( COMMAND ./xintface.exe
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
Expand All @@ -95,11 +95,11 @@ MESSAGE(STATUS "Running ./xintface...")


if (xintface_RES EQUAL 0)
STRING(REPLACE "\n" "" xintface_OUT "${xintface_OUT}")
MESSAGE(STATUS "Fortran MANGLING convention: ${xintface_OUT}")
SET(CDEFS ${xintface_OUT})
string(REPLACE "\n" "" xintface_OUT "${xintface_OUT}")
message(STATUS "Fortran MANGLING convention: ${xintface_OUT}")
set(CDEFS ${xintface_OUT})
else()
MESSAGE(FATAL_ERROR "FORTRAN_MANGLING:ERROR ${xintface_ERR}")
message(FATAL_ERROR "FORTRAN_MANGLING:ERROR ${xintface_ERR}")
endif()

endmacro(FORTRAN_MANGLING)
endmacro()
Loading