Skip to content
Snippets Groups Projects
Verified Commit 83b8d1a0 authored by baptiste.coudray's avatar baptiste.coudray
Browse files

Fixed compilation

parent f1eccfac
No related branches found
No related tags found
No related merge requests found
......@@ -2,11 +2,13 @@ all: release debug
release:
mkdir -p "cmake-build-release"
touch gol.h gol.c
cmake -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release
$(MAKE) -C cmake-build-release all
debug:
mkdir -p "cmake-build-debug"
touch gol.h gol.c
cmake -DCMAKE_BUILD_TYPE=Debug -Bcmake-build-debug
$(MAKE) -C cmake-build-release all
......
......@@ -15,7 +15,7 @@ include_directories(${MPI_C_INCLUDE_PATH})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCC_COMPILE_FLAGS}")
add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/lbm.h ${CMAKE_CURRENT_SOURCE_DIR}/lbm.c
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/lbm_seq.h ${CMAKE_CURRENT_SOURCE_DIR}/lbm_seq.c
COMMAND futhark c ${CMAKE_CURRENT_SOURCE_DIR}/lbm.fut --library
DEPENDS lbm.fut
)
......@@ -43,13 +43,33 @@ add_custom_command(
add_custom_target(futhark_lbm_multicore DEPENDS lbm_mc.h lbm_mc.c)
########## Lattice-Boltzmann ##########
## Sequential
add_executable(lattice_boltzmann_seq main.c lbm.h lbm.c ../futhark_mpi/dispatch.h ../futhark_mpi/dispatch.c ../futhark_mpi/chunk_info.c ../futhark_mpi/chunk_info.h)
add_dependencies(lattice_boltzmann_seq futhark_lbm_seq)
target_link_libraries(lattice_boltzmann_seq m ${MPI_C_LIBRARIES})
## CUDA
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_executable(lattice_boltzmann_cuda main.c lbm.h lbm.c ../futhark_mpi/dispatch.h ../futhark_mpi/dispatch.c ../futhark_mpi/chunk_info.c ../futhark_mpi/chunk_info.h)
add_dependencies(lattice_boltzmann_cuda futhark_lbm_cuda)
target_link_libraries(lattice_boltzmann_cuda cuda cudart nvrtc m ${MPI_C_LIBRARIES})
endif ()
## OpenCL
add_executable(lattice_boltzmann_opencl main.c lbm.h lbm.c ../futhark_mpi/dispatch.h ../futhark_mpi/dispatch.c ../futhark_mpi/chunk_info.c ../futhark_mpi/chunk_info.h)
add_dependencies(lattice_boltzmann_opencl futhark_lbm_opencl)
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
target_link_libraries(lattice_boltzmann_opencl "-framework OpenCL" SDL2 ${MPI_C_LIBRARIES})
target_link_libraries(lattice_boltzmann_opencl "-framework OpenCL" m ${MPI_C_LIBRARIES})
endif ()
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(lattice_boltzmann_opencl OpenCL SDL2 m ${MPI_C_LIBRARIES})
target_link_libraries(lattice_boltzmann_opencl OpenCL m ${MPI_C_LIBRARIES})
endif ()
## Multicore
add_executable(lattice_boltzmann_mc main.c lbm.h lbm.c ../futhark_mpi/dispatch.h ../futhark_mpi/dispatch.c ../futhark_mpi/chunk_info.c ../futhark_mpi/chunk_info.h)
add_dependencies(lattice_boltzmann_mc futhark_lbm_multicore)
target_link_libraries(lattice_boltzmann_mc pthread m ${MPI_C_LIBRARIES})
all: release debug
release:
mkdir -p "cmake-build-release"
touch lbm.h lbm.c
cmake -DCMAKE_BUILD_TYPE=Release -Bcmake-build-release
$(MAKE) -C cmake-build-release all
debug:
mkdir -p "cmake-build-debug"
touch lbm.h lbm.c
cmake -DCMAKE_BUILD_TYPE=Debug -Bcmake-build-debug
$(MAKE) -C cmake-build-release all
clean:
$(MAKE) -C cmake-build-release clean
$(MAKE) -C cmake-build-release clean
.PHONY: release debug clean
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment