AIDA GELINA BRIKEN nToF CRIB ISOLDE CIRCE nTOFCapture DESPEC DTAS EDI_PSA 179Ta CARME StellarModelling DCF K40
  AIDA  ELOG logo
Message ID: 369     Entry time: Sun Oct 2 15:03:11 2016
Author: CG, TD 
Subject: Problems compiling AIDAsort program on aidas1 
I have been trying to compile the sort program I have been working on in Edinburgh so I can work on it locally
while at RIKEN.

When compiling i receive the error shown in make.log (attached) saying that there are undefined reference in
DataSource.cpp.
Also attached is the make output when compiled in Edinburgh - basically just 'unused variable' warnings.

This is exactly the same DataSource.cpp I am using in Edinburgh. I have carried out 'diff' on the DataSpyLib and
DataXferLib directories which are included
in the Makefile and no differences are present. I have also done this for DataSource directory and again, there
are no differences between what I am running here and in Edinburgh.

The only difference I have been able to observe so far is that in Edinburgh I am using g++ version:
 Using built-in specs.
 COLLECT_GCC=g++
 COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
 Target: x86_64-redhat-linux
 Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array
--disable-libgcj --with-isl=/builddir/build/BUILD /gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install
--enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
 Thread model: posix
 gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)

whereas on aidas1:
 Using built-in specs.
 Target: x86_64-redhat-linux
 Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile
--enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
 Thread model: posix
 gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)

The libraries used are all found in LD_LIBRARY_PATH.
On aidas1 this is: /MIDAS/Linux/lib64:/homes/npg/root/lib:/homes/npg/root/lib:/MIDAS/Linux/lib64:/homes/npg/root/lib
and in Edinburgh:
/Disk/ds-sopa-group/np/RIKEN/AIDAsort/MIDAS/Linux/lib64:/Disk/ds-sopa-group/np/thehubdata/thehub6/jlab_software/Linux_Scientific6-x86_64-gcc4.4.6/root/5.34.23/lib:


*********UPDATE 03/10/16 *************

The methods are defined in /MIDAS/DataPackage/DataXferLib/V4_TCP/transfer.c

