Removed the user-function dependency on libPMusr

It should now be possible to build a static version of musrfit and shared libraries for the user functions.
This is needed on systems which do not support linking static libraries to shared ones (like Cygwin).
These changes still need to be tested on Cygwin, especially with user functions implementing the "global interface".
This commit is contained in:
Bastian M. Wojek
2011-04-13 08:18:14 +00:00
parent f471eb2efe
commit 1024f5a28f
11 changed files with 20 additions and 19 deletions

View File

@ -9,6 +9,7 @@ changes since 0.9.0
FIXED Makefiles so that the NeXus support will not be built if it has not been enabled during the configure stage FIXED Makefiles so that the NeXus support will not be built if it has not been enabled during the configure stage
FIXED ASCII export from musrview in case of a Fourier-Power- or Fourier-Phase-difference plot FIXED ASCII export from musrview in case of a Fourier-Power- or Fourier-Phase-difference plot
FIXED bug in asymmetry fit with fixed background FIXED bug in asymmetry fit with fixed background
REMOVED the user-function dependency on libPMusr
musrfit 0.9.0 - changes since 0.8.0 musrfit 0.9.0 - changes since 0.8.0
=================================== ===================================

View File

@ -808,6 +808,6 @@ AC_CONFIG_FILES([Makefile \
src/external/libGapIntegrals/Makefile \ src/external/libGapIntegrals/Makefile \
src/external/libCalcMeanFieldsLEM/Makefile \ src/external/libCalcMeanFieldsLEM/Makefile \
src/external/Nonlocal/Makefile \ src/external/Nonlocal/Makefile \
src/external/MagProximity/Makefile]) src/external/MagProximity/Makefile])
AC_OUTPUT AC_OUTPUT

View File

@ -39,7 +39,7 @@ CLEANFILES = *Dict.cpp *Dict.h *~ core
lib_LTLIBRARIES = libPMagProximityFitter.la lib_LTLIBRARIES = libPMagProximityFitter.la
libPMagProximityFitter_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources) libPMagProximityFitter_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources)
libPMagProximityFitter_la_LIBADD = $(PMUSR_LIBS) $(FFTW3_LIBS) $(ROOT_LIBS) libPMagProximityFitter_la_LIBADD = $(FFTW3_LIBS) $(ROOT_LIBS)
libPMagProximityFitter_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS) libPMagProximityFitter_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS)
## For the moment do not build pkgconfig files for musrfit plug-ins... ## For the moment do not build pkgconfig files for musrfit plug-ins...

View File

@ -39,7 +39,7 @@ CLEANFILES = *Dict.cpp *Dict.h *~ core
lib_LTLIBRARIES = libPNL_PippardFitter.la lib_LTLIBRARIES = libPNL_PippardFitter.la
libPNL_PippardFitter_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources) libPNL_PippardFitter_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources)
libPNL_PippardFitter_la_LIBADD = $(PMUSR_LIBS) $(FFTW3_LIBS) $(ROOT_LIBS) libPNL_PippardFitter_la_LIBADD = $(FFTW3_LIBS) $(ROOT_LIBS)
libPNL_PippardFitter_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS) libPNL_PippardFitter_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS)
## For the moment do not build pkgconfig files for musrfit plug-ins... ## For the moment do not build pkgconfig files for musrfit plug-ins...

View File

@ -32,7 +32,7 @@ CLEANFILES = *Dict.cpp *Dict.h *~ core
lib_LTLIBRARIES = libCalcMeanFieldsLEM.la lib_LTLIBRARIES = libCalcMeanFieldsLEM.la
libCalcMeanFieldsLEM_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources) libCalcMeanFieldsLEM_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources)
libCalcMeanFieldsLEM_la_LIBADD = $(BMWTOOLS_LIBS) $(FITPOFB_LIBS) $(PMUSR_LIBS) $(ROOT_LIBS) libCalcMeanFieldsLEM_la_LIBADD = $(BMWTOOLS_LIBS) $(FITPOFB_LIBS) $(ROOT_LIBS)
libCalcMeanFieldsLEM_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS) libCalcMeanFieldsLEM_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS)
## For the moment do not build pkgconfig files for musrfit plug-ins... ## For the moment do not build pkgconfig files for musrfit plug-ins...

View File

@ -50,7 +50,7 @@ CLEANFILES = *Dict.cpp *Dict.h *~ ../include/*~ core
lib_LTLIBRARIES = libFitPofB.la lib_LTLIBRARIES = libFitPofB.la
libFitPofB_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources) libFitPofB_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources)
libFitPofB_la_LIBADD = $(BMWTOOLS_LIBS) $(LEM_LIBS) $(PMUSR_LIBS) $(FFTW3_LIBS) $(ROOT_LIBS) libFitPofB_la_LIBADD = $(BMWTOOLS_LIBS) $(LEM_LIBS) $(FFTW3_LIBS) $(ROOT_LIBS)
libFitPofB_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS) libFitPofB_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS)
## For the moment do not build pkgconfig files for musrfit plug-ins... ## For the moment do not build pkgconfig files for musrfit plug-ins...

View File

@ -32,7 +32,7 @@ CLEANFILES = *Dict.cpp *Dict.h *~ core
lib_LTLIBRARIES = libGapIntegrals.la lib_LTLIBRARIES = libGapIntegrals.la
libGapIntegrals_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources) libGapIntegrals_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources)
libGapIntegrals_la_LIBADD = $(BMWTOOLS_LIBS) $(PMUSR_LIBS) $(GSL_LIBS) $(ROOT_LIBS) $(CUBA_LIBS) libGapIntegrals_la_LIBADD = $(BMWTOOLS_LIBS) $(GSL_LIBS) $(ROOT_LIBS) $(CUBA_LIBS)
libGapIntegrals_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS) libGapIntegrals_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS)
## For the moment do not build pkgconfig files for musrfit plug-ins... ## For the moment do not build pkgconfig files for musrfit plug-ins...

View File

@ -32,7 +32,7 @@ CLEANFILES = *Dict.cpp *Dict.h *~ core
lib_LTLIBRARIES = libLFRelaxation.la lib_LTLIBRARIES = libLFRelaxation.la
libLFRelaxation_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources) libLFRelaxation_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources)
libLFRelaxation_la_LIBADD = $(BMWTOOLS_LIBS) $(PMUSR_LIBS) $(FFTW3_LIBS) $(GSL_LIBS) $(ROOT_LIBS) $(CUBA_LIBS) libLFRelaxation_la_LIBADD = $(BMWTOOLS_LIBS) $(FFTW3_LIBS) $(GSL_LIBS) $(ROOT_LIBS) $(CUBA_LIBS)
libLFRelaxation_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS) libLFRelaxation_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS)
## For the moment do not build pkgconfig files for musrfit plug-ins... ## For the moment do not build pkgconfig files for musrfit plug-ins...

View File

@ -290,7 +290,7 @@ int PNeXus::ReadFile(const char *fileName)
// read 'magnetic_field_vector' and 'coordinate_system' attribute // read 'magnetic_field_vector' and 'coordinate_system' attribute
if (!ErrorHandler(NXopendata(fFileHandle, "magnetic_field_vector"), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'magnetic_field_vector' data in sample group!")) return NX_ERROR; if (!ErrorHandler(NXopendata(fFileHandle, "magnetic_field_vector"), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'magnetic_field_vector' data in sample group!")) return NX_ERROR;
int attLen = SIZE_INT32, attType = NX_INT32; int attLen = SIZE_INT32, attType = NX_INT32;
if (!ErrorHandler(NXgetattr(fFileHandle, "available", &fSample.fMagneticFieldVectorAvailable, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'magnetic_field_vector available' data in sample group!")) return NX_ERROR; if (!ErrorHandler(NXgetattr(fFileHandle, const_cast<char*>("available"), &fSample.fMagneticFieldVectorAvailable, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'magnetic_field_vector available' data in sample group!")) return NX_ERROR;
if (fSample.fMagneticFieldVectorAvailable) { if (fSample.fMagneticFieldVectorAvailable) {
if (!ErrorHandler(GetDoubleVectorData(fSample.fMagneticFieldVector), PNEXUS_GET_DATA_ERROR, "couldn't get 'magnetic_field_vector' data!")) return NX_ERROR; if (!ErrorHandler(GetDoubleVectorData(fSample.fMagneticFieldVector), PNEXUS_GET_DATA_ERROR, "couldn't get 'magnetic_field_vector' data!")) return NX_ERROR;
} }
@ -375,29 +375,29 @@ int PNeXus::ReadFile(const char *fileName)
// get number of histos // get number of histos
attLen = SIZE_INT32; attLen = SIZE_INT32;
attType = NX_INT32; attType = NX_INT32;
if (!ErrorHandler(NXgetattr(fFileHandle, "number", &fData.fNumberOfHistos, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'number' data in histogram_data_1 group!")) return NX_ERROR; if (!ErrorHandler(NXgetattr(fFileHandle, const_cast<char*>("number"), &fData.fNumberOfHistos, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'number' data in histogram_data_1 group!")) return NX_ERROR;
// get histo length // get histo length
attLen = SIZE_INT32; attLen = SIZE_INT32;
attType = NX_INT32; attType = NX_INT32;
if (!ErrorHandler(NXgetattr(fFileHandle, "length", &histoLength, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'number' data in histogram_data_1 group!")) return NX_ERROR; if (!ErrorHandler(NXgetattr(fFileHandle, const_cast<char*>("length"), &histoLength, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'number' data in histogram_data_1 group!")) return NX_ERROR;
// get t0 // get t0
attLen = SIZE_INT32; attLen = SIZE_INT32;
attType = NX_INT32; attType = NX_INT32;
if (!ErrorHandler(NXgetattr(fFileHandle, "t0_bin", &ival, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 't0_bin' data in histogram_data_1 group!")) return NX_ERROR; if (!ErrorHandler(NXgetattr(fFileHandle, const_cast<char*>("t0_bin"), &ival, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 't0_bin' data in histogram_data_1 group!")) return NX_ERROR;
fData.fT0.push_back(ival); fData.fT0.push_back(ival);
// get first good bin // get first good bin
attLen = SIZE_INT32; attLen = SIZE_INT32;
attType = NX_INT32; attType = NX_INT32;
if (!ErrorHandler(NXgetattr(fFileHandle, "first_good_bin", &ival, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'first_good_bin' data in histogram_data_1 group!")) return NX_ERROR; if (!ErrorHandler(NXgetattr(fFileHandle, const_cast<char*>("first_good_bin"), &ival, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'first_good_bin' data in histogram_data_1 group!")) return NX_ERROR;
fData.fFirstGoodBin.push_back(ival); fData.fFirstGoodBin.push_back(ival);
// get last good bin // get last good bin
attLen = SIZE_INT32; attLen = SIZE_INT32;
attType = NX_INT32; attType = NX_INT32;
if (!ErrorHandler(NXgetattr(fFileHandle, "last_good_bin", &ival, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'last_good_bin' data in histogram_data_1 group!")) return NX_ERROR; if (!ErrorHandler(NXgetattr(fFileHandle, const_cast<char*>("last_good_bin"), &ival, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'last_good_bin' data in histogram_data_1 group!")) return NX_ERROR;
fData.fLastGoodBin.push_back(ival); fData.fLastGoodBin.push_back(ival);
// get data // get data
@ -460,7 +460,7 @@ int PNeXus::ReadFile(const char *fileName)
if (!ErrorHandler(NXopendata(fFileHandle, "grouping"), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'grouping' data in histogram_data_1 group!")) return NX_ERROR; if (!ErrorHandler(NXopendata(fFileHandle, "grouping"), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'grouping' data in histogram_data_1 group!")) return NX_ERROR;
attLen = SIZE_INT32; attLen = SIZE_INT32;
attType = NX_INT32; attType = NX_INT32;
if (!ErrorHandler(NXgetattr(fFileHandle, "available", &ival, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'grouping available' data in histogram_data_1 group!")) return NX_ERROR; if (!ErrorHandler(NXgetattr(fFileHandle, const_cast<char*>("available"), &ival, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'grouping available' data in histogram_data_1 group!")) return NX_ERROR;
if (ival) { if (ival) {
vector<int> grouping; vector<int> grouping;
if (!ErrorHandler(GetIntVectorData(grouping), PNEXUS_GET_DATA_ERROR, "couldn't read 'grouping' data in histogram_data_1 group!")) return NX_ERROR; if (!ErrorHandler(GetIntVectorData(grouping), PNEXUS_GET_DATA_ERROR, "couldn't read 'grouping' data in histogram_data_1 group!")) return NX_ERROR;
@ -474,7 +474,7 @@ int PNeXus::ReadFile(const char *fileName)
if (!ErrorHandler(NXopendata(fFileHandle, "alpha"), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'alpha' data in histogram_data_1 group!")) return NX_ERROR; if (!ErrorHandler(NXopendata(fFileHandle, "alpha"), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'alpha' data in histogram_data_1 group!")) return NX_ERROR;
attLen = SIZE_INT32; attLen = SIZE_INT32;
attType = NX_INT32; attType = NX_INT32;
if (!ErrorHandler(NXgetattr(fFileHandle, "available", &ival, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'alpha available' data in histogram_data_1 group!")) return NX_ERROR; if (!ErrorHandler(NXgetattr(fFileHandle, const_cast<char*>("available"), &ival, &attLen, &attType), PNEXUS_OPEN_DATA_ERROR, "couldn't open 'alpha available' data in histogram_data_1 group!")) return NX_ERROR;
if (ival) { if (ival) {
if (!ErrorHandler(NXgetinfo(fFileHandle, &rank, dims, &type), PNEXUS_GET_META_INFO_ERROR, "couldn't get alpha info!")) return NX_ERROR; if (!ErrorHandler(NXgetinfo(fFileHandle, &rank, dims, &type), PNEXUS_GET_META_INFO_ERROR, "couldn't get alpha info!")) return NX_ERROR;
// calculate the needed size // calculate the needed size
@ -1388,7 +1388,7 @@ void PNeXus::Init()
* \param errCode will set the fErrorCode of the class * \param errCode will set the fErrorCode of the class
* \param errMsg will set the fErrorMsg of the class * \param errMsg will set the fErrorMsg of the class
*/ */
bool PNeXus::ErrorHandler(NXstatus status, int errCode, string errMsg) bool PNeXus::ErrorHandler(NXstatus status, int errCode, const string &errMsg)
{ {
if (status != NX_OK) { if (status != NX_OK) {
fErrorCode = errCode; fErrorCode = errCode;

View File

@ -299,7 +299,7 @@ class PNeXus {
virtual void Init(); virtual void Init();
virtual void CleanUp(); virtual void CleanUp();
virtual bool ErrorHandler(NXstatus status, int errCode, string errMsg); virtual bool ErrorHandler(NXstatus status, int errCode, const string &errMsg);
virtual NXstatus GetStringData(string &str); virtual NXstatus GetStringData(string &str);
virtual NXstatus GetStringAttr(string attr, string &str); virtual NXstatus GetStringAttr(string attr, string &str);
virtual int GetDataSize(int type); virtual int GetDataSize(int type);