Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
lib4neuro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
MolDyn
lib4neuro
Commits
237c2f9a
Commit
237c2f9a
authored
Aug 08, 2018
by
Martin Beseda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Simplified building system + added automatic Boost detection.
parent
8770eecd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
72 deletions
+32
-72
CMakeLists.txt
CMakeLists.txt
+24
-11
build.sh
build.sh
+4
-61
src/exprtk.cpp
src/exprtk.cpp
+4
-0
No files found.
CMakeLists.txt
View file @
237c2f9a
...
@@ -31,11 +31,6 @@ if(CMAKE_BUILD_TYPE MATCHES DEBUG)
...
@@ -31,11 +31,6 @@ if(CMAKE_BUILD_TYPE MATCHES DEBUG)
set
(
CMAKE_VERBOSE_MAKEFILE ON
)
set
(
CMAKE_VERBOSE_MAKEFILE ON
)
endif
()
endif
()
# Processing user variables
if
(
WITH_TIME_PROFILING
)
add_definitions
(
-DTIME_PROFILING
)
endif
()
# C & CXX compilers
# C & CXX compilers
if
(
WIN32
)
if
(
WIN32
)
set
(
CMAKE_C_COMPILER gcc
)
set
(
CMAKE_C_COMPILER gcc
)
...
@@ -52,6 +47,19 @@ file(APPEND compilers.env "export CC=${CMAKE_C_COMPILER}\n")
...
@@ -52,6 +47,19 @@ file(APPEND compilers.env "export CC=${CMAKE_C_COMPILER}\n")
set
(
SRC_DIR src
)
set
(
SRC_DIR src
)
set
(
PROJECT_BINARY_DIR build
)
set
(
PROJECT_BINARY_DIR build
)
#-------------------------#
# Find external libraries #
#-------------------------#
set
(
Boost_USE_MULTITHREADED ON
)
find_package
(
Boost REQUIRED COMPONENTS serialization random
)
if
(
Boost_FOUND
)
message
(
"Boost INCLUDE DIR:
${
Boost_INCLUDE_DIRS
}
"
)
message
(
"Boost LIB DIR:
${
Boost_LIBRARY_DIRS
}
"
)
include_directories
(
${
Boost_INCLUDE_DIRS
}
)
endif
()
#find_package(exprt) #TODO write FindExprt.cmake script
#--------------------#
#--------------------#
# Building libraries #
# Building libraries #
#--------------------#
#--------------------#
...
@@ -63,9 +71,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin)
...
@@ -63,9 +71,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin)
add_subdirectory
(
${
SRC_DIR
}
${
PROJECT_BINARY_DIR
}
)
add_subdirectory
(
${
SRC_DIR
}
${
PROJECT_BINARY_DIR
}
)
message
(
"Current directory:"
${
PWD
}
)
message
(
"Current directory:"
${
CMAKE_CURRENT_SOURCE_DIR
}
)
message
(
"SRC_DIR: "
${
SRC_DIR
}
)
message
(
"SRC_DIR: "
${
SRC_DIR
}
)
message
(
"BUILD_DIR:"
${
BUILD_DIR
}
)
message
(
"BUILD_DIR:"
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY
}
)
if
(
WIN32
)
if
(
WIN32
)
message
(
"Windows"
)
message
(
"Windows"
)
...
@@ -73,8 +81,13 @@ else ()
...
@@ -73,8 +81,13 @@ else ()
message
(
"Not Windows"
)
message
(
"Not Windows"
)
endif
()
endif
()
#find_package(Boost COMPONENTS unit_test_framework REQUIRED)
#TODO implement to utilize a maximum number of threads for OpenMP
IF
(
Boost_FOUND
)
include
(
ProcessorCount
)
message
(
"Boost DIR: "
${
Boost_INCLUDE_DIR
}
)
ProcessorCount
(
n_cores
)
include_directories
(
${
Boost_INCLUDE_DIR
}
)
if
(
NOT n_cores EQUAL 0
)
message
(
"Build will be performed on
${
n_cores
}
cores."
)
set
(
CTEST_BUILD_FLAGS -j
${
N
}
)
set
(
ENV{N_CORES}
${
N
}
)
set
(
ctest_test_args
${
ctest_test_args
}
PARALLEL_LEVEL
${
N
}
)
endif
()
endif
()
build.sh
View file @
237c2f9a
...
@@ -9,67 +9,10 @@
...
@@ -9,67 +9,10 @@
# FORTRAN_COMPILER=gfortran
# FORTRAN_COMPILER=gfortran
# Build type (Release/Debug)
# Build type (Release/Debug)
BUILD_TYPE
=
Debug
BUILD_TYPE
=
Debug
CXX_COMPILER
=
"g++-8"
# Turn of/off time profiling (1/0)
WITH_TIME_PROFILIN
=
1
CPP_COMPILER
=
g++
#--------------#----------------------------------------------------------
# Library path #
#--------------#
MAKEFILE_TYPE
=
""
LIB_PATH
=
"
$PWD
/build/lib"
#LIB_PATH_WIN="$CD\\build\\lib"
echo
${
LIB_PATH
}
#echo ${LIB_PATH_WIN}
case
`
uname
-s
`
in
Darwin
)
echo
'OS X is not supported yet...'
exit
-1
;;
Linux
)
MAKEFILE_TYPE
=
"Unix Makefiles"
if
[[
${
LD_LIBRARY_PATH
}
!=
*${
LIB_PATH
}*
]]
;
then
export
LD_LIBRARY_PATH
=
${
LD_LIBRARY_PATH
}
:
${
LIB_PATH
}
fi
;;
CYGWIN
*
)
MAKEFILE_TYPE
=
"Unix Makefiles"
# if [[ ${PATH} != *${LIB_PATH_WIN}* ]]; then
# export PATH=${PATH};${LIB_PATH_WIN}
# fi
;;
MINGW
*
)
MAKEFILE_TYPE
=
"MinGW Makefiles"
# if [[ ${PATH} != *${LIB_PATH_WIN}* ]]; then
# export PATH=${PATH};${LIB_PATH_WIN}
# fi
;;
MSYS
*
)
MAKEFILE_TYPE
=
"MSYS Makefiles"
echo
${
MAKEFILE_TYPE
}
# if [[ ${PATH} != *${LIB_PATH_WIN}* ]]; then
# export PATH=${PATH};${LIB_PATH_WIN}
# fi
;;
*
)
echo
"Your makefile generator
`
uname
-s
`
is not yet supported. Please, write an issue to https://code.it4i.cz/moldyn/4Neuro"
exit
-1
;;
esac
#-------------------------------------------------------------------------
rm
-rf
build CMakeCache.txt
;
rm
-rf
build CMakeCache.txt
;
cmake
-G
"
${
MAKEFILE_TYPE
}
"
-DCMAKE_BUILD_TYPE
=
${
BUILD_TYPE
}
-DWITH_TIME_PROFILING
:BOOLEAN
=
${
WITH_TIME_PROFILING
}
.
#cmake -G "${MAKEFILE_TYPE}" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_COMPILER=g++-8 .
make
VERBOSE
=
1
&&
echo
"Build complete."
||
exit
-1
;
cmake
-DCMAKE_BUILD_TYPE
=
${
BUILD_TYPE
}
-DCMAKE_CXX_COMPILER
=
${
CXX_COMPILER
}
.
make
VERBOSE
=
1
-j
${
N_CORES
}
&&
echo
"Build complete."
||
exit
-1
;
#make install;
#make install;
src/exprtk.cpp
0 → 100644
View file @
237c2f9a
//
// Created by martin on 8/8/18.
//
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment