diff --git a/configure.ac b/configure.ac index 20f97754..90f3a453 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,7 @@ MUSR_LIBRARY_NAME=PMusr LEM_LIBRARY_NAME=TLemRunHeader PSIBIN_LIBRARY_NAME=Class_MuSR_PSI MUD_LIBRARY_NAME=mud +CUBA_LIBRARY_NAME=cuba dnl ----------------------------------------------- dnl Optional plug-ins @@ -105,6 +106,7 @@ AC_SUBST(MUSR_LIBRARY_NAME) AC_SUBST(LEM_LIBRARY_NAME) AC_SUBST(PSIBIN_LIBRARY_NAME) AC_SUBST(MUD_LIBRARY_NAME) +AC_SUBST(CUBA_LIBRARY_NAME) PSIBIN_VERSION=$PSIBIN_MAJOR_VERSION.$PSIBIN_MINOR_VERSION.$PSIBIN_MICRO_VERSION PSIBIN_RELEASE=$PSIBIN_MAJOR_VERSION.$PSIBIN_MINOR_VERSION @@ -499,6 +501,7 @@ LOCAL_LIB_LDFLAGS= case "$host" in *-*-cygwin) + ARCH=CYGWIN LOCAL_BIN_CXXFLAGS="${LOCAL_BIN_CXXFLAGS}" LOCAL_LIB_CXXFLAGS="${LOCAL_BIN_CXXFLAGS} -D_DLL" LOCAL_PSIBIN_LIB_CXXFLAGS="${LOCAL_LIB_CXXFLAGS} -D_WIN32GCC" @@ -507,8 +510,11 @@ case "$host" in LOCAL_BIN_LDFLAGS="${LOCAL_BIN_LDFLAGS} -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc" LOCAL_LIB_LDFLAGS="-no-undefined ${LOCAL_BIN_LDFLAGS} -Wl,--export-all-symbols" ;; + *-*-darwin*) + ARCH=DARWIN + ;; *) - LOCAL_PSIBIN_LIB_CXXFLAGS="${LOCAL_LIB_CXXFLAGS} -D__linux__" + ARCH=OTHERUNIX ;; esac @@ -547,6 +553,9 @@ dnl ----------------------------------------------- dnl Specify the files that are going to be created by configure dnl ----------------------------------------------- +AM_CONDITIONAL([IS_DARWIN], [test "${ARCH}" = "DARWIN"]) +AM_CONDITIONAL([IS_CYGWIN], [test "${ARCH}" = "CYGWIN"]) + AM_CONDITIONAL([BUILD_CUBALIB], [test "${BUILD_CUBA}" = "1"]) AM_CONDITIONAL([BUILD_BMWLIBS], [test "${BUILD_BMW_LIBS}" = "1"]) AM_CONDITIONAL([BUILD_ASLIBS], [test "${BUILD_AS_LIBS}" = "1"]) diff --git a/src/external/BMWIntegrator/BMWIntegrator.h b/src/external/BMWIntegrator/BMWIntegrator.h index 3fec935e..804fcd2f 100644 --- a/src/external/BMWIntegrator/BMWIntegrator.h +++ b/src/external/BMWIntegrator/BMWIntegrator.h @@ -92,15 +92,15 @@ class TMCIntegrator { virtual ~TMCIntegrator(); void SetParameters(const std::vector &par) const { fPar=par; } virtual double FuncAtX(double *) const = 0; - double IntegrateFunc(unsigned int, double *, double *); + double IntegrateFunc(size_t, double *, double *); protected: mutable vector fPar; private: - static double FuncAtXgsl(double *, unsigned int, void *); + static double FuncAtXgsl(double *, size_t, void *); ROOT::Math::GSLMCIntegrator *fMCIntegrator; - mutable double (*fFunc)(double *, unsigned int, void *); + mutable double (*fFunc)(double *, size_t, void *); }; inline TMCIntegrator::TMCIntegrator() : fFunc(0) { @@ -116,12 +116,12 @@ inline TMCIntegrator::~TMCIntegrator(){ fFunc=0; } -inline double TMCIntegrator::FuncAtXgsl(double *x, unsigned int dim, void *obj) +inline double TMCIntegrator::FuncAtXgsl(double *x, size_t dim, void *obj) { return ((TMCIntegrator*)obj)->FuncAtX(x); } -inline double TMCIntegrator::IntegrateFunc(unsigned int dim, double *x1, double *x2) +inline double TMCIntegrator::IntegrateFunc(size_t dim, double *x1, double *x2) { fFunc = &TMCIntegrator::FuncAtXgsl; return fMCIntegrator->Integral(fFunc, dim, x1, x2, (this)); diff --git a/src/external/Nonlocal/Makefile.am b/src/external/Nonlocal/Makefile.am index f9dc8690..7f1fd10e 100644 --- a/src/external/Nonlocal/Makefile.am +++ b/src/external/Nonlocal/Makefile.am @@ -46,3 +46,19 @@ libPNL_PippardFitter_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -relea ## pkgconfigdir = $(libdir)/pkgconfig ## pkgconfig_DATA = PNL_PippardFitter.pc +## However, create some symbolic links to the shared library +## in order to unify the function call on different operating systems + +if IS_DARWIN +install-exec-hook: + $(LN_S) $(libdir)/libPNL_PippardFitter.dylib $(libdir)/libPNL_PippardFitter.so +uninstall-hook: + rm -f $(libdir)/libPNL_PippardFitter.so +endif + +if IS_CYGWIN +install-exec-hook: + $(LN_S) $(libdir)/libPNL_PippardFitter.dll.a $(libdir)/libPNL_PippardFitter.so +uninstall-hook: + rm -f $(libdir)/libPNL_PippardFitter.so +endif diff --git a/src/external/TFitPofB-lib/classes/Makefile.am b/src/external/TFitPofB-lib/classes/Makefile.am index 66d902bb..18395848 100644 --- a/src/external/TFitPofB-lib/classes/Makefile.am +++ b/src/external/TFitPofB-lib/classes/Makefile.am @@ -63,3 +63,19 @@ libTFitPofB_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUG ## pkgconfigdir = $(libdir)/pkgconfig ## pkgconfig_DATA = PTFitPofB.pc +## However, create some symbolic links to the shared library +## in order to unify the function call on different operating systems + +if IS_DARWIN +install-exec-hook: + $(LN_S) $(libdir)/libTFitPofB.dylib $(libdir)/libTFitPofB.so +uninstall-hook: + rm -f $(libdir)/libTFitPofB.so +endif + +if IS_CYGWIN +install-exec-hook: + $(LN_S) $(libdir)/libTFitPofB.dll.a $(libdir)/libTFitPofB.so +uninstall-hook: + rm -f $(libdir)/libTFitPofB.so +endif diff --git a/src/external/TFitPofB-lib/include/TBulkTriVortexFieldCalc.h b/src/external/TFitPofB-lib/include/TBulkTriVortexFieldCalc.h index 3ff8db96..0d5b1d51 100644 --- a/src/external/TFitPofB-lib/include/TBulkTriVortexFieldCalc.h +++ b/src/external/TFitPofB-lib/include/TBulkTriVortexFieldCalc.h @@ -36,7 +36,7 @@ #include using namespace std; -#include +#include "fftw3.h" //-------------------- // Base class for any kind of vortex symmetry diff --git a/src/external/TFitPofB-lib/include/TPofTCalc.h b/src/external/TFitPofB-lib/include/TPofTCalc.h index 4b40beff..43d11f14 100644 --- a/src/external/TFitPofB-lib/include/TPofTCalc.h +++ b/src/external/TFitPofB-lib/include/TPofTCalc.h @@ -33,7 +33,7 @@ #define _TPofTCalc_H_ #include "TPofBCalc.h" -#include +#include "fftw3.h" #include #define PI 3.14159265358979323846 diff --git a/src/external/libCalcMeanFieldsLEM/Makefile.am b/src/external/libCalcMeanFieldsLEM/Makefile.am index d30ab6f1..31abb7b3 100644 --- a/src/external/libCalcMeanFieldsLEM/Makefile.am +++ b/src/external/libCalcMeanFieldsLEM/Makefile.am @@ -18,7 +18,7 @@ dict_cpp_sources = \ include_HEADERS = $(h_sources) noinst_HEADERS = $(h_linkdef) $(dict_h_sources) -INCLUDES = -I$(top_srcdir)/src/include $(TFITPOFB_CFLAGS) $(PMUSR_CFLAGS) $(ROOT_CFLAGS) +INCLUDES = -I$(top_srcdir)/src/include $(TFITPOFB_CFLAGS) $(PMUSR_CFLAGS) $(ROOT_CFLAGS) $(FFTW3_CFLAGS) AM_CXXFLAGS = $(LOCAL_LIB_CXXFLAGS) BUILT_SOURCES = $(dict_cpp_sources) $(dict_h_sources) @@ -38,3 +38,19 @@ libCalcMeanFieldsLEM_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -relea ## pkgconfigdir = $(libdir)/pkgconfig ## pkgconfig_DATA = CalcMeanFieldsLEM.pc +## However, create some symbolic links to the shared library +## in order to unify the function call on different operating systems + +if IS_DARWIN +install-exec-hook: + $(LN_S) $(libdir)/libCalcMeanFieldsLEM.dylib $(libdir)/libCalcMeanFieldsLEM.so +uninstall-hook: + rm -f $(libdir)/libCalcMeanFieldsLEM.so +endif + +if IS_CYGWIN +install-exec-hook: + $(LN_S) $(libdir)/libCalcMeanFieldsLEM.dll.a $(libdir)/libCalcMeanFieldsLEM.so +uninstall-hook: + rm -f $(libdir)/libCalcMeanFieldsLEM.so +endif diff --git a/src/external/libGapIntegrals/Makefile.am b/src/external/libGapIntegrals/Makefile.am index a22b0ccc..f1753324 100644 --- a/src/external/libGapIntegrals/Makefile.am +++ b/src/external/libGapIntegrals/Makefile.am @@ -40,3 +40,19 @@ libGapIntegrals_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $( ## pkgconfigdir = $(libdir)/pkgconfig ## pkgconfig_DATA = GapIntegrals.pc +## However, create some symbolic links to the shared library +## in order to unify the function call on different operating systems + +if IS_DARWIN +install-exec-hook: + $(LN_S) $(libdir)/libGapIntegrals.dylib $(libdir)/libGapIntegrals.so +uninstall-hook: + rm -f $(libdir)/libGapIntegrals.so +endif + +if IS_CYGWIN +install-exec-hook: + $(LN_S) $(libdir)/libGapIntegrals.dll.a $(libdir)/libGapIntegrals.so +uninstall-hook: + rm -f $(libdir)/libGapIntegrals.so +endif diff --git a/src/external/libLFRelaxation/Makefile.am b/src/external/libLFRelaxation/Makefile.am index 4c199220..5fe462a2 100644 --- a/src/external/libLFRelaxation/Makefile.am +++ b/src/external/libLFRelaxation/Makefile.am @@ -40,3 +40,19 @@ libLFRelaxation_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $( ## pkgconfigdir = $(libdir)/pkgconfig ## pkgconfig_DATA = LFRelaxation.pc +## However, create some symbolic links to the shared library +## in order to unify the function call on different operating systems + +if IS_DARWIN +install-exec-hook: + $(LN_S) $(libdir)/libLFRelaxation.dylib $(libdir)/libLFRelaxation.so +uninstall-hook: + rm -f $(libdir)/libLFRelaxation.so +endif + +if IS_CYGWIN +install-exec-hook: + $(LN_S) $(libdir)/libLFRelaxation.dll.a $(libdir)/libLFRelaxation.so +uninstall-hook: + rm -f $(libdir)/libLFRelaxation.so +endif \ No newline at end of file diff --git a/src/external/libLFRelaxation/TLFRelaxation.cpp b/src/external/libLFRelaxation/TLFRelaxation.cpp index abd1a3f4..ae24398c 100644 --- a/src/external/libLFRelaxation/TLFRelaxation.cpp +++ b/src/external/libLFRelaxation/TLFRelaxation.cpp @@ -132,7 +132,7 @@ double TLFStatLorKT::operator()(double t, const vector &par) const { // LF Dynamic Gaussian KT -TLFDynGssKT::TLFDynGssKT() : fCalcNeeded(true), fFirstCall(true), fWisdom("/home/l_wojek/analysis/WordsOfWisdom.dat"), fNSteps(524288), fDt(0.00004), fCounter(0) { +TLFDynGssKT::TLFDynGssKT() : fCalcNeeded(true), fFirstCall(true), fWisdom("WordsOfWisdom.dat"), fNSteps(524288), fDt(0.00004), fCounter(0) { // Calculate d_omega and C for given NFFT and dt fDw = PI/fNSteps/fDt; fC = 2.0*gsl_sf_log(double(fNSteps))/(double(fNSteps-1)*fDt); @@ -228,11 +228,11 @@ double TLFDynGssKT::operator()(double t, const vector &par) const { if(fCalcNeeded) { - double t1,t2; +/* double t1,t2; // get start time struct timeval tv_start, tv_stop; gettimeofday(&tv_start, 0); - +*/ double tt(0.),sigsqtsq(0.); if(fabs(par[0])<0.00135538817) { @@ -262,10 +262,10 @@ double TLFDynGssKT::operator()(double t, const vector &par) const { fFFTtime[i]=(1.0-(coeff1*(1.0-exp(-0.5*sigsq*tt*tt)*gsl_sf_cos(omegaL*tt)))+(coeff2*totoIntegrale))*exp(mcplusnu*tt)*fDt; } } - +/* gettimeofday(&tv_stop, 0); t1 = (tv_stop.tv_sec - tv_start.tv_sec)*1000.0 + (tv_stop.tv_usec - tv_start.tv_usec)/1000.0; - +*/ // Transform to frequency domain fftw_execute(fFFTplanFORW); @@ -291,11 +291,11 @@ double TLFDynGssKT::operator()(double t, const vector &par) const { // } fCalcNeeded=false; fCounter++; - +/* gettimeofday(&tv_stop, 0); t2 = (tv_stop.tv_sec - tv_start.tv_sec)*1000.0 + (tv_stop.tv_usec - tv_start.tv_usec)/1000.0; cout << "# Calculation times: " << t1 << " (ms), " << t2 << " (ms)" << endl; - +*/ } // return fFFTtime[int(t/fDt)]; return fDw*exp(fC*t)/PI*fFFTtime[int(t/fDt)]; @@ -303,7 +303,7 @@ double TLFDynGssKT::operator()(double t, const vector &par) const { // LF Dynamic Lorentz KT -TLFDynLorKT::TLFDynLorKT() : fCalcNeeded(true), fFirstCall(true), fWisdom("/home/l_wojek/analysis/WordsOfWisdom.dat"), fNSteps(524288), fDt(0.000040), fCounter(0), fL1(0.0), fL2(0.0) { +TLFDynLorKT::TLFDynLorKT() : fCalcNeeded(true), fFirstCall(true), fWisdom("WordsOfWisdom.dat"), fNSteps(524288), fDt(0.000040), fCounter(0), fL1(0.0), fL2(0.0) { // Calculate d_omega and C for given NFFT and dt fDw = TMath::Pi()/fNSteps/fDt; fC = 2.0*TMath::Log(double(fNSteps))/(double(fNSteps-1)*fDt); @@ -329,8 +329,8 @@ TLFDynLorKT::TLFDynLorKT() : fCalcNeeded(true), fFirstCall(true), fWisdom("/home fFFTtime = (double *)malloc(sizeof(double) * fNSteps); fFFTfreq = (fftw_complex *)fftw_malloc(sizeof(fftw_complex) * (fNSteps/2+1)); - fFFTplanFORW = fftw_plan_dft_r2c_1d(fNSteps, fFFTtime, fFFTfreq, FFTW_EXHAUSTIVE); - fFFTplanBACK = fftw_plan_dft_c2r_1d(fNSteps, fFFTfreq, fFFTtime, FFTW_EXHAUSTIVE); + fFFTplanFORW = fftw_plan_dft_r2c_1d(fNSteps, fFFTtime, fFFTfreq, FFTW_ESTIMATE); + fFFTplanBACK = fftw_plan_dft_c2r_1d(fNSteps, fFFTfreq, fFFTtime, FFTW_ESTIMATE); } TLFDynLorKT::~TLFDynLorKT() { diff --git a/src/external/libLFRelaxation/TLFRelaxation.h b/src/external/libLFRelaxation/TLFRelaxation.h index c5324b74..44a349b0 100644 --- a/src/external/libLFRelaxation/TLFRelaxation.h +++ b/src/external/libLFRelaxation/TLFRelaxation.h @@ -38,17 +38,11 @@ using namespace std; -//#include -//#include -//#include -//#include -//#include - -#include "/usr/include/gsl/gsl_math.h" -#include "/usr/include/gsl/gsl_sf_exp.h" -#include "/usr/include/gsl/gsl_sf_log.h" -#include "/usr/include/gsl/gsl_sf_trig.h" -#include "/usr/include/gsl/gsl_sf_bessel.h" +#include "gsl/gsl_math.h" +#include "gsl/gsl_sf_exp.h" +#include "gsl/gsl_sf_log.h" +#include "gsl/gsl_sf_trig.h" +#include "gsl/gsl_sf_bessel.h" //#include "TMath.h"