Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lib4neuro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MolDyn
lib4neuro
Commits
f4e171c8
Commit
f4e171c8
authored
6 years ago
by
Martin Beseda
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Trying to fix CI...
parent
b442d55e
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+9
-1
9 additions, 1 deletion
CMakeLists.txt
DownloadOpenBLAS.cmake
+22
-28
22 additions, 28 deletions
DownloadOpenBLAS.cmake
FindArmadillo.cmake
+2
-2
2 additions, 2 deletions
FindArmadillo.cmake
FindOpenBLAS.cmake
+44
-24
44 additions, 24 deletions
FindOpenBLAS.cmake
with
77 additions
and
55 deletions
CMakeLists.txt
+
9
−
1
View file @
f4e171c8
...
...
@@ -172,8 +172,16 @@ find_package(Armadillo)
if
(
NOT ARMADILLO_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD
)
message
(
"Armadillo will be downloaded and compiled locally in 'external_dependencies folder."
)
include
(
DownloadArmadillo
)
endif
()
if
(
NOT LAPACK_FOUND AND NOT BLAS_FOUND
)
target_link_libraries
(
armadillo
PUBLIC
openblas
)
endif
()
endif
()
#---------------------------------------------------#
# Add subdirectory with source codes to be compiled #
...
...
This diff is collapsed.
Click to expand it.
DownloadOpenBLAS.cmake
+
22
−
28
View file @
f4e171c8
...
...
@@ -20,34 +20,28 @@ FetchContent_Populate(OpenBLAS)
##################
# Build OpenBLAS #
##################
cexecute_process
(
COMMAND cmake -j
${
N_CORES
}
.
WORKING_DIRECTORY
${
OPENBLAS_LOCAL_PATH
}
RESULT_VARIABLE rv
)
if
(
NOT rv STREQUAL
"0"
)
message
(
"OpenBLAS build: cmake .:
${
rv
}
"
)
endif
()
set_target_properties
(
openblas PROPERTIES LINK_FLAGS -lpthread -lgfortran
)
# Build library
execute_process
(
COMMAND cmake --build . -j
${
N_CORES
}
--config Release
WORKING_DIRECTORY
${
OPENBLAS_LOCAL_PATH
}
RESULT_VARIABLE rv
)
if
(
NOT rv STREQUAL
"0"
)
message
(
"OpenBLAS build: cmake --build . -j
${
N_CORES
}
:
${
rv
}
"
)
endif
()
# Remove link flags
set
(
CMAKE_EXE_LINKER_FLAGS
${
OLD_CMAKE_EXE_LINKER_FLAGS
}
)
#execute_process(
# COMMAND cmake -j ${N_CORES} .
# WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH}
# RESULT_VARIABLE rv
#)
#if(NOT rv STREQUAL "0")
# message("OpenBLAS build: cmake .: ${rv}")
#endif()
#
## Build library
#execute_process(
# COMMAND cmake --build . -j ${N_CORES} --config Release
# WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH}
# RESULT_VARIABLE rv
#)
#if(NOT rv STREQUAL "0")
# message("OpenBLAS build: cmake --build . -j ${N_CORES}: ${rv}")
#endif()
set
(
OpenBLAS_DIR
${
CMAKE_CURRENT_LIST_DIR
}
/external_dependencies/OpenBLAS
)
find_package
(
OpenBLAS
)
if
(
NOT OpenBLAS_FOUND
)
message
(
FATAL_ERROR
"OpenBLAS was not downloaded successfully!"
)
endif
()
#
#
if(NOT OpenBLAS_FOUND)
#
message(FATAL_ERROR "OpenBLAS was not downloaded successfully!")
#
endif()
This diff is collapsed.
Click to expand it.
FindArmadillo.cmake
+
2
−
2
View file @
f4e171c8
...
...
@@ -51,14 +51,14 @@ else()
${
LIBNAME
}
HINTS
external_dependencies/armadillo
${
ROOT_DIR
}
/
external_dependencies/armadillo
PATHS
/usr
/usr/local
PATH_SUFFIXES
lib
local
)
# Set ARMADILLO_FOUND honoring the QUIET and REQUIRED arguments
...
...
This diff is collapsed.
Click to expand it.
FindOpenBLAS.cmake
+
44
−
24
View file @
f4e171c8
...
...
@@ -19,35 +19,55 @@ FIND_PATH(
include/x86_64-linux-gnu
)
FIND_LIBRARY
(
OpenBLAS_LIBRARIES
#option(LOCAL OFF)
IF
(
${
OpenBLAS_INCLUDE_DIR
}
MATCHES
"^.*external_dependencies.*$"
)
message
(
"OpenBLAS is downloaded locally - the library will be built when needed."
)
set
(
LOCAL ON
)
set
(
TMP
""
)
string
(
REGEX REPLACE
"/include"
""
TMP
${
OpenBLAS_INCLUDE_DIR
}
)
add_subdirectory
(
${
TMP
}
${
TMP
}
)
endif
()
NAMES
${
LIB_PREFIX
}
openblas.
${
LIB_SUFFIX
}
if
(
LOCAL
)
# If OpenBLAS is downloaded locally, the library will be compiled during build-time
INCLUDE
(
FindPackageHandleStandardArgs
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
OpenBLAS
"OpenBLAS was NOT found!"
OpenBLAS_INCLUDE_DIR
)
else
()
HINTS
${
OpenBLAS_LIBRARY_DIRECTORY
}
$ENV{OpenBLAS_LIBRARY_DIRECTORY}
${
ROOT_DIR
}
/external_dependencies/OpenBLAS
/usr
PATH_SUFFIXES
lib
lib/x86_64-linux-gnu
)
FIND_LIBRARY
(
OpenBLAS_LIBRARIES
# Set OpenBLAS_Found
INCLUDE
(
FindPackageHandleStandardArgs
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
OpenBLAS
NAMES
${
LIB_PREFIX
}
openblas.
${
LIB_SUFFIX
}
FAIL_MESSAGE
"OpenBLAS was NOT found!"
HINTS
${
OpenBLAS_LIBRARY_DIRECTORY
}
$ENV{OpenBLAS_LIBRARY_DIRECTORY}
${
ROOT_DIR
}
/external_dependencies/OpenBLAS
/usr
REQUIRED_VARS
OpenBLAS_INCLUDE_DIR
OpenBLAS_LIBRARIES
)
PATH_SUFFIXES
lib
lib/x86_64-linux-gnu
local
)
# Set OpenBLAS_Found
INCLUDE
(
FindPackageHandleStandardArgs
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
OpenBLAS
FAIL_MESSAGE
"OpenBLAS was NOT found!"
REQUIRED_VARS
OpenBLAS_INCLUDE_DIR
OpenBLAS_LIBRARIES
)
endif
()
IF
(
OpenBLAS_FOUND
)
MESSAGE
(
STATUS
"Found OpenBLAS libraries:
${
OpenBLAS_LIBRARIES
}
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment