Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
scopatz committed Sep 7, 2017
2 parents 8d21b3a + e2b0474 commit 9956d5c
Show file tree
Hide file tree
Showing 18 changed files with 279 additions and 169 deletions.
205 changes: 134 additions & 71 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ENDIF()
# quiets fortify_source warnings when not compiling with optimizations
# in linux distros where compilers were compiled with fortify_source enabled by
# default (e.g. Arch linux).
MESSAGE("${CMAKE_BUILD_TYPE}")
MESSAGE("-- CMake Build Type: ${CMAKE_BUILD_TYPE}")
STRING(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)
IF(NOT ${BUILD_TYPE} STREQUAL "release")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0")
Expand Down Expand Up @@ -63,7 +63,7 @@ IF(NOT CYCLUS_DOC_ONLY)
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/cyclus")

# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
Expand All @@ -72,19 +72,41 @@ IF(NOT CYCLUS_DOC_ONLY)
# the RPATH to be used when installing, but only if it's not a system directory
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/cyclus")
GET_FILENAME_COMPONENT(cxxCompilerRoot ${CMAKE_CXX_COMPILER} DIRECTORY)
GET_FILENAME_COMPONENT(cxxCompilerRoot ${cxxCompilerRoot} DIRECTORY)
IF (NOT "${CMAKE_INSTALL_RPATH}" STREQUAL "${cxxCompilerRoot}")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:${cxxCompilerRoot}/lib:${cxxCompilerRoot}/lib/cyclus")
ENDIF (NOT "${CMAKE_INSTALL_RPATH}" STREQUAL "${cxxCompilerRoot}")
SET(CMAKE_BUILD_RPATH "${CMAKE_INSTALL_RPATH}")
ENDIF("${isSystemDir}" STREQUAL "-1")
MESSAGE("-- CMAKE_INSTALL_RPATH: ${CMAKE_INSTALL_RPATH}")

# Tell CMake where the modules are
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_DIR}/share/cmake-2.8/Modules")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_INSTALL_PREFIX}/share/cyclus/cmake")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CYCAMORE_SOURCE_DIR}/cmake)
MESSAGE("CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}")
MESSAGE("--CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}")

# get dependency hints
if (NOT DEPS_ROOT_DIR)
get_filename_component(compdir ${CMAKE_CXX_COMPILER} DIRECTORY)
get_filename_component(DEPS_ROOT_DIR ${compdir} DIRECTORY)
endif (NOT DEPS_ROOT_DIR)
SET(DEPS_HINTS HINTS "${DEPS_ROOT_DIR}")
SET(DEPS_BIN_HINTS ${DEPS_HINTS} "${DEPS_ROOT_DIR}/bin")
SET(DEPS_LIB_HINTS ${DEPS_HINTS} "${DEPS_ROOT_DIR}/lib")
SET(DEPS_INCLUDE_HINTS HINTS "${DEPS_ROOT_DIR}/include")
MESSAGE("-- Dependency Root Dir (DEPS_ROOT_DIR): ${DEPS_ROOT_DIR}")
MESSAGE("-- Dependency Hints (DEPS_HINTS): ${DEPS_HINTS}")
MESSAGE("-- Dependency Binary Hints (DEPS_BIN_HINTS): ${DEPS_BIN_HINTS}")
MESSAGE("-- Dependency Library Hints (DEPS_LIB_HINTS): ${DEPS_LIB_HINTS}")
MESSAGE("-- Dependency Include Hints (DEPS_INCLUDE_HINTS): ${DEPS_INCLUDE_HINTS}")

# Find cyclus
FIND_PACKAGE(Cyclus REQUIRED)
SET(
CYCAMORE_INCLUDE_DIRS
${CYCAMORE_INCLUDE_DIRS}
CYCAMORE_INCLUDE_DIRS
${CYCAMORE_INCLUDE_DIRS}
${CYCLUS_CORE_INCLUDE_DIR} # INSTALL_PATH/include/cyclus
)
SET(LIBS ${LIBS} ${CYCLUS_CORE_LIBRARIES})
Expand All @@ -96,25 +118,32 @@ IF(NOT CYCLUS_DOC_ONLY)
FIND_PACKAGE(LibXML++ REQUIRED)
SET(CYCAMORE_INCLUDE_DIRS ${CYCAMORE_INCLUDE_DIRS} ${LibXML++_INCLUDE_DIR} ${Glibmm_INCLUDE_DIRS} ${LibXML++Config_INCLUDE_DIR})
SET(LIBS ${LIBS} ${LibXML++_LIBRARIES})
MESSAGE("--LIBS: ${LIBS}")

MESSAGE("--LD_LIBRARY_PATH: $ENV{LD_LIBRARY_PATH}")

