Skip to content

Commit 500f159

Browse files
authored
Merge pull request #22 from MUSIC-fluid/chun_dev
fix CMake settings for Eigen3
2 parents 3fa9151 + 7c05790 commit 500f159

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ find_package(GSL)
1919
if (GSL_FOUND)
2020
message("Found GSL library ${GSL_INCLUDE_DIR}, will build MUSIC with GSL")
2121
include_directories(${GSL_INCLUDE_DIR})
22-
elseif()
22+
else()
2323
message("Did not find GSL library, will build MUSIC alone")
2424
endif()
2525

2626
find_package (Eigen3 REQUIRED)
27-
include_directories(${EIGEN3_INCLUDE_DIR})
27+
#include_directories(${EIGEN3_INCLUDE_DIR})
2828

2929
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
3030
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)

src/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ if (GSL_FOUND)
4343
endif()
4444

4545
add_library(${libname} SHARED ${SOURCES})
46+
target_link_libraries (${libname} Eigen3::Eigen)
4647
set(CompileFlags "")
4748
if (APPLE)
4849
set(CompileFlags "${CompileFlags} -DAPPLE")
4950
endif (APPLE)
5051
if (GSL_FOUND)
5152
set(CompileFlags "${CompileFlags} -DGSL")
52-
target_link_libraries (${libname} ${GSL_LIBRARIES} ${EIGEN3_LIBRARIES})
53+
target_link_libraries (${libname} ${GSL_LIBRARIES})
5354
endif()
5455
set_target_properties (${libname} PROPERTIES COMPILE_FLAGS "${CompileFlags}")
5556
install(TARGETS ${libname} DESTINATION ${CMAKE_HOME_DIRECTORY})
@@ -76,6 +77,7 @@ else (unittest)
7677
target_link_libraries (${exename} ${libname})
7778
else (link_with_lib)
7879
add_executable (${exename} main.cpp ${SOURCES})
80+
target_link_libraries (${exename} Eigen3::Eigen)
7981
if (GSL_FOUND)
8082
target_link_libraries (${exename} ${GSL_LIBRARIES})
8183
endif (GSL_FOUND)

src/doctest.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2299,9 +2299,9 @@ class DOCTEST_INTERFACE Context {
22992299
#endif // DOCTEST_CONFIG_WITH_VARIADIC_MACROS
23002300

23012301
// for subcases
2302-
#define DOCTEST_SUBCASE(name) \
2303-
if (const doctest::detail::Subcase \
2304-
& DOCTEST_ANONYMOUS(_DOCTEST_ANON_SUBCASE_) DOCTEST_UNUSED = \
2302+
#define DOCTEST_SUBCASE(name) \
2303+
if (const doctest::detail::Subcase& DOCTEST_ANONYMOUS( \
2304+
_DOCTEST_ANON_SUBCASE_) DOCTEST_UNUSED = \
23052305
doctest::detail::Subcase(name, __FILE__, __LINE__))
23062306

23072307
// for grouping tests in test suites by using code blocks
@@ -2488,7 +2488,7 @@ constexpr T to_lvalue = x;
24882488
#expr, DOCTEST_TOSTR(DOCTEST_HANDLE_BRACED_VA_ARGS(as))); \
24892489
try { \
24902490
expr; \
2491-
} catch (const DOCTEST_HANDLE_BRACED_VA_ARGS(as)&) { \
2491+
} catch (const DOCTEST_HANDLE_BRACED_VA_ARGS(as) &) { \
24922492
_DOCTEST_RB.m_threw = true; \
24932493
_DOCTEST_RB.m_threw_as = true; \
24942494
} catch (...) { \
@@ -4348,9 +4348,10 @@ void Color::init() {
43484348
#endif // DOCTEST_CONFIG_COLORS_WINDOWS
43494349
}
43504350

4351-
void Color::use(Code
4351+
void Color::use(
4352+
Code
43524353
#ifndef DOCTEST_CONFIG_COLORS_NONE
4353-
code
4354+
code
43544355
#endif // DOCTEST_CONFIG_COLORS_NONE
43554356
) {
43564357
const ContextState* p = contextState;

src/hydro_source_TATB.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,7 @@ double HydroSourceTATB::compute_yL(
472472
double denom = sqrt_a * denom_base;
473473

474474
// robust regularization
475-
denom = std::copysign(
476-
std::max(std::abs(denom), Util::small_eps), denom);
475+
denom = std::copysign(std::max(std::abs(denom), Util::small_eps), denom);
477476

478477
// ------------------------------
479478
// 3. denum
@@ -575,8 +574,7 @@ double HydroSourceTATB::energy_eta_profile_normalisation_tilted(
575574
double denom_base = 4.0 * eta_m * eta_m - loga * loga;
576575
double denom = sqrt_a * denom_base;
577576
// robust regularization
578-
denom = std::copysign(
579-
std::max(std::abs(denom), Util::small_eps), denom);
577+
denom = std::copysign(std::max(std::abs(denom), Util::small_eps), denom);
580578

581579
// ------------------------------
582580
// Term 3

0 commit comments

Comments
 (0)