ID |
Date |
Author |
Topic |
Subject |
636
|
06 Sep 2009 |
Exaos Lee | Bug Report | Compiling error of "src/history_odbc.cxx" |
Exaos Lee wrote: | Version svn-r4556, I got a compiling error as below:
The detail error log is attached. I used my CMake script without any optimization flags. I will try the default Makefile again. |
BUG is confirmed using the default "Makefile". |
637
|
06 Sep 2009 |
Exaos Lee | Bug Fix | Maybe a fix | Changing "SQLINTEGER" to "SQLLEN" maybe let the compiling pass. See the attached diff.
But I failed in another error. It was the problem in CMakeLists.txt. (FIXED) |
Attachment 1: history_odbc.cxx.diff
|
diff --git a/src/history_odbc.cxx b/src/history_odbc.cxx
index 5f00016..392062f 100644
--- a/src/history_odbc.cxx
+++ b/src/history_odbc.cxx
@@ -584,7 +584,7 @@ int SqlODBC::Exec(const char* sql)
int SqlODBC::GetNumRows()
{
- SQLINTEGER nrows = 0;
+ SQLLEN nrows = 0;
/* How many rows are there */
int status = SQLRowCount(fStmt, &nrows);
if (!SQL_SUCCEEDED(status)) {
@@ -634,7 +634,7 @@ int SqlODBC::Done()
const char* SqlODBC::GetColumn(int icol)
{
static char buf[1024];
- SQLINTEGER indicator;
+ SQLLEN indicator;
int status = SQLGetData(fStmt, icol, SQL_C_CHAR, buf, sizeof(buf), &indicator);
if (!SQL_SUCCEEDED(status)) {
|
638
|
06 Sep 2009 |
Exaos Lee | Suggestion | Updated "CMakeLists.txt" | Add installation commands. Please see the attachment. |
Attachment 1: CMakeLists.txt
|
#-*- mode: cmake -*-
## CMake pre-settings
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
cmake_policy(SET CMP0011 NEW)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
## Project setup
project(MIDAS)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
enable_language(C)
enable_language(CXX)
## Include utilities and options
# Find mxml
include(FindMXML)
include_directories(include ${MXML_PATH})
# OS specific flags
# OS-related CMake variables:
# 1. OS_EXTRA_UTILS --- Extra utilities for specific OS
# 2. OS_EXTRA_LDFLAGS --- Extra link flags for specific OS
# 3. OS_EXTRA_DEFS --- Extra definitions for specific OS
# 4. Other flags switched on for specific OS
include(OSflags)
include(FindROOT) # Find ROOT environment
include(FindMySQL) # Find MySQL
include(FindODBC) # Find ODBC
include(FindZLIB) # Find zlib
## Options for MIDAS
set(NEED_CERNLIB TRUE) # Need CERNLIB or not?
set(NEED_SHLIB TRUE) # Need shared library?
set(NEED_ROOT TRUE) # Need root?
set(NEED_FTPLIB TRUE) # Need ftp protocol?
#set(NEED_STRLCPY TRUE) # Need strlcpy.h? -- maybe opened in OSflags.cmake
#set(MIDAS_MAX_EVENT_SIZE 1000000) # maxmimum event size = ?
##############################################################################
## Setup options
## OS-specific
add_definitions(${OS_EXTRA_DEFS})
set(LDFLAGS "${LDFLAGS} ${OS_EXTRA_LDFLAGS}")
set(EXTRA_UTILS ${EXTRA_UTILS} ${OS_EXTRA_UTILS})
## Midas max event size
if(MIDAS_MAX_EVENT_SIZE)
add_definitions(-DMAX_EVENT_SIZE=${MIDAS_MAX_EVENT_SIZE})
endif(MIDAS_MAX_EVENT_SIZE)
## strlcpy in "MXML"?
if(NEED_STRLCPY)
set(EXTRA_OBJS ${EXTRA_OBJS} strlcpy)
add_definitions( -DHAVE_STRLCPY )
message(STATUS "Using Stephen's own strlcpy()")
endif(NEED_STRLCPY)
## FTPLIB needed?
if(NEED_FTPLIB)
set(FTPLIB ftplib)
add_definitions(-DINCLUDE_FTPLIB)
message(STATUS "Using ftplib (FTP library)")
endif(NEED_FTPLIB)
## ODBC: -lodbc or -liodbc
if(ODBC_FOUND)
message(STATUS "Add ODBC-specified targets using ${ODBC_LIBRARY}")
set(EXTRA_UTILS ${EXTRA_UTILS} mh2sql)
add_definitions(-DHAVE_ODBC)
set(LDFLAGS "${LDFLAGS} -l${ODBC_NAME}")
else(ODBC_FOUND)
message(STATUS "ODBC not found!")
endif(ODBC_FOUND)
## ZLIB
if(ZLIB_FOUND)
add_definitions(-DHAVE_ZLIB)
set(LDFLAGS "${LDFLAGS} -lz")
endif(ZLIB_FOUND)
## ROOT
if(NEED_ROOT AND ROOT_FOUND)
message(STATUS "Using ROOT at ${ROOTSYS}")
if(NEED_RPATH) # Add rpath ..
set(ROOT_LIBS "${ROOT_LIBS} -Wl,-rpath,${ROOTSYS}/lib")
endif(NEED_RPATH)
## libRoot.a: Static ROOT library
if(NEED_LIBROOTA AND ROOT_LIBA)
set(LDFLAGS "${LDFLAGS} ${ROOTSYS}/lib/libRoot.a -lssl -ldl -lcrypt")
message(STATUS "Using statlic ROOT library: ${ROOT_LIBA}")
endif(NEED_LIBROOTA AND ROOT_LIBA)
endif(NEED_ROOT AND ROOT_FOUND)
####### MIDAS library and objects #########################
## Objects needed to build the libmidas(.a,.so,..)
foreach(obj ${FTPLIB} midas system mrpc odb ybos history alarm elog)
set(LIB_OBJS ${LIB_OBJS} src/${obj}.c)
endforeach(obj)
foreach(obj mxml ${EXTRA_OBJS})
set(LIB_OBJS ${LIB_OBJS} ${MXML_PATH}/${obj}.c)
endforeach(obj)
if(ODBC_FOUND)
set(LIB_OBJS ${LIB_OBJS} src/history_odbc.cxx)
endif(ODBC_FOUND)
## Library definition
## Add static lib
add_library(midas-static STATIC ${LIB_OBJS})
set_target_properties(midas-static PROPERTIES OUTPUT_NAME "midas")
if(NEED_SHLIB) # Add shared lib
add_library(midas-shared SHARED ${LIB_OBJS})
set_target_properties(midas-shared PROPERTIES OUTPUT_NAME "midas")
endif(NEED_SHLIB)
########## Utilities ######################################
## Core Utilties
set(CORE_UTILS mserver mhttpd mlogger odbedit lazylogger)
add_executable(mserver src/mserver.c)
add_executable(mlogger src/mlogger.c)
add_executable(mhttpd src/mhttpd.c src/mgd.c )
add_executable(odbedit src/odbedit.c src/cmdedit.c )
add_executable(lazylogger src/lazylogger.c)
foreach(exe ${CORE_UTILS})
target_link_libraries(${exe} midas-static)
set_target_properties(${exe} PROPERTIES LINK_FLAGS "${LDFLAGS}")
endforeach(exe)
set_target_properties( mhttpd PROPERTIES
LINK_FLAGS "-lm ${LDFLAGS}" LINKER_LANGUAGE CXX )
## for mlogger --- It's BAD to name a CXX source using ".c" file extension !!!
set_target_properties( mlogger
PROPERTIES
LINK_FLAGS "${MYSQL_LIBS} ${ROOT_LIBS} ${LDFLAGS}"
LINKER_LANGUAGE CXX
COMPILE_FLAGS "${ROOT_CFLAGS}" )
set_source_files_properties( src/mlogger.c PROPERTIES LANGUAGE CXX )
## Utilities
set(UTILS mtape mhist mstat mdump mchart
webpaw odbhist melog mcnaf
mhdump mtransition # C++ codes
${EXTRA_UTILS} )
foreach(exe mtape mhist mstat mdump melog mchart odbhist webpaw)
add_executable(${exe} utils/${exe}.c)
endforeach(exe)
add_executable(mhdump utils/mhdump.cxx)
add_executable(mcnaf utils/mcnaf.c drivers/camac/camacrpc.c)
add_executable(mtransition src/mtransition.cxx)
# optional utilities
if("${UTILS}" MATCHES "mh2sql")
add_executable(mh2sql utils/mh2sql.cxx src/history_odbc.cxx )
endif("${UTILS}" MATCHES "mh2sql")
if("${UTILS}" MATCHES "mlxspeaker")
add_executable(mlxspeaker utils/mlxspeaker.c)
endif("${UTILS}" MATCHES "mlxspeaker")
if("${UTILS}" MATCHES "dio")
add_executable(dio utils/dio.c)
endif("${UTILS}" MATCHES "dio")
foreach(exe ${UTILS})
add_dependencies(${exe} midas-static)
target_link_libraries(${exe} midas-static)
set_target_properties(${exe} PROPERTIES LINK_FLAGS "${LDFLAGS}")
endforeach(exe)
## Scripts
set(SCRIPTS stripchart.tcl ) # TCL script
## Special targets
## for generating mfe.o
add_custom_command( OUTPUT mfe.o DEPENDS src/mfe.c
COMMAND ${CMAKE_C_COMPILER}
ARGS -I${CMAKE_SOURCE_DIR}/include -c ${CMAKE_SOURCE_DIR}/src/mfe.c
WORKING_DIRECTORY lib )
add_custom_target(mfe ALL DEPENDS mfe.o)
## for generating mfe.o
add_custom_command( OUTPUT fal.o DEPENDS src/fal.c
COMMAND ${CMAKE_C_COMPILER}
ARGS -I${CMAKE_SOURCE_DIR}/include -Dextname -DMANA_LITE
-c ${CMAKE_SOURCE_DIR}/src/fal.c
WORKING_DIRECTORY lib )
add_custom_target(fal ALL DEPENDS fal.o)
## analyzer objects: mana.o
add_custom_command( OUTPUT mana.o DEPENDS src/mana.c
COMMAND ${CMAKE_C_COMPILER}
ARGS -I${CMAKE_SOURCE_DIR}/include -c ${CMAKE_SOURCE_DIR}/src/mana.c
WORKING_DIRECTORY lib )
add_custom_target(mana ALL DEPENDS mana.o)
set(EXTRA_MOBJS mfe.o fal.o mana.o)
# rmana.o
if(NEED_ROOT)
set(ARG_LIST "-DUSE_ROOT ${ROOT_CFLAGS} -I${CMAKE_SOURCE_DIR}/include -o rmana.o -c ${CMAKE_SOURCE_DIR}/src/mana.c")
separate_arguments(ARG_LIST)
add_custom_command( OUTPUT rmana.o DEPENDS src/mana.c
COMMAND ${CMAKE_CXX_COMPILER}
ARGS ${ARG_LIST} WORKING_DIRECTORY lib )
add_custom_target(rmana ALL DEPENDS rmana.o )
set(EXTRA_MOBJS ${EXTRA_MOBJS} rmana.o )
endif(NEED_ROOT)
## hmana.o
if(NEED_CERNLIB)
add_custom_command( OUTPUT hmana.o DEPENDS src/mana.c
COMMAND ${CMAKE_C_COMPILER}
ARGS -I${CMAKE_SOURCE_DIR}/include -Dextname -DHAVE_HBOOK -o hmana.o
-c ${CMAKE_SOURCE_DIR}/src/mana.c
WORKING_DIRECTORY lib )
add_custom_target(hmana ALL DEPENDS hmana.o)
set(EXTRA_MOBJS ${EXTRA_MOBJS} hmana.o )
endif(NEED_CERNLIB)
########## Drivers and modules ################################
#
########## Examples ###########################################
#
########## Installation########################################
#
## Library and objects (custom targets)
install(TARGETS midas-static ARCHIVE DESTINATION lib)
if(NEED_SHLIB)
install(TARGETS midas-shared LIBRARY DESTINATION lib
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_EXECUTE WORLD_READ)
endif(NEED_SHLIB)
foreach(obj ${EXTRA_MOBJS})
install(FILES ${PROJECT_BINARY_DIR}/lib/${obj} DESTINATION lib)
endforeach(obj)
## Core and extra utilities, scripts
install(TARGETS ${CORE_UTILS} ${UTILS}
RUNTIME DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_EXECUTE WORLD_READ)
#install ${SCRIPTS}
foreach(script ${SCRIPTS})
install(FILES utils/${script} DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_EXECUTE WORLD_READ)
endforeach(script)
## include, src, examples, drivers
# install(DIRECTORY include/ DESTINATION include/midas
# FILES_MATCHING PATTERN "*.h")
# install(DIRECTORY src DESTINATION share/midas)
# install(DIRECTORY examples DESTINATION share/midas)
# install(DIRECTORY drivers DESTINATION share/midas)
install(DIRECTORY include/ DESTINATION include
FILES_MATCHING PATTERN "*.h")
install(DIRECTORY src/ DESTINATION src)
install(DIRECTORY examples/ DESTINATION examples)
install(DIRECTORY drivers/ DESTINATION drivers)
|
639
|
06 Sep 2009 |
Exaos Lee | Bug Report | Delete key "/A_Str" problem | > Another problem while using odbedit.
> I tried the batch mode of "odbedit". I created a key as "/A_Str" by mistake and
> wanted to delete it. Then "odbedit" failed to accept the "Return" key. Please see
> the screen-shot attached. :-(
This bug has been fixed in the latest repository.
I encountered it in svn-r4488. |
640
|
06 Sep 2009 |
Exaos Lee | Suggestion | Could not create strings other than 32 characters with odbedit -c "..." command | > > Ok, I added a command
> >
> > odbedit -c "create STRING Test[8][40]"
> >
> > which works now. Please update to SVN revision 4555 of odbedit.c
> >
> > - Stefan
>
> If I want to create only one string, should I write like this:
>
> odbedit -c "create STRING Test[] [256]"
>
> OK. I need it. I will try the new odbedit.
"create STRING test[1][256]" works. |
641
|
07 Sep 2009 |
Exaos Lee | Forum | deprecated conversion from string constant to ‘char*’ | I encountered many warning while building MIDAS (svn r4556). Please see the
attached log file. Most of them are caused by type conversion from string to
"char*".
Though I can ignore all the warning without any problem, I still hate to see
them. :-) |
Attachment 1: make-warnings.log
|
Scanning dependencies of target midas-static
[ 1%] Building C object CMakeFiles/midas-static.dir/src/ftplib.c.o
[ 3%] Building C object CMakeFiles/midas-static.dir/src/midas.c.o
[ 5%] Building C object CMakeFiles/midas-static.dir/src/system.c.o
[ 7%] Building C object CMakeFiles/midas-static.dir/src/mrpc.c.o
[ 9%] Building C object CMakeFiles/midas-static.dir/src/odb.c.o
[ 11%] Building C object CMakeFiles/midas-static.dir/src/ybos.c.o
[ 13%] Building C object CMakeFiles/midas-static.dir/src/history.c.o
[ 15%] Building C object CMakeFiles/midas-static.dir/src/alarm.c.o
[ 17%] Building C object CMakeFiles/midas-static.dir/src/elog.c.o
[ 19%] Building C object CMakeFiles/midas-static.dir/opt/DAQ/bot/mxml/mxml.c.o
[ 21%] Building C object CMakeFiles/midas-static.dir/opt/DAQ/bot/mxml/strlcpy.c.o
[ 23%] Building CXX object CMakeFiles/midas-static.dir/src/history_odbc.cxx.o
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
Linking CXX static library lib/libmidas.a
[ 23%] Built target midas-static
Scanning dependencies of target dio
[ 25%] Building C object CMakeFiles/dio.dir/utils/dio.c.o
Linking C executable bin/dio
[ 25%] Built target dio
Scanning dependencies of target fal
[ 25%] Generating fal.o
[ 26%] Built target fal
Scanning dependencies of target hmana
[ 26%] Generating hmana.o
[ 28%] Built target hmana
Scanning dependencies of target lazylogger
[ 30%] Building C object CMakeFiles/lazylogger.dir/src/lazylogger.c.o
Linking C executable bin/lazylogger
[ 30%] Built target lazylogger
Scanning dependencies of target mana
[ 30%] Generating mana.o
[ 32%] Built target mana
Scanning dependencies of target mchart
[ 34%] Building C object CMakeFiles/mchart.dir/utils/mchart.c.o
Linking C executable bin/mchart
[ 34%] Built target mchart
Scanning dependencies of target mcnaf
[ 36%] Building C object CMakeFiles/mcnaf.dir/utils/mcnaf.c.o
[ 38%] Building C object CMakeFiles/mcnaf.dir/drivers/camac/camacrpc.c.o
Linking C executable bin/mcnaf
[ 38%] Built target mcnaf
Scanning dependencies of target mdump
[ 40%] Building C object CMakeFiles/mdump.dir/utils/mdump.c.o
Linking C executable bin/mdump
[ 40%] Built target mdump
Scanning dependencies of target melog
[ 42%] Building C object CMakeFiles/melog.dir/utils/melog.c.o
Linking C executable bin/melog
[ 42%] Built target melog
Scanning dependencies of target mfe
[ 42%] Generating mfe.o
[ 44%] Built target mfe
Scanning dependencies of target mh2sql
[ 46%] Building CXX object CMakeFiles/mh2sql.dir/utils/mh2sql.cxx.o
/opt/DAQ/bot/midas/utils/mh2sql.cxx: In function ‘int main(int, char**)’:
/opt/DAQ/bot/midas/utils/mh2sql.cxx:144: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mh2sql.cxx:144: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mh2sql.cxx:144: warning: deprecated conversion from string constant to ‘char*’
[ 48%] Building CXX object CMakeFiles/mh2sql.dir/src/history_odbc.cxx.o
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
Linking CXX executable bin/mh2sql
[ 48%] Built target mh2sql
Scanning dependencies of target mhdump
[ 50%] Building CXX object CMakeFiles/mhdump.dir/utils/mhdump.cxx.o
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/utils/mhdump.cxx:91: warning: deprecated conversion from string constant to ‘char*’
Linking CXX executable bin/mhdump
[ 50%] Built target mhdump
Scanning dependencies of target mhist
[ 51%] Building C object CMakeFiles/mhist.dir/utils/mhist.c.o
Linking C executable bin/mhist
[ 51%] Built target mhist
Scanning dependencies of target mhttpd
[ 53%] Building C object CMakeFiles/mhttpd.dir/src/mhttpd.c.o
[ 55%] Building C object CMakeFiles/mhttpd.dir/src/mgd.c.o
Linking CXX executable bin/mhttpd
[ 55%] Built target mhttpd
Scanning dependencies of target midas-shared
[ 57%] Building C object CMakeFiles/midas-shared.dir/src/ftplib.c.o
[ 59%] Building C object CMakeFiles/midas-shared.dir/src/midas.c.o
[ 61%] Building C object CMakeFiles/midas-shared.dir/src/system.c.o
[ 63%] Building C object CMakeFiles/midas-shared.dir/src/mrpc.c.o
[ 65%] Building C object CMakeFiles/midas-shared.dir/src/odb.c.o
[ 67%] Building C object CMakeFiles/midas-shared.dir/src/ybos.c.o
[ 69%] Building C object CMakeFiles/midas-shared.dir/src/history.c.o
[ 71%] Building C object CMakeFiles/midas-shared.dir/src/alarm.c.o
[ 73%] Building C object CMakeFiles/midas-shared.dir/src/elog.c.o
[ 75%] Building C object CMakeFiles/midas-shared.dir/opt/DAQ/bot/mxml/mxml.c.o
[ 76%] Building C object CMakeFiles/midas-shared.dir/opt/DAQ/bot/mxml/strlcpy.c.o
[ 78%] Building CXX object CMakeFiles/midas-shared.dir/src/history_odbc.cxx.o
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:95: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:116: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/history_odbc.cxx:136: warning: deprecated conversion from string constant to ‘char*’
Linking CXX shared library lib/libmidas.so
[ 78%] Built target midas-shared
Scanning dependencies of target mlogger
[ 80%] Building CXX object CMakeFiles/mlogger.dir/src/mlogger.c.o
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:81: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c: In function ‘INT ftp_open(char*, FTP_CON**)’:
/opt/DAQ/bot/midas/src/mlogger.c:952: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:956: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:960: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:960: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:965: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:970: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c: In function ‘EVENT_DEF* db_get_event_definition(short int)’:
/opt/DAQ/bot/midas/src/mlogger.c:1339: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:1341: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:1343: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:1345: warning: deprecated conversion from string constant to ‘char*’
/opt/DAQ/bot/midas/src/mlogger.c:1347: warning: deprecated conversion from string constant to ‘char*’
... 75 more lines ...
|
647
|
27 Sep 2009 |
Exaos Lee | Forum | deprecated conversion from string constant to ‘char*’ | > There is no "type conversions". The compiler is whining about code like this:
>
> /* data type names */
> static char *tid_name[] = {
> "NULL",
> "BYTE",
> ...
>
> I guess we should keep the compiler happy and make them "static const char*".
>
> BTW, my compiler is SL5.2 gcc-4.1.2 and it does not complain. What's your compiler?
>
> K.O.
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.4-2' --with-
bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-
languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch -
-enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-
gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3
--program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --
enable-mpfr --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --
host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.4 (Debian 4.3.4-2) |
648
|
29 Sep 2009 |
Exaos Lee | Bug Report | Error invoking 'odbedit': db_validate_size | Revision: r4567
Error output:
$ odbedit -e expcvadc
odbedit: /opt/DAQ/repos/bot/midas/src/odb.c:651: db_validate_sizes: Assertion `sizeof(EQUIPMENT_INFO) == 400' failed.
zsh: abort odbedit -e expcvadc
|
649
|
29 Sep 2009 |
Exaos Lee | Bug Report | Error invoking 'odbedit': db_validate_size | It seems to be fixed in svn-r4568:
-----------------------------------------------------------------------
r4568 | olchanski | 2009-09-27 23:56:39 +0800 (日, 27 9月 2009) | 5 lines
mhttpd: compile using the C++ compiler.
mhttpd: fix wrong initialization of /History/ODBC_DSN
odb.c: size of EQUIPMENT_INFO has changed.
Makefile: use "-O2" compiler flag instead of "-O3" - to fix SL5 gcc crash (ICE)
But another compiling error:
Linking CXX executable bin/mh2sql
CMakeFiles/mh2sql.dir/utils/mh2sql.cxx.o: In function `main':
/opt/DAQ/repos/bot/midas/utils/mh2sql.cxx:150: undefined reference to `MakeMidasHistoryODBC()'
|
655
|
08 Oct 2009 |
Exaos Lee | Bug Report | Multiple definition of `SqlODBC::SqlODBC() | I found there are two SqlODBC defined in different sources.
$ grep -n "class SqlODBC" src/*
src/history_odbc.cxx:282:class SqlODBC: public SqlBase
src/history_sql.cxx:293:class SqlODBC: public SqlBase
Both of them will be archived into one library libmidas.a if "HAVE_ODBC" defined. Then if you build a shared library, you will
get a link error as the following:
Linking CXX shared library lib/libmidas.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/midas-shared.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -shared -Wl,-soname,libmidas.so -o lib/libmidas.so CMakeFiles/midas-shared.dir/src/ftplib.c.o CMakeFiles/midas-shared.dir/src/midas.c.o CMakeFiles/midas-shared.dir/src/system.c.o CMakeFiles/midas-shared.dir/src/mrpc.c.o CMakeFiles/midas-shared.dir/src/odb.c.o CMakeFiles/midas-shared.dir/src/ybos.c.o CMakeFiles/midas-shared.dir/src/history.c.o CMakeFiles/midas-shared.dir/src/alarm.c.o CMakeFiles/midas-shared.dir/src/elog.c.o CMakeFiles/midas-shared.dir/opt/DAQ/repos/bot/mxml/mxml.c.o CMakeFiles/midas-shared.dir/opt/DAQ/repos/bot/mxml/strlcpy.c.o CMakeFiles/midas-shared.dir/src/history_odbc.cxx.o CMakeFiles/midas-shared.dir/src/history_sql.cxx.o
CMakeFiles/midas-shared.dir/src/history_sql.cxx.o: In function `SqlODBC':
/opt/DAQ/repos/bot/midas/src/history_sql.cxx:200: multiple definition of `SqlODBC::SqlODBC()'
CMakeFiles/midas-shared.dir/src/history_odbc.cxx.o:/opt/DAQ/repos/bot/midas/src/history_odbc.cxx:315: first defined here
...
history_odbc.cxx:727: first defined here
collect2: ld returned 1 exit status
make[2]: *** [lib/libmidas.so] Error 1
Why is the class "SqlODBC" duplicated? |
658
|
09 Oct 2009 |
Exaos Lee | Bug Report | Building error of history_midas.cxx due to missing declaration |
Platform: Debian Linux testing
Compiler: gcc 4.3.4 (Debian 4.3.4-2)
Arch: x86
Description:
The "g++" is whining while compiling history_midas.cxx. Please see the attached log file.
This can be fixed by add "#include <cstdlib>" to the C++ source. You know, different versions
of g++ don't act the same way. I think, maybe in version 4.2 or before, g++ can automatically
include the C header "stdlib.h" (which in C++ should be <cstdlib> because of some confusion
between C and C++), but not in version 4.3 or later. I tested g++-4.4, the problem still exists.
And g++-4.2 gives no error.
|
Attachment 1: build-20091010.log
|
g++ -c -g -O2 -Wall -Wuninitialized -Iinclude -Idrivers -I../mxml -Llinux/lib -DINCLUDE_FTPLIB -D_LARGEFILE64_SOURCE -DHAVE_MYSQL -I/usr/include/mysql -DHAVE_ODBC -DHAVE_ZLIB -DOS_LINUX -fPIC -Wno-unused-function -o linux/lib/history_midas.o src/history_midas.cxx
src/history_midas.cxx: In function 'WORD get_variable_id(DWORD, const char*, const char*)':
src/history_midas.cxx:45: error: 'atoi' was not declared in this scope
src/history_midas.cxx:47: warning: comparison between signed and unsigned integer expressions
src/history_midas.cxx:55: error: 'strchr' was not declared in this scope
src/history_midas.cxx:75: error: 'free' was not declared in this scope
src/history_midas.cxx:81: error: 'free' was not declared in this scope
src/history_midas.cxx: In function 'WORD get_variable_id_tags(const char*, const char*)':
src/history_midas.cxx:119: error: 'atoi' was not declared in this scope
src/history_midas.cxx:121: warning: comparison between signed and unsigned integer expressions
src/history_midas.cxx:127: error: 'strchr' was not declared in this scope
src/history_midas.cxx: In function 'void list_add(poor_mans_list*, const char*)':
src/history_midas.cxx:182: error: 'strlen' was not declared in this scope
src/history_midas.cxx:188: error: 'realloc' was not declared in this scope
src/history_midas.cxx:193: error: 'memcpy' was not declared in this scope
src/history_midas.cxx: In member function 'virtual int MidasHistory::hs_connect(const char*)':
src/history_midas.cxx:284: error: 'memset' was not declared in this scope
src/history_midas.cxx: In member function 'int MidasHistory::GetEventsFromOdbEvents(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)':
src/history_midas.cxx:471: error: 'strchr' was not declared in this scope
src/history_midas.cxx: In member function 'int MidasHistory::GetEventsFromOdbTags(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*)':
src/history_midas.cxx:531: error: 'strtoul' was not declared in this scope
src/history_midas.cxx: In member function 'int MidasHistory::GetTagsFromHS(const char*, std::vector<TAG, std::allocator<TAG> >*)':
src/history_midas.cxx:778: error: 'free' was not declared in this scope
src/history_midas.cxx: In member function 'int MidasHistory::GetTagsFromOdb(const char*, std::vector<TAG, std::allocator<TAG> >*)':
src/history_midas.cxx:820: error: 'atoi' was not declared in this scope
src/history_midas.cxx:824: warning: comparison between signed and unsigned integer expressions
src/history_midas.cxx:874: error: 'strchr' was not declared in this scope
src/history_midas.cxx:903: error: 'strchr' was not declared in this scope
src/history_midas.cxx: In member function 'virtual int MidasHistory::hs_read(time_t, time_t, time_t, int, const char**, const char**, const int*, int*, time_t**, double**, int*)':
src/history_midas.cxx:975: error: 'malloc' was not declared in this scope
src/history_midas.cxx:994: error: 'memset' was not declared in this scope
src/history_midas.cxx:1006: error: 'realloc' was not declared in this scope
src/history_midas.cxx:1016: error: 'malloc' was not declared in this scope
src/history_midas.cxx:1070: error: 'free' was not declared in this scope
src/history_midas.cxx:1072: error: 'free' was not declared in this scope
make: *** [linux/lib/history_midas.o] Error 1
|
663
|
15 Oct 2009 |
Exaos Lee | Suggestion | Building MIDAS using CMake | The attached zip file is the updated configurations for building MIDAS using CMake. It works with svn-r4604.
If you want to use it, please follow the steps here:
Quote: |
- Unzip the attachment, copy CMakeLists.txt and directory "cmake" into the midas source tree.
$ cp -rp CMakeLists.txt cmake/ <Path-to-MIDAS-tree>/ - Make a build dir, and change to it.
- Execute cmake as this
$ cmake -DCMAKE_INSTALL_PREFIX=<path-to-install> <path-to-MIDAS-tree> - Make and install
|
You may use 'cmake -G <generator-name>' to generate building files for Unix Makefiles, Eclipse CDT4, KDevelop3 or Xcode, etc. I didn't test with other platforms. It now works with Unix Makefiles under Linux system. Please feedback any bugs to me: Exaos.Lee(AT)gmail.com . |
Attachment 1: cmake4midas.zip
|
664
|
19 Oct 2009 |
Exaos Lee | Forum | It' better to fix this warnings | > There is no "type conversions". The compiler is whining about code like this:
>
> /* data type names */
> static char *tid_name[] = {
> "NULL",
> "BYTE",
> ...
>
> I guess we should keep the compiler happy and make them "static const char*".
>
> BTW, my compiler is SL5.2 gcc-4.1.2 and it does not complain. What's your compiler?
>
> K.O.
When I use "make" with odbedit, the generated "experim.h" also contains such codes as:
#define EXPCVADC_COMMON_STR(_name) char *_name[] = {\
"[.]",\
...
This will cause "type conversion" warnings. I hope that "odbedit" can generate codes like this:
#define EXPCVADC_COMMON_STR(_name) const char *_name[] = {\
"[.]",\
...
In fact, "const char*" is enough to suppress the warnings. Using "const char* foo=\"blarblar\"" is a good habit because it can avoid the following bugs:
char *s = "whatever";
...
strcpy(s, "Hello, this is a string longer than the initial one.");
The above code can successfully generate an executable, but it will encounter segmentation fault while executing. "const char*" means we should not change the variable in other place, which is important to suppress bugs.
Another problem, if I change the "experim.h" as I wished, new warnings appeared when the compiler parsing the following code:
status = db_create_record(hDB, 0, set_str, strcomb(expcvadc_settings_str));
Warning:
cvadcfe.c: In function ‘frontend_init’:
cvadcfe.c:144: warning: passing argument 1 of ‘strcomb’ from incompatible pointer type
|
667
|
02 Nov 2009 |
Exaos Lee | Bug Fix | Build error due to missing header | I encountered a build error as "sort undefined...". It is caused by missing C++ header <algorithm> in which "sort" is defined. It can be fixed as the attachment.
Environment:
G++: 4.3.4
Platform: Debian Linux testing
> I committed an updated lazylogger with updated documentation. The new version supports subruns and
> can save to external storage arbitrary files (i.e. odb dump files). It also moves most book keeping out of
> odb to permit handling more files on bigger storage disks.
>
> Example lazylogger scripts for castor (CERN) and dcache (TRIUMF) are in the directory "utils".
>
> The lazylogger documentation was updated to remove obsolete information and to describe the new
> functions. As usual "make dox; cd doxfiles/html; firefox index.html" or see my copy at:
>
> http://ladd00.triumf.ca/~olchansk/midas/Utilities.html#lazylogger_task
>
> svn rev 4615, 4616.
> K.O. |
Attachment 1: lazylogger.diff
|
diff --git a/src/lazylogger.c b/src/lazylogger.c
index 34be17a..a7ba4a3 100644
--- a/src/lazylogger.c
+++ b/src/lazylogger.c
@@ -17,6 +17,7 @@ $Id$
#include <vector>
#include <string>
+#include <algorithm>
#define NOTHING_TODO 0
#define FORCE_EXIT 1
|
668
|
02 Nov 2009 |
Exaos Lee | Suggestion | New cmake files | Though ended with ".c", "lazylogger.c" has to be build with C++ compiler. I have
to modify my CMakeLists.txt.
Please see the attachment if you need it. It works with svn-r4616. |
Attachment 1: cmake4midas.zip
|
674
|
23 Nov 2009 |
Exaos Lee | Suggestion | Scripts for "midas-config" | Supposing you have installed MIDAS to some directory such as "/opt/MIDAS/r4621", you have to write some Makefile as the following while building some applications based on the version installed:
Quote: |
CFLAGS += -I/opt/MIDAS/r4621/include -DOS_LINUX -g -O2 -Wall -fPIC
LIBS += -lutil -lpthread -lodbc -lz
....
|
Why not use a script to record your MIDAS building options? When you want to build something based on it, just type something such as
Quote: |
M_CFLAGS := `midas-config --cflags`
M_LIBS := `midas-config --libs`
|
You needn't to check your installed options each time when you build something against it. Each time you install a new version of MIDAS, you only need to update the script called 'midas-config'. I wrote a sample script named "genconf.sh" in the first zipped attachment. The 2nd "midas-config" is a sampled generated by it. Also a diff of Makefile is included. I hope it may help.  |
Attachment 1: genc.zip
|
Attachment 2: midas-config
|
#!/bin/sh
prefix=/usr/local
cflags="-I/usr/local/include -g -O2 -Wall -Wuninitialized -DINCLUDE_FTPLIB -DOS_LINUX -fPIC -Wno-unused-function -DHAVE_ODBC -DHAVE_ZLIB"
st_libs="-lutil -lpthread -lodbc -lz /usr/local/lib/libmidas.a"
dyn_libs="-lutil -lpthread -lodbc -lz -L/usr/local/lib -lmidas"
incdir=/usr/local/include
libdir=/usr/local/lib
svnver=r4621
platform=linux
drvdir=/usr/local/share/drivers
camacdir=/usr/local/share/drivers/camac
vmedir=/usr/local/share/drivers/vme
srcdir=/usr/local/share/src
exampledir=/usr/local/share/examples
out=""
while test $# -gt 0; do
case "$1" in
-*=*) optarg=/usr/local ;;
*) optarg= ;;
esac
case $1 in
--prefix)
out="$out ${prefix}"
;;
--cflags|-c)
out="$out ${cflags}"
;;
--incdir|-dI)
out="$out ${incdir}"
;;
--libdir|-dL)
out="$out ${libdir}"
;;
--libs|--static-libs|-l)
out="$out ${st_libs}"
;;
--dyn-libs)
out="$out ${dyn_libs}"
;;
--platform)
out="$out ${platform}"
;;
--drvdir|-dD)
out="$out ${drvdir}"
;;
--camacdir|-dC)
out="$out ${camacdir}"
;;
--vmedir|-dV)
out="$out ${vmedir}"
;;
--srcdir|-dS)
out="$out ${srcdir}"
;;
--exampledir|-dE)
out="$out ${exampledir}"
;;
--version|-v)
out="$out ${svnver}"
;;
--help|-h)
echo "Usage: midas-config [options]"
echo "Options:"
echo " --prefix Display the installation prefix"
echo " --cflags,-c Display C/C++ flags using for compilation"
echo " --incdir,-dI Display midas header directory installed"
echo " --libdir,-dL Display midas library directory installed"
echo " --libs, -l"
echo " --static-libs Display link flags while linking with static midas library"
echo " --dyn-libs Display link flags while linking with dynamic library"
echo " --platform Display installed platform"
echo " --drvdir,-dD Display the driver directory"
echo " --camacdir,-dC Display the directory including CAMAC APIs"
echo " --vmedir,-dV Display the directory including VME APIs"
echo " --srcdir,-dS Display the source directory"
echo " --exampledir,-dE Display the examples directory"
echo " --version, -v Show the subversion number"
echo " --help, -h Display this usage"
echo
exit 0
;;
*)
### Give an error
echo "Unknown argument \"/usr/local\"!" 1>&2
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
echo $out
|
697
|
08 Apr 2010 |
Exaos Lee | Forum | How to stop a run with a timer? | I want to let the run stop and start periodically. But I looked through the ODB
and didn't find anything may help. I also checked the FAQ online and didn't find
answer either. Who can help me? Thank you. |
754
|
30 Mar 2011 |
Exaos Lee | Forum | How large does "bank32" support? | Reading an FADC buffer often needs large buffer size, especially while several
FADCs work together. I want to know how large a bank32 can support. |
768
|
24 Jun 2011 |
Exaos Lee | Suggestion | Build MIDAS debian packages using autoconf/automake. | Here is my story. I deployed several Debian Linux boxes as the DAQ systems in our lab. But I feel it's boring to build and install midas and its related softwares (such as root) on each box. So I need a local debian software repository and put midas and its related packages in it. First of all, I need a midas debian package. After a week's study and searching, I finally finished the job. Hope you feel it useful.
All the work is attached as "daq-midas_deb.tar.gz". The detail is followed. I also created several debian packages. But it's too large to be uploaded. I havn't my own site accessible from internet. So, if you need the debian packages, please give me an accessible ftp or other similar service, then I can upload them to you.
First, I use autoconf/automake to rewrite the building system of MIDAS. You can check it this way:
1. Untar daq-midas_deb.tar.gz somewhere, assumming ~/Temp.
2. cd ~/Temp/daq-midas
3. svn co -r 5065 svn+ssh://svn@savannah.psi.ch/repos/meg/midas/trunk midas
4. svn co -r 68 svn+ssh://svn@savannah.psi.ch/repos/meg/mxml/trunk mxml
5. cp -rvp debian/autoconf/* ./
6. ./configure --help
7. ./configure <--options>
8. make && make install
Then, I created the debian packages based on the new building files. You need to install root-system package from http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian/. You can build debs this way:
1. untar daq-midas_deb.tar.gz somewhere, assuming ~/Temp.
2. cd ~/Temp/daq-midas
3. svn co -r 5065 svn+ssh://svn@savannah.psi.ch/repos/meg/midas/trunk midas
4. svn co -r 68 svn+ssh://svn@savannah.psi.ch/repos/meg/mxml/trunk mxml
5. dpkg-buildpackage -b -us -uc
I split the package into serverals parts:
- daq-midas-doc -- The documents and references
- daq-midas-root -- the midas runtime library and utilities built with root
- daq-midas-noroot -- the midas runtime library and utilities built without root
- daq-midas-dev-root -- the midas devel files (headers, objects, drivers, examples) built with root
- daq-midas-dev-noroot -- the midas devel files (headers, objects, drivers, examples) built without root
Here are the installation:
- executalbes -- /usr/lib/daq-midas/bin
- library and objs -- /usr/lib/daq-midas/lib
- headers -- /usr/lib/daq-midas/include
- sources and drivers -- /usr/share/daq-midas/
- docs and examples -- /usr/share/doc/daq-midas
- mdaq-config -- /usr/bin/mdaq-config
I add an auto-generated shell script -- mdaq-config. It behaves just like "root-config". You can get midas build flags and link flags this way:
gcc `mdaq-config --cflags` -c -o myfe.o myfe.c
gcc `mdaq-config --libs` -o myfe myfe.o `mdaq-config --libdir`/mfe.o
Bugs and suggestions are welcomed.
P.S. Based on debian packages, I am planing to write another script, "mdaq.py":
- each midas experiment will be configured in a file named "mdaq.yaml"
- mdaq.py reads the configure file and prepare the daq environment, just like "examples/experiment/start_daq.sh"
- mdaq.py will handle "start/stop/restart/info" about the daq codes.
The attached "mdaq.py" is the old one. |
Attachment 1: daq-midas_deb.tar.gz
|
Attachment 2: mdaq.py
|
#!/usr/bin/env python
'''
Python script to handle daq sessions using MIDAS/PSI.
Auther: Exaos Lee <Exaos DOT Lee AT gmail DOT com>
Date: 2009-07-15
'''
import os, os.path
import sys, signal, time
from commands import getoutput
from ConfigParser import ConfigParser
from pprint import pprint
class mdaq:
_codes_ = { 'MSERVER':"MIDAS Server", 'MHTTPD':"MIDAS HTTPD Server",
'ODBEDIT':"ODB Editor", 'LOGGER':"Data Logger",
'PROG_FE':"Frontend", 'PROG_ANA':"Analyzer" }
_env_ = dict()
def __init__(self,**kws):
env = dict()
if kws.has_key('fname') and kws['fname'] != "":
env = self.parse_conf(kws['fname'])
self.apply_env(env)
def parse_conf(self, fname):
if not os.path.isfile(fname):
print("**WARNING** File \"%s\" does not exist!"%fname)
return None
conf = ConfigParser()
conf.read(fname)
env={'CONF_FILE':fname }
fcpath = os.path.dirname(fname)
sec = 'EXP_INFO' ## Parsing Experiment Information
env['EXP_INFO'] = [ self.safe_parse(conf,sec,'Name'),
self.safe_parse(conf,sec,'Info'), ]
msg = self.safe_parse(conf,sec,'DAQ_DIR')
if msg != "" and os.path.isdir(msg):
dpath = msg
if not os.path.isabs(msg):
dpath = os.path.join(os.path.abspath(fcpath),msg)
env['DAQ_DIR'] = os.path.normpath(dpath)
## Parsing MIDAS configuration
env['MIDASSYS'] = ["MIDAS System Path",
self.safe_parse(conf,"MIDAS","MIDASSYS")]
if env['MIDASSYS'][1]=="": env['MIDASSYS'][1] = self.get_default_msys()
## Parsing Info of programs
for key in self._codes_.keys():
code = self.parse_prog_opt(conf, key, fpath=fcpath)
if code:
env[key] = [self._codes_[key], ]
env[key].extend(code)
port = self.safe_parse(conf, "MHTTPD","PORT")
if port != "":
if not env.has_key('MHTTPD'):
env['MHTTPD'] = ["MIDAS HTTP Server",
os.path.join(env['MIDASSYS'][1],"bin/mhttpd"),
"-h localhost -D"]
if "-p %s"%port not in env['MHTTPD'][2]:
env['MHTTPD'][2] = env['MHTTPD'][2] + " -p %s"%port
return env
def parse_prog_opt(self, cnf, sec, fpath="./"):
name = self.safe_parse(cnf, sec, "NAME")
path = self.safe_parse(cnf, sec, "PATH")
fn = os.path.join(path,name)
if name == "": fn = ""
elif not os.path.isabs(fn):
fn = os.path.normpath(os.path.join(os.path.abspath(fpath),fn))
else:
fn = os.path.normpath(fn)
opts = self.safe_parse(cnf, sec, "Option")
if opts != "" or name != "":
return [fn, opts]
return None
def safe_parse(self, cnf, sec, opt):
try: return cnf.get(sec,opt)
except: return ""
def get_default_msys(self):
if os.environ.has_key('MIDASSYS'): return os.environ['MIDASSYS']
return "/opt/MIDAS.PSI/Version/Current"
def apply_env(self, daq_env=dict()):
env = daq_env
if not env:
print("** WARNING** No environment defined! Using the default values. ****")
env = {'MIDASSYS':['MIDAS System Path', ""], 'CONF_FILE':"", }
if not env.has_key('MIDASSYS'): env['MIDASSYS'] = ['MIDAS System Path',""]
if env['MIDASSYS'][1]=="": env['MIDASSYS'][1] = self.get_default_msys()
def_env = {
'MSERVER' :["MIDAS Server",
os.path.join(env['MIDASSYS'][1],"bin/mserver"),
"-D", True],
'MHTTPD' :["MIDAS HTTP Server",
os.path.join(env['MIDASSYS'][1],"bin/mhttpd"),
"-h localhost -D -p 8080", True],
'ODBEDIT' :["ODB Editor",
os.path.join(env['MIDASSYS'][1],"bin/odbedit"),
"-c clean", False],
'LOGGER' :["Data Logger",
os.path.join(env['MIDASSYS'][1],"bin/mlogger"),
"", True],
'PROG_FE' :["Frontend","", "", True],
'PROG_ANA':["Analyzer","", "", True],
'EXP_INFO':["test","The test experiment"],
'DAQ_DIR':os.path.join(os.environ['HOME'],"online/test") }
for key in def_env.keys():
if not env.has_key(key): env[key] = def_env[key]
for key in self._codes_.keys():
if env[key][1] == "": env[key][1] = def_env[key][1]
if env[key][2] == "": env[key][2] = def_env[key][2]
if not os.path.isdir(env['DAQ_DIR']):
try: os.makedirs(env['DAQ_DIR'])
except: print("ERROR to make file")
## Asign default program options
exp_opt = "-e %s"%env['EXP_INFO'][0]
for key in ['LOGGER', 'PROG_FE', 'PROG_ANA', "MHTTPD"]:
if exp_opt not in env[key][2]:
env[key][2] = exp_opt + ' ' + env[key][2]
if "-D" not in env[key][2]:
env[key][2] = env[key][2] + ' -D'
if exp_opt not in env['ODBEDIT'][2]:
env['ODBEDIT'][2] = env['ODBEDIT'][2] + ' ' + exp_opt
self._env_ = env
def print_conf(self):
print "\n================= DAQ Config ====================="
for key in self._env_.keys():
print key,": ",
pprint(self._env_[key])
def info(self): self.print_conf()
## running programs
def getpids(self, pname):
return [int(k) for k in getoutput("pidof %s"%pname).strip().split()]
def kill_prog(self,pname):
for i in self.getpids(pname): os.kill(i,signal.SIGTERM)
def run_prog(self, prog):
if len(prog)>=4 and not prog[3]: return
if len(prog)>=3 and prog[1]:
print("Starting %s: %s"%(prog[0],prog[1]))
os.system("%s %s"%(prog[1],prog[2]))
else:
print("%s: no executable exist!"%prog[0])
def get_status(self,pfile):
msg = "Not running!"
pids = self.getpids( os.path.basename(pfile) )
if pids: return 'PIDs = ' + str(pids)
return msg
def echo_status(self,pname,pfile):
print("%s:\n %s\n "%(pname,pfile)
+ self.get_status(pfile))
## Session manage: start, stop, status, restart
def status(self):
print( "\n===== Session status for experiment \"%s\" =====\n" %
self._env_['EXP_INFO'][0] )
for code in ['MSERVER','MHTTPD','LOGGER','PROG_FE','PROG_ANA']:
self.echo_status(self._env_[code][0], self._env_[code][1])
def start(self):
## Running mserver & mhttpd
ms_pids = self.getpids(os.path.basename(self._env_['MSERVER'][1]))
if not ms_pids:
self.run_prog(self._env_['MSERVER'])
print("Killing %s ...\n"%self._env_['MHTTPD'][0])
self.kill_prog(self._env_['MHTTPD'][1])
if not self.getpids(os.path.basename(self._env_['MHTTPD'][1])):
self.run_prog(self._env_['MHTTPD'])
## Running FE and Analyzer
old_path = os.getcwd()
os.chdir( self._env_['DAQ_DIR'] )
# Init ODB
print("Initializing ODB for experiment %s ..." % self._env_['EXP_INFO'][0])
self.run_prog(self._env_['ODBEDIT'])
time.sleep(1)
# First stop, then start ...
self.stop()
time.sleep(1)
# Start FE & ANA
self.run_prog(self._env_['PROG_FE'])
self.run_prog(self._env_['PROG_ANA'])
time.sleep(1)
# Start Logger
self.run_prog(self._env_['LOGGER'])
os.chdir(old_path)
def stop(self):
for key in ["LOGGER", "PROG_FE", "PROG_ANA"]:
if self._env_[key][1]:
print("Killing threads:\n %s"%self._env_[key][1])
self.kill_prog(self._env_[key][1])
def stop_all(self):
self.stop()
for key in ['MHTTPD', 'MSERVER']:
if self._env_[key][1]:
print("Killing threads:\n %s"%self._env_[key][1])
self.kill_prog(self._env_[key][1])
def restart(self): self.start()
if __name__=='__main__':
from optparse import OptionParser
usage = "usage: %prog [options] <command>"
parser = OptionParser(usage=usage, version="%prog 0.1")
parser.add_option("-c","--config", metavar="filename",
help="Read config from FILENAME")
cmds = ["start","stop","stop_all","restart","status","info"]
(opts,args) = parser.parse_args( sys.argv[1:] )
if not args or len(args)>2:
parser.print_help()
print "\nCommands:\n\t",
pprint(cmds)
exit()
fcnf = "daq.conf"
if opts.config: fcnf = opts.config
if args[0] in cmds:
daq = mdaq(fname=fcnf)
exec( "daq.%s()"%args[0] )
else:
parser.print_help()
print "\nCommands:\n\t",
pprint(cmds)
|
786
|
18 Apr 2012 |
Exaos Lee | Bug Report | Build error with mlogger: invalid conversion from ‘void*’ to ‘gzFile’ | I tried to build MIDAS under ArchLinux, failed on errors as following:src/mlogger.cxx: In function ‘INT midas_flush_buffer(LOG_CHN*)’:
src/mlogger.cxx:1011:54: error: invalid conversion from ‘void*’ to ‘gzFile’ [-fpermissive]
In file included from src/mlogger.cxx:33:0:
/usr/include/zlib.h:1318:21: error: initializing argument 1 of ‘int gzwrite(gzFile, voidpc, unsigned int)’ [-fpermissive]
src/mlogger.cxx: In function ‘INT midas_log_open(LOG_CHN*, INT)’:
src/mlogger.cxx:1200:79: error: invalid conversion from ‘void*’ to ‘gzFile’ [-fpermissive]
In file included from src/mlogger.cxx:33:0: Please refer to attachment elog:786/1 for detail. There are also many warnings listed.
This error can be supressed by adding -fpermissive to CXXFLAGS. But the error message is correct."gzFile" is not equal to "void *"! C allows implicit casts between void* and any pointer type, C++ doesn't allow that. It's better to fix this error. A quick fix would be adding explicit casts. But I'm not sure what is the proper way to fix this. |
Attachment 1: mlogger-err.log.gz
|
|