Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
325592a
Added conan dependency resolving for zmq
erikzenker Sep 22, 2016
fcc9b9e
Conan travis integration
erikzenker Sep 26, 2016
1f43439
Pip upgrade
erikzenker Sep 26, 2016
a99bda9
pip install into home directory
erikzenker Sep 26, 2016
0555fdf
pip install into home directory
erikzenker Sep 26, 2016
0062359
remove -r option of pip
erikzenker Sep 26, 2016
a93ad1b
Added metis and boost dependency
erikzenker Sep 30, 2016
8ca4687
* Set required option for graybat cmake deps
erikzenker Oct 5, 2016
0410287
update matrix env setting
erikzenker Oct 5, 2016
7df97e5
update travis if/else construction
erikzenker Oct 5, 2016
918a461
matrix build testing
erikzenker Oct 5, 2016
2dfbc16
matrix build testing - #2
erikzenker Oct 5, 2016
c6b902c
matrix build testing - #3
erikzenker Oct 5, 2016
7d119b0
matrix build testing - #4
erikzenker Oct 5, 2016
0309d90
matrix build testing - #5
erikzenker Oct 5, 2016
10813ca
matrix build testing - #6
erikzenker Oct 5, 2016
c8b46d3
matrix build testing - #6
erikzenker Oct 5, 2016
6142a51
matrix build testing - #7
erikzenker Oct 5, 2016
ac091e9
Add cmake to all travis install targets
erikzenker Oct 5, 2016
9b5c0c3
Boost does not yet build from conan with mpi, thus, leave it open for…
erikzenker Oct 5, 2016
2a5f367
Boost does not yet build from conan with mpi, thus, leave it open for…
erikzenker Oct 5, 2016
4035070
Boost does not yet build from conan with mpi, thus, leave it open for…
erikzenker Oct 5, 2016
a3b317b
conan compiler configuration
erikzenker Oct 5, 2016
eb31e19
try to set cmake compiler id correctly
erikzenker Oct 5, 2016
2819070
debug print cmake compiler id
erikzenker Oct 5, 2016
1f191b1
dirty workaround to set compiler id manually
erikzenker Oct 5, 2016
c13bc04
Fix zmq module include and library path
erikzenker Oct 6, 2016
947b3df
Fix zmq module include and library path - #2
erikzenker Oct 6, 2016
870f3f1
Generate shared object from conan zmq
erikzenker Oct 6, 2016
4fd37fb
Add boost on conanfile
erikzenker Nov 17, 2016
46927fb
WIP
erikzenker Nov 18, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 67 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ env:
- BOOST_MIN: 106100 # careful: hard coded below
- GRAYBAT_ROOT: $TRAVIS_BUILD_DIR
- OMP_NUM_THREADS: 4 # ignored in thread layer
- COMPILER: gcc
matrix:
- COMPILER=gcc STRATEGY=""
#- COMPILER=clang STRATEGY=""
- RESOLVE_DEPS_BY: manual
- RESOLVE_DEPS_BY: conan

before_install:
- mkdir -p $HOME/build