# Include the boost header files, system, and filesystem libraries
SET(Boost_USE_STATIC_LIBS OFF)
SET(Boost_USE_STATIC_RUNTIME OFF)
#FIND_PACKAGE(Boost COMPONENTS filesystem system REQUIRED)
FIND_PACKAGE( Boost 1.46.1 COMPONENTS filesystem system REQUIRED)
MESSAGE("-- LIBS: ${LIBS}")

MESSAGE("-- LD_LIBRARY_PATH: $ENV{LD_LIBRARY_PATH}")

# Include the boost header files and the program_options library
# Please be sure to use Boost rather than BOOST.
# Capitalization matters on some platforms
SET(Boost_USE_STATIC_LIBS OFF)
SET(Boost_USE_STATIC_RUNTIME OFF)
# SET(Boost_USE_MULTITHREADED OFF)
if (DEPS_ROOT_DIR)
SET(BOOST_ROOT "${DEPS_ROOT_DIR}")
SET(BOOST_INCLUDEDIR "${DEPS_INCLUDE_HINTS}")
endif (DEPS_ROOT_DIR)
FIND_PACKAGE(Boost COMPONENTS program_options filesystem system serialization REQUIRED)
MESSAGE("-- Boost Root: ${Boost_ROOT}")
MESSAGE("-- Boost Include directory: ${Boost_INCLUDE_DIR}")
MESSAGE("-- Boost Library directories: ${Boost_LIBRARY_DIRS}")
SET(LIBS ${LIBS} ${Boost_PROGRAM_OPTIONS_LIBRARY})
MESSAGE("-- Boost Program Options location: ${Boost_PROGRAM_OPTIONS_LIBRARY}")
SET(LIBS ${LIBS} ${Boost_SYSTEM_LIBRARY})
MESSAGE("-- Boost System location: ${Boost_SYSTEM_LIBRARY}")
SET(LIBS ${LIBS} ${Boost_FILESYSTEM_LIBRARY})
MESSAGE("-- Boost Filesystem location: ${Boost_FILESYSTEM_LIBRARY}")
SET(CYCAMORE_INCLUDE_DIRS ${CYCAMORE_INCLUDE_DIRS} ${Boost_INCLUDE_DIR})
SET(LIBS ${LIBS} ${Boost_FILESYSTEM_LIBRARY})
SET(LIBS ${LIBS} ${Boost_SYSTEM_LIBRARY})
SET(LIBS ${LIBS} ${Boost_SERIALIZATION_LIBRARY})
MESSAGE("-- Boost Serialization location: ${Boost_SERIALIZATION_LIBRARY}")

# find lapack and link to it
# note there is no include directory variable:
Expand All @@ -124,14 +153,14 @@ IF(NOT CYCLUS_DOC_ONLY)
MESSAGE("\tFound LAPACK Libraries: ${LAPACK_LIBRARIES}")

# Find HDF5
FIND_PACKAGE(HDF5 REQUIRED)
FIND_PACKAGE(HDF5 REQUIRED COMPONENTS HL)
ADD_DEFINITIONS(${HDF5_DEFINITIONS})
SET(CYCAMORE_INCLUDE_DIRS ${CYCAMORE_INCLUDE_DIRS} ${HDF5_INCLUDE_DIR})
set(LIBS ${LIBS} ${HDF5_LIBRARIES})
set(LIBS ${LIBS} ${HDF5_C_LIBRARIES} ${HDF5_C_HL_LIBRARIES})
MESSAGE("-- HDF5 Root: ${HDF5_ROOT}")
MESSAGE("-- HDF5 Include directory: ${HDF5_INCLUDE_DIR}")
MESSAGE("-- HDF5 Library directories: ${HDF5_LIBRARY_DIRS}")
MESSAGE("-- HDF5 Libraries: ${HDF5_LIBRARIES}")
MESSAGE("-- HDF5 Libraries: ${HDF5_C_LIBRARIES}")
MESSAGE("-- HDF5 High Level Libraries: ${HDF5_C_HL_LIBRARIES}")

# find coin and link to it
FIND_PACKAGE(COIN REQUIRED)
Expand All @@ -147,6 +176,74 @@ IF(NOT CYCLUS_DOC_ONLY)
MESSAGE("-- SQLITE3 Include directories: ${SQLITE3_INCLUDE_DIR}")
MESSAGE("-- SQLITE3 Libraries: ${SQLITE3_LIBRARIES}")

#
# Some optional libraries to link in, as availble. Required for conda.
#
# pcre
FIND_LIBRARY(PCRE_LIBRARIES pcre ${DEPS_LIB_HINTS})
MESSAGE("-- Found PCRE Libraries (optional): ${PCRE_LIBRARIES}")
IF(PCRE_LIBRARIES)
set(LIBS ${LIBS} ${PCRE_LIBRARIES})
ENDIF(PCRE_LIBRARIES)

