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
7826f8f5
Commit
7826f8f5
authored
6 years ago
by
Martin Beseda
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Trying to fix CI...
parent
f4e171c8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+11
-9
11 additions, 9 deletions
CMakeLists.txt
DownloadOpenBLAS.cmake
+26
-23
26 additions, 23 deletions
DownloadOpenBLAS.cmake
FindOpenBLAS.cmake
+17
-15
17 additions, 15 deletions
FindOpenBLAS.cmake
with
54 additions
and
47 deletions
CMakeLists.txt
+
11
−
9
View file @
7826f8f5
...
@@ -156,13 +156,15 @@ endif()
...
@@ -156,13 +156,15 @@ endif()
message
(
"Checking Armadillo dependencies"
)
message
(
"Checking Armadillo dependencies"
)
find_package
(
LAPACK
)
find_package
(
LAPACK
)
find_package
(
BLAS
)
find_package
(
BLAS
)
set
(
ARMA_LIBS
""
)
set
(
ARMA_LIBS
""
)
if
(
NOT LAPACK_FOUND AND NOT BLAS_FOUND
)
if
(
NOT LAPACK_FOUND AND NOT BLAS_FOUND
)
find_package
(
OpenBLAS
)
find_package
(
OpenBLAS
)
if
(
NOT OpenBLAS_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD
)
if
(
NOT OpenBLAS_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD
)
# Download and build OpenBLAS locally
# Download and build OpenBLAS locally
message
(
"LAPACK nor BLAS were found - OpenBLAS will be downloaded and built."
)
message
(
"
Nor
LAPACK nor BLAS were found - OpenBLAS will be downloaded and built."
)
include
(
DownloadOpenBLAS
)
include
(
DownloadOpenBLAS
)
find_package
(
OpenBLAS
)
endif
()
endif
()
endif
()
endif
()
set
(
ARMA_LIBS
"
${
OpenBLAS_LIBRARIES
}
"
)
set
(
ARMA_LIBS
"
${
OpenBLAS_LIBRARIES
}
"
)
...
@@ -173,14 +175,14 @@ if(NOT ARMADILLO_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD)
...
@@ -173,14 +175,14 @@ if(NOT ARMADILLO_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD)
message
(
"Armadillo will be downloaded and compiled locally in 'external_dependencies folder."
)
message
(
"Armadillo will be downloaded and compiled locally in 'external_dependencies folder."
)
include
(
DownloadArmadillo
)
include
(
DownloadArmadillo
)
if
(
NOT LAPACK_FOUND AND NOT BLAS_FOUND
)
#
if(NOT LAPACK_FOUND AND NOT BLAS_FOUND)
target_link_libraries
(
#
target_link_libraries(
armadillo
#
armadillo
#
PUBLIC
#
PUBLIC
openblas
#
openblas
)
#
)
endif
()
#
endif()
endif
()
endif
()
#---------------------------------------------------#
#---------------------------------------------------#
...
...
This diff is collapsed.
Click to expand it.
DownloadOpenBLAS.cmake
+
26
−
23
View file @
7826f8f5
...
@@ -15,33 +15,36 @@ FetchContent_Declare(
...
@@ -15,33 +15,36 @@ FetchContent_Declare(
set
(
FETCHCONTENT_QUIET FALSE
)
set
(
FETCHCONTENT_QUIET FALSE
)
FetchContent_Populate
(
OpenBLAS
)
if
(
NOT OpenBLAS_POPULATED
)
FetchContent_Populate
(
OpenBLAS
)
#add_subdirectory(${OPENBLAS_LOCAL_PATH} ${OPENBLAS_LOCAL_PATH}/build)
endif
()
##################
##################
# Build OpenBLAS #
# Build OpenBLAS #
##################
##################
#
execute_process(
execute_process
(
#
COMMAND cmake -j ${N_CORES} .
COMMAND cmake -j
${
N_CORES
}
.
#
WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH}
WORKING_DIRECTORY
${
OPENBLAS_LOCAL_PATH
}
#
RESULT_VARIABLE rv
RESULT_VARIABLE rv
#
)
)
#
if(NOT rv STREQUAL "0")
if
(
NOT rv STREQUAL
"0"
)
#
message("OpenBLAS build: cmake .: ${rv}")
message
(
"OpenBLAS build: cmake .:
${
rv
}
"
)
#
endif()
endif
()
#
#
# Build library
# Build library
#
execute_process(
execute_process
(
#
COMMAND cmake --build . -j ${N_CORES} --config Release
COMMAND cmake --build . -j
${
N_CORES
}
--config Release
#
WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH}
WORKING_DIRECTORY
${
OPENBLAS_LOCAL_PATH
}
#
RESULT_VARIABLE rv
RESULT_VARIABLE rv
#
)
)
#
if(NOT rv STREQUAL "0")
if
(
NOT rv STREQUAL
"0"
)
#
message("OpenBLAS build: cmake --build
. -j ${N_CORES}
: ${rv}")
message
(
"OpenBLAS build: cmake --build:
${
rv
}
"
)
#
endif()
endif
()
find_package
(
OpenBLAS
)
find_package
(
OpenBLAS
)
#
#
if(NOT OpenBLAS_FOUND)
if
(
NOT OpenBLAS_FOUND
)
#
message(FATAL_ERROR "OpenBLAS was not downloaded successfully!")
message
(
FATAL_ERROR
"OpenBLAS was not downloaded successfully!"
)
#
endif()
endif
()
This diff is collapsed.
Click to expand it.
FindOpenBLAS.cmake
+
17
−
15
View file @
7826f8f5
...
@@ -19,22 +19,18 @@ FIND_PATH(
...
@@ -19,22 +19,18 @@ FIND_PATH(
include/x86_64-linux-gnu
include/x86_64-linux-gnu
)
)
#option(LOCAL OFF)
IF
(
${
OpenBLAS_INCLUDE_DIR
}
MATCHES
"^.*external_dependencies.*$"
)
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
()
if
(
LOCAL
)
# If OpenBLAS is downloaded locally, the library will be compiled during build-time
# If OpenBLAS is downloaded locally, the library will be compiled during build-time
INCLUDE
(
FindPackageHandleStandardArgs
)
INCLUDE
(
FindPackageHandleStandardArgs
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
OpenBLAS
OpenBLAS
"OpenBLAS was NOT found!"
"OpenBLAS was NOT found!"
OpenBLAS_INCLUDE_DIR
)
OpenBLAS_INCLUDE_DIR
)
if
(
OpenBLAS_FOUND
)
message
(
STATUS
"OpenBLAS is downloaded locally:
${
OpenBLAS_INCLUDE_DIR
}
"
)
endif
()
else
()
else
()
FIND_LIBRARY
(
FIND_LIBRARY
(
...
@@ -67,11 +63,17 @@ else()
...
@@ -67,11 +63,17 @@ else()
OpenBLAS_INCLUDE_DIR
OpenBLAS_INCLUDE_DIR
OpenBLAS_LIBRARIES
OpenBLAS_LIBRARIES
)
)
if
(
OpenBLAS_FOUND
)
MESSAGE
(
STATUS
"Found OpenBLAS libraries:
${
OpenBLAS_LIBRARIES
}
"
)
MESSAGE
(
STATUS
"Found OpenBLAS include:
${
OpenBLAS_INCLUDE_DIR
}
"
)
endif
()
endif
()
endif
()
IF
(
OpenBLAS_
FOUND
)
#
IF (OpenBLAS_
LIBRARIES
)
MESSAGE
(
STATUS
"Found OpenBLAS libraries:
${
OpenBLAS_LIBRARIES
}
"
)
##
MESSAGE(STATUS "Found OpenBLAS libraries: ${OpenBLAS_LIBRARIES}")
MESSAGE
(
STATUS
"Found OpenBLAS include:
${
OpenBLAS_INCLUDE_DIR
}
"
)
#
MESSAGE(STATUS "Found OpenBLAS include: ${OpenBLAS_INCLUDE_DIR}")
ELSE
()
#
ELSE()
MESSAGE
(
"Could not find OpenBLAS"
)
#
MESSAGE("Could not find OpenBLAS")
ENDIF
()
#
ENDIF()
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