Commit 7cef7922 authored by kraus's avatar kraus

moving Classic into src directory and pack all objects into libOpal since...

moving Classic into src directory and pack all objects into libOpal since Classic also depends on libOpal
parent cde86960
......@@ -140,16 +140,16 @@ ENDIF (USE_H5HUT2)
IF (ENABLE_AMR_SOLVER)
ENABLE_LANGUAGE (Fortran)
SET ( CCSE_DIR $ENV{BOXLIB_PREFIX} )
SET ( CCSE_LIBRARY_DIR $ENV{BOXLIB_LIBRARY_DIR} )
FIND_PACKAGE (CCSE REQUIRED)
MESSAGE (STATUS "Found BoxLib include dir: ${CCSE_INCLUDE_DIR}")
MESSAGE (STATUS "Found BoxLib library dir: ${CCSE_LIBRARY_DIR}")
MESSAGE (STATUS "Found BoxLib perl dir: ${CCSE_PERL_DIR}")
SET (BL_SPACEDIM 3 CACHE INT "Dimension of BoxLib build")
SET (ENABLE_MPI 1 CACHE INT "Enable build with MPI")
SET (ENABLE_OpenMP 0 CACHE INT "Enable build with OpenMP")
......@@ -158,10 +158,10 @@ IF (ENABLE_AMR_SOLVER)
SET (BL_DEBUG 0 CACHE INT "Include debugging information in BoxLib build")
SET (ENABLE_PROFILING 0 CACHE INT "Include profiling information in BoxLib build")
SET (ENABLE_BACKTRACE 0 CACHE INT "Include backtrace information in BoxLib build")
# FIXME disable due to BoxLib
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable -Wno-maybe-uninitialized")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBL_PRECISION=${BL_PRECISION}")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_MPI=${ENABLE_MPI}")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_OpenMP=${ENABLE_OpenMP}")
......@@ -169,7 +169,7 @@ IF (ENABLE_AMR_SOLVER)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBL_DEBUG=${BL_DEBUG}")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_BACKTRACE=${ENABLE_BACKTRACE}")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_PROFILING=${ENABLE_PROFILING}")
MESSAGE (STATUS "Use following BoxLib settings:")
MESSAGE (STATUS " BL_SPACEDIM = ${BL_SPACEDIM}")
MESSAGE (STATUS " BL_MACHINE = ${BL_MACHINE}")
......@@ -263,7 +263,6 @@ ENDIF()
SET (IPPL_USED_FROM_OPAL "TRUE")
ADD_SUBDIRECTORY (ippl)
ADD_SUBDIRECTORY (classic/src)
ADD_SUBDIRECTORY (src)
IF (BUILD_OPAL_UNIT_TESTS)
......@@ -274,7 +273,7 @@ ENDIF (BUILD_OPAL_UNIT_TESTS)
set(OPAL_CXX_FLAGS ${OPAL_CXX_FLAGS}
CACHE INTERNAL "" FORCE
)
set(OPAL_LIBS ${OPAL_LIBS}
CACHE INTERNAL "" FORCE
)
)
\ No newline at end of file
cmake_minimum_required (VERSION 2.6)
project (CLASSIC)
set (CLASSIC_VERSION_MAJOR 5)
set (CLASSIC_VERSION_MINOR 1.4)
set (PACKAGE \"classic\")
set (PACKAGE_BUGREPORT \"andreas.adelmann@psi.ch\")
set (PACKAGE_NAME \"classic\")
set (PACKAGE_TARNAME \"classic\")
set (PACKAGE_VERSION \"5.1.4\")
configure_file(config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
configure_file(revision.h.in ${CMAKE_CURRENT_SOURCE_DIR}/revision.h)
#FIXME: get from Makefile.def (IPPL)
set (CMAKE_CXX_FLAGS
"-DUSE_H5FED -DPARALLEL_IO ${IPPL_CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS}"
)
set (CLASSIC_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
macro (add_cl_sources)
file (RELATIVE_PATH _relPath "${CLASSIC_SRC_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
foreach (_src ${ARGN})
if (_relPath)
list (APPEND CLASSIC_SRCS "${_relPath}/${_src}")
else()
list (APPEND CLASSIC_SRCS "${_src}")
endif()
endforeach()
if (_relPath)
# propagate SRCS to parent directory
set (CLASSIC_SRCS ${CLASSIC_SRCS} PARENT_SCOPE)
endif()
endmacro()
add_subdirectory(AbsBeamline)
add_subdirectory(Algebra)
add_subdirectory(Algorithms)
add_subdirectory(BeamlineCore)
add_subdirectory(BeamlineGeometry)
add_subdirectory(Beamlines)
add_subdirectory(Channels)
add_subdirectory(ComponentWrappers)
add_subdirectory(Construction)
add_subdirectory(Fields)
add_subdirectory(Filters)
add_subdirectory(FixedAlgebra)
add_subdirectory(MemoryManagement)
add_subdirectory(Parser)
add_subdirectory(Physics)
add_subdirectory(Solvers)
add_subdirectory(Structure)
add_subdirectory(Utilities)
include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
${IPPL_INCLUDE_DIR}
${H5Hut_INCLUDE_DIR}
${HDF5_INCLUDE_DIR}
${GSL_INCLUDE_DIR}
${IPPL_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/src # libclassic should not have any dependencies on libopal
)
IF (ENABLE_OPENCL OR ENABLE_CUDA OR ENABLE_MIC)
include_directories (${DKS_INCLUDE_DIR})
ENDIF (ENABLE_OPENCL OR ENABLE_CUDA OR ENABLE_MIC)
add_library( CLASSIC ${CLASSIC_SRCS} )
install (TARGETS CLASSIC DESTINATION "${CMAKE_INSTALL_PREFIX}/lib")
install (FILES Utilities/ClassicException.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include/Utilities")
\ No newline at end of file
#include "revision.h"
/* Name of package */
#define PACKAGE "classic"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "andreas.adelmann@psi.ch"
/* Define to the full name of this package. */
#define PACKAGE_NAME "classic"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "classic"
/* Define to the version of this package. */
#define PACKAGE_VERSION "5.1.4"
/* Version number of package */
#define VERSION
......@@ -160,7 +160,9 @@ ADD_LIBRARY ( ippl ${IPPL_SRCS} ${IPPL_SRCS_FORT} )
IF (ENABLE_OPENCL OR ENABLE_CUDA OR ENABLE_OPENMP)
#TARGET_LINK_LIBRARIES(ippl dks)
TARGET_LINK_LIBRARIES(ippl ${DKS_LIBRARY_DIR}/libdks.a)
TARGET_LINK_LIBRARIES(ippl ${DKS_LIBRARY_DIR}/libdks.a -lgfortran)
ELSE ()
TARGET_LINK_LIBRARIES(ippl -lgfortran)
ENDIF (ENABLE_OPENCL OR ENABLE_CUDA OR ENABLE_OPENMP)
INSTALL (FILES ${MAKE_DEF} DESTINATION lib)
......
......@@ -22,7 +22,7 @@ IF(ENABLE_AMR_SOLVER)
set (AMR_SRC Solvers/amr/AccelBld.cpp)
set (AMR_INCLUDE_DIR Solvers/amr)
set (CBOXLIB -lmpi -lmpi_mpifh -lcboxlib)
ENDIF(ENABLE_AMR_SOLVER)
set (OPAL_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
......@@ -47,6 +47,7 @@ add_subdirectory (Algorithms)
add_subdirectory (Aperture)
add_subdirectory (Attributes)
add_subdirectory (BasicActions)
add_subdirectory (Classic)
add_subdirectory (Distribution)
add_subdirectory (Editor)
add_subdirectory (Elements)
......@@ -66,26 +67,28 @@ add_subdirectory (ValueDefinitions)
IF (ENABLE_AMR_SOLVER)
add_subdirectory (Solvers/amr)
set (OPAL_SRCS
${OPAL_SRCS}
${AMR_SRC}
)
include_directories(${AMR_INCLUDE_DIR})
ENDIF (ENABLE_AMR_SOLVER)
include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
${OPAL_SRC_DIR}
${CLASSIC_SRC_DIR}
${IPPL_INCLUDE_DIR}
${H5Hut_INCLUDE_DIR}
${HDF5_INCLUDE_DIR}
${GSL_INCLUDE_DIR}
${CLASSIC_SOURCE_DIR}
${Trilinos_INCLUDE_DIRS}
${Trilinos_TPL_INCLUDE_DIRS}
${IPPL_SOURCE_DIRS}
${CCSE_INCLUDE_DIRS}
${GTEST_INCLUDE_DIR}
)
link_directories (
${IPPL_LIBRARY_DIR}
${CLASSIC_SOURCE_DIR}
${Trilinos_LIBRARY_DIRS}
${Trilinos_TPL_LIBRARY_DIRS}
${CCSE_LIBRARY_DIR}
......@@ -97,27 +100,30 @@ IF (ENABLE_OPENCL OR ENABLE_CUDA OR ENABLE_MIC)
ENDIF (ENABLE_OPENCL OR ENABLE_CUDA OR ENABLE_MIC)
set (OPAL_LIBS
m
${GSL_LIBRARY}
${H5Hut_LIBRARY}
${HDF5_LIBRARY}
${IPPL_LIBRARY}
z
${Boost_LIBRARIES}
mpi
mpi_cxx
${Boost_LIBRARIES}
m
z
)
IF (ENABLE_OPENCL OR ENABLE_CUDA OR ENABLE_MIC)
set (OPAL_LIBS
${OPAL_LIBS}
${DKS_LIBRARY_DIR}/libdks.a)
${DKS_LIBRARY_DIR}/libdks.a
)
ENDIF (ENABLE_OPENCL OR ENABLE_CUDA OR ENABLE_MIC)
add_library( OPALib ${OPAL_SRCS} opal.cpp )
set_target_properties( OPALib PROPERTIES OUTPUT_NAME OPAL )
add_executable( opal Main.cpp ${AMR_SRC} )
target_link_libraries( opal OPALib CLASSIC ${OPAL_LIBS} ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} -lgfortran ${CCSE_LIBRARIES} ${CBOXLIB} ${OTHER_CMAKE_EXE_LINKER_FLAGS} ${CMAKE_DL_LIBS})
target_link_libraries( OPALib ${OPAL_LIBS} ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} ${CCSE_LIBRARIES} ${CBOXLIB} ${OTHER_CMAKE_EXE_LINKER_FLAGS} )
add_executable( opal Main.cpp )
target_link_libraries( opal OPALib ${OTHER_CMAKE_EXE_LINKER_FLAGS} ${CMAKE_DL_LIBS})
install (TARGETS ${TEST_EXE} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
install (TARGETS opal RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
......@@ -126,4 +132,4 @@ install (FILES opal.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
install (FILES Utilities/OpalException.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include/Utilities")
set (OPAL_LIBS ${OPAL_LIBS} PARENT_SCOPE)
set (OPAL_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE)
set (OPAL_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE)
\ No newline at end of file
......@@ -41,4 +41,4 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
add_cl_sources(${_SRCS})
\ No newline at end of file
add_sources(${_SRCS})
\ No newline at end of file
......@@ -15,4 +15,4 @@ include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
add_cl_sources(${_SRCS})
\ No newline at end of file
add_sources(${_SRCS})
\ No newline at end of file