diff --git a/configure.ac b/configure.ac index a37f17fd..ef7ec0cb 100644 --- a/configure.ac +++ b/configure.ac @@ -731,6 +731,7 @@ LOCAL_LIB_LDFLAGS= case "$host" in *-*-cygwin) ARCH=CYGWIN + AC_DEFINE([_WIN32GCC], [1], [Define to 1 if host system is Cygwin]) LOCAL_BIN_CXXFLAGS="${LOCAL_BIN_CXXFLAGS}" LOCAL_LIB_CXXFLAGS="${LOCAL_BIN_CXXFLAGS} -D_DLL" LOCAL_PSIBIN_LIB_CXXFLAGS="${LOCAL_LIB_CXXFLAGS} -D_WIN32GCC" diff --git a/src/external/libFitPofB/classes/TBulkTriVortexFieldCalc.cpp b/src/external/libFitPofB/classes/TBulkTriVortexFieldCalc.cpp index a348acb1..bff8fb47 100644 --- a/src/external/libFitPofB/classes/TBulkTriVortexFieldCalc.cpp +++ b/src/external/libFitPofB/classes/TBulkTriVortexFieldCalc.cpp @@ -135,16 +135,12 @@ TBulkTriVortexLondonFieldCalc::TBulkTriVortexLondonFieldCalc(const string& wisdo fParam.resize(3); fGridExists = false; -#ifdef HAVE_LIBFFTW3_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3_THREADS) && defined(HAVE_GOMP) int init_threads(fftw_init_threads()); if (init_threads) { -#ifdef HAVE_GOMP fftw_plan_with_nthreads(omp_get_num_procs()); -#else - fftw_plan_with_nthreads(2); -#endif /* HAVE_GOMP */ } -#endif /* HAVE_LIBFFTW3_THREADS */ +#endif fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps]; fFFTout = new double[fSteps*fSteps]; @@ -318,16 +314,12 @@ TBulkSqVortexLondonFieldCalc::TBulkSqVortexLondonFieldCalc(const string& wisdom, fParam.resize(3); fGridExists = false; -#ifdef HAVE_LIBFFTW3_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3_THREADS) && defined(HAVE_GOMP) int init_threads(fftw_init_threads()); if (init_threads) { -#ifdef HAVE_GOMP fftw_plan_with_nthreads(omp_get_num_procs()); -#else - fftw_plan_with_nthreads(2); -#endif /* HAVE_GOMP */ } -#endif /* HAVE_LIBFFTW3_THREADS */ +#endif fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps]; fFFTout = new double[fSteps*fSteps]; @@ -469,16 +461,12 @@ TBulkTriVortexMLFieldCalc::TBulkTriVortexMLFieldCalc(const string& wisdom, const fParam.resize(3); fGridExists = false; -#ifdef HAVE_LIBFFTW3_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3_THREADS) && defined(HAVE_GOMP) int init_threads(fftw_init_threads()); if (init_threads) { -#ifdef HAVE_GOMP fftw_plan_with_nthreads(omp_get_num_procs()); -#else - fftw_plan_with_nthreads(2); -#endif /* HAVE_GOMP */ } -#endif /* HAVE_LIBFFTW3_THREADS */ +#endif fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps]; fFFTout = new double[fSteps*fSteps]; @@ -669,16 +657,12 @@ TBulkTriVortexAGLFieldCalc::TBulkTriVortexAGLFieldCalc(const string& wisdom, con fParam.resize(3); fGridExists = false; -#ifdef HAVE_LIBFFTW3_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3_THREADS) && defined(HAVE_GOMP) int init_threads(fftw_init_threads()); if (init_threads) { -#ifdef HAVE_GOMP fftw_plan_with_nthreads(omp_get_num_procs()); -#else - fftw_plan_with_nthreads(2); -#endif /* HAVE_GOMP */ } -#endif /* HAVE_LIBFFTW3_THREADS */ +#endif fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps]; fFFTout = new double[fSteps*fSteps]; @@ -878,16 +862,12 @@ TBulkTriVortexAGLIIFieldCalc::TBulkTriVortexAGLIIFieldCalc(const string& wisdom, fParam.resize(3); fGridExists = false; -#ifdef HAVE_LIBFFTW3_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3_THREADS) && defined(HAVE_GOMP) int init_threads(fftw_init_threads()); if (init_threads) { -#ifdef HAVE_GOMP fftw_plan_with_nthreads(omp_get_num_procs()); -#else - fftw_plan_with_nthreads(2); -#endif /* HAVE_GOMP */ } -#endif /* HAVE_LIBFFTW3_THREADS */ +#endif fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps]; fFFTout = new double[fSteps*fSteps]; @@ -1100,16 +1080,12 @@ TBulkTriVortexNGLFieldCalc::TBulkTriVortexNGLFieldCalc(const string& wisdom, con fParam.resize(3); fGridExists = false; -#ifdef HAVE_LIBFFTW3_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3_THREADS) && defined(HAVE_GOMP) int init_threads(fftw_init_threads()); if (init_threads) { -#ifdef HAVE_GOMP fftw_plan_with_nthreads(omp_get_num_procs()); -#else - fftw_plan_with_nthreads(2); -#endif /* HAVE_GOMP */ } -#endif /* HAVE_LIBFFTW3_THREADS */ +#endif const unsigned int stepsSq(fSteps*fSteps); @@ -2374,16 +2350,12 @@ TBulkAnisotropicTriVortexLondonFieldCalc::TBulkAnisotropicTriVortexLondonFieldCa fParam.resize(3); fGridExists = false; -#ifdef HAVE_LIBFFTW3_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3_THREADS) && defined(HAVE_GOMP) int init_threads(fftw_init_threads()); if (init_threads) { -#ifdef HAVE_GOMP fftw_plan_with_nthreads(omp_get_num_procs()); -#else - fftw_plan_with_nthreads(2); -#endif /* HAVE_GOMP */ } -#endif /* HAVE_LIBFFTW3_THREADS */ +#endif fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps]; fFFTout = new double[fSteps*fSteps]; @@ -2595,16 +2567,12 @@ TBulkAnisotropicTriVortexMLFieldCalc::TBulkAnisotropicTriVortexMLFieldCalc(const fParam.resize(3); fGridExists = false; -#ifdef HAVE_LIBFFTW3_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3_THREADS) && defined(HAVE_GOMP) int init_threads(fftw_init_threads()); if (init_threads) { -#ifdef HAVE_GOMP fftw_plan_with_nthreads(omp_get_num_procs()); -#else - fftw_plan_with_nthreads(2); -#endif /* HAVE_GOMP */ } -#endif /* HAVE_LIBFFTW3_THREADS */ +#endif fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps]; fFFTout = new double[fSteps*fSteps]; @@ -2798,16 +2766,12 @@ TBulkAnisotropicTriVortexAGLFieldCalc::TBulkAnisotropicTriVortexAGLFieldCalc(con fParam.resize(3); fGridExists = false; -#ifdef HAVE_LIBFFTW3_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3_THREADS) && defined(HAVE_GOMP) int init_threads(fftw_init_threads()); if (init_threads) { -#ifdef HAVE_GOMP fftw_plan_with_nthreads(omp_get_num_procs()); -#else - fftw_plan_with_nthreads(2); -#endif /* HAVE_GOMP */ } -#endif /* HAVE_LIBFFTW3_THREADS */ +#endif fFFTin = new fftw_complex[(fSteps/2 + 1) * fSteps]; fFFTout = new double[fSteps*fSteps]; diff --git a/src/external/libFitPofB/classes/TFilmTriVortexFieldCalc.cpp b/src/external/libFitPofB/classes/TFilmTriVortexFieldCalc.cpp index b97aa37f..973490a5 100644 --- a/src/external/libFitPofB/classes/TFilmTriVortexFieldCalc.cpp +++ b/src/external/libFitPofB/classes/TFilmTriVortexFieldCalc.cpp @@ -155,16 +155,12 @@ TFilmTriVortexNGLFieldCalc::TFilmTriVortexNGLFieldCalc(const string& wisdom, con fParam.resize(3); fGridExists = false; -#ifdef HAVE_LIBFFTW3_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3F_THREADS) && defined(HAVE_GOMP) int init_threads(fftwf_init_threads()); if (init_threads) { -#ifdef HAVE_GOMP fftwf_plan_with_nthreads(omp_get_num_procs()); -#else - fftwf_plan_with_nthreads(2); -#endif /* HAVE_GOMP */ } -#endif /* HAVE_LIBFFTW3_THREADS */ +#endif const unsigned int stepsSqStZ(fSteps*fSteps*fStepsZ); diff --git a/src/external/libFitPofB/classes/TPofTCalc.cpp b/src/external/libFitPofB/classes/TPofTCalc.cpp index fe11bb1b..768cda83 100644 --- a/src/external/libFitPofB/classes/TPofTCalc.cpp +++ b/src/external/libFitPofB/classes/TPofTCalc.cpp @@ -70,19 +70,13 @@ TPofTCalc::TPofTCalc (const TPofBCalc *PofB, const string &wisdom, const vector &par) : fWisdom(wisdom) { - -#ifdef HAVE_LIBFFTW3_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3_THREADS) && defined(HAVE_GOMP) int init_threads(fftw_init_threads()); if (!init_threads) cout << "TPofTCalc::TPofTCalc: Couldn't initialize multiple FFTW-threads ..." << endl; - else { -#ifdef HAVE_GOMP + else fftw_plan_with_nthreads(omp_get_num_procs()); -#else - fftw_plan_with_nthreads(2); -#endif /* HAVE_GOMP */ - } -#endif /* HAVE_LIBFFTW3_THREADS */ +#endif fNFFT = static_cast(1.0/(gBar*par[1]*par[2])); if (fNFFT % 2) { diff --git a/src/external/libLFRelaxation/TLFRelaxation.cpp b/src/external/libLFRelaxation/TLFRelaxation.cpp index 00c6bc65..9ef20c6b 100644 --- a/src/external/libLFRelaxation/TLFRelaxation.cpp +++ b/src/external/libLFRelaxation/TLFRelaxation.cpp @@ -187,18 +187,13 @@ double TLFStatExpKT::operator()(double t, const vector &par) const { */ TLFDynGssKT::TLFDynGssKT() : fCalcNeeded(true), fFirstCall(true), fCounter(0) { -#ifdef HAVE_LIBFFTW3F_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3F_THREADS) && defined(HAVE_GOMP) int init_threads(fftwf_init_threads()); if (!init_threads) cout << "TLFDynGssKT::TLFDynGssKT: Couldn't initialize multiple FFTW-threads ..." << endl; - else { -#ifdef HAVE_GOMP + else fftwf_plan_with_nthreads(omp_get_num_procs()); -#else - fftwf_plan_with_nthreads(1); -#endif /* HAVE_GOMP */ - } -#endif /* HAVE_LIBFFTW3F_THREADS */ +#endif // read startup file string startup_path_name("BMW_startup.xml"); @@ -514,18 +509,13 @@ double TLFDynSG::operator()(double t, const vector &par) const { */ TLFDynExpKT::TLFDynExpKT() : fCalcNeeded(true), fFirstCall(true), fCounter(0), fL1(0.0), fL2(0.0) { -#ifdef HAVE_LIBFFTW3F_THREADS +#if !defined(_WIN32GCC) && defined(HAVE_LIBFFTW3F_THREADS) && defined(HAVE_GOMP) int init_threads(fftwf_init_threads()); if (!init_threads) cout << "TLFDynExpKT::TLFDynExpKT: Couldn't initialize multiple FFTW-threads ..." << endl; - else { -#ifdef HAVE_GOMP + else fftwf_plan_with_nthreads(omp_get_num_procs()); -#else - fftwf_plan_with_nthreads(1); -#endif /* HAVE_GOMP */ - } -#endif /* HAVE_LIBFFTW3F_THREADS */ +#endif // read startup file string startup_path_name("BMW_startup.xml"); diff --git a/src/musredit/PGetAsymmetryRunBlockDialog.cpp b/src/musredit/PGetAsymmetryRunBlockDialog.cpp index 70036ae6..4153afae 100644 --- a/src/musredit/PGetAsymmetryRunBlockDialog.cpp +++ b/src/musredit/PGetAsymmetryRunBlockDialog.cpp @@ -286,8 +286,12 @@ void PGetAsymmetryRunBlockDialog::helpContent() if (fHelpUrl.isEmpty()) { QMessageBox::information(this, "**INFO**", "Will eventually show a help window"); } else { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fHelpUrl); help->show(); + #endif // _WIN32GCC } } diff --git a/src/musredit/PGetDefaultDialog.cpp b/src/musredit/PGetDefaultDialog.cpp index d15ccc8b..1764afb4 100644 --- a/src/musredit/PGetDefaultDialog.cpp +++ b/src/musredit/PGetDefaultDialog.cpp @@ -107,9 +107,12 @@ void PGetDefaultDialog::setFileFormat(const QString &str) */ void PGetDefaultDialog::helpContent() { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fHelpUrl); - help->show(); + #endif // _WIN32GCC } //--------------------------------------------------------------------------- diff --git a/src/musredit/PGetFourierBlockDialog.cpp b/src/musredit/PGetFourierBlockDialog.cpp index 6dc5d068..93fc4d9c 100644 --- a/src/musredit/PGetFourierBlockDialog.cpp +++ b/src/musredit/PGetFourierBlockDialog.cpp @@ -134,8 +134,12 @@ void PGetFourierBlockDialog::helpContent() if (fHelpUrl.isEmpty()) { QMessageBox::information(this, "**INFO**", "Will eventually show a help window"); } else { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fHelpUrl); help->show(); + #endif // _WIN32GCC } } diff --git a/src/musredit/PGetFunctionsBlockDialog.cpp b/src/musredit/PGetFunctionsBlockDialog.cpp index 71777b9c..1561b1ec 100644 --- a/src/musredit/PGetFunctionsBlockDialog.cpp +++ b/src/musredit/PGetFunctionsBlockDialog.cpp @@ -110,8 +110,12 @@ void PGetFunctionsBlockDialog::helpContent() if (fHelpUrl.isEmpty()) { QMessageBox::information(this, "**INFO**", "Will eventually show a help window"); } else { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fHelpUrl); help->show(); + #endif // _WIN32GCC } } diff --git a/src/musredit/PGetNonMusrRunBlockDialog.cpp b/src/musredit/PGetNonMusrRunBlockDialog.cpp index 59b2abdc..39e9e3cf 100644 --- a/src/musredit/PGetNonMusrRunBlockDialog.cpp +++ b/src/musredit/PGetNonMusrRunBlockDialog.cpp @@ -158,8 +158,12 @@ void PGetNonMusrRunBlockDialog::helpContent() if (fHelpUrl.isEmpty()) { QMessageBox::information(this, "**INFO**", "Will eventually show a help window"); } else { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fHelpUrl); help->show(); + #endif // _WIN32GCC } } diff --git a/src/musredit/PGetParameterBlockDialog.cpp b/src/musredit/PGetParameterBlockDialog.cpp index 96063fb3..68352ed5 100644 --- a/src/musredit/PGetParameterBlockDialog.cpp +++ b/src/musredit/PGetParameterBlockDialog.cpp @@ -221,8 +221,12 @@ void PGetParameterBlockDialog::helpContent() if (fHelpUrl.isEmpty()) { QMessageBox::information(this, "**INFO**", "Will eventually show a help window"); } else { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fHelpUrl); help->show(); + #endif // _WIN32GCC } } diff --git a/src/musredit/PGetPlotBlockDialog.cpp b/src/musredit/PGetPlotBlockDialog.cpp index 37705d51..d2f1bc03 100644 --- a/src/musredit/PGetPlotBlockDialog.cpp +++ b/src/musredit/PGetPlotBlockDialog.cpp @@ -162,8 +162,12 @@ void PGetPlotBlockDialog::helpContent() if (fHelpUrl.isEmpty()) { QMessageBox::information(this, "**INFO**", "Will eventually show a help window"); } else { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fHelpUrl); help->show(); + #endif // _WIN32GCC } } diff --git a/src/musredit/PGetSingleHistoRunBlockDialog.cpp b/src/musredit/PGetSingleHistoRunBlockDialog.cpp index 176d769b..ac5a8d98 100644 --- a/src/musredit/PGetSingleHistoRunBlockDialog.cpp +++ b/src/musredit/PGetSingleHistoRunBlockDialog.cpp @@ -284,8 +284,12 @@ void PGetSingleHistoRunBlockDialog::helpContent() if (fHelpUrl.isEmpty()) { QMessageBox::information(this, "**INFO**", "Will eventually show a help window"); } else { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fHelpUrl); help->show(); + #endif // _WIN32GCC } } diff --git a/src/musredit/PGetTheoryBlockDialog.cpp b/src/musredit/PGetTheoryBlockDialog.cpp index dcb9ba4c..fcf4673c 100644 --- a/src/musredit/PGetTheoryBlockDialog.cpp +++ b/src/musredit/PGetTheoryBlockDialog.cpp @@ -128,8 +128,12 @@ void PGetTheoryBlockDialog::helpContent() if (fHelpUrl.isEmpty()) { QMessageBox::information(this, "**INFO**", "Will eventually show a help window"); } else { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fHelpUrl); help->show(); + #endif // _WIN32GCC } } diff --git a/src/musredit/PGetTitleBlockDialog.cpp b/src/musredit/PGetTitleBlockDialog.cpp index 6cca2ed2..96ecb12c 100644 --- a/src/musredit/PGetTitleBlockDialog.cpp +++ b/src/musredit/PGetTitleBlockDialog.cpp @@ -56,8 +56,12 @@ void PGetTitleBlockDialog::helpContent() if (fHelpUrl.isEmpty()) { QMessageBox::information(this, "**INFO**", "Will eventually show a help window"); } else { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fHelpUrl); help->show(); + #endif // _WIN32GCC } } diff --git a/src/musredit/PHelp.cpp b/src/musredit/PHelp.cpp index a63ab6e0..9b1894e1 100644 --- a/src/musredit/PHelp.cpp +++ b/src/musredit/PHelp.cpp @@ -44,6 +44,7 @@ */ PHelp::PHelp(const QString &url) { + #ifndef _WIN32GCC fProgress = 0; QNetworkProxyFactory::setUseSystemConfiguration(true); @@ -71,6 +72,7 @@ PHelp::PHelp(const QString &url) setCentralWidget(fView); setUnifiedTitleAndToolBarOnMac(true); + #endif // _WIN32GCC } //--------------------------------------------------------------------------- diff --git a/src/musredit/PHelp.h b/src/musredit/PHelp.h index fb2fbc8a..23bee3bd 100644 --- a/src/musredit/PHelp.h +++ b/src/musredit/PHelp.h @@ -64,6 +64,7 @@ class PHelp : public QMainWindow QWebView *fView; ///< web viewer QLineEdit *fLocationEdit; ///< url address line edit int fProgress; ///< progress value (0-100) while loading an url + }; #endif // _PHELP_H_ diff --git a/src/musredit/PMsr2DataDialog.cpp b/src/musredit/PMsr2DataDialog.cpp index 9fc4e08b..7c890ca0 100644 --- a/src/musredit/PMsr2DataDialog.cpp +++ b/src/musredit/PMsr2DataDialog.cpp @@ -285,8 +285,12 @@ void PMsr2DataDialog::helpContent() if (fHelpUrl.isEmpty()) { QMessageBox::information(this, "**INFO**", "Will eventually show a help window"); } else { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fHelpUrl); help->show(); + #endif // _WIN32GCC } } diff --git a/src/musredit/PTextEdit.cpp b/src/musredit/PTextEdit.cpp index 084e650c..aafb520c 100644 --- a/src/musredit/PTextEdit.cpp +++ b/src/musredit/PTextEdit.cpp @@ -2198,9 +2198,12 @@ void PTextEdit::musrSwapMsrMlog() */ void PTextEdit::helpContents() { + #ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); + #else PHelp *help = new PHelp(fAdmin->getHelpUrl("main")); - help->show(); + #endif // _WIN32GCC } //---------------------------------------------------------------------------------------------------- diff --git a/src/musredit/musredit.pro b/src/musredit/musredit.pro index bc9a295d..f2999267 100644 --- a/src/musredit/musredit.pro +++ b/src/musredit/musredit.pro @@ -13,6 +13,7 @@ exists ( /opt/fontconfig-2.8.0/lib/libfontconfig.so ) { } exists( /usr/bin/cygwin1.dll ) { + QMAKE_CXXFLAGS += -D_WIN32GCC QMAKE_LFLAGS_SHAPP = -Wl,--enable-auto-import }