Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stlplus headers to ratpac include config file to address breakage in #115 #116

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
add_compile_options(-w)
add_compile_options(-Wno-terminate)

###########################################################
# Set CMAKE standards
Expand Down
1 change: 1 addition & 0 deletions config/RatpacConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ set(RATROOT @RATROOT@)
set(RATSHARE @RATSHARE@)
set(ROOT_INCLUDE_PATH @RATROOT@/include)
set(Ratpac_LIBRARIES @RATROOT@/lib/libRATPAC.so)
include_directories(SYSTEM @RATROOT@/include/stlplus)
include_directories(@RATROOT@/include)
link_directories(@RATROOT@/lib)
13 changes: 13 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,22 @@ add_library(RATEvent SHARED
stlplus/src/stringio.cc
stlplus/src/textio.cc
util/src/ReadFile.cc)
target_include_directories(RATEvent SYSTEM PUBLIC ${ROOT_INCLUDE_DIRS}/stlplus)
target_include_directories(RATEvent PUBLIC ${RATPAC_INCLUDE_DIR})
target_link_libraries(RATEvent PUBLIC
${Geant4_LIBRARIES} ${ROOT_LIBRARIES} RATDict)
set_source_files_properties(
stlplus/src/debug.cc
stlplus/src/dprintf.cc
stlplus/src/exceptions.cc
stlplus/src/file_system.cc
stlplus/src/fileio.cc
stlplus/src/multiio.cc
stlplus/src/string_utilities.cc
stlplus/src/stringio.cc
stlplus/src/textio.cc
PROPERTIES COMPILE_FLAGS -w
)

