Skip to content

Commit

Permalink
Fix #239.
Browse files Browse the repository at this point in the history
Perhaps.  I could not reproduce the problem.  This explicitly declares the Jsonnet API functions instead of including the header that is causing FNAL problems
  • Loading branch information
brettviren committed Aug 23, 2023
1 parent fac1225 commit d5b0ad2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
4 changes: 2 additions & 2 deletions img/src/BlobSetReframer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ struct FromActivity {
activity[ich->ident()] = act;
}

double qtot=0;
// double qtot=0;

// check each layer of the blob
for (const auto& strip : blob.strips()) {
Expand All @@ -145,7 +145,7 @@ struct FromActivity {
auto strace = std::make_shared<SimpleTrace>(chid, tbin, charge);
traces.push_back(strace);

qtot += act_charge;
// qtot += act_charge;
}
}
return traces;
Expand Down
5 changes: 4 additions & 1 deletion util/inc/WireCellUtil/Persist.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@
//
// ./wcb configure --with-jsonnet-libs=gojsonnet [...as usual...]
//
// extern "C" {
// #include "libjsonnet.h"
// }
extern "C" {
#include "libjsonnet.h"
struct JsonnetVm;
}
#include <boost/filesystem.hpp>
#include <vector>
Expand Down
7 changes: 5 additions & 2 deletions util/inc/WireCellUtil/custard/custard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ namespace custard {
return sum;
}

class Header
{ /* byte offset */
struct TarHeader {
char name_[100]; /* 0 */
char mode_[8]; /* 100 */
char uid_[8]; /* 108 */
Expand All @@ -114,6 +113,10 @@ namespace custard {
char devminor_[8]; /* 337 */
char prefix_[155]; /* 345 */
char padding_[12]; /* 500 */
};

class Header : private TarHeader
{ /* byte offset */
/* 512 */
public:
Header(std::string filename="", size_t siz=0)
Expand Down
16 changes: 16 additions & 0 deletions util/src/Persist.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@
#include <sstream>
#include <fstream>

// see #239 for why this is here.
extern "C" {
struct JsonnetVm;
struct JsonnetVm* jsonnet_make();
char *jsonnet_realloc(struct JsonnetVm *vm, char *buf, size_t sz);
void jsonnet_destroy(struct JsonnetVm* vmRef);
void jsonnet_jpath_add(struct JsonnetVm* vmRef, char* path);
void jsonnet_ext_var(struct JsonnetVm* vmRef, char* key, char* value);
void jsonnet_ext_code(struct JsonnetVm* vmRef, char* key, char* value);
void jsonnet_tla_var(struct JsonnetVm* vmRef, char* key, char* value);
void jsonnet_tla_code(struct JsonnetVm* vmRef, char* key, char* value);
char* jsonnet_evaluate_file(struct JsonnetVm* vmRef, char* filename, int* e);
char* jsonnet_evaluate_snippet(struct JsonnetVm* vmRef, char* filename, char* code, int* e);
}


using spdlog::debug;
using spdlog::error;
using spdlog::info;
Expand Down
2 changes: 2 additions & 0 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ int main(int argc,const char *argv[])


def build(bld):
bld.env.CXXFLAGS += ['-Wc99-extensions']

bld.load('wcb')

def dumpenv(bld):
Expand Down

0 comments on commit d5b0ad2

Please sign in to comment.