Skip to content

Commit

Permalink
MSVC: Suppress link warning
Browse files Browse the repository at this point in the history
Recent versions of MSVC have starting issuing warnings when the `.dbg` file
associated with a library isn't found when linking Debug code.  I thought this
issue was restricted to libeospac.lib, but it turns out other TPLs also
cause this warning to be emitted.

I'm pulling the change to `cdi_eospac/CMakeLists.txt` that I made in lanl#649 and
replacing it by moving the `ignore` link flag to the global `LINK_OPTIONS`
CMake variable.
  • Loading branch information
KineticTheory committed Aug 1, 2019
1 parent f29e8e1 commit de4c9e4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 59 deletions.
4 changes: 4 additions & 0 deletions config/windows-cl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ if( NOT CXX_FLAGS_INITIALIZED )
set( CMAKE_CXX_FLAGS_MINSIZEREL "/${MD_or_MT} /O1 /DNDEBUG" )
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "/${MD_or_MT} /O2 /Zi /DDEBUG" )

# Don't warn about missing pdb files. We won't necessarily have these for
# TPLs.
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099" )

endif()

##---------------------------------------------------------------------------##
Expand Down
5 changes: 0 additions & 5 deletions src/cdi_eospac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ add_component_library(
SOURCES "${sources}"
HEADERS "${headers}" )
target_include_directories( Lib_cdi_eospac PUBLIC ${EOSPAC_INCLUDE_DIR} )
if(MSVC)
# we don't normally have access to debug symbol file for eospac.lib, so
# ignore warnings about missing pdb files.
set_target_properties( Lib_cdi_eospac PROPERTIES LINK_OPTIONS "/ignore:4099" )
endif()