#- export CMAKE_FLAGS="-DALPAKA_ACC_"$STRATEGY"_ENABLE=ON"
- export CMAKE_FLAGS="-DCMAKE_CXX_FLAGS=\"-Werror\""
- if [ "$COMPILER" == "gcc" ]; then
echo "Using g++-6";
Expand Down Expand Up @@ -67,17 +67,16 @@ install:
mv -f cmake-3.3.2-Linux-x86_64/* . &&
rm -rf cmake-3.3.2-Linux-x86_64.tar.gz cmake-3.3.2-Linux-x86_64 &&
cd -;
fi
- cmake --version
fi
- cmake --version;
#############################################################################
# BOOST #
#############################################################################
- export CMAKE_PREFIX_PATH=$BOOST_ROOT:$CMAKE_PREFIX_PATH
# cmake --find-package -DNAME=Boost -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST
- export CMAKE_PREFIX_PATH=$BOOST_ROOT:$CMAKE_PREFIX_PATH;
- echo -e "#include <boost/version.hpp>\n#include <iostream>\nint main() { std::cout << BOOST_VERSION << std::endl; return 0; }"
| $CXX -I$BOOST_ROOT/include -x c++ - >/dev/null || { echo 0; }
| $CXX -I$BOOST_ROOT/include -x c++ - >/dev/null || { echo 0; }
- ls $BOOST_ROOT
- BOOST_FOUND=$([ $(./a.out) -ge $BOOST_MIN ] && { echo 0; } || { echo 1; })
- BOOST_FOUND=$([ $(./a.out) -ge $BOOST_MIN ] && { echo 0; } || { echo 1; });
- if [ $BOOST_FOUND -ne 0 ]; then
mkdir -p $BOOST_ROOT &&
cd $BOOST_ROOT &&
Expand All @@ -91,34 +90,72 @@ install:
./b2 install &&
rm -rf boost.tar.bz2 boost_1_61_0 &&
cd $HOME;
fi;


#############################################################################
# Resolve missing dependencies
#############################################################################
- if [ "$RESOLVE_DEPS_BY" == "manual" ]; then
echo "Resolve library dependencies manually.";
elif [ "$RESOLVE_DEPS_BY" == "conan" ]; then
pip install --upgrade pip --user;
pip install conan --user;
fi


#############################################################################
# ZMQ #
#############################################################################
- export CMAKE_PREFIX_PATH=$ZMQ_ROOT:$CMAKE_PREFIX_PATH
- echo $CMAKE_PREFIX_PATH
- ls $ZMQ_ROOT
- if [ ! "$(ls -A $ZMQ_ROOT)" ]; then
cd /tmp/ &&
travis_retry git clone https://github.com/zeromq/libzmq.git&&
travis_retry git clone https://github.com/zeromq/cppzmq.git;
cd /tmp/libzmq/ &&
./autogen.sh &&
mkdir -p $ZMQ_ROOT &&
./configure --prefix=$ZMQ_ROOT &&
make &&
make install &&
cp /tmp/cppzmq/zmq.hpp $ZMQ_ROOT/include/ &&
cp /tmp/cppzmq/zmq_addon.hpp $ZMQ_ROOT/include/;
else
echo "ZeroMQ directory already exists";
fi
# export CMAKE_PREFIX_PATH=$ZMQ_ROOT:$CMAKE_PREFIX_PATH;
# echo $CMAKE_PREFIX_PATH;
# ls $ZMQ_ROOT;
# if [ ! "$(ls -A $ZMQ_ROOT)" ]; then
# cd /tmp/ &&
# travis_retry git clone https://github.com/zeromq/libzmq.git&&
# travis_retry git clone https://github.com/zeromq/cppzmq.git;
# cd /tmp/libzmq/ &&
# ./autogen.sh &&
# mkdir -p $ZMQ_ROOT &&
# ./configure --prefix=$ZMQ_ROOT &&
# make &&
# make install &&
# cp /tmp/cppzmq/zmq.hpp $ZMQ_ROOT/include/ &&
# cp /tmp/cppzmq/zmq_addon.hpp $ZMQ_ROOT/include/;
# else
# echo "ZeroMQ directory already exists";
# fi;
#
#elif [ "$RESOLVE_DEPS_BY" = "conan" ]; then
# else
# echo "Resolve library dependencies using conan.";

# fi
# TODO Metis

script:
- cd $HOME/build
- cmake $CMAKE_FLAGS $GRAYBAT_ROOT
- if [ "$RESOLVE_DEPS_BY" == "manual" ]; then
echo "Build with manually installed dependencies.";
elif [ "$RESOLVE_DEPS_BY" == "conan" ]; then
echo "Build with conan installed dependencies.";
cd $HOME/build;
conan install $GRAYBAT_ROOT --build=missing -s compiler=gcc -s compiler.version=6.2 -s compiler.libcxx=libstdc++;
fi
- cmake $CMAKE_FLAGS -DCONAN_DISABLE_CHECK_COMPILER=TRUE $GRAYBAT_ROOT
- make check
- make gbZMQSignaling
- ./gbZMQSignaling&
- ./bin/gbZMQSignaling&
- ctest --output-on-failure
- killall gbZMQSignaling

#- if ["$RESOLVE_DEPS_BY" = "manual"]; then
# cd $HOME/build;
# cmake $CMAKE_FLAGS $GRAYBAT_ROOT;
# make check
# elif ["$RESOLVE_DEPS_BY" = "conan"]; then
# cd $HOME/build;
# conan install $GRAYBAT_ROOT --build=missing;
# cmake $CMAKE_FLAGS $GRAYBAT_ROOT;
# make check
# fi

30 changes: 25 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,31 @@ if(${benchmark_FOUND})
set(LIBS ${LIBS} ${benchmark_LIBRARIES})
endif(${benchmark_FOUND})

###############################################################################
# Conan
# - Resolves dependencies of ZMQ
###############################################################################

if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup()
message("${CMAKE_INCLUDE_PATH}")
message("${CMAKE_LIBRARY_PATH}")
endif()

###############################################################################
# Boost
###############################################################################
find_package(Boost 1.58.0 COMPONENTS unit_test_framework program_options REQUIRED)
find_package(Boost 1.56.0 COMPONENTS unit_test_framework program_options REQUIRED)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
set(LIBS ${LIBS} ${Boost_LIBRARIES})

###############################################################################
# Elegant Progressbars for a More Cililized Age
###############################################################################
#set(elegant-progressbars_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/elegant-progressbars/cmake")
#find_package(elegant-progressbars 1.0.0 REQUIRED CONFIG)

###############################################################################
# Graybat
###############################################################################
Expand All @@ -60,6 +78,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-parameter")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif()

Expand All @@ -84,6 +103,7 @@ endif()
###############################################################################
# Targets
###############################################################################
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# Benchmark
file(GLOB BENCHMARKS test/benchmark/*.cpp)
Expand Down Expand Up @@ -120,9 +140,9 @@ target_link_libraries(gbZMQSignaling ${LIBS})
enable_testing()
add_test(graybat_check_build "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target check)
add_test(graybat_example_build "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target example)
add_test(graybat_test_run mpiexec -n 2 check )
add_test(graybat_gol_run mpiexec gol 90 4 )
add_test(graybat_pr_run mpiexec pagerank )
add_test(graybat_test_run mpiexec -n 2 bin/check )
add_test(graybat_gol_run mpiexec bin/gol 90 4 )
add_test(graybat_pr_run mpiexec bin/pagerank )
set_tests_properties(graybat_test_run PROPERTIES DEPENDS graybat_check_build)
set_tests_properties(graybat_gol_run PROPERTIES DEPENDS graybat_example_build)
set_tests_properties(graybat_pr_run PROPERTIES DEPENDS graybat_example_build)
Expand Down Expand Up @@ -166,4 +186,4 @@ foreach(P ${_SOURCES_PRE})
set(_SOURCES ${_SOURCES} ${P})
endif()
endforeach()
ADD_LIBRARY(CLION_DUMMY_TARGET EXCLUDE_FROM_ALL ${_SOURCES})
ADD_LIBRARY(CLION_DUMMY_TARGET EXCLUDE_FROM_ALL ${_SOURCES})
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ The project is organized in a couple of subdirectories.
* zeromq 4.1.3 (zeromq communication policy)
* metis 5.1 (graph partitioning mapping)

**Note** that some graybat dependencies can be resolved using [conan](https://www.conan.io/) automatically. Have a look into the [conan documentation](http://docs.conan.io/en/latest/getting_started.html) for more details on that.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add the conan code below this paragraph to resolve all dependencies :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some or all dependencies?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to investigate if I could use local dependencies when they are available and just get the missing ones.


##Roadmap##
* [Dynamic context](https://github.com/ComputationalRadiationPhysics/graybat/milestones/Dynamic%20Context)
Expand Down Expand Up @@ -111,7 +112,6 @@ The following is a an example of how to embed graybat into your `CMakeLists.txt`

Finally, the application can use graybat e.g. `#include <graybat/Cage.hpp>`.


##Compiling Tests/Examples##

* Clone the repository: `git clone https://github.com/computationalradiationphysics/graybat.git`
Expand Down
12 changes: 12 additions & 0 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[requires]
zmqcpp/4.1.1@memsharded/stable
ZMQ/4.1.1@memsharded/stable
Metis/5.1.0.p1@erikzenker/testing
Boost/1.62.0.beta.1@erikzenker/testing

[generators]
cmake

[options]
ZMQ:shared=True
Boost:shared=True
26 changes: 22 additions & 4 deletions graybatConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# graybat
###############################################################################
cmake_minimum_required(VERSION 3.3.0)
project("graybat")
project("graybat" CXX)

set(graybat_INCLUDE_DIRS ${graybat_INCLUDE_DIRS} "${graybat_DIR}/include")

Expand All @@ -43,41 +43,59 @@ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
###############################################################################
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${graybat_DIR}/include/graybat/utils/cmake/modules/" )


###############################################################################
# DEPENDENCIES
###############################################################################

###############################################################################
# Conan
# - Resolves dependencies of ZMQ
###############################################################################

if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup()
message("${CMAKE_INCLUDE_PATH}")
message("${CMAKE_LIBRARY_PATH}")
endif()


###############################################################################
# METIS LIB
###############################################################################
find_package(METIS MODULE 5.1.0)
set(graybat_INCLUDE_DIRS ${graybat_INCLUDE_DIRS} ${METIS_INCLUDE_DIRS})
set(graybat_LIBRARIES ${graybat_LIBRARIES} ${METIS_LIBRARIES})


###############################################################################
# ZMQ LIB
###############################################################################
find_package(ZMQ MODULE 4.0.0)
find_package(ZMQ MODULE 4.0.0 REQUIRED)
set(graybat_INCLUDE_DIRS ${graybat_INCLUDE_DIRS} ${ZMQ_INCLUDE_DIRS})
set(graybat_LIBRARIES ${graybat_LIBRARIES} ${ZMQ_LIBRARIES})


###############################################################################
# Boost LIB
###############################################################################
find_package(Boost 1.56.0 MODULE COMPONENTS mpi serialization REQUIRED)
set(graybat_INCLUDE_DIRS ${graybat_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
set(graybat_LIBRARIES ${graybat_LIBRARIES} ${Boost_LIBRARIES})


################################################################################
# MPI LIB
################################################################################
find_package(MPI MODULE)
find_package(MPI MODULE REQUIRED)
set(graybat_INCLUDE_DIRS ${graybat_INCLUDE_DIRS} ${MPI_C_INCLUDE_PATH})
set(graybat_LIBRARIES ${graybat_LIBRARIES} ${MPI_C_LIBRARIES})
set(graybat_LIBRARIES ${graybat_LIBRARIES} ${MPI_CXX_LIBRARIES})


################################################################################
# Find PThreads
################################################################################
find_package(Threads MODULE)
find_package(Threads MODULE REQUIRED)
set(graybat_LIBRARIES ${graybat_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
3 changes: 2 additions & 1 deletion include/graybat/utils/cmake/modules/FindZMQ.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ else (ZMQ_LIBRARIES AND ZMQ_INCLUDE_DIRS)
/usr/local/include
/opt/local/include
/sw/include
HINTS "${CMAKE_PREFIX_PATH}/include"
HINTS "${CMAKE_PREFIX_PATH}/include" "${CMAKE_INCLUDE_PATH}"

)

Expand All @@ -38,6 +38,7 @@ else (ZMQ_LIBRARIES AND ZMQ_INCLUDE_DIRS)
/usr/local/lib
/opt/local/lib
/sw/lib
HINTS "${CMAKE_LIBRARY_PATH}"
)

set(ZMQ_INCLUDE_DIRS
Expand Down
11 changes: 6 additions & 5 deletions test/integration/CageUT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
* If not, see <http://www.gnu.org/licenses/>.
*/

// BOOST
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/hana/tuple.hpp>
#include <boost/hana/append.hpp>

// STL
#include <array>
#include <vector>
Expand All @@ -26,11 +32,6 @@
#include <cstdlib> /* std::getenv */
#include <string> /* std::string, std::stoi */

// BOOST
#include <boost/test/unit_test.hpp>
#include <boost/hana/tuple.hpp>
#include <boost/hana/append.hpp>

// GRAYBAT
#include <graybat/Cage.hpp>
#include <graybat/communicationPolicy/BMPI.hpp>
Expand Down
1 change: 1 addition & 0 deletions test/integration/CommunicationPolicyUT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

// BOOST
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/hana/tuple.hpp>

Expand Down
1 change: 1 addition & 0 deletions test/integration/EdgeUT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

// BOOST
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/hana/tuple.hpp>

Expand Down
2 changes: 1 addition & 1 deletion test/integration/UT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
* If not, see <http://www.gnu.org/licenses/>.
*/

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE "GrayBat Unit Tests"
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
1 change: 1 addition & 0 deletions test/integration/VertexUT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

// BOOST
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/hana/tuple.hpp>

Expand Down