This is in the expected INCLUDES path of: INCLUDES=  -I/MIDAS/DataPackage/DataXferLib/V4_TCP -I/MIDAS/DataPackage/DataSpyLib
Attachment 1: make.log  3 kB  Uploaded Sun Oct 2 16:11:03 2016  | Hide | Hide all
aidas1> make
g++ -c -Wall -Wextra -DUNIX -DLINUX -DLINUX64 -DPOSIX -pthread -m64 -I/homes/npg/root/include -I/tmp/DataXferLib_edi/V4_TCP -I/tmp/DataSpyLib_edi  -Iinclude/ main.cpp
g++ -c -Wall -Wextra -DUNIX -DLINUX -DLINUX64 -DPOSIX -pthread -m64 -I/homes/npg/root/include -I/tmp/DataXferLib_edi/V4_TCP -I/tmp/DataSpyLib_edi  -Iinclude/ ./include/DataSource.h ./src/DataSource.cpp
In file included from ./src/DataSource.cpp:12:
include/c_functions.h:10: warning: unused parameter ‘id’
include/c_functions.h:10: warning: unused parameter ‘xclass’
include/c_functions.h:10: warning: unused parameter ‘level’
include/c_functions.h:10: warning: unused parameter ‘source’
include/c_functions.h:10: warning: unused parameter ‘body’
./src/DataSource.cpp: In member function ‘void DataSource::TransferBuffer(double)’:
./src/DataSource.cpp:345: warning: suggest parentheses around comparison in operand of ‘|’
g++ -c -Wall -Wextra -DUNIX -DLINUX -DLINUX64 -DPOSIX -pthread -m64 -I/homes/npg/root/include -I/tmp/DataXferLib_edi/V4_TCP -I/tmp/DataSpyLib_edi  -Iinclude/ ./include/Unpacker.h ./src/Unpacker.cpp
./src/Unpacker.cpp:684:3: warning: "/*" within comment
./src/Unpacker.cpp: In member function ‘void Unpacker::Process(DataSource&)’:
./src/Unpacker.cpp:37: warning: unused variable ‘my_int’
./src/Unpacker.cpp: In member function ‘void Unpacker::LoadParameters(char*)’:
./src/Unpacker.cpp:425: warning: unused variable ‘line’
./src/Unpacker.cpp:427: warning: unused variable ‘ch_first’
./src/Unpacker.cpp:429: warning: unused variable ‘channel’
g++ -c -Wall -Wextra -DUNIX -DLINUX -DLINUX64 -DPOSIX -pthread -m64 -I/homes/npg/root/include -I/tmp/DataXferLib_edi/V4_TCP -I/tmp/DataSpyLib_edi  -Iinclude/ ./include/Calibrator.h ./src/Calibrator.cpp
./src/Calibrator.cpp: In member function ‘void Calibrator::LoadParameters(char*)’:
./src/Calibrator.cpp:299: warning: unused variable ‘line’
./src/Calibrator.cpp:301: warning: unused variable ‘ch_first’
g++ -c -Wall -Wextra -DUNIX -DLINUX -DLINUX64 -DPOSIX -pthread -m64 -I/homes/npg/root/include -I/tmp/DataXferLib_edi/V4_TCP -I/tmp/DataSpyLib_edi  -Iinclude/ ./include/Analysis.h ./src/Analysis.cpp
./src/Analysis.cpp:915:35: warning: "/*" within comment
./src/Analysis.cpp: In member function ‘void Analysis::CloseEvent()’:
./src/Analysis.cpp:146: warning: unused variable ‘b_beam’
./src/Analysis.cpp: In member function ‘void Analysis::WriteOutBuffer(DataSource&)’:
./src/Analysis.cpp:381: warning: comparison between signed and unsigned integer expressions
./src/Analysis.cpp: In member function ‘void Analysis::LoadParameters(char*)’:
./src/Analysis.cpp:1484: warning: unused variable ‘line’
./src/Analysis.cpp:1486: warning: unused variable ‘ch_first’
./src/Analysis.cpp:1488: warning: unused variable ‘channel’
g++ -lrt -m64 -L/homes/npg/root/lib -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic  -L/usr/ucblib -lrt -lpthread -L/tmp/MIDAS/Linux/lib64  -ldataspy  -o AIDAsort.v2.exe main.o DataSource.o Unpacker.o Calibrator.o Analysis.o
DataSource.o: In function `DataSource::InitDataSource(int, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool)':
DataSource.cpp:(.text+0x1159): undefined reference to `transferMultiBlockSize'
DataSource.cpp:(.text+0x1176): undefined reference to `transferMultiMode'
DataSource.cpp:(.text+0x1193): undefined reference to `transferMultiPort'
DataSource.cpp:(.text+0x11b2): undefined reference to `transferMultiInit'
DataSource.o: In function `DataSource::TransferBuffer(double)':
DataSource.cpp:(.text+0x133c): undefined reference to `transferMultiTxData'
collect2: ld returned 1 exit status
make: *** [AIDAsort.v2.exe] Error 1
Attachment 2: make.logEdi  5 kB  Uploaded Sun Oct 2 16:19:20 2016  | Hide | Hide all
[s0804967@escrow order_sort_cg]$ make
g++ -c -Wall -Wextra -DUNIX -DLINUX -DLINUX64 -DPOSIX -pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/usr/include/root -I/Disk/ds-sopa-group/np/RIKEN/AIDAsort/DataXferLib/V4_TCP -I/Disk/ds-sopa-group/np/RIKEN/AIDAsort/DataSpyLib -Iinclude/ main.cpp
g++ -c -Wall -Wextra -DUNIX -DLINUX -DLINUX64 -DPOSIX -pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/usr/include/root -I/Disk/ds-sopa-group/np/RIKEN/AIDAsort/DataXferLib/V4_TCP -I/Disk/ds-sopa-group/np/RIKEN/AIDAsort/DataSpyLib -Iinclude/ ./include/DataSource.h ./src/DataSource.cpp
In file included from ./src/DataSource.cpp:12:0:
include/c_functions.h:10:5: warning: unused parameter ‘id’ [-Wunused-parameter]
 int msgDefineMessage (u_int id, u_int xclass, u_int level, char *source, char *body) {
     ^
include/c_functions.h:10:5: warning: unused parameter ‘xclass’ [-Wunused-parameter]
include/c_functions.h:10:5: warning: unused parameter ‘level’ [-Wunused-parameter]
include/c_functions.h:10:5: warning: unused parameter ‘source’ [-Wunused-parameter]
include/c_functions.h:10:5: warning: unused parameter ‘body’ [-Wunused-parameter]
./src/DataSource.cpp: In member function ‘void DataSource::Close()’:
./src/DataSource.cpp:28:9: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
     int i;
         ^
./src/DataSource.cpp: In member function ‘bool DataSource::ReadBuffer()’:
./src/DataSource.cpp:149:9: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
     int i;
         ^
./src/DataSource.cpp: In member function ‘void DataSource::InitDataSource(int, int, std::string&, bool)’:
./src/DataSource.cpp:285:9: warning: variable ‘i’ set but not used [-Wunused-but-set-variable]
     int i;
         ^
./src/DataSource.cpp: In member function ‘void DataSource::TransferBuffer(double)’:
./src/DataSource.cpp:345:22: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses]
   if(GetBuffOffset() > MAX_LENGTH_DATA | ts > (ts_0 + DELTA_TS )){
                      ^
g++ -c -Wall -Wextra -DUNIX -DLINUX -DLINUX64 -DPOSIX -pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/usr/include/root -I/Disk/ds-sopa-group/np/RIKEN/AIDAsort/DataXferLib/V4_TCP -I/Disk/ds-sopa-group/np/RIKEN/AIDAsort/DataSpyLib -Iinclude/ ./include/Unpacker.h ./src/Unpacker.cpp
./src/Unpacker.cpp:684:3: warning: "/*" within comment [-Wcomment]
   /***************/
 ^
./src/Unpacker.cpp: In member function ‘void Unpacker::Process(DataSource&)’:
./src/Unpacker.cpp:37:16: warning: unused variable ‘my_int’ [-Wunused-variable]
   unsigned int my_int;
                ^
./src/Unpacker.cpp: In member function ‘void Unpacker::LoadParameters(char*)’:
./src/Unpacker.cpp:425:8: warning: unused variable ‘line’ [-Wunused-variable]
   char line[1024]; // string or char array?
        ^
./src/Unpacker.cpp:427:8: warning: unused variable ‘ch_first’ [-Wunused-variable]
   char ch_first;
        ^
./src/Unpacker.cpp:429:15: warning: unused variable ‘channel’ [-Wunused-variable]
   int module, channel;
               ^
./src/Unpacker.cpp:430:10: warning: variable ‘data’ set but not used [-Wunused-but-set-variable]
   double data;
          ^
g++ -c -Wall -Wextra -DUNIX -DLINUX -DLINUX64 -DPOSIX -pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/usr/include/root -I/Disk/ds-sopa-group/np/RIKEN/AIDAsort/DataXferLib/V4_TCP -I/Disk/ds-sopa-group/np/RIKEN/AIDAsort/DataSpyLib -Iinclude/ ./include/Calibrator.h ./src/Calibrator.cpp
./src/Calibrator.cpp: In member function ‘void Calibrator::LoadParameters(char*)’:
./src/Calibrator.cpp:299:8: warning: unused variable ‘line’ [-Wunused-variable]
   char line[1024];        //
        ^
./src/Calibrator.cpp:301:8: warning: unused variable ‘ch_first’ [-Wunused-variable]
   char ch_first;          //
        ^
g++ -c -Wall -Wextra -DUNIX -DLINUX -DLINUX64 -DPOSIX -pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/usr/include/root -I/Disk/ds-sopa-group/np/RIKEN/AIDAsort/DataXferLib/V4_TCP -I/Disk/ds-sopa-group/np/RIKEN/AIDAsort/DataSpyLib -Iinclude/ ./include/Analysis.h ./src/Analysis.cpp
./src/Analysis.cpp:915:35: warning: "/*" within comment [-Wcomment]
   /*int m_side[32]= {1,1,0,0,     /* 1:4 */
 ^
./src/Analysis.cpp: In member function ‘void Analysis::CloseEvent()’:
./src/Analysis.cpp:146:8: warning: unused variable ‘b_beam’ [-Wunused-variable]
   bool b_beam= false;
        ^
./src/Analysis.cpp: In member function ‘void Analysis::WriteOutBuffer(DataSource&)’:
./src/Analysis.cpp:381:65: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i= offset; i< offset+sizeof(evt_data)+sizeof(int32_t); i++){
                                                                 ^
./src/Analysis.cpp: In member function ‘void Analysis::LoadParameters(char*)’:
./src/Analysis.cpp:1484:8: warning: unused variable ‘line’ [-Wunused-variable]
   char line[1024];        // string or char array?
        ^
./src/Analysis.cpp:1486:8: warning: unused variable ‘ch_first’ [-Wunused-variable]
   char ch_first;
        ^
./src/Analysis.cpp:1488:15: warning: unused variable ‘channel’ [-Wunused-variable]
   int module, channel;
               ^
g++ -lrt -m64 -L/usr/lib64/root -lGui -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -pthread -lm -ldl -rdynamic  -L/usr/ucblib -lrt -lpthread -L/Disk/ds-sopa-group/np/RIKEN/AIDAsort/MIDAS/Linux/lib64 -lxfer -ldataspy -o AIDAsort.v2.exe main.o DataSource.o Unpacker.o Calibrator.o Analysis.o
Attachment 3: transfer.h  3 kB  Uploaded Mon Oct 3 08:38:09 2016  | Hide | Hide all
#ifndef INCtransferh
#define INCtransferh

#define MAX_STREAM 4
#define MAXPORTS 8

typedef struct block_header {              /* format of data block  */
        unsigned short hdr_flags;          /* see below */
        unsigned short hdr_stream;         /* =0 for forced ack request or 1=>MAX_STREAM  */
        unsigned short hdr_endian;         /*   data byte order */
        unsigned short hdr_ID;
        unsigned int hdr_sequence;        /* for this stream */
        unsigned int hdr_blocklength;     /*  total length of this block including the header */
        unsigned int hdr_datalength;      /*  length of user data in the block  */
        unsigned int hdr_offset;          /*  very large blocks may be fragmented  */
        unsigned int hdr_id1;             /*  for spy to locate header  =0x19062002 */
        unsigned int hdr_id2;             /*  for spy to locate header  =0x09592400 */
} HEADER;

#define HDR_ID1 0x19062002
#define HDR_ID2 0x09592400

typedef struct mbs_block_header {
        unsigned int mbs_endian;
        unsigned int mbs_blocksize;
} MBS_BLKHEADER;


typedef struct ack {
        unsigned short acq_flags;          /* bit 0 = 1 for ack  */
        unsigned short acq_code;           /* =0 for good ack otherwise error reason */
        unsigned short acq_ts_state;       /* tape server state - see below */
        unsigned short acq_stream;         /* =0 for forced ack ack or 1=>MAX_STREAM  */
        unsigned short acq_endian;         /* =1 transmitted in host byte order */
        unsigned short acq_ID;             /* value of ID variable  0 => */
        unsigned int acq_sequence;        /* for stream != 0 is sequence being acked */
        unsigned short acq_stream_state1;           /* see below  */
        unsigned short acq_stream_state2;           /*   */
        unsigned short acq_stream_state3;           /*   */
        unsigned short acq_stream_state4;           /*   */
        unsigned short acq_stream_window1;          /*   */
        unsigned short acq_stream_window2;          /*   */
        unsigned short acq_stream_window3;          /*   */
        unsigned short acq_stream_window4;          /*   */
} ACK;

        
int transferTxData (char *, int, int);
int transferTxRestart ();
int transferBlockSize(int);
int transferMode(int);
int transferBlockMode(int);
int transferEndian(int);
int transferPort(int);
int transferInit (char *);
void transferClose ();
int transferStatus ();
int transferSetVerbose(int);
int transferSetUser(int);
int transferNice(int);
int transferUseOverlap(int);
int transferTxWait();
int transferState();
int transferSndBufSize(int);
int transferRcvBufSize(int);

/*     All these have the thread ID as the first argument  */
int transferMultiTxData (int, char *, int, int);
int transferMultiTxRestart (int);
int transferMultiBlockSize(int, int);
int transferMultiMode(int, int);
int transferMultiBlockMode(int, int);
int transferMultiEndian(int, int);
int transferMultiPort(int, int);
int transferMultiInit (int, char *);
void transferMultiClose (int);
int transferMultiStatus (int);
int transferMultiNice(int, int);
int transferMultiUseOverlap(int, int);
int transferMultiTxWait(int);
int transferMultiState(int);
int transferMultiSndBufSize(int, int);
int transferMultiRcvBufSize(int, int);

#ifndef OK
#define OK 0
#endif

#ifndef ERROR
#define ERROR -1
#endif


#endif
ELOG V3.1.4-unknown