Skip to content

Commit af56155

Browse files
committed
Merge branch 'master' of git:cadabra2
2 parents 1c02f14 + c73e01d commit af56155

File tree

16 files changed

+1157
-35
lines changed

16 files changed

+1157
-35
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ option(ENABLE_MATHEMATICA "Enable Mathematica support" ON)
8282

8383
option(ENABLE_FRONTEND "Enable the UI frontend" ON)
8484

85+
option(ENABLE_SYSTEM_JSONCPP "Use the system-provided jsoncpp library" OFF)
86+
8587
option(INSTALL_TARGETS_ONLY "Only install targets; skipping icons, shared libraries etc..." OFF)
8688
if (INSTALL_TARGETS_ONLY)
8789
message(STATUS "INSTALL_TARGETS_ONLY is enabled, please make sure all auxillary files and programs Cadabra requires are already installed")

client_server/CMakeLists.txt

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ find_package(GLIBMM REQUIRED)
1919
find_package(SQLite3 REQUIRED)
2020
find_package(Threads REQUIRED)
2121
find_package(Boost 1.53.0 COMPONENTS system program_options date_time filesystem REQUIRED)
22-
22+
if(ENABLE_SYSTEM_JSONCPP)
23+
message("-- Linking against system-provided jsoncpp")
24+
find_package(jsoncpp REQUIRED)
25+
else()
26+
message("-- Linking against included jsoncpp")
27+
endif()
2328

2429
#---------------------------------------------------------------------------
2530
# Enumerate input files.
@@ -32,9 +37,8 @@ set(CADABRA_SERVER_SRC
3237
${CADABRA_CORE_DIR}/InstallPrefix.cc
3338
${CADABRA_CORE_DIR}/CdbPython.cc
3439
${CADABRA_CORE_DIR}/Stopwatch.cc
35-
${CADABRA_LIBS_DIR}/jsoncpp/jsoncpp.cpp
3640
${CADABRA_LIBS_DIR}/whereami/whereami.c
37-
)
41+
)
3842

3943
set(CADABRA_CLIENT_SRC
4044
ComputeThread.cc
@@ -43,9 +47,18 @@ set(CADABRA_CLIENT_SRC
4347
Snoop.cc
4448
${CADABRA_CORE_DIR}/DataCell.cc
4549
${CADABRA_CORE_DIR}/InstallPrefix.cc
46-
${CADABRA_LIBS_DIR}/jsoncpp/jsoncpp.cpp
4750
${CADABRA_LIBS_DIR}/whereami/whereami.c
48-
)
51+
)
52+
53+
if(ENABLE_SYSTEM_JSONCPP)
54+
else()
55+
list(APPEND CADABRA_SERVER_SRC
56+
${CADABRA_LIBS_DIR}/jsoncpp/jsoncpp.cpp
57+
)
58+
list(APPEND CADABRA_CLIENT_SRC
59+
${CADABRA_LIBS_DIR}/jsoncpp/jsoncpp.cpp
60+
)
61+
endif()
4962

5063
#---------------------------------------------------------------------------
5164
# Include directories and preprocessor directives.
@@ -56,13 +69,21 @@ include_directories(
5669
"${CADABRA_CORE_DIR}"
5770
"${CADABRA_LIBS_DIR}/pybind11/include"
5871
"${CADABRA_LIBS_DIR}/websocketpp"
59-
"${CADABRA_LIBS_DIR}/jsoncpp"
6072
"${CADABRA_LIBS_DIR}/internal/include"
6173
"${CADABRA_LIBS_DIR}/whereami"
6274
${Boost_INCLUDE_DIRS}
6375
${PYTHON_INCLUDE_DIRS}
6476
${SQLITE3_INCLUDE_DIR}
6577
)
78+
if(ENABLE_SYSTEM_JSONCPP)
79+
include_directories(
80+
${JSONCPP_INCLUDE_DIRS}
81+
)
82+
else()
83+
include_directories(
84+
"${CADABRA_LIBS_DIR}/jsoncpp"
85+
)
86+
endif()
6687

6788
add_definitions(
6889
-D_WEBSOCKETPP_CPP11_STL_
@@ -87,8 +108,13 @@ target_link_libraries(cadabra-server
87108
${SQLITE3_LIBRARIES}
88109
${PYTHON_LIBRARIES}
89110
${GLIBMM3_LIBRARIES}
90-
Threads::Threads
91-
)
111+
Threads::Threads
112+
)
113+
if(ENABLE_SYSTEM_JSONCPP)
114+
target_link_libraries(cadabra-server
115+
${JSONCPP_LIBRARIES}
116+
)
117+
endif()
92118
if(WIN32)
93119
target_link_libraries(cadabra-server ws2_32 mswsock bcrypt)
94120
endif()
@@ -109,6 +135,11 @@ target_link_libraries(cadabra_client
109135
${GLIBMM3_LIBRARIES}
110136
Threads::Threads
111137
)
138+
if(ENABLE_SYSTEM_JSONCPP)
139+
target_link_libraries(cadabra_client
140+
${JSONCPP_LIBRARIES}
141+
)
142+
endif()
112143
if(WIN32)
113144
target_link_libraries(cadabra_client ws2_32 bcrypt)
114145
endif()

client_server/notebook.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<html>
22
<head>
3-
<link rel="stylesheet" href="http://cadabra.science/static/fonts/Serif/cmun-serif.css"></link>
3+
<link rel="stylesheet" href="https://cadabra.science/static/fonts/Serif/cmun-serif.css"></link>
44
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/latest.js?config=TeX-AMS-MML_HTMLorMML' async></script>
55
<style>
66
div.image_png { width: 400px; }
@@ -10,6 +10,8 @@
1010
div.image_png img { width: 100%; }
1111
div.python { font-family: monospace; padding-left: 10px; margin-left: 40px; margin-right; 40px; margin-bottom: 10px; margin-top: 10px; white-space: pre; color: blue; }
1212
pre.output { color: black; }
13+
div.author { font-weight: bold; }
14+
div.email { font-family: monospace; }
1315
</style>
1416
<script>
1517
MathJax.Hub.Config({

client_server/notebook.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
}
2727
\newcommand{\algo}[1]{{\tt \detokenize{#1}}}
2828
\newcommand{\prop}[1]{{\tt \detokenize{#1}}}
29+
\newcommand{\author}[1]{{\bfseries #1}}
30+
\newcommand{\email}[1]{, {\tt #1}}
2931
%\makeatletter\def\old@comma{,}\catcode`\,=13 \def,{%
3032
%\ifmmode\old@comma\discretionary{}{}{}\else\old@comma\fi}\makeatother
3133

cmake/modules/FindJSONCPP.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
find_package(PkgConfig REQUIRED)
2+
pkg_check_modules(JSONCPP jsoncpp)
3+
#message("**** ${JSONCPP_INCLUDE_DIRS}")
4+
#message("**** ${JSONCPP_LIBRARIES}")

0 commit comments

Comments
 (0)