# gfortran
FIND_LIBRARY(GFORTRAN_LIBRARIES gfortran ${DEPS_LIB_HINTS})
MESSAGE("-- Found GFORTRAN Libraries (optional): ${GFORTRAN_LIBRARIES}")
IF(GFORTRAN_LIBRARIES)
set(LIBS ${LIBS} ${GFORTRAN_LIBRARIES})
ENDIF(GFORTRAN_LIBRARIES)

# openblas
FIND_LIBRARY(OPENBLAS_LIBRARIES openblas ${DEPS_LIB_HINTS})
MESSAGE("-- Found OPENBLAS Libraries (optional): ${OPENBLAS_LIBRARIES}")
IF(OPENBLAS_LIBRARIES)
set(LIBS ${LIBS} ${OPENBLAS_LIBRARIES})
ENDIF(OPENBLAS_LIBRARIES)

# ClpSolver
FIND_LIBRARY(CLPSOLVER_LIBRARIES ClpSolver ${DEPS_LIB_HINTS})
MESSAGE("-- Found CLPSOLVER Libraries (optional): ${CLPSOLVER_LIBRARIES}")
IF(CLPSOLVER_LIBRARIES)
set(LIBS ${LIBS} ${CLPSOLVER_LIBRARIES})
ENDIF(CLPSOLVER_LIBRARIES)

# iconv
FIND_LIBRARY(ICONV_LIBRARIES iconv ${DEPS_LIB_HINTS})
MESSAGE("-- Found ICONV Libraries (optional): ${ICONV_LIBRARIES}")
IF(ICONV_LIBRARIES)
set(LIBS ${LIBS} ${ICONV_LIBRARIES})
ENDIF(ICONV_LIBRARIES)

# icudata
FIND_LIBRARY(ICUDATA_LIBRARIES icudata ${DEPS_LIB_HINTS})
MESSAGE("-- Found ICUDATA Libraries (optional): ${ICUDATA_LIBRARIES}")
IF(ICUDATA_LIBRARIES)
set(LIBS ${LIBS} ${ICUDATA_LIBRARIES})
ENDIF(ICUDATA_LIBRARIES)

# icui18n
FIND_LIBRARY(ICUI18N_LIBRARIES icui18n ${DEPS_LIB_HINTS})
MESSAGE("-- Found ICUI18N Libraries (optional): ${ICUI18N_LIBRARIES}")
IF(ICUI18N_LIBRARIES)
set(LIBS ${LIBS} ${ICUI18N_LIBRARIES})
ENDIF(ICUI18N_LIBRARIES)

# icuuc
FIND_LIBRARY(ICUUC_LIBRARIES icuuc ${DEPS_LIB_HINTS})
MESSAGE("-- Found ICUUC Libraries (optional): ${ICUUC_LIBRARIES}")
IF(ICUUC_LIBRARIES)
set(LIBS ${LIBS} ${ICUUC_LIBRARIES})
ENDIF(ICUUC_LIBRARIES)

# Python
find_package(PythonInterp)
message("-- PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}")
find_package(PythonLibs)
MESSAGE("-- Found Python Libraries (optional): ${PYTHON_LIBRARIES}")
IF(PYTHON_LIBRARIES)
set(LIBS ${LIBS} ${PYTHON_LIBRARIES})
ENDIF(PYTHON_LIBRARIES)

# include all the directories we just found
INCLUDE_DIRECTORIES(${CYCAMORE_INCLUDE_DIRS})

Expand Down Expand Up @@ -187,54 +284,20 @@ IF(NOT CYCLUS_DOC_ONLY)
)

TARGET_LINK_LIBRARIES(cycamore_unit_tests
dl ${LIBS} ${CYCLUS_TEST_LIBRARIES})
dl
${LIBS}
${CYCLUS_TEST_LIBRARIES}
)

INSTALL(TARGETS cycamore_unit_tests
RUNTIME DESTINATION bin
COMPONENT testing
)

# read tests after building the driver, and add them to ctest
set(tgt "cycamore_unit_tests")
set(script "${CYCAMORE_SOURCE_DIR}/config/generate_test_macros.py")
set(exec "--executable=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${tgt}")
set(reg_dir "--reg_dir=${CYCAMORE_SOURCE_DIR}/../${test_dir}")
set(out "--output=${CMAKE_BINARY_DIR}/CTestTestfile.cmake")
add_custom_command(TARGET ${tgt}
POST_BUILD
COMMAND python ${script} ${exec} ${reg_dir} ${out}
COMMENT "adding tests from ${tgt}"
DEPENDS
VERBATIM
)

