Ticket #4250 (accepted defect)

Opened 6 years ago

Last modified 6 years ago

Errors compiling on 64-bit Windows XP with Visual Studio and Intel compilers

Reported by: ycollette.nospam@… Owned by: briadam
Priority: low Milestone:
Component: Code Errors/Issues Version:
Severity: minor Keywords:
Cc: briadam, wjbohnh, dmvigi Due Date:
Parent Tickets: Blocked By:
Blocking: Requestor:
Sensitive: no

Description

Hello,

I am trying to compile dakota under windows using visual studio and intel compilers. I found some problems:

First, libboost_signal is not correctly detected.
It found:

  •  C:/Program Files (x86)/boost/boost_1_47/lib/libboost_signals-vc100-mt-1_47.lib

But it should have found:

  •  C:/Program Files (x86)/boost/boost_1_47/lib/libboost_signals-vc100-mt-s-1_47.lib

The file ParamStudy?.hpp has problem under windows with overloaded operator+=. I changed the build of the dakota string ... now this part compiles fine.

Index: ParamStudy?.hpp
===================================================================
--- ParamStudy?.hpp (révision 1529)
+++ ParamStudy?.hpp (copie de travail)
@@ -620,8 +620,11 @@

h_string.clear();
if (asynchFlag)

h_string += "\n\n";

  • h_string += ">>>>> Centered parameter study evaluation for " + type + "[" +
  • boost::lexical_cast<std::string>(var_index+1) + "]";

+ h_string += ">>>>> Centered parameter study evaluation for ";
+ h_string += type; h_string += "["; h_string += std::to_string((long
+ long)(var_index+1)); h_string += "]";

if (step < 0) h_string += " - " + boost::lexical_cast<std::string>(-step);
else h_string += " + " + boost::lexical_cast<std::string>( step);
h_string += "delta:\n";

And now I've got last compilation problem with:

packages\teuchos\packages\teuchos\src\Teuchos_ScalarTraits.hpp
packages\teuchos\packages\teuchos\src\Teuchos_OrdinalTraits.hpp
packages\teuchos\packages\teuchos\src\Teuchos_TypeNameTraits.hpp
packages\teuchos\packages\teuchos\src\Teuchos_BLAS_types.hpp

...

I join the log.txt file of the compilation under windows XP 64.

Best regards,

YC

Subtickets (add)

Attachments

log.txt Download (27.3 KB) - added by briadam 6 years ago.
Build log

Change History

Changed 6 years ago by briadam

Build log

comment:1 Changed 6 years ago by wjbohnh

Since Brian had problems with Boost.Signals (other platforms though), I will link his most recent commit to ACRO:
 https://software.sandia.gov/viewvc/acro?view=revision&revision=7522

And also note that ACRO is the only package that depends on libboost_signals. Further, since it can be disabled, temporarily disabling ACRO in the CMake cache (i.e. '-DHAVE_ACRO=OFF') *might* be worth considering for "experimental" Dakota builds on native Windows. If you could provide your CMakeCache.txt file as an attachment, it would be appreciated.

The teuchos compiler errors are new, resulting from an upgrade of the package distributed with SNL's Trilinos Project Release 11.0.3. Sorry that package does not compile on Windows. It may take a while to resolve that issue. I generally am not a fan of rolling-back to an older version of an external package. That said, in this case I feel obligated to mention that the previous version, did indeed compile on Windows:
 https://software.sandia.gov/svn/public/tpl/teuchos/tags/10.6.0

So that _might_ be an option worth considering if you're hoping to produce a working build of Dakota quickly soon as possible.

Thank you for your 'operator+=' patch to ParamStudy?.hpp. The Dakota team will discuss our strategy/timing of committing your fix. It is likely that it will NOT be committed until AFTER we rollout the Dakota-5.3 release tarballs. Thanks for your patience.
--Bill

comment:2 Changed 6 years ago by wjbohnh

Forgot to mention that, historically, Kitware has recommended the following CMake cache setting:

-DBoost_USE_STATIC_LIBS=ON


Please consider adding that to your build specification if you haven't already.


comment:3 Changed 6 years ago by briadam

  • Owner changed from wjbohnh to briadam
  • Status changed from new to accepted

From: ycollette.nospam@… ycollette.nospam@…
Sent: Monday, February 11, 2013 2:04 AM
To: Adams, Brian M
Subject: [EXTERNAL] Compilation under windows

Hello,

Here are my last work on the windows compilation.
First, the hopspack package force CMAKE_BUILD_TYPE=DEBUG. So, if you compile in release mode, dakota.exe will not link because of mixed release and debug objects.
Second, the last patach I sent for ParamStudy?.hpp was working only under windows. std::to_string doesn't exist under linux.
So here is the last changes I made to ParamStudy?.hpp

svn diff ParamStudy?.hpp
Index: ParamStudy?.hpp
===================================================================
--- ParamStudy?.hpp (révision 1538)
+++ ParamStudy?.hpp (copie de travail)
@@ -620,8 +620,11 @@

h_string.clear();
if (asynchFlag)

h_string += "\n\n";

  • h_string += ">>>>> Centered parameter study evaluation for " + type + "[" +
  • boost::lexical_cast<std::string>(var_index+1) + "]";

+ h_string += ">>>>> Centered parameter study evaluation for ";
+ h_string += type; h_string += "["; h_string +=
+ boost::lexical_cast<std::string>(var_index+1);
+ h_string += "]";

if (step < 0) h_string += " - " + boost::lexical_cast<std::string>(-step);
else h_string += " + " + boost::lexical_cast<std::string>( step);
h_string += "delta:\n";

Third: I met a problem with min and max in Teuchos_ScalarTraits.hpp. This is due to a "stupid" behavior of visual. It uses first the macros min and max and not std::min and std::max. So, to be able to compile, I must add #undef min and #undef max in this file:

svn diff
Index: Teuchos_ScalarTraits.hpp
===================================================================
--- Teuchos_ScalarTraits.hpp (révision 2688)
+++ Teuchos_ScalarTraits.hpp (copie de travail)
@@ -78,6 +78,8 @@

#include "Teuchos_ScalarTraitsDecl.hpp"

+#undef min
+#undef max

namespace Teuchos {

The command line I use to configure and build a win32 exe:

cmake -DCMAKE_INSTALL_PREFIX=e:\dakota_bin -DCMAKE_BUILD_TYPE=RELEASE -G "NMake Makefiles" -DLAPACK_DIR:FILEPATH=e:\dakota\lapack-3.4.1\build -DBUILD_SHARED_LIBS=OFF -Ddebug=OFF ..

Best regards,

YC

comment:4 Changed 6 years ago by briadam

Referenced in changeset [1551]:

Apply patch for Dakota::String vs. std::string concatenation from Ticket #4250 to address MSVC issue.

Note: See TracTickets for help on using tickets.