# This copies the root dict files to <build>/lib
add_custom_command(TARGET RATEvent POST_BUILD
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ add_library(cmd OBJECT
src/TrackingMessenger.cc)

# Set our include directories
target_include_directories(cmd SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(cmd PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 2 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ add_library(core OBJECT
src/GLG4HitPMTCollection.cc)

# Set our include directories
target_include_directories(core SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(core PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 1 addition & 1 deletion src/core/src/Log.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <RAT/Log.hh>
#include <RAT/fileio.hpp>
#include <cstdlib>
#include <fileio.hpp>
#include <fstream>
#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion src/core/src/PruneProc.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <RAT/Log.hh>
#include <RAT/PruneProc.hh>
#include <RAT/string_utilities.hpp>
#include <algorithm>
#include <string_utilities.hpp>
#include <vector>

namespace RAT {
Expand Down
2 changes: 2 additions & 0 deletions src/daq/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ add_library(daq OBJECT
)

# Set our include directories
target_include_directories(daq SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(daq PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
4 changes: 2 additions & 2 deletions src/daq/include/RAT/NoiseProc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class NoiseProc : public Processor {
double fLookback;
double fLookforward;
double fMaxTime;
bool fNearHits;
bool fNoiseFlag;
int fNearHits;
int fNoiseFlag;
std::vector<RAT::PMTTime *> fPMTTime;
std::vector<RAT::PMTCharge *> fPMTCharge;
std::map<std::string, double> fModelNoiseMap;
Expand Down
2 changes: 1 addition & 1 deletion src/daq/src/NoiseProc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ NoiseProc::NoiseProc() : Processor("noise") {}
void NoiseProc::BeginOfRun(DS::Run *run) {
DBLinkPtr lnoise = DB::Get()->GetLink("NOISEPROC");

fNoiseFlag = lnoise->GetD("noise_flag");
fNoiseFlag = lnoise->GetI("noise_flag");
fDefaultNoiseRate = lnoise->GetD("default_noise_rate");
fLookback = lnoise->GetD("noise_lookback");
fLookforward = lnoise->GetD("noise_lookforward");
Expand Down
2 changes: 2 additions & 0 deletions src/db/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ add_library(db OBJECT
src/DBTable.cc)

# Set our include directories
target_include_directories(db SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(db PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 1 addition & 1 deletion src/db/include/RAT/DB.hh
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ double rindex = lmedia->GetD("index_of_refraction");
#include <RAT/DBTable.hh>
#include <RAT/HTTPDownloader.hh>
#include <RAT/Log.hh>
#include <RAT/smart_ptr.hpp>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <smart_ptr.hpp>
#include <string>

namespace RAT {
Expand Down
2 changes: 1 addition & 1 deletion src/db/include/RAT/DBTable.hh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

#include <RAT/DBFieldCallback.hh>
#include <RAT/HashFunc.hh>
#include <RAT/hash.hpp>
#include <RAT/json.hh>
#include <hash.hpp>
#include <string>
#include <vector>

Expand Down
4 changes: 4 additions & 0 deletions src/ds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ add_library(ds OBJECT
src/MCPMT.cc
src/RunStore.cc)
# Set our include directories
target_include_directories(ds SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(ds PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down Expand Up @@ -55,6 +57,8 @@ root_generate_dictionary(G__RATDict
DEPENDENCIES core ds db io)

add_library(RATDict OBJECT G__RATDict.cxx)
target_include_directories(RATDict SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(RATDict PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 2 additions & 0 deletions src/fit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ add_library(fit OBJECT


# Set our include directories
target_include_directories(fit SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(fit PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 2 additions & 0 deletions src/gen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ endif()
add_library(gen OBJECT ${gen_sources})

# Set our include directories
target_include_directories(gen SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(gen PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
15 changes: 9 additions & 6 deletions src/gen/src/BetaFunction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,11 @@ bool BetaFunction::ReadInputFile(const std::string dName, int iZ, int iA, int iT
iRead = (fscanf(inputFile, "%s", dummy) > 0);
std::string iString(dummy);
if (iString == dProbe) {
fscanf(inputFile, "%s", tName);
fscanf(inputFile, "%d %d %f", &Z, &A, &tau);
bool readParseSuccess = fscanf(inputFile, "%s", tName) == 1;
readParseSuccess &= fscanf(inputFile, "%d %d %lf", &Z, &A, &tau) == 3;
if (!readParseSuccess) {
ThrowParsingException(inputFileName, dName);
}
std::string iString2(tName);
iFound = (dName == iString2);
iFound = ((iFound) || ((iA == A) && (iZ == Z)));
Expand All @@ -414,17 +417,17 @@ bool BetaFunction::ReadInputFile(const std::string dName, int iZ, int iA, int iT

bool iScan = true;
while (iScan) {
bool parseSuccess = fscanf(inputFile, "%f %d %f %d", &iBr, &iSpin, &W0, &nP) == 4;
bool scanParseSuccess = fscanf(inputFile, "%lf %d %lf %d", &iBr, &iSpin, &W0, &nP) == 4;
SetBranches((double)iBr, iSpin, (double)W0);
for (int j = 0; j < nReadGamma; j++) {
parseSuccess &= fscanf(inputFile, "%f", &eP[j]) == 1;
scanParseSuccess &= fscanf(inputFile, "%lf", &eP[j]) == 1;
if (eP[j] > 0.) SetGammas((double)eP[j]);
}
parseSuccess &= fscanf(inputFile, "%f %f %f", &aC[0], &aC[1], &aC[2]) == 3;
scanParseSuccess &= fscanf(inputFile, "%lf %lf %lf", &aC[0], &aC[1], &aC[2]) == 3;
if (iBr >= 1.) {
iScan = false;
}
if (!parseSuccess) {
if (!scanParseSuccess) {
ThrowParsingException(inputFileName, dName);
}
}
Expand Down
17 changes: 14 additions & 3 deletions src/gen/src/DecayChain.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <CLHEP/Vector/LorentzVector.h>

#include <G4Exception.hh>
#include <G4ExceptionSeverity.hh>
#include <RAT/DecayChain.hh>
#include <RAT/FermiFunction.hh>
#include <RAT/Log.hh>
Expand Down Expand Up @@ -185,18 +187,27 @@ bool DecayChain::ReadInputFile(const std::string dName) {
std::string iString(dummy);

if (iString == dProbe) {
fscanf(inputFile, "%s", tName);
bool parseSuccess = fscanf(inputFile, "%s", tName) == 1;
if (!parseSuccess) {
G4Exception("DecayChain::ReadInputFile", "InvalidInput", FatalException, "Error reading input file");
}
std::string iString2(tName);
if (dName == iString2) {
if (!fAlphaDecayStart) {
iFound = true;
}
fscanf(inputFile, "%d", &eP);
parseSuccess = fscanf(inputFile, "%d", &eP) == 1;
if (!parseSuccess) {
G4Exception("DecayChain::ReadInputFile", "InvalidInput", FatalException, "Error reading input file");
}
if (isVerbose) {
printf("Reading %s \n \n", tName);
}
for (int j = 0; j < eP; j++) {
fscanf(inputFile, "%s %d %f %d %f", sName, &iChain, &weight, &iDecay, &tau);
parseSuccess &= fscanf(inputFile, "%s %d %lf %d %lf", sName, &iChain, &weight, &iDecay, &tau) == 5;
if (!parseSuccess) {
G4Exception("DecayChain::ReadInputFile", "InvalidInput", FatalException, "Error reading input file");
}
std::string iString3(sName);
if (iDecay != NullParticle && !fAlphaDecayStart) {
AddElement(iString3, iChain, iDecay, (double)tau, (double)weight);
Expand Down
2 changes: 2 additions & 0 deletions src/geo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ add_library(geo OBJECT
)

# Set our include directories
target_include_directories(geo SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(geo PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 2 additions & 0 deletions src/io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ add_library(io OBJECT
src/TrackNav.cc)

# Set our include directories
target_include_directories(io SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(io PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 1 addition & 1 deletion src/io/src/OutNetProc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <RAT/Config.hh>
#include <RAT/Log.hh>
#include <RAT/OutNetProc.hh>
#include <RAT/string_utilities.hpp>
#include <string_utilities.hpp>
#include <vector>

namespace RAT {
Expand Down
4 changes: 2 additions & 2 deletions src/io/src/TrackCursor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#include <RAT/Log.hh>
#include <RAT/TrackCursor.hh>
#include <RAT/TrackNode.hh>
#include <RAT/dprintf.hpp>
#include <RAT/string_utilities.hpp>
#include <dprintf.hpp>
#include <iostream>
#include <string_utilities.hpp>

namespace RAT {

Expand Down
2 changes: 2 additions & 0 deletions src/physics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ add_library(physics OBJECT
)

# Set our include directories
target_include_directories(physics SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(physics PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 1 addition & 1 deletion src/physics/src/GLG4Scint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <RAT/NaiveQuenchingCalculator.hh>
#include <RAT/PhotonThinning.hh>
#include <RAT/TrackInfo.hh>
#include <RAT/fileio.hpp>
#include <fileio.hpp>

#include "G4Timer.hh"
#include "G4TrackFastVector.hh" // for G4TrackFastVectorSize
Expand Down
2 changes: 2 additions & 0 deletions src/ratbase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ add_library(ratbase OBJECT
src/AnyParse.cc)

# Set our include directories
target_include_directories(ratbase SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(ratbase PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
3 changes: 3 additions & 0 deletions src/stlplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ add_library(stlplus OBJECT
src/stringio.cc
src/textio.cc)

target_compile_options(stlplus PUBLIC -w)
# Set our include directories
target_include_directories(stlplus SYSTEM PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}/stlplus>)
target_include_directories(stlplus PUBLIC
$<BUILD_INTERFACE:${RATPAC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class hash_iterator {
hash_element<K, T>* m_element;

void check_owner(const hash<K, T, H, E>* owner) const throw();
void check_non_null(void) const throw();
void check_non_end(void) const throw();
void check_non_null(void) const;
void check_non_end(void) const;
void check_valid(void) const throw();
void check(const hash<K, T, H, E>* owner) const throw();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ void hash_iterator<K,T,H,E,V>::check_owner(const hash<K,T,H,E>* _owner) const

template<typename K, typename T, class H, class E, typename V>
void hash_iterator<K,T,H,E,V>::check_non_null(void) const
throw()
{
if (null())
throw null_dereference("hash iterator");
}

template<typename K, typename T, class H, class E, typename V>
void hash_iterator<K,T,H,E,V>::check_non_end(void) const
throw()
{
if (end())
throw end_dereference("hash iterator");
Expand Down
6 changes: 3 additions & 3 deletions src/stlplus/src/debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
License: BSD License, see ../docs/license.html

------------------------------------------------------------------------------*/
#include "RAT/debug.hpp"
#include "debug.hpp"

#include <stdlib.h>

#include "RAT/file_system.hpp"
#include "RAT/string_utilities.hpp"
#include "file_system.hpp"
#include "string_utilities.hpp"

////////////////////////////////////////////////////////////////////////////////

Expand Down
6 changes: 3 additions & 3 deletions src/stlplus/src/dprintf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
License: BSD License, see ../docs/license.html

------------------------------------------------------------------------------*/
#include "RAT/dprintf.hpp"
#include "dprintf.hpp"

#include <ctype.h>
#include <float.h>
#include <limits.h>
#include <stdio.h>

#include "RAT/debug.hpp"
#include "RAT/string_utilities.hpp"
#include "debug.hpp"
#include "string_utilities.hpp"

/*--------------------------------------------------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions src/stlplus/src/exceptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

------------------------------------------------------------------------------*/

#include "RAT/exceptions.hpp"
#include "exceptions.hpp"

#include "RAT/debug.hpp"
#include "RAT/fileio.hpp"
#include "debug.hpp"
#include "fileio.hpp"

////////////////////////////////////////////////////////////////////////////////

Expand Down
Loading
Loading