ID |
Date |
Author |
Topic |
Subject |
99
|
08 Sep 2005 |
Ryu Sawada | Forum | Dividing xml the definition xml file. | I am thinking to divide my definition xml file into several files.
I do not know if there is a general way, but I found some web pages mentioning about it. According to
these pages we can include an xml document to other one like.
---------- booklist.xml ------------
<?xml version="1.0"?>
<!DOCTYPE books [
<!ENTITY book1 SYSTEM "book1.xml">
]>
<books>
&book1;
</books>
------------------------------------
------------ book1.xml -------------
<?xml version="1.0"?>
<book>
<title>Title of the book</title>
<author>Author of the book</author>
</book>
------------------------------------
Is it possible to do it with mxml ?
I have two reasons.
1.
I have two ROME programs. I call them as "writer" and "reader" in this message. "reader" reads output
file from "writer". In this case, "reader" needs to know the structure of branch folder defined in "writer"'s
xml file.
What I am doing is adding headers of "writer" to DictionaryHeaders in Makefile.user of "reader". At least,
it works, but this way I have to write reading function of trees by hand. On the other hand, If it is
possible to include a part of xml file of "writer" in that of "reader", romebuilder can create proper
functions automatically.
2.
My project definition file is already big. It has more than 2000 lines. If one has good XML editor, it may
not be a problem. But unfortunately I do not know good editor on Linux. What I am thinking is making a
directory structure like this.
.
|-- main_definition.xml
`-- xml
|-- folders
| |-- folder_1.xml
| |-- folder_2.xml
| `-- folder_3.xml
`-- tasks
|-- task_1.xml
|-- task_2.xml
`-- task_3.xml
folder_[1-3].xml and task_[1-3].xml will be included in main_definition.xml. |
100
|
06 Oct 2005 |
Ryu Sawada | Forum | Dividing xml the definition xml file. | > I am thinking to divide my definition xml file into several files.
>
> I do not know if there is a general way, but I found some web pages mentioning about it. According to
> these pages we can include an xml document to other one like.
>
> ---------- booklist.xml ------------
> <?xml version="1.0"?>
> <!DOCTYPE books [
> <!ENTITY book1 SYSTEM "book1.xml">
> ]>
>
> <books>
> &book1;
> </books>
> ------------------------------------
> ------------ book1.xml -------------
> <?xml version="1.0"?>
> <book>
> <title>Title of the book</title>
> <author>Author of the book</author>
> </book>
> ------------------------------------
>
> Is it possible to do it with mxml ?
I made a patch to enable it with mxml.
Please test it.
If it is reliable, I will commit it.
----
cd $ROMESYS
patch -p0 < mxml.diff
---- |
Attachment 1: mxml.diff
|
Index: include/mxml.h
===================================================================
RCS file: /usr/local/cvsroot/rome/include/mxml.h,v
retrieving revision 1.7
diff -u -r1.7 mxml.h
--- include/mxml.h 12 Jul 2005 09:04:15 -0000 1.7
+++ include/mxml.h 6 Oct 2005 21:53:13 -0000
@@ -43,6 +43,10 @@
#define PROCESSING_INSTRUCTION_NODE 3
#define COMMENT_NODE 4
#define DOCUMENT_NODE 5
+#define ENTITY_NODE 6
+
+#define INTERNAL_ENTITY 0
+#define EXTERNAL_ENTITY 1
typedef struct {
int fh;
@@ -115,6 +119,7 @@
PMXML_NODE mxml_create_root_node();
PMXML_NODE mxml_parse_file(char *file_name, char *error, int error_size);
PMXML_NODE mxml_parse_buffer(char *buffer, char *error, int error_size);
+PMXML_NODE mxml_parse_entity(char *buf, char *error, int error_size);
int mxml_write_tree(char *file_name, PMXML_NODE tree);
void mxml_debug_tree(PMXML_NODE tree, int level);
void mxml_free_tree(PMXML_NODE tree);
Index: src/mxml.c
===================================================================
RCS file: /usr/local/cvsroot/rome/src/mxml.c,v
retrieving revision 1.8
diff -u -r1.8 mxml.c
--- src/mxml.c 11 May 2005 12:50:02 -0000 1.8
+++ src/mxml.c 6 Oct 2005 21:53:13 -0000
@@ -1209,6 +1209,30 @@
p += 2;
+ } else if (strncmp(p, "!ENTITY", 7) == 0) {
+
+ /* found !ENTITY element */
+ pnew = mxml_add_special_node(ptree, ENTITY_NODE, "ENTYTY", NULL);
+ pv = p+1;
+
+ p++;
+ if (strstr(p, ">") == NULL)
+ return read_error(HERE, "Unterminated !ENTITY element");
+
+ while (*p != '>') {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+
+ len = (size_t)p - (size_t)pv;
+ pnew->value = (char *)malloc(len+1);
+ memcpy(pnew->value, pv, len);
+ pnew->value[len] = 0;
+ mxml_decode(pnew->value);
+
+ p ++;
+
} else {
/* found normal element */
@@ -1407,6 +1431,249 @@
/*------------------------------------------------------------------*/
+PMXML_NODE mxml_parse_entity(char *buf, char *error, int error_size)
+/* parse !ENTYTY entries of XML files and replace with references. Return NULL
+ in case of error, return error description. Optional file_name is used
+ for error reporting if called from mxml_parse_file() */
+{
+ char *p;
+ char *pv;
+ char delimiter;
+ int i,j,k, line_number;
+ char replacement[1000];
+ char entity_name[256][256];
+ char entity_reference_name[256][256];
+ char *entity_value[256];
+ int entity_type[256]; /* internal or external */
+ int nentity;
+ int fh, length,len;
+ char *buffer;
+ PMXML_NODE root = mxml_create_root_node(); // dummy for 'HERE'
+ char *file_name = NULL; // dummy for 'HERE'
+
+ /* copy string to temporary space */
+ buffer = (char *)malloc(strlen(buf)+1);
+ strcpy(buffer,buf);
+ free(buf);
+
+ p = buffer;
+ line_number = 1;
+ nentity = -1;
+
+ /* search !ENTITY */
+ do {
+ if (*p == '<') {
+
+ /* found new entity */
+ p++;
+ while (*p && isspace(*p)) {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+ if (!*p)
+ return read_error(HERE, "Unexpected end of file");
+
+ if (strncmp(p, "!ENTITY", 7) == 0) {
+
+ /* found entity */
+ nentity++;
+ if(nentity>=1000)
+ return read_error(HERE, "Too much entities");
+
+ pv = p+7;
+ while (*pv == ' ')
+ pv++;
+
+ /* extract entity name */
+ p = pv;
+
+ while (*p && isspace(*p) && *p != '<' && *p != '>') {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+ if (!*p)
+ return read_error(HERE, "Unexpected end of file");
+ if (*p == '<' || *p == '>')
+ return read_error(HERE, "Unexpected \'%c\' inside !ENTITY", *p);
+
+ pv = p;
+ while (*pv && !isspace(*pv) && *pv != '<' && *pv != '>')
+ pv++;
+
+ if (!*pv)
+ return read_error(HERE, "Unexpected end of file");
+ if (*pv == '<' || *pv == '>' )
+ return read_error(HERE, "Unexpected \'%c\' inside entity \"%s\"", *pv, &entity_name[nentity][1]);
+
+ len = (size_t)pv - (size_t)p;
+ if (len > (int)sizeof(replacement)-1)
+ len = sizeof(replacement)-1;
+ memcpy(replacement, p, len);
+ replacement[len] = 0;
+ mxml_decode(replacement);
+
+ entity_name[nentity][0] = '&';
+ i = 1;
+ entity_name[nentity][i] = 0;
+ while (*p && !isspace(*p) && *p != '/' && *p != '>' && *p != '<' && i<253)
+ entity_name[nentity][i++] = *p++;
+ entity_name[nentity][i++] = ';';
+ entity_name[nentity][i] = 0;
+
+ if (!*p)
+ return read_error(HERE, "Unexpected end of file");
+ if (*p == '<')
+ return read_error(HERE, "Unexpected \'<\' inside entity \"%s\"", &entity_name[nentity][1]);
+
+ /* extract replacement or SYSTEM*/
+ while (*p && isspace(*p)) {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+ if (!*p)
+ return read_error(HERE, "Unexpected end of file");
+ if (*p == '>')
+ return read_error(HERE, "Unexpected \'>\' inside entity \"%s\"", &entity_name[nentity][1]);
+
+ /* check if SYSTEM */
+ if(strncmp(p, "SYSTEM", 6) == 0){
+ entity_type[nentity] = EXTERNAL_ENTITY;
+ p += 6;
+ }
+ else{
+ entity_type[nentity] = INTERNAL_ENTITY;
+ }
+
+ /* extract replacement */
+ while (*p && isspace(*p)) {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+ if (!*p)
+ return read_error(HERE, "Unexpected end of file");
+ if (*p == '>')
+ return read_error(HERE, "Unexpected \'>\' inside entity \"%s\"", &entity_name[nentity][1]);
+
+ if (*p != '\"' && *p != '\'')
+ return read_error(HERE, "Replacement was not found for entity \"%s\"", &entity_name[nentity][1]);
+ delimiter = *p;
+ p++;
+ if (!*p)
+ return read_error(HERE, "Unexpected end of file");
+ pv = p;
+ while (*pv && *pv != delimiter )
+ pv++;
+
+ if (!*pv)
+ return read_error(HERE, "Unexpected end of file");
+ if (*pv == '<' )
+ return read_error(HERE, "Unexpected \'%c\' inside entity \"%s\"", *pv, &entity_name[nentity][1]);
+
+ len = (size_t)pv - (size_t)p;
+ if (len > (int)sizeof(replacement)-1)
+ len = sizeof(replacement)-1;
+ memcpy(replacement, p, len);
+ replacement[len] = 0;
+
+ if(entity_type[nentity] == EXTERNAL_ENTITY){
+ strcpy(entity_reference_name[nentity],replacement);
+ }
+ else{
+ entity_value[nentity] = (char *)malloc(strlen(replacement));
+ strcpy(entity_value[nentity],replacement);
+ }
+
+ p = pv;
+ while (*p && isspace(*p)) {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+ if (!*p)
+ return read_error(HERE, "Unexpected end of file");
+ }
+ }
+
+ /* go to next element */
+ while (*p && *p != '<') {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+ } while (*p);
+ nentity++;
+
+ /* read external file */
+ for(i=0;i<nentity;i++){
+ if(entity_type[i] == EXTERNAL_ENTITY){
+ fh = open(entity_reference_name[i], O_RDONLY | O_TEXT, 0644);
+
+ if (fh == -1) {
+ return read_error(HERE, "Unable to open file \"%s\"",entity_reference_name[i]);
+ }
+
+ length = lseek(fh, 0, SEEK_END);
+ lseek(fh, 0, SEEK_SET);
+ entity_value[i] = (char *)malloc(length+1);
+ if (entity_value[i] == NULL) {
+ close(fh);
+ return read_error(HERE, "Cannot allocate buffer of %d bytes for \"%s\".",length+1,&entity_name[1]);
+ }
+
+ /* read complete file at once */
+ length = read(fh, entity_value[i], length);
+ entity_value[i][length] = 0;
+ close(fh);
+ }
+ }
+
+ /* count length of output string */
+ length = strlen(buffer);
+ for(i=0;i<nentity;i++){
+ p = buffer;
+ while(1){
+ pv =strstr(entity_name[i],p);
+ if(pv){
+ length += -strlen(entity_name[i]) + strlen(entity_value[i]);
+ p = pv+1;
+ }
+ else{
+ break;
+ }
+ }
+ }
+
+ /* allocate memory */
+ buf = (char *)malloc(length+1);
+
+ /* replace entities */
+ p = buffer;
+ pv = buf;
+ do {
+ if (*p == '&') {
+ /* found entity */
+ for(j=0;j<nentity;j++){
+ if(strncmp(p,entity_name[j],strlen(entity_name[j])) == 0){
+ for(k=0;k<(int)strlen(entity_value[j]);k++)
+ *pv++ = entity_value[j][k];
+ p += strlen(entity_name[j]);
+ break;
+ }
... 27 more lines ...
|
101
|
07 Oct 2005 |
Ryu Sawada | Forum | Dividing xml the definition xml file. | > I made a patch to enable it with mxml.
> Please test it.
>
> If it is reliable, I will commit it.
>
> ----
> cd $ROMESYS
> patch -p0 < mxml.diff
> ----
I modified bugs, and commited. |
Attachment 1: mxml.patch
|
? mxml.c
? mxml.h
? mxml.patch
? obj
? src/indent.txt
Index: include/mxml.h
===================================================================
RCS file: /usr/local/cvsroot/rome/include/mxml.h,v
retrieving revision 1.7
diff -u -r1.7 mxml.h
--- include/mxml.h 12 Jul 2005 09:04:15 -0000 1.7
+++ include/mxml.h 7 Oct 2005 13:15:53 -0000
@@ -43,6 +43,11 @@
#define PROCESSING_INSTRUCTION_NODE 3
#define COMMENT_NODE 4
#define DOCUMENT_NODE 5
+#define ENTITY_NODE 6
+
+#define INTERNAL_ENTITY 0
+#define EXTERNAL_ENTITY 1
+#define MXML_MAX_ENTITY 1000
typedef struct {
int fh;
@@ -115,6 +120,7 @@
PMXML_NODE mxml_create_root_node();
PMXML_NODE mxml_parse_file(char *file_name, char *error, int error_size);
PMXML_NODE mxml_parse_buffer(char *buffer, char *error, int error_size);
+PMXML_NODE mxml_parse_entity(char **buf, char *error, int error_size);
int mxml_write_tree(char *file_name, PMXML_NODE tree);
void mxml_debug_tree(PMXML_NODE tree, int level);
void mxml_free_tree(PMXML_NODE tree);
Index: src/mxml.c
===================================================================
RCS file: /usr/local/cvsroot/rome/src/mxml.c,v
retrieving revision 1.8
diff -u -r1.8 mxml.c
--- src/mxml.c 11 May 2005 12:50:02 -0000 1.8
+++ src/mxml.c 7 Oct 2005 13:15:53 -0000
@@ -1209,6 +1209,30 @@
p += 2;
+ } else if (strncmp(p, "!ENTITY", 7) == 0) {
+
+ /* found !ENTITY element */
+ pnew = mxml_add_special_node(ptree, ENTITY_NODE, "ENTYTY", NULL);
+ pv = p + 1;
+
+ p++;
+ if (strstr(p, ">") == NULL)
+ return read_error(HERE, "Unterminated !ENTITY element");
+
+ while (*p != '>') {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+
+ len = (size_t)p - (size_t)pv;
+ pnew->value = (char *)malloc(len+1);
+ memcpy(pnew->value, pv, len);
+ pnew->value[len] = 0;
+ mxml_decode(pnew->value);
+
+ p ++;
+
} else {
/* found normal element */
@@ -1407,6 +1431,422 @@
/*------------------------------------------------------------------*/
+PMXML_NODE mxml_parse_entity(char **buf, char *error, int error_size)
+/* parse !ENTYTY entries of XML files and replace with references. Return NULL
+ in case of error, return error description. Optional file_name is used
+ for error reporting if called from mxml_parse_file() */
+{
+ char *p;
+ char *pv;
+ char delimiter;
+ int i, j, k, line_number;
+ char *replacement;
+ char entity_name[MXML_MAX_ENTITY][256];
+ char entity_reference_name[MXML_MAX_ENTITY][256];
+ char *entity_value[MXML_MAX_ENTITY];
+ int entity_type[MXML_MAX_ENTITY]; /* internal or external */
+ int nentity;
+ int fh, length, len;
+ char *buffer;
+ PMXML_NODE root = mxml_create_root_node(); /* dummy for 'HERE' */
+ char *file_name = NULL; /* dummy for 'HERE' */
+ int ip; /* counter for entity value */
+
+ for (ip = 0; ip < MXML_MAX_ENTITY; ip++)
+ entity_value[ip] = NULL;
+
+ line_number = 1;
+ nentity = -1;
+
+ /* copy string to temporary space */
+ buffer = (char *) malloc(strlen(*buf) + 1);
+ if (buffer == NULL) {
+ return read_error(HERE, "Cannot allocate memory.");
+ }
+
+ p = buffer;
+
+ strcpy(buffer, *buf);
+ free(*buf);
+
+ /* search !ENTITY */
+ do {
+ if (*p == '<') {
+
+ /* found new entity */
+ p++;
+ while (*p && isspace(*p)) {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+ if (!*p) {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected end of file");
+ }
+
+ if (strncmp(p, "!ENTITY", 7) == 0) {
+
+ /* found entity */
+ nentity++;
+ if (nentity >= MXML_MAX_ENTITY) {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Too much entities");
+ }
+
+ pv = p + 7;
+ while (*pv == ' ')
+ pv++;
+
+ /* extract entity name */
+ p = pv;
+
+ while (*p && isspace(*p) && *p != '<' && *p != '>') {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+ if (!*p) {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected end of file");
+ }
+ if (*p == '<' || *p == '>') {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected \'%c\' inside !ENTITY", *p);
+ }
+
+ pv = p;
+ while (*pv && !isspace(*pv) && *pv != '<' && *pv != '>')
+ pv++;
+
+ if (!*pv) {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected end of file");
+ }
+ if (*pv == '<' || *pv == '>') {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected \'%c\' inside entity \"%s\"", *pv,
+ &entity_name[nentity][1]);
+ }
+
+ len = (size_t) pv - (size_t) p;
+
+ entity_name[nentity][0] = '&';
+ i = 1;
+ entity_name[nentity][i] = 0;
+ while (*p && !isspace(*p) && *p != '/' && *p != '>' && *p != '<' && i < 253)
+ entity_name[nentity][i++] = *p++;
+ entity_name[nentity][i++] = ';';
+ entity_name[nentity][i] = 0;
+
+ if (!*p) {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected end of file");
+ }
+ if (*p == '<') {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected \'<\' inside entity \"%s\"", &entity_name[nentity][1]);
+ }
+
+ /* extract replacement or SYSTEM */
+ while (*p && isspace(*p)) {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+ if (!*p) {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected end of file");
+ }
+ if (*p == '>') {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected \'>\' inside entity \"%s\"", &entity_name[nentity][1]);
+ }
+
+ /* check if SYSTEM */
+ if (strncmp(p, "SYSTEM", 6) == 0) {
+ entity_type[nentity] = EXTERNAL_ENTITY;
+ p += 6;
+ } else {
+ entity_type[nentity] = INTERNAL_ENTITY;
+ }
+
+ /* extract replacement */
+ while (*p && isspace(*p)) {
+ if (*p == '\n')
+ line_number++;
+ p++;
+ }
+ if (!*p) {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected end of file");
+ }
+ if (*p == '>') {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected \'>\' inside entity \"%s\"", &entity_name[nentity][1]);
+ }
+
+ if (*p != '\"' && *p != '\'') {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Replacement was not found for entity \"%s\"",
+ &entity_name[nentity][1]);
+ }
+ delimiter = *p;
+ p++;
+ if (!*p) {
+/*
+ free(buffer);
+ for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+ free(entity_value[ip]);
+*/
+ return read_error(HERE, "Unexpected end of file");
+ }
+ pv = p;
+ while (*pv && *pv != delimiter)
+ pv++;
+
... 207 more lines ...
|
Draft
|
28 Feb 2018 |
Francesco Renga | Forum | DB path | Dear all,
I need to perform a DB query in ROME, where I have to select an array of |
109
|
09 Jan 2006 |
Ryu Sawada | Suggestion | Configuration file | About configuration XML files.
Now we merged ROME and ARGUS.
So I expect that users often have several configuration files for one project.
But I realized many people don't know that they can specify configuration file.
So I propose following scheme.
* When a program starts, it searches all XML files located in current directory which has <Configuration> tag at the top.
* If it does not find any XML file, it asks user to generate new one.
* ask configuration type [R/A/M/N]
* ask filename. Default is romeConfig.xml
* If it find only one XML file, it reads the XML file.
* If it find several XML files, it asks user which file should be used with a prompt like,
Which configuration file do you use ?
[1] filename1.xml
[2] romeConfig.xml
[3] filename2.xml
[q] quit program
* When user starts program with option -c, it asks creates new configuration anyway.
* When user starts program with option -i, it uses specified file. |
111
|
13 Jan 2006 |
Ryu Sawada | Suggestion | Configuration file | done.
Program searches configuration XML file in ./ and ./config |
71
|
09 Apr 2005 |
Daniele Barbareschi | Bug Report | Compiling Builder | I am Daniele Barbareschi, I am a Corrado Gatto's student
I work to interfacing between ALIROOT and MYSQL for CONSTANT CALIBRATION of
subdetector.
There's a bug in compiling...
NAME of file "ROMEXML.h,ROMEXML.cpp" in the ultimate version ROME is lowercase.
The gmake program return error.
Maybe ROMESQL too.
See you those files and similar.
D.B. |
70
|
07 Apr 2005 |
Ryu Sawada | Info | Compiler warning | Followings are warning message from compiler, please check if they are correct.
When I changed line-490 like,
490 while ((obj = iterFolders->Next())) {
warning disappeared.
ROMEAnalyzer.cpp:490: warning: suggest parentheses around assignment used as truth value
//get folder names
485 TObject *obj;
486 TObjArray *names = new TObjArray(100);
487
488 TCollection *folders = folder->GetListOfFolders();
489 TIterator *iterFolders = folders->MakeIterator();
490 while (obj = iterFolders->Next()) {
491 ROMEString str;
492 str.SetFormatted("%s",obj->GetName());
493 names->Add(new TObjString(str.Data()));
494 }
495
ROMEString.cpp:74: warning: `int numberOfDigits' might be used uninitialized in this function
ROMEXMLDataBase.cpp:83: warning: `ROMEXML*xml' might be used uninitialized in this function |
208
|
29 Nov 2017 |
Yusuke Uchiyama | Info | Compiler warning | Dear all,
Under the environment with GCC4.8.5 and ROOT6.08.04,
we get the following warning messages when compiling XXXAnalyzer3, XXXAnalyzer4,
XXXConfig, XXXConfig2,3,4, XXXDBAccess, and XXXConfigToForm.
In file included from /usr/include/stdlib.h:24:0,
from /meg/data1/shared/mc/benchmark_test/rome3-root6.08.04-
gcc485/include/ROMEAnalyzer.h:10,
from include/generated/MEGPrecompile.h:23,
from <command-line>:0:
/usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling
with optimization (-O) [-Wcpp]
# warning _FORTIFY_SOURCE requires compiling with optimization (-O)
^
[345/369] compiling obj/MEGAnalyzer4.o
In file included from /usr/include/stdlib.h:24:0,
from /meg/data1/shared/mc/benchmark_test/rome3-root6.08.04-
gcc485/include/ROMEAnalyzer.h:10,
from include/generated/MEGPrecompile.h:23,
from <command-line>:0:
/usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling
with optimization (-O) [-Wcpp]
# warning _FORTIFY_SOURCE requires compiling with optimization (-O)
^
It seems due to 'NOOPT' flag added to those objects in the Makefile.
Is the 'NOOPT' flag necessary? If not, how can we remove it?
Regards,
Yusuke |
209
|
29 Nov 2017 |
Ryu Sawada | Info | Compiler warning | Hi Yusuke
NOOPT is added for potentially large source files to reduce the compile time and memory usage.
I guess -D_FORTIFY_SOURCE option is added in your project Makefile or in your environment variable, instead of by
ROME.
However, we could modify ROME to explicitly disable it by adding -D_FORTIFY_SOURCE=0 to NOOPT.
That can be done by modifying builder/src/ROMEBuildMakeFile.cpp line 1348.
Could you try to do it ?
Ryu
> Dear all,
>
> Under the environment with GCC4.8.5 and ROOT6.08.04,
> we get the following warning messages when compiling XXXAnalyzer3, XXXAnalyzer4,
> XXXConfig, XXXConfig2,3,4, XXXDBAccess, and XXXConfigToForm.
>
>
> In file included from /usr/include/stdlib.h:24:0,
> from /meg/data1/shared/mc/benchmark_test/rome3-root6.08.04-
> gcc485/include/ROMEAnalyzer.h:10,
> from include/generated/MEGPrecompile.h:23,
> from <command-line>:0:
> /usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling
> with optimization (-O) [-Wcpp]
> # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
> ^
> [345/369] compiling obj/MEGAnalyzer4.o
> In file included from /usr/include/stdlib.h:24:0,
> from /meg/data1/shared/mc/benchmark_test/rome3-root6.08.04-
> gcc485/include/ROMEAnalyzer.h:10,
> from include/generated/MEGPrecompile.h:23,
> from <command-line>:0:
> /usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling
> with optimization (-O) [-Wcpp]
> # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
> ^
>
> It seems due to 'NOOPT' flag added to those objects in the Makefile.
> Is the 'NOOPT' flag necessary? If not, how can we remove it?
>
> Regards,
> Yusuke |
210
|
29 Nov 2017 |
Yusuke Uchiyama | Info | Compiler warning | Hi Ryu,
Thank you.
You are right. We add -D_FORTIFY_SOURCE=2 in CFLAGS and CXXFLAGS in our project Makefile.
If we remove it, the warnings go away.
I tried your suggestion but I got the following warning:
[346/369] compiling obj/MEGAnalyzer3.o
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
However, if I add
'-U_FORTIFY_SOURCE' instead the warning above disappears.
Do you think it is OK for all?
Regards,
Yusuke
> Hi Yusuke
>
> NOOPT is added for potentially large source files to reduce the compile time and memory usage.
>
> I guess -D_FORTIFY_SOURCE option is added in your project Makefile or in your environment variable, instead of by
> ROME.
> However, we could modify ROME to explicitly disable it by adding -D_FORTIFY_SOURCE=0 to NOOPT.
> That can be done by modifying builder/src/ROMEBuildMakeFile.cpp line 1348.
>
> Could you try to do it ?
>
> Ryu
>
>
> > Dear all,
> >
> > Under the environment with GCC4.8.5 and ROOT6.08.04,
> > we get the following warning messages when compiling XXXAnalyzer3, XXXAnalyzer4,
> > XXXConfig, XXXConfig2,3,4, XXXDBAccess, and XXXConfigToForm.
> >
> >
> > In file included from /usr/include/stdlib.h:24:0,
> > from /meg/data1/shared/mc/benchmark_test/rome3-root6.08.04-
> > gcc485/include/ROMEAnalyzer.h:10,
> > from include/generated/MEGPrecompile.h:23,
> > from <command-line>:0:
> > /usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling
> > with optimization (-O) [-Wcpp]
> > # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
> > ^
> > [345/369] compiling obj/MEGAnalyzer4.o
> > In file included from /usr/include/stdlib.h:24:0,
> > from /meg/data1/shared/mc/benchmark_test/rome3-root6.08.04-
> > gcc485/include/ROMEAnalyzer.h:10,
> > from include/generated/MEGPrecompile.h:23,
> > from <command-line>:0:
> > /usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling
> > with optimization (-O) [-Wcpp]
> > # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
> > ^
> >
> > It seems due to 'NOOPT' flag added to those objects in the Makefile.
> > Is the 'NOOPT' flag necessary? If not, how can we remove it?
> >
> > Regards,
> > Yusuke |
211
|
29 Nov 2017 |
Ryu Sawada | Info | Compiler warning | Hi.
Thank you for testing.
-U_FORTIFY_SOURCE is fine, and can be implemented in ROME.
Ryu
> Hi Ryu,
>
> Thank you.
> You are right. We add -D_FORTIFY_SOURCE=2 in CFLAGS and CXXFLAGS in our project Makefile.
> If we remove it, the warnings go away.
>
> I tried your suggestion but I got the following warning:
>
> [346/369] compiling obj/MEGAnalyzer3.o
> <command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
> <command-line>:0:0: note: this is the location of the previous definition
>
> However, if I add
> '-U_FORTIFY_SOURCE' instead the warning above disappears.
>
> Do you think it is OK for all?
>
> Regards,
> Yusuke
>
> > Hi Yusuke
> >
> > NOOPT is added for potentially large source files to reduce the compile time and memory usage.
> >
> > I guess -D_FORTIFY_SOURCE option is added in your project Makefile or in your environment variable, instead of by
> > ROME.
> > However, we could modify ROME to explicitly disable it by adding -D_FORTIFY_SOURCE=0 to NOOPT.
> > That can be done by modifying builder/src/ROMEBuildMakeFile.cpp line 1348.
> >
> > Could you try to do it ?
> >
> > Ryu
> >
> >
> > > Dear all,
> > >
> > > Under the environment with GCC4.8.5 and ROOT6.08.04,
> > > we get the following warning messages when compiling XXXAnalyzer3, XXXAnalyzer4,
> > > XXXConfig, XXXConfig2,3,4, XXXDBAccess, and XXXConfigToForm.
> > >
> > >
> > > In file included from /usr/include/stdlib.h:24:0,
> > > from /meg/data1/shared/mc/benchmark_test/rome3-root6.08.04-
> > > gcc485/include/ROMEAnalyzer.h:10,
> > > from include/generated/MEGPrecompile.h:23,
> > > from <command-line>:0:
> > > /usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling
> > > with optimization (-O) [-Wcpp]
> > > # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
> > > ^
> > > [345/369] compiling obj/MEGAnalyzer4.o
> > > In file included from /usr/include/stdlib.h:24:0,
> > > from /meg/data1/shared/mc/benchmark_test/rome3-root6.08.04-
> > > gcc485/include/ROMEAnalyzer.h:10,
> > > from include/generated/MEGPrecompile.h:23,
> > > from <command-line>:0:
> > > /usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling
> > > with optimization (-O) [-Wcpp]
> > > # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
> > > ^
> > >
> > > It seems due to 'NOOPT' flag added to those objects in the Makefile.
> > > Is the 'NOOPT' flag necessary? If not, how can we remove it?
> > >
> > > Regards,
> > > Yusuke |
203
|
18 Apr 2016 |
SUDESHNA GANGULY | Info | Clear histogram/group of histograms at the beginning of run in ROME | Hi All,
Is there any way in ROME that I can clear histograms at:
1)Run start.
2) Clear by group (tab) ?
Thanks a lot!
Sudeshna |
204
|
21 Apr 2016 |
Ryu Sawada | Info | Clear histogram/group of histograms at the beginning of run in ROME | Dear Sudeshna,
In ROME, histograms are associated with a task (not with a tab).
Histograms are reset at the beginning of runs when "HistAccumulate" is false.
You can set it in your configuration XML like,
<Histogram>
<HistName>MyHisto</HistName>
<HistAccumulate>false</HistAccumulate>
</Histogram>
If you want to clear by hand, you can use ResetHisto() function of your tasks; the function is automatically implemented by ROMEbuilder.
Ryu
> Hi All,
>
> Is there any way in ROME that I can clear histograms at:
>
> 1)Run start.
> 2) Clear by group (tab) ?
>
>
> Thanks a lot!
> Sudeshna |
49
|
06 Mar 2005 |
Ryu Sawada | Suggestion | Cint mode on online | We sometimes want to use trees in ROME.
One way is to read it by TSocket connection. But treees are larger than histograms in general, and it
takes time to download.
And I need to make shared library when I changed the structure of folders.
So, I want to propose is to prepare Cint mode with continueing analysis in background.
Currently, when user press "i", ROME stops analysis and goes into cint mode. This is good for offline
mode, but this is not good for online mode. So I propose that when user press "I", ROME goes cint
mode, and continue analysis in background.
Then we can see Trees at run time.
In addition, If you are going to implement this feature, please prepare short way to call trees in cint mode.
If I understand correctly, the way to call a tree is like,
gAnalyzer->GetTreeObjectAt(0)->GetTree()->Draw("");
but it is too long to use in interactively and we need to remeber the number of trees.
gAnalyzer->GetTree("trigger")->Draw(); is better. |
104
|
16 Nov 2005 |
Matthias Schneebeli | Info | Changed Root DAQ to Rome DAQ | I have changed the name of ROMEs input/output DAQ system from Root to Rome.
This has to implications for the user :
1. One has to select 'rome' intead of 'root' for the <DAQSystem> tag in the romeConfig file.
2. To access this DAQ system one has to call GetRome() instead of GetRoot()
Matthias |
123
|
09 Jun 2006 |
Matthias Schneebeli | Info | ChangeableClassFile in Definition XML removed | We removed the <ChangeableClassFile> under <Task> in the project definition XML file. ROME will always make a user editable class file.
This change does not affect your project.
You may get errors when validating the xml file. This can simply be fixed by removing all <ChangeableClassFile> tags under <Task> in your project definition file. |
24
|
06 Dec 2004 |
Ryu Sawada | Info | Changeable folder as branch a tree | I tried to make changeable folder a branch of tree.
I could process data. Rome succeeded to write the tree.
But when I tried to draw a leaf of the branch, root complains that the class name is invalid. |
213
|
23 Jul 2019 |
Yusuke Uchiyama | Forum | Change of MIDAS library path | Dear all,
From the recent release of MIDAS, "midas-2019-06", the MIDAS library path is changed:
it was $MIDASSYS/linux/lib, but now $MIDASSYS/lib.
See https://midas.triumf.ca/elog/Midas/1564 for the detail.
Due to this change, ROME analyzers cannot be built with -midas option.
The solution seems easy: change the path in
$ROMESYS/buildersrc/ROMEBuilderMakeFile.cpp AddDAQLibraries().
However, directly changing the code will loose backward compatibility.
Do you have any suggestions?
Regards,
Yusuke |
206
|
06 May 2016 |
SUDESHNA GANGULY | Info | Can we reset histograms at the middle of a run in ROME? | Hi All,
Suppose I want to pause a run, at the middle, and change some run conditions. So
I want to clear histograms at the middle of a run. Is that possible to do in ROME?
That when I pause the run, I want to clear histograms. So with the new run
conditions, when we resume that run, we will get clear pads and histograms will
be filled in new.
Thanks a lot!
Sudeshna |
|