CMakeLists.txt 4.55 KB
Newer Older
incardon's avatar
incardon committed
1
2
3
4
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)

########################### Executables

incardon's avatar
incardon committed
5
6
7
8
9
10
11
12
13
add_executable(io main.cpp 
				  MetaParser/MetaParser_unit_test.cpp 
				  HDF5_wr/HDF5_writer_cuda.cu 
				  ObjReader/ObjReader_unit_test.cpp  
				  ../../openfpm_vcluster/src/VCluster/VCluster.cpp 
				  ../../openfpm_devices/src/memory/CudaMemory.cu 
				  ../../openfpm_devices/src/memory/HeapMemory.cpp 
				  ../../openfpm_devices/src/Memleak_check.cpp 
				  ../../openfpm_devices/src/memory/PtrMemory.cpp)
incardon's avatar
incardon committed
14

incardon's avatar
incardon committed
15
if ( CMAKE_COMPILER_IS_GNUCC )
incardon's avatar
incardon committed
16
    target_compile_options(io PRIVATE "-Wno-deprecated-declarations")
incardon's avatar
incardon committed
17
18
19
    if (TEST_COVERAGE)
        target_compile_options(io PRIVATE $<$<COMPILE_LANGUAGE:CXX>: -fprofile-arcs -ftest-coverage>)
    endif()
incardon's avatar
incardon committed
20
endif()
incardon's avatar
incardon committed
21
22
23

###########################

incardon's avatar
incardon committed
24
if (CUDA_FOUND)
incardon's avatar
incardon committed
25
	target_compile_options(io PUBLIC $<$<COMPILE_LANGUAGE:CUDA>: ${WARNING_SUPPRESSION_AND_OPTION_NVCC} >)
26
	target_include_directories (io PUBLIC ${MPI_C_INCLUDE_DIRS})
incardon's avatar
incardon committed
27
28
29
30
31

   	if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 )
        	add_compile_options( "-fabi-version=6" )
    	endif()

incardon's avatar
incardon committed
32
33
34
        if (TEST_COVERAGE)
                target_compile_options(io PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: -Xcompiler "-fprofile-arcs -ftest-coverage">)
        endif()
incardon's avatar
incardon committed
35
endif()
incardon's avatar
incardon committed
36
37
38
39
40
41
42
43
44
45

target_include_directories (io PUBLIC ${CUDA_INCLUDE_DIRS})
target_include_directories (io PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories (io PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_devices/src/)
target_include_directories (io PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_vcluster/src/)
target_include_directories (io PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../openfpm_data/src/)
target_include_directories (io PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../src/)
target_include_directories (io PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
target_include_directories (io PUBLIC ${HDF5_ROOT}/include)
target_include_directories (io PUBLIC ${TINYOBJLOADER_INCLUDE_DIRS} )
incardon's avatar
incardon committed
46
target_include_directories (io PUBLIC ${Boost_INCLUDE_DIRS})
incardon's avatar
incardon committed
47
target_include_directories (io PUBLIC ${OPENFPM_PDATA_DIR}/src)
incardon's avatar
incardon committed
48

incardon's avatar
incardon committed
49
50
51
52
if (PETSC_FOUND)
	target_include_directories(io PUBLIC ${PETSC_INCLUDES})
endif()

incardon's avatar
incardon committed
53
target_link_libraries(io ${Boost_LIBRARIES})
incardon's avatar
incardon committed
54
target_link_libraries(io ${HDF5_LIBRARIES})
incardon's avatar
incardon committed
55
target_link_libraries(io ${TINYOBJLOADER_LIBRARIES} )
incardon's avatar
incardon committed
56
57
58
if (PETSC_FOUND)
	target_link_libraries(io ${PETSC_LIBRARIES})
endif()
incardon's avatar
incardon committed
59
60
61
62
63
64
65

# Request that particles be built with -std=c++11
# As this is a public compile feature anything that links to particles
# will also build with -std=c++11
target_compile_features(io PUBLIC cxx_std_11)
target_link_libraries(io ${MPI_C_LIBRARIES})

incardon's avatar
incardon committed
66
67
68
69
if (TEST_COVERAGE)
    target_link_libraries(io -lgcov)
endif()

incardon's avatar
incardon committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
install(FILES RawReader/RawReader.hpp 
	      RawReader/RawReader_unit_tests.hpp 
	      DESTINATION openfpm_io/include/RawReader )

install(FILES CSVWriter/csv_multiarray.hpp 
	      CSVWriter/CSVWriter.hpp 
	      CSVWriter/is_csv_writable.hpp
	      DESTINATION openfpm_io/include/CSVWriter/ )
      
install(FILES GraphMLWriter/GraphMLWriter.hpp 
	DESTINATION openfpm_io/include/GraphMLWriter )

install(FILES util/util.hpp util/GBoxes.hpp
	DESTINATION openfpm_io/include/util )

install(FILES VTKWriter/VTKWriter.hpp 
	      VTKWriter/byteswap_portable.hpp 
	      VTKWriter/VTKWriter_dist_graph.hpp 
	      VTKWriter/VTKWriter_graph.hpp 
	      VTKWriter/VTKWriter_point_set.hpp  
	      VTKWriter/VTKWriter_grids.hpp 
	      VTKWriter/VTKWriter_grids_st.hpp 
	      VTKWriter/VTKWriter_grids_util.hpp 
	      VTKWriter/VTKWriter_vector_box.hpp 
	      VTKWriter/is_vtk_writable.hpp
	DESTINATION openfpm_io/include/VTKWriter/ )

97
98
99
install(FILES MetaParser/MetaParser.hpp
	DESTINATION openfpm_io/include/MetaParser/ )

incardon's avatar
incardon committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
install(FILES HDF5_wr/HDF5_wr.hpp
	HDF5_wr/HDF5_writer.hpp 
	HDF5_wr/HDF5_writer_vd.hpp 
	HDF5_wr/HDF5_writer_gd.hpp 
	HDF5_wr/HDF5_reader_gd.hpp  
	HDF5_wr/HDF5_reader.hpp 
	HDF5_wr/HDF5_reader_vd.hpp
	DESTINATION openfpm_io/include/HDF5_wr)

install(FILES Plot/GoogleChart.hpp Plot/util.hpp
	DESTINATION openfpm_io/include/Plot )


#if(BUILD_TESTING)

#  add_executable(particle_test test.cu)

#  set_target_properties(particle_test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
#  target_link_libraries(particle_test PRIVATE particles)

#  add_test(NAME particles_10k COMMAND particle_test 10000 )
#  add_test(NAME particles_256k COMMAND particle_test 256000 )

#  if(APPLE)
    # We need to add the default path to the driver (libcuda.dylib) as an rpath,
    # so that the static cuda runtime can find it at runtime.
    #    set_property(TARGET particle_test PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
    #  endif()
    #endif()