Home | History | Annotate | Download | only in blas
      1 
      2 project(EigenBlas CXX)
      3 
      4 include("../cmake/language_support.cmake")
      5 
      6 workaround_9220(Fortran EIGEN_Fortran_COMPILER_WORKS)
      7 
      8 if(EIGEN_Fortran_COMPILER_WORKS)
      9   enable_language(Fortran OPTIONAL)
     10 endif()
     11 
     12 add_custom_target(blas)
     13 
     14 set(EigenBlas_SRCS single.cpp double.cpp complex_single.cpp complex_double.cpp xerbla.cpp)
     15 
     16 if(EIGEN_Fortran_COMPILER_WORKS)
     17 
     18 set(EigenBlas_SRCS ${EigenBlas_SRCS}
     19     complexdots.f
     20     srotm.f srotmg.f drotm.f drotmg.f
     21     lsame.f   chpr2.f  dspmv.f    dtpsv.f ssbmv.f  sspr.f   stpmv.f
     22     zhpr2.f  chbmv.f  chpr.f   ctpmv.f     dspr2.f  sspmv.f    stpsv.f
     23     zhbmv.f  zhpr.f   ztpmv.f chpmv.f   ctpsv.f    dsbmv.f  dspr.f   dtpmv.f   sspr2.f
     24     zhpmv.f    ztpsv.f
     25     dtbmv.f stbmv.f ctbmv.f ztbmv.f
     26 )
     27 else()
     28 
     29 message(WARNING " No fortran compiler has been detected, the blas build will be incomplete.")
     30 
     31 endif()
     32 
     33 add_library(eigen_blas_static ${EigenBlas_SRCS})
     34 add_library(eigen_blas SHARED ${EigenBlas_SRCS})
     35 
     36 if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
     37   target_link_libraries(eigen_blas_static ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
     38   target_link_libraries(eigen_blas        ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
     39 endif()
     40 
     41 add_dependencies(blas eigen_blas eigen_blas_static)
     42 
     43 install(TARGETS eigen_blas eigen_blas_static
     44         RUNTIME DESTINATION bin
     45         LIBRARY DESTINATION lib
     46         ARCHIVE DESTINATION lib)
     47 
     48 if(EIGEN_Fortran_COMPILER_WORKS)
     49 
     50 if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
     51   add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest
     52 else()
     53   add_subdirectory(testing EXCLUDE_FROM_ALL)
     54 endif()
     55 
     56 endif()
     57 
     58