mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-15 11:45:47 +00:00
Fixes compilation of Armadillo in Ubuntu 12.04 by switching back to version 3.9 if gcc <=4.6 is detected.
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@478 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
4edd485cd0
commit
ad01074657
@ -540,8 +540,62 @@ if(NOT ARMADILLO_FOUND)
|
|||||||
message (STATUS " Armadillo has not been found.")
|
message (STATUS " Armadillo has not been found.")
|
||||||
message (STATUS " Armadillo will be downloaded and built automatically ")
|
message (STATUS " Armadillo will be downloaded and built automatically ")
|
||||||
message (STATUS " when doing 'make'. ")
|
message (STATUS " when doing 'make'. ")
|
||||||
set(armadillo_RELEASE 4.000.0)
|
# Check if the patch command is available (does not come by default on Fedora or openSUSE)
|
||||||
set(armadillo_MD5 "3110e2030ebf61ac61ba0d0423816790")
|
find_program(PATCH_EXECUTABLE NAME patch PATHS ENV PATH)
|
||||||
|
if(NOT PATCH_EXECUTABLE)
|
||||||
|
message(" The patch command has not been found.")
|
||||||
|
message(" You can try to install it by typing:")
|
||||||
|
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||||
|
message(" sudo yum install patch")
|
||||||
|
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
|
||||||
|
message(" sudo zypper install patch")
|
||||||
|
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||||
|
message(" sudo apt-get install patch")
|
||||||
|
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||||
|
message(FATAL_ERROR "The patch command is required to download and build armadillo")
|
||||||
|
endif(NOT PATCH_EXECUTABLE)
|
||||||
|
set(OLD_GCC false)
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
||||||
|
if(GCC_VERSION VERSION_EQUAL 4.6 OR GCC_VERSION VERSION_LESS 4.6)
|
||||||
|
set(OLD_GCC true)
|
||||||
|
endif(GCC_VERSION VERSION_EQUAL 4.6 OR GCC_VERSION VERSION_LESS 4.6)
|
||||||
|
endif(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
|
||||||
|
if(OLD_GCC)
|
||||||
|
set(armadillo_RELEASE 3.920.2)
|
||||||
|
set(armadillo_MD5 "3d0396513e2802c08152f50e18b4a1cd")
|
||||||
|
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}/armadillo-${armadillo_RELEASE}.tar.gz)
|
||||||
|
set(ARMADILLO_PATCH_FILE ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}/armadillo_no.patch)
|
||||||
|
file(WRITE ${ARMADILLO_PATCH_FILE} "")
|
||||||
|
else(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}/armadillo-${armadillo_RELEASE}.tar.gz)
|
||||||
|
set(ARMADILLO_PATCH_FILE ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}/armadillo_staticlib.patch)
|
||||||
|
file(WRITE ${ARMADILLO_PATCH_FILE}
|
||||||
|
"35c35
|
||||||
|
< set(ARMA_USE_WRAPPER true )
|
||||||
|
---
|
||||||
|
> set(ARMA_USE_WRAPPER false)
|
||||||
|
323c323
|
||||||
|
< add_library( armadillo SHARED src/wrap_libs )
|
||||||
|
---
|
||||||
|
> add_library( armadillo STATIC src/wrap_libs )
|
||||||
|
")
|
||||||
|
endif(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}/armadillo-${armadillo_RELEASE}.tar.gz)
|
||||||
|
ExternalProject_Add(
|
||||||
|
armadillo-${armadillo_RELEASE}
|
||||||
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
|
||||||
|
URL http://sourceforge.net/projects/arma/files/armadillo-${armadillo_RELEASE}.tar.gz
|
||||||
|
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}
|
||||||
|
URL_MD5 ${armadillo_MD5}
|
||||||
|
PATCH_COMMAND patch -N <BINARY_DIR>/CMakeLists.txt ${ARMADILLO_PATCH_FILE}
|
||||||
|
BUILD_IN_SOURCE 1
|
||||||
|
BUILD_COMMAND make
|
||||||
|
UPDATE_COMMAND ""
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
)
|
||||||
|
else(OLD_GCC)
|
||||||
|
set(armadillo_RELEASE 4.000.2)
|
||||||
|
set(armadillo_MD5 "b2891c7b59b96337c154c5d961fd40fb")
|
||||||
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}/armadillo-${armadillo_RELEASE}.tar.gz)
|
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}/armadillo-${armadillo_RELEASE}.tar.gz)
|
||||||
set(ARMADILLO_PATCH_FILE ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}/armadillo_no.patch)
|
set(ARMADILLO_PATCH_FILE ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}/armadillo_no.patch)
|
||||||
file(WRITE ${ARMADILLO_PATCH_FILE} "")
|
file(WRITE ${ARMADILLO_PATCH_FILE} "")
|
||||||
@ -570,22 +624,7 @@ if(NOT ARMADILLO_FOUND)
|
|||||||
---
|
---
|
||||||
> #define ARMA_USE_LAPACK
|
> #define ARMA_USE_LAPACK
|
||||||
")
|
")
|
||||||
|
|
||||||
endif(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}/armadillo-${armadillo_RELEASE}.tar.gz)
|
endif(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}/armadillo-${armadillo_RELEASE}.tar.gz)
|
||||||
# Check if the patch command is available (does not come by default on Fedora or openSUSE)
|
|
||||||
find_program(PATCH_EXECUTABLE NAME patch PATHS ENV PATH)
|
|
||||||
if(NOT PATCH_EXECUTABLE)
|
|
||||||
message(" The patch command has not been found.")
|
|
||||||
message(" You can try to install it by typing:")
|
|
||||||
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
|
||||||
message(" sudo yum install patch")
|
|
||||||
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
|
|
||||||
message(" sudo zypper install patch")
|
|
||||||
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
|
||||||
message(" sudo apt-get install patch")
|
|
||||||
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
|
||||||
message(FATAL_ERROR "The patch command is required to download and build armadillo")
|
|
||||||
endif(NOT PATCH_EXECUTABLE)
|
|
||||||
ExternalProject_Add(
|
ExternalProject_Add(
|
||||||
armadillo-${armadillo_RELEASE}
|
armadillo-${armadillo_RELEASE}
|
||||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
|
||||||
@ -598,6 +637,7 @@ if(NOT ARMADILLO_FOUND)
|
|||||||
UPDATE_COMMAND ""
|
UPDATE_COMMAND ""
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
)
|
)
|
||||||
|
endif(OLD_GCC)
|
||||||
# Set up variables
|
# Set up variables
|
||||||
ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir)
|
ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir)
|
||||||
set(ARMADILLO_INCLUDE_DIRS ${binary_dir}/include )
|
set(ARMADILLO_INCLUDE_DIRS ${binary_dir}/include )
|
||||||
|
Loading…
Reference in New Issue
Block a user