# for post test commands
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/config/CTestCustom.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake"
IMMEDIATE @ONLY)

# for printing regression tests
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/config/print_regs.py"
"${CMAKE_CURRENT_BINARY_DIR}/print_regs.py"
IMMEDIATE @ONLY)

# AMS: I don't believe that this is needed anymore.
# This just copies the shared dir from cyclus to cycamore.
# However, the 'share/' dir should now be the same. So this
# was failing because you can't copy a file to itself.
#FILE(GLOB cyclus_shared "${CYCLUS_CORE_SHARE_DIR}/*")
#INSTALL(FILES ${cyclus_shared}
# DESTINATION share
# COMPONENT data
# )


##############################################################################################
################################## begin uninstall target ####################################
##############################################################################################

CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/config/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
Expand All @@ -247,15 +310,15 @@ IF(NOT CYCLUS_DOC_ONLY)
##############################################################################################
################################### end uninstall target #####################################
##############################################################################################

##############################################################################################
####################################### begin cpack ##########################################
##############################################################################################


# Here's where we package it with CPack
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cycamore : The Cyclus Additional Module Repository.")

# Here we set some components for installation with cpack
SET(CPACK_COMPONENTS_ALL cycamore testing libraries data core)
SET(CPACK_GENERATOR "DEB")
Expand All @@ -265,22 +328,22 @@ IF(NOT CYCLUS_DOC_ONLY)
SET(CPACK_PACKAGE_VENDOR "CNERG, UW-Madison")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.rst")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.rst")

# Version
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "4")
SET(CPACK_PACKAGE_VERSION_PATCH "0")

# Dependencies
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "cyclus (>= 1.4.0)")
MESSAGE("CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS}")

# Names
SET(CPACK_PACKAGE_NAME "cycamore")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "cycamore_${CPACK_PACKAGE_VERSION_MAJOR}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}.${CPACK_PACKAGE_VERSION_MINOR}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}.${CPACK_PACKAGE_VERSION_PATCH}")

SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${CPACK_PACKAGE_VERSION_MINOR}")
Expand All @@ -303,7 +366,7 @@ IF(NOT CYCLUS_DOC_ONLY)
SET(ROOT_DIR ${CYCLUS_ROOT_DIR})
SET(PROJ_DIR ${PROJECT_BINARY_DIR})
SET(CORE_SHARE_DIR ${CYCLUS_CORE_SHARE_DIR})

##############################################################################################
######################################## end cpack ###########################################
##############################################################################################
Expand Down
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ dependencies:
test:
override:
- docker run cyclus/cycamore:latest cycamore_unit_tests
- docker run cyclus/cycamore:latest nosetests3 -w /cycamore/tests
- docker run cyclus/cycamore:latest nosetests -w /cycamore/tests

deployment:
develop:
branch: develop
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push cyclus/cycamore:latest

master:
branch: master
commands:
Expand Down
9 changes: 4 additions & 5 deletions docker/develop-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ FROM cyclus/cyclus:latest

COPY . /cycamore
WORKDIR /cycamore
RUN mkdir Release
WORKDIR /cycamore/Release
RUN cmake .. -DCMAKE_BUILD_TYPE=Release
RUN make -j2 && make install

ENV PATH="/root/.local/bin:${PATH}"
RUN python install.py -j 2 --build-type=Release \
-DBLAS_LIBRARIES="/opt/conda/lib/libblas.so" \
-DLAPACK_LIBRARIES="/opt/conda/lib/liblapack.so"
4 changes: 2 additions & 2 deletions input/enrichment/1_src_enr_rxtr_sink.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

<recipe>
<name>natl_u</name>
<basis>atom</basis>
<basis>mass</basis>
<nuclide>
<id>922350000</id>
<comp>0.7</comp>
Expand All @@ -113,7 +113,7 @@

<recipe>
<name>fuel_recipe</name>
<basis>atom</basis>
<basis>mass</basis>
<nuclide>
<id>922350000</id>
<comp>4.5</comp>
Expand Down
4 changes: 2 additions & 2 deletions input/enrichment/linear_src_enr_rxtr_sink.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

<recipe>
<name>natl_u</name>
<basis>atom</basis>
<basis>mass</basis>
<nuclide>
<id>922350000</id>
<comp>0.7</comp>
Expand All @@ -138,7 +138,7 @@

<recipe>
<name>fuel_recipe</name>
<basis>atom</basis>
<basis>mass</basis>
<nuclide>
<id>922350000</id>
<comp>4.5</comp>
Expand Down
Loading

0 comments on commit 9956d5c

Please sign in to comment.