Skip to content

Commit

Permalink
Fixes #7 - parallel CMake build
Browse files Browse the repository at this point in the history
Identical file names in multiple directories were causing file
overwrites during parallel CMake build.  Fixed this by splitting the
build into two subdirectories.
  • Loading branch information
eheien committed Apr 22, 2014
1 parent db86c68 commit e9f73ba
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 60 deletions.
60 changes: 0 additions & 60 deletions CMakeLists.txt

This file was deleted.

14 changes: 14 additions & 0 deletions MESHER/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# Define the mesher executable
FILE(GLOB MESHER_SRCS "${AXISEM_SOURCE_DIR}/MESHER/*.f90" "${AXISEM_SOURCE_DIR}/MESHER/*.F90")
ADD_EXECUTABLE(xmesh ${MESHER_SRCS})

# Set compile/link flags for the mesher
SET(MESHER_COMPILER_FLAGS "${MESHER_COMPILER_FLAGS} ${OpenMP_Fortran_FLAGS}")
IF(NETCDF_FOUND)
SET(MESHER_COMPILER_FLAGS "${MESHER_COMPILER_FLAGS} -Dunc")
TARGET_LINK_LIBRARIES(xmesh ${NETCDF_LIBRARIES})
ENDIF(NETCDF_FOUND)
SET_TARGET_PROPERTIES(xmesh PROPERTIES LINK_FLAGS ${OpenMP_Fortran_FLAGS})
SET_TARGET_PROPERTIES(xmesh PROPERTIES COMPILE_FLAGS ${MESHER_COMPILER_FLAGS})

18 changes: 18 additions & 0 deletions SOLVER/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Define the axisem executable
FILE(GLOB SOLVER_SRCS "${AXISEM_SOURCE_DIR}/SOLVER/*.f90" "${AXISEM_SOURCE_DIR}/SOLVER/*.F90" "${AXISEM_SOURCE_DIR}/SOLVER/*.c")
ADD_EXECUTABLE(axisem ${SOLVER_SRCS})

# Set compile/link flags for axisem
SET(SOLVER_COMPILER_FLAGS "${SOLVER_COMPILER_FLAGS} -Dsolver")
SET(SOLVER_COMPILER_FLAGS "${SOLVER_COMPILER_FLAGS} ${OpenMP_Fortran_FLAGS}")
IF(NOT MPI_Fortran_FOUND)
SET(SOLVER_COMPILER_FLAGS "${SOLVER_COMPILER_FLAGS} -Dserial")
ENDIF(NOT MPI_Fortran_FOUND)
TARGET_LINK_LIBRARIES(axisem ${MPI_Fortran_LIBRARIES})
IF(NETCDF_FOUND)
SET(SOLVER_COMPILER_FLAGS "${SOLVER_COMPILER_FLAGS} -Dunc")
TARGET_LINK_LIBRARIES(axisem ${NETCDF_LIBRARIES})
ENDIF(NETCDF_FOUND)
SET_TARGET_PROPERTIES(axisem PROPERTIES COMPILE_FLAGS ${SOLVER_COMPILER_FLAGS})
SET_TARGET_PROPERTIES(axisem PROPERTIES LINK_FLAGS ${OpenMP_Fortran_FLAGS})

3 comments on commit e9f73ba

@QuLogic
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the top-level CMakeLists.txt still exist though?

@eheien
Copy link
Contributor Author

@eheien eheien commented on e9f73ba Apr 22, 2014

Choose a reason for hiding this comment

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

Yes, it got removed somehow but it's back in with the next commit.

@QuLogic
Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, it's annoying GitHub shows parents, but not children in the diff view here. But I see it now, and it seems to work, too.

Please sign in to comment.