add_component_executable(
TARGET Exe_QueryEospac
Expand Down
72 changes: 20 additions & 52 deletions src/cdi_eospac/test/tEospac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ void cdi_eospac_test(rtt_dsxx::UnitTest &ut) {
// Create a SesameTables object //
// ---------------------------- //

// The user must create a SesameTables object that links material ID
// numbers to EOSPAC data types (each SesameTables object only contains
// lookups for one material). If the user needs heat capacity values for
// Al then he/she must create a SesameTables object for Aluminum and then
// assign an aluminum material ID (e.g. 3717) to the enelc EOSPAC data
// type. See the tests below for more details.
// The user must create a SesameTables object that links material ID numbers
// to EOSPAC data types (each SesameTables object only contains lookups for
// one material). If the user needs heat capacity values for Al then he/she
// must create a SesameTables object for Aluminum and then assign an aluminum
// material ID (e.g. 3717) to the enelc EOSPAC data type. See the tests below
// for more details.

// Set the material identifier
// This one is for Aluminum (03717)
// Category-1 data (0) + Mat# 371 (Al) + Version # 7

// See http://xweb.lanl.gov/projects/data/ for material ID information.

// This matID for Al has lookup tables for prtot, entot, tptot, tntot,
// pntot, eptot, prelc, enelc, tpelc, tnelc pnelc, epelc, prcld, and encld
// (see SesameTables.hh for an explanantion of these keywords). I need
// the table that contains enion lookups so that I can query for Cve()
// values.
// This matID for Al has lookup tables for prtot, entot, tptot, tntot, pntot,
// eptot, prelc, enelc, tpelc, tnelc pnelc, epelc, prcld, and encld (see
// SesameTables.hh for an explanantion of these keywords). I need the table
// that contains enion lookups so that I can query for Cve() values.

// Sesame Number 3717 provides data tables: 101 102 201 301 303 304 305 306 401
// Sesame Number 3717 provides data tables: 101 102 201 301 303 304 305 306
// 401
int const Al3717 = 3717;

// I also want to lookup the mean ion charge (EOS_Zfc_DT) which is found
// in sesame table 601. Add sesame number 23714 which provides data
// tables: 101 102 201 601 602 603 604
// I also want to lookup the mean ion charge (EOS_Zfc_DT) which is found in
// sesame table 601. Add sesame number 23714 which provides data tables: 101
// 102 201 601 602 603 604
int const Al23714 = 23714;

// Create a SesameTables object for Aluminum.
Expand All @@ -68,9 +68,8 @@ void cdi_eospac_test(rtt_dsxx::UnitTest &ut) {
// Print a list of EosTables
AlSt.printEosTableList();

// Assign matID Al3717 to enion lookups (used for Cvi) for AlSt. We can
// also assign these tables when the Eospac object is created (see example
// below).
// Assign matID Al3717 to enion lookups (used for Cvi) for AlSt. We can also
// assign these tables when the Eospac object is created (see example below).

// Also assign matID Al23714 for temperature-based electron thermal
// conductivity (tconde).
Expand Down Expand Up @@ -120,43 +119,14 @@ void cdi_eospac_test(rtt_dsxx::UnitTest &ut) {
return;
}

// CAUTION!!! CAUTION!!! CAUTION!!! CAUTION!!! CAUTION!!! CAUTION!!!

// Adding this block breaks Eospac as currently implemented. Effectively,
// the destructor for spEospacAlt destroys all of the table handles for
// libeospac. This is a flaw in libeospac, but we may be forced to manage
// it in cdi_eospac by using a Singleton Eospac object that uses reference
// counting for each material+data tuple and calls eos_DestroyTables()
// instead of eos_DestroyAll(). A redesign is also required to make this
// package thread safe!

// { // Test alternate ctor method:

// // Alternatively, we can avoid carrying around the AlSt object. We
// // can, instead, create a temporary version that is only used here in
// // the constructor of Eospac().

// std::shared_ptr< rtt_cdi_eospac::Eospac const > spEospacAlt;
// spEospacAlt = new rtt_cdi_eospac::Eospac(
// rtt_cdi_eospac::SesameTables().Ue_DT( Al3717 ).Zfc_DT( Al23714
// ).Uic_DT( Al3717 ).Ktc_DT( Al23714 ) );

// if ( spEospacAlt )
// PASSMSG("shared_ptr to new Eospac object created (Alternate "
// "ctor).");
// else
// FAILMSG("Unable to create shared_ptr to new Eospac object " +
// "(Alternate ctor).");
// }

// --------------------------- //
// Test scalar access routines //
// --------------------------- //

double const K2keV = 1.0 / 1.1604412E+7; // keV/Kelvin

// All of these tests request an EoS value given a single temperature and
// a single density.
// All of these tests request an EoS value given a single temperature and a
// single density.

// Retrieve an Electron internal energy value;

Expand Down Expand Up @@ -255,8 +225,6 @@ void cdi_eospac_test(rtt_dsxx::UnitTest &ut) {

// Test the getElectronTemperature function

// spEospac->printTableInformation( EOS_T_DUic, std::cout );

double SpecificIonInternalEnergy(10.0); // kJ/g
Tout = spEospac->getIonTemperature(density, SpecificIonInternalEnergy); // keV

Expand Down Expand Up @@ -433,7 +401,7 @@ void cdi_eospac_except_test(rtt_dsxx::UnitTest &ut) {
if (exceptionThrown)
PASSMSG("Attempted access to unloaded table throws exception.");
else
FAILMSG("Failed to throw exeption for invalid table access.");
FAILMSG("Failed to throw exception for invalid table access.");
}

return;
Expand Down
4 changes: 2 additions & 2 deletions src/compton/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# file src/compton/CMakeLists.txt
# author Kendra Keady
# date 2017 February 28
# brief Instructions for building compton Makefiles.
# brief Instructions for building Compton Makefiles.
# note Copyright (C) 2017-2019 Triad National Security, LLC.
# All rights reserved.
#------------------------------------------------------------------------------#
Expand Down Expand Up @@ -64,7 +64,7 @@ if( TARGET COMPTON::compton )

else()

# If no compton library, only install headers (stubs).
# If no Compton library, only install headers (stubs).
install( FILES ${headers} DESTINATION ${DBSCFGDIR}include/compton )

endif()
Expand Down

0 comments on commit de4c9e4

Please sign in to comment.