summaryrefslogtreecommitdiff
path: root/volk
diff options
context:
space:
mode:
Diffstat (limited to 'volk')
-rw-r--r--volk/CMakeLists.txt11
-rw-r--r--volk/apps/CMakeLists.txt7
-rw-r--r--volk/gen/archs.xml1
-rw-r--r--volk/gen/volk_register.py2
-rw-r--r--volk/lib/CMakeLists.txt31
-rw-r--r--volk/lib/volk_prefs.c2
6 files changed, 45 insertions, 9 deletions
diff --git a/volk/CMakeLists.txt b/volk/CMakeLists.txt
index 22c09b3f8..743f07925 100644
--- a/volk/CMakeLists.txt
+++ b/volk/CMakeLists.txt
@@ -30,6 +30,9 @@ ENABLE_TESTING()
SET(VERSION 0.1)
SET(LIBVER 0.0.0)
+SET(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) #allows this to be a sub-project
+SET(CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) #allows this to be a sub-project
+
########################################################################
# Dependencies setup
########################################################################
@@ -55,6 +58,7 @@ CONFIGURE_FILE(
INSTALL(
FILES ${CMAKE_CURRENT_BINARY_DIR}/volk.pc
DESTINATION lib${LIB_SUFFIX}/pkgconfig
+ COMPONENT "volk_devel"
)
########################################################################
@@ -62,7 +66,8 @@ INSTALL(
########################################################################
INSTALL(
DIRECTORY ${CMAKE_SOURCE_DIR}/include/volk
- DESTINATION include FILES_MATCHING PATTERN "*.h"
+ DESTINATION include COMPONENT "volk_devel"
+ FILES_MATCHING PATTERN "*.h"
)
INSTALL(FILES
@@ -70,7 +75,9 @@ INSTALL(FILES
${CMAKE_BINARY_DIR}/include/volk/volk_cpu.h
${CMAKE_BINARY_DIR}/include/volk/volk_config_fixed.h
${CMAKE_BINARY_DIR}/include/volk/volk_typedefs.h
-DESTINATION include/volk)
+ DESTINATION include/volk
+ COMPONENT "volk_devel"
+)
########################################################################
# Setup the library
diff --git a/volk/apps/CMakeLists.txt b/volk/apps/CMakeLists.txt
index a0bf7e900..b0b48360f 100644
--- a/volk/apps/CMakeLists.txt
+++ b/volk/apps/CMakeLists.txt
@@ -18,6 +18,10 @@
########################################################################
# Setup profiler
########################################################################
+FIND_PACKAGE(Boost)
+
+IF(Boost_FOUND AND UNIX) #uses mkdir and $HOME
+
IF(MSVC)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/msvc)
ENDIF(MSVC)
@@ -28,6 +32,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/lib
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
+ ${Boost_INCLUDE_DIRS}
)
ADD_EXECUTABLE(volk_profile
@@ -36,3 +41,5 @@ ADD_EXECUTABLE(volk_profile
)
TARGET_LINK_LIBRARIES(volk_profile volk ${Boost_LIBRARIES})
+
+ENDIF(Boost_FOUND AND UNIX)
diff --git a/volk/gen/archs.xml b/volk/gen/archs.xml
index f6822871f..960558b7c 100644
--- a/volk/gen/archs.xml
+++ b/volk/gen/archs.xml
@@ -29,6 +29,7 @@
<val>1</val>
<overrule>MD_SUBCPU</overrule>
<overrule_val>x86</overrule_val>
+ <mutex>32</mutex>
</arch>
<arch name="3dnow" type="x86">
diff --git a/volk/gen/volk_register.py b/volk/gen/volk_register.py
index 75e5eeb87..f5854bbce 100644
--- a/volk/gen/volk_register.py
+++ b/volk/gen/volk_register.py
@@ -91,7 +91,7 @@ for arch in archs:
if a_var:
archs.remove(arch);
-
+#strip out mutex archs
archflags_dict = {}
for filearch in filearchs:
diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt
index 33a478265..c8b9449a6 100644
--- a/volk/lib/CMakeLists.txt
+++ b/volk/lib/CMakeLists.txt
@@ -27,6 +27,14 @@ EXECUTE_PROCESS(
OUTPUT_VARIABLE arch_lines OUTPUT_STRIP_TRAILING_WHITESPACE
)
+#get any mutually exclusive archs so we can exclude them
+#this is really for compilers which can do both 32- and 64-bit compilations.
+EXECUTE_PROCESS(
+ COMMAND ${PYTHON_EXECUTABLE} -c
+ "from xml.dom import minidom; print ';'.join(map(lambda a: '%s %s'%(a.parentNode.attributes['name'].value,a.firstChild.data),minidom.parse('${CMAKE_SOURCE_DIR}/gen/archs.xml').getElementsByTagName('mutex')))"
+ OUTPUT_VARIABLE mutex_lines OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
#This macro sets the ${arch}_flag variable,
#and handles special cases for MSVC arch flags.
MACRO(set_arch_flag name flag)
@@ -59,12 +67,25 @@ MACRO(handle_arch name flag)
ENDIF()
ENDMACRO(handle_arch)
+MACRO(remove_mutex name mutex)
+ IF(have_${name})
+ UNSET(have_${mutex})
+ ENDIF()
+ LIST(REMOVE_ITEM available_arches ${mutex})
+ENDMACRO(remove_mutex)
+
#create a list of available arches
FOREACH(arch_line ${arch_lines})
SEPARATE_ARGUMENTS(args UNIX_COMMAND "${arch_line}")
handle_arch(${args})
ENDFOREACH(arch_line)
+#strip out mutex archs
+FOREACH(mutex_line ${mutex_lines})
+ SEPARATE_ARGUMENTS(args UNIX_COMMAND "${mutex_line}")
+ remove_mutex(${args})
+ENDFOREACH(mutex_line)
+
MESSAGE(STATUS "Available arches: ${available_arches}")
########################################################################
@@ -160,7 +181,7 @@ ADD_CUSTOM_COMMAND(
########################################################################
FIND_PACKAGE(PkgConfig)
IF(PKG_CONFIG_FOUND)
-PKG_CHECK_MODULES(ORC "orc-0.4")
+PKG_CHECK_MODULES(ORC "orc-0.4 > 0.4.11")
ENDIF(PKG_CONFIG_FOUND)
FIND_PROGRAM(ORCC_EXECUTABLE orcc)
@@ -231,9 +252,9 @@ SET_TARGET_PROPERTIES(volk PROPERTIES SOVERSION ${LIBVER})
SET_TARGET_PROPERTIES(volk PROPERTIES DEFINE_SYMBOL "volk_EXPORTS")
INSTALL(TARGETS volk
- LIBRARY DESTINATION lib${LIB_SUFFIX} # .so file
- ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
- RUNTIME DESTINATION bin # .dll file
+ LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_runtime" # .so file
+ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_devel" # .lib file
+ RUNTIME DESTINATION bin COMPONENT "volk_runtime" # .dll file
)
########################################################################
@@ -256,6 +277,6 @@ ADD_EXECUTABLE(test_all
${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc
)
TARGET_LINK_LIBRARIES(test_all volk ${Boost_LIBRARIES})
-ADD_TEST(qa_volk_test_all test_all)
+#ADD_TEST(qa_volk_test_all test_all)
ENDIF()
diff --git a/volk/lib/volk_prefs.c b/volk/lib/volk_prefs.c
index 9743c51d9..b29d5fd87 100644
--- a/volk/lib/volk_prefs.c
+++ b/volk/lib/volk_prefs.c
@@ -23,7 +23,7 @@ int load_preferences(struct volk_arch_pref **prefs) {
//get the config path
get_config_path(path);
config_file = fopen(path, "r");
- if(!config_file) return; //no prefs found
+ if(!config_file) return n_arch_prefs; //no prefs found
while(fgets(line, 512, config_file) != NULL) {
if(sscanf(line, "%s %s", function, arch) == 2 && !strncmp(function, "volk_", 5)) {