Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1145,8 +1145,9 @@ jobs:
# Source Intel OneAPI environment
source /opt/intel/oneapi/setvars.sh

# Modify PATH to use our binaries
# Modify PATH and LD_LIBRARY_PATH to use our binaries
export PATH="../bin:$PATH"
export LD_LIBRARY_PATH="../bin:${LD_LIBRARY_PATH:-}"

# Run the test script and capture output
set +e # Don't exit on error
Expand All @@ -1169,8 +1170,9 @@ jobs:
# Source Intel OneAPI environment
source /opt/intel/oneapi/setvars.sh

# Modify PATH to use our binaries
# Modify PATH and LD_LIBRARY_PATH to use our binaries
export PATH="../bin:$PATH"
export LD_LIBRARY_PATH="../bin:${LD_LIBRARY_PATH:-}"

# Run the test script and capture output
set +e # Don't exit on error
Expand Down
17 changes: 13 additions & 4 deletions dynadjust/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ if(BUILD_TESTING)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif()

# Set output directories for all platforms to use ../bin/
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../bin)
# Set output directories for all platforms to use ../bin/ (unless overridden)
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../bin)
endif()
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../bin)
endif()
if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../bin)
endif()

# For multi-config generators (Visual Studio, Xcode)
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
Expand Down Expand Up @@ -300,10 +306,13 @@ message(STATUS "Found Boost version: ${Boost_VERSION}")
# Set up libraries
# ----------------------------------------------------------------------------

find_package(Threads REQUIRED)

set(DNA_LIBRARIES
${Boost_LIBRARIES}
${XercesC_LIBRARIES}
${XERCES_ICU_LIBRARIES}
Threads::Threads
)

# ----------------------------------------------------------------------------
Expand Down
17 changes: 15 additions & 2 deletions dynadjust/cmake/StaticBuildOptimizations.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,26 @@ function(optimize_static_target TARGET_NAME)
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set_property(TARGET ${TARGET_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

# Platform-specific optimizations
if(UNIX AND NOT APPLE)
# Linux-specific optimizations
target_link_options(${TARGET_NAME} PRIVATE
-static
-Wl,--gc-sections # Remove unused sections
-pthread
# Clang + static glibc: libstdc++'s gthr-posix.h uses __weakref__ aliases
# for pthread functions. GCC resolves these at link time, but Clang leaves
# them as null, causing segfaults when std::thread calls through them.
# Force the linker to pull in the real symbols from libc.a.
-Wl,-u,pthread_create
-Wl,-u,pthread_join
-Wl,-u,pthread_cancel
-Wl,-u,pthread_detach
-Wl,-u,pthread_mutex_lock
-Wl,-u,pthread_mutex_unlock
-Wl,-u,pthread_once
-Wl,-u,pthread_key_create
-Wl,--gc-sections # Remove unused sections
-Wl,--as-needed # Only link libraries that are actually used
-Wl,-O2 # Optimize at link time
-Wl,--strip-all # Strip all symbols
Expand Down
2 changes: 1 addition & 1 deletion dynadjust/include/config/dnaversion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ const char* const __plot_dll_name__ = "libdnaplot.so";

#if defined(__clang__) // Clang compiler
#define __COMPILER__ "Clang"
#define __COMPILER_VERSION__ __VERSION__
#define __COMPILER_VERSION__ __clang_version__
#elif defined(__GNUC__) || defined(__GNUG__) // GNU GCC
#define __COMPILER__ "GNU GCC"
#define __COMPILER_VERSION__ __VERSION__
Expand Down
2 changes: 1 addition & 1 deletion dynadjust/include/functions/dnaiostreamfuncs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void print_file_header(
stream << std::setw(PRINT_VAR_PAD) << std::left << "File created:";
std::ostringstream datetime_ss;
boost::posix_time::time_facet* p_time_output = new boost::posix_time::time_facet;
std::locale special_locale (std::locale(""), p_time_output);
std::locale special_locale (std::locale::classic(), p_time_output);
// special_locale takes ownership of the p_time_output facet
datetime_ss.imbue (special_locale);
(*p_time_output).format("%A, %d %B %Y, %X");
Expand Down
2 changes: 1 addition & 1 deletion dynadjust/include/functions/dnatemplatedatetimefuncs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ T formattedDateTimeString()
{
std::stringstream datetime_ss, stream;
boost::posix_time::time_facet* p_time_output = new boost::posix_time::time_facet;
std::locale special_locale (std::locale(""), p_time_output);
std::locale special_locale (std::locale::classic(), p_time_output);

// special_locale takes ownership of the p_time_output facet
datetime_ss.imbue (special_locale);
Expand Down
Loading