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
82a539db
Commit
82a539db
authored
6 years ago
by
Martin Beseda
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Fixed bad parallel flag for cmake --build
parent
a358f696
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-12
1 addition, 12 deletions
CMakeLists.txt
DownloadOpenBLAS.cmake
+3
-3
3 additions, 3 deletions
DownloadOpenBLAS.cmake
build_scripts/windows/win_VS_build_x64_debug.bat
+1
-1
1 addition, 1 deletion
build_scripts/windows/win_VS_build_x64_debug.bat
with
5 additions
and
16 deletions
CMakeLists.txt
+
1
−
12
View file @
82a539db
...
...
@@ -7,16 +7,6 @@ message("Using CMake ${CMAKE_VERSION}")
#TODO use 'option' instead of 'set' for boolean variables!
#-------------------------------------#
# Set a flag for parallel compilation #
#-------------------------------------#
set
(
ENV{PARALLEL_BUILD_FLAG}
"-j"
)
set
(
PARALLEL_BUILD_FLAG $ENV{PARALLEL_BUILD_FLAG}
)
if
(
WIN32
)
set
(
ENV{PARALLEL_BUILD_FLAG}
"/MP"
)
set
(
PARALLEL_BUILD_FLAG $ENV{PARALLEL_BUILD_FLAG}
)
endif
()
#------------------------------------------#
# Detect maximum available number of cores #
# and set corresponding build options #
...
...
@@ -26,7 +16,7 @@ include(ProcessorCount)
ProcessorCount
(
N_CORES
)
if
(
N_CORES GREATER 1
)
math
(
EXPR N_CORES
"
${
N_CORES
}
-1"
)
set
(
CTEST_BUILD_FLAGS
${
PARALLEL_BUILD_FLAG
}
${
N_CORES
}
)
set
(
CTEST_BUILD_FLAGS
-j
${
N_CORES
}
)
set
(
ENV{N_CORES}
${
N_CORES
}
)
set
(
ctest_test_args
${
ctest_test_args
}
PARALLEL_LEVEL
${
N_CORES
}
)
endif
()
...
...
@@ -37,7 +27,6 @@ message("Build will be performed on ${N_CORES} cores.")
if
(
WIN32
)
add_compile_options
(
"/D BOOST_ALL_NO_LIB"
)
add_compile_options
(
"/D NOMINMAX"
)
add_compile_options
(
"
${
PARALLEL_BUILD_FLAG
}
${
N_CORES
}
"
)
else
()
add_compile_options
(
"-DBOOST_TEST_DYN_LINK"
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
DownloadOpenBLAS.cmake
+
3
−
3
View file @
82a539db
...
...
@@ -21,7 +21,7 @@ FetchContent_Populate(OpenBLAS)
# Build OpenBLAS #
##################
execute_process
(
COMMAND cmake
${
PARALLEL_BUILD_FLAG
}
${
N_CORES
}
.
COMMAND cmake
-j
${
N_CORES
}
.
WORKING_DIRECTORY
${
OPENBLAS_LOCAL_PATH
}
RESULT_VARIABLE rv
)
...
...
@@ -34,12 +34,12 @@ set_target_properties(openblas PROPERTIES LINK_FLAGS "-lgfortran -lpthreads")
# Build library
execute_process
(
COMMAND cmake --build .
${
PARALLEL_BUILD_FLAG
}
${
N_CORES
}
--config Release
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 .
${
PARALLEL_BUILD_FLAG
}
${
N_CORES
}
:
${
rv
}
"
)
message
(
"OpenBLAS build: cmake --build .
-j
${
N_CORES
}
:
${
rv
}
"
)
endif
()
set
(
OpenBLAS_DIR
${
CMAKE_CURRENT_LIST_DIR
}
/external_dependencies/OpenBLAS
)
...
...
This diff is collapsed.
Click to expand it.
build_scripts/windows/win_VS_build_x64_debug.bat
+
1
−
1
View file @
82a539db
...
...
@@ -108,7 +108,7 @@ IF "%BUILD_SOMETHING_LIB%"=="yes" (
cmake
-G
"Visual Studio 15 2017 Win64"
-DCMAKE
_VERBOSE_MAKEFILE:BOOL
=
ON
-DCMAKE
_BUILD_TYPE
=
Debug
-DCMAKE
_CXX_COMPILER
=
%CXX_COMPILER%
-DCMAKE
_C_COMPILER
=
%C_COMPILER%
-DBOOST
_ROOT
=
%BOOST_ROOT%
-DBOOST
_LIBRARYDIR
=
%BOOST_LIBRARYDIR%
-DBOOST
_INCLUDEDIR
=
%BOOST_INCLUDEDIR%
-DBUILD
_TESTS
=
%BUILD_TESTS%
-DBUILD
_EXAMPLES
=
%BUILD_EXAMPLES%
-DBUILD
_LIB
=
%BUILD_LIB%
-DLIB
4
NEURO_DIR
=
build
\lib
-DDEPENDENCIES
_LINK_TYPE
=
%LINK_TYPE%
-DLIB
4
NEURO_INCLUDE_DIR
=
%LIB4
NEURO_INCLUDE_DIR
%
.
||
goto
error_occured_lib
rem cmake -G "mingw32-make" -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=%CXX_COMPILER% -DCMAKE_C_COMPILER=%C_COMPILER% -DBOOST_ROOT=%BOOST_ROOT% -DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% -DBOOST_INCLUDEDIR=%BOOST_INCLUDEDIR% -DBUILD_TESTS=%BUILD_TESTS% -DBUILD_EXAMPLES=%BUILD_EXAMPLES% -DBUILD_LIB=%BUILD_LIB% -DLIB4NEURO_DIR=build\lib -DDEPENDENCIES_LINK_TYPE=%LINK_TYPE% -DLIB4NEURO_INCLUDE_DIR=%LIB4NEURO_INCLUDE_DIR% . || goto error_occured_lib
title
Building
the
'lib4neuro'
project
for
Debug
[
building
]
cmake
--build
.
$
{
PARALLEL_BUILD_FLAG
}
$
{
N_CORES
}
--config
Debug
&&
echo
"Build complete."
||
goto
error_occured_lib
cmake
--build
.
-j
$
{
N_CORES
}
--config
Debug
&&
echo
"Build complete."
||
goto
error_occured_lib
cd
build_scripts
\windows
)
